In this paper, carbon dot (CD)-encapsulated 1,3,5-tris(4-formylphenyl)benzene (TFB)/2,5-dihydroxyterephthalohydrazide (DHTH) covalent organic frameworks (TDCOFs) grafted with thermoresponsive poly(N-isopropylacrylamide) (PNIPAM) (CDs@TDCOFs@PNIPAM) were fabricated for the detection of pyrethroids. CDs@TDCOFs@PNIPAM achieved a temperatureresponsive "on/off" detection of pyrethroids based on the target-triggered electron-transfer mechanism. The detection limit of pyrethroids was as low as 0.69 μg/L in the wide linear range of 5−400 μg/L (R 2 > 0.9523). Simultaneously, CDs@TDCOFs@ PNIPAM with red, green, and blue (RGB) fluorescence emissions were integrated with a smartphone-assisted device, enabling the visual smart quantitative detection of pyrethroids with a detection limit of 4.875 μg/L. Ultimately, agricultural products were chosen as actual samples to verify the applicability of both recognition modes, and the calculated recovery rate was 105.48−113.40%. Accordingly, CDs@TDCOFs@PNIPAM featuring temperature-responsive switching behavior and RGB fluorescence emission provided a promising analytical strategy for ensuring agricultural and food safety.