CO2 enhanced shale gas recovery has significant potential for improving the recovery rate of adsorbed gas and facilitating the geological sequestration of CO2. Nevertheless, the feasibility and microscopic mechanisms of CO2 enhanced gas recovery in deep shale gas reservoirs remain to be elucidated. In this study, a quartz-kerogen slit model was constructed to represent the shale composite nanopores of deep shale reservoirs. Utilizing the grand canonical Monte Carlo and molecular dynamics methods, the adsorption and diffusion behavior of CH4, CO2 and their mixtures was investigated under high-temperature and high-pressure conditions representative of deep shale reservoirs. The influences of temperature, pressure and aperture size were analyzed. The microscopic mechanisms governing the CH4/CO2 competitive adsorption in deep shale nanopores were uncovered by considering the competitive interactions between different rock constituents and quantifying the various gas storage states. The results show that the adsorption capacity of CO2 is greater than that of CH4 under the deep shale reservoir conditions. The replacement efficiency of CH4 by CO2 is higher in small shale pores. High temperature has a more significant negative impact on the adsorption of CO2 compared to that of CH4. Compared to mid-deep shale reservoirs, the nanopores of deep shale reservoirs have a higher proportion of free CH4/CO2 states. Quartz exhibits greater affinity for CH4/CO2 than kerogen, but kerogen possesses a larger specific surface area, resulting in a higher adsorption capacity per unit volume. The hierarchy of CH4/CO2 diffusion capacity in various storage states is as follows: dissolved gas in the kerogen matrix < adsorbed gas on the quartz surface < adsorbed gas on the kerogen surface < free gas in the pore center. This study improves the understanding of CO2 enhanced gas recovery in deep shale gas reservoirs.