The phenomena of thermochromic afterglow have attracted significant attention in advanced information encryption and anticounterfeiting applications. However, it is still a challenge to realize visible light-activated thermochromic afterglow in a single material. Herein, we demonstrate thermochromic afterglow under visible light excitation in a novel carbon dot (CD)-based composite, utilizing a temperature-dependent dual-mode afterglow mechanism. The composite (PCD@BA) is synthesized by incorporating phosphorus-doped CDs (PCDs) into an inorganic rigid matrix via covalent bonding. Notably, phosphorus doping significantly enhances the photoluminescent properties and redshifts the excitation wavelength of the PCD@BA composite, enabling it to exhibit bright thermally activated delayed fluorescence (TADF) when activated by white light. The thermochromic afterglow of the PCD@BA composite exhibits dynamic color transitions from deep blue to orange by tuning the proportion of the temperature-dependent room temperature phosphorescence (RTP) and TADF. Consequently, the concepts of white light-excited high-resolution multilevel afterglow 2D code information encryption and thermochromic afterglow based anticounterfeiting labels were developed. This work offers exciting opportunities for utilizing CD-based materials with visible light-activated thermochromic afterglow in advanced information security fields.