Rui He, Qianna Wang, Kaixi Liu, Xiangyun Shi, Xiaohuan Jiang
Carbon sources and sinks are crucial to climate regulation. Megacities, as major emitters, encounter increasing pressure from rapid land-use changes and ecological degradation. These challenges are prominent in mountain–basin transition regions owing to fragmented terrain, ecological sensitivity, and accelerated urbanization. However, the combined effects of climate and landscape patterns on carbon sinks in these regions remain poorly understood. This study investigated the spatiotemporal dynamics (2000−2020) and combined effects of climate and landscape patterns on carbon sinks across production–living–ecological spaces in a typical transition-region megacity. Net ecosystem productivity (NEP) was used as a carbon sink indicator. An interpretable machine learning model, eXtreme Gradient Boosting with Shapley Additive Explanations, was applied to quantify the independent and interactive effects of four key climatic factors (temperature, precipitation, potential evapotranspiration, and sunshine duration) and landscape patterns. Climatic factors exerted stronger effects on NEP than on landscape patterns, with moderate temperatures, sufficient rainfall, and sunshine enhancing sequestration. The key landscape pattern indices were the percentage of landscape, landscape shape index, edge density, and splitting index, with living space being the most sensitive. Climate–landscape interactions were context-dependent: fragmentation and edge density reduced carbon sinks but were potentially mitigated under optimal climate conditions. Improved landscape patterns further enhanced NEP, highlighting the importance of expanding and connecting ecological spaces, using a “large-scattered, small-clustered” layout in production spaces, and integrating green infrastructure in living spaces. These findings inform landscape planning and management to optimize land-use structures and strengthen carbon sinks in megacities under climate change.