Excessive use of kanamycin (KAN) in food can lead to ototoxicity, nephrotoxicity, and antibiotic resistance in humans. Therefore, developing a rapid and sensitive detection method to accurately identify KAN is urgent. In this study, we propose a sensitive and convenient detection technique based on an intelligent color-changing hydrogel. This hydrogel incorporates coral-shaped prussian blue (C-PB) nanozymes and Au polyhedra to achieve dual detection of KAN through colorimetric and Raman techniques. We first combined aptamer chains with DNA single strands to construct a "lock" structure within porous metal-organic frameworks, encapsulating numerous 3,3',5,5'-tetramethylbenzidine (TMB) molecules. In the presence of KAN, because of the higher affinity between the aptamer chain and KAN, the "lock" structure is disrupted, releasing a large amount of TMB. Subsequently, TMB is absorbed by the C-PB-based hydrogel and catalyzed into oxidized TMB with the assistance of hydrogen peroxide. Consequently, the hydrogel changes from pink to blue, accompanied by a significant Raman signal. This intelligent hydrogel platform enables ultrasensitive identification of KAN through both colorimetric and Raman modes with a detection limit of 1.58 × 10-13 mol/L and a linear range from 1.0 × 10-12 to 1.0 × 10-3 mol/L. We believe this dual-mode strategy offers a promising pathway for real-time detection and monitoring of actual samples.