With the rapid development of autonomous driving technology, lane detection, a key component of intelligent vehicle systems, is crucial for ensuring road safety and efficient vehicle navigation. In this paper, a new lane detection method is proposed to address the problem of degraded performance of existing lane detection methods when dealing with complex road environments. The proposed method evolves from the original Cross Layer Refinement Network (CLRNet) by incorporating two of our carefully designed core components: the Global Feature Optimizer (GFO) and the Adaptive Lane Geometry Aggregator (ALGA). The GFO is a multi-scale attention mechanism that mimics the human visual focusing ability, effectively filtering out unimportant information and focusing on the image regions most relevant to the task. The ALGA is a shape feature-aware aggregation module that utilizes the shape prior of lanes to enhance the correlation of anchor points in an image, better fusing global and local information. By integrating both components into CLRNet, an enhanced version called Enhanced CLRNet (E-CLRNet) is presented, which exhibits higher performance stability in complex roadway scenarios. Experiments on the CULane dataset reveal that E-CLRNet demonstrates superior performance stability over the original CLRNet in complex scenarios, including curves, shadows, missing lines, and dazzling light conditions. In particular, in the curves, the F1 score of E-CLRNet is improved by almost 3% over the original CLRNet. This study not only improves the accuracy and performance stability of lane detection but also provides a new solution for the application of autonomous driving technology in complex environments, which promotes the development of intelligent vehicle systems.