Rapid urbanization and stringent ecological protection policies in China have intensified spatial competition among Urban–Agricultural–Ecological (UAE) spaces. However, existing studies often overlook how this competition evolves across different slope structures. To address this, this study establishes a fine-scale analytical framework using H3 hexagonal grids and slope spectrum analysis to investigate the slope structure evolution and spatial competition mechanisms from 1990 to 2023. The results reveal a distinct topographic stratification of competitive niches: urban space dominates low-slope regions (< 6°) but exhibits a pervasive "upslope expansion" trend, with its average slope increasing from 1.81° to 2.07°. Agricultural space characterizes the transition zones (6°–15°), showing an "upslope migration" in the Southeastern Hills driven by urban squeeze. Ecological space functions as a stable barrier in steep terrains (> 15°) but faces encroachment in transition zones. Furthermore, cluster analysis identifies significant regional heterogeneity aligning with China’s macro-topography: the Eastern Plains are characterized by "low-slope agglomeration," where urban–agricultural conflict is most intense; the Southern Hilly Regions display an "interwoven upslope" pattern; while the Western Highlands maintain absolute ecological dominance. Mechanism analysis using GeoDetector and Multiscale Geographically Weighted Regression (MGWR) indicates that competition intensity is predominantly driven by human activity factors (e.g., human footprint, nighttime lights, q > 0.29), yet significantly modulated by topographic constraints (e.g., elevation), creating a nonlinear enhancement effect. Crucially, this study challenges the traditional flat-projection planning model. We propose a transition to "three-dimensional topographic regulation," advocating for differentiated management strategies—such as strict "slope redlines" for urban–agricultural transition zones—to resolve the intensifying spatial conflicts in complex terrains and safeguard agricultural sustainability.