Sulfadimethoxine (SDM) is a widely used veterinary antibiotic. Its residues in food and the environment may cause bacterial resistance and threaten human health. In this study, a novel electrochemiluminescence (ECL) biosensor with signal amplification was developed for the sensitive detection of SDM. A g-C3N4@Au composite was modified on the electrode surface, generating a strong ECL signal with K2S2O8 as the coreactant. Hairpin DNA terminated with ferrocene carboxylic acid (FcA) was self-assembled onto g-C3N4@Au via thiol-gold bonds, causing Fc to quench the electrochemiluminescence signal of g-C3N4. Upon SDM addition, it specifically bound to the aptamer strand, releasing the DNA Walker. The DNA walker then continuously hybridized with the activator strand S1 and was cleaved by the nicking endonuclease Nt.BsmAI, generating a large number of S1. S1 further activated the trans-cleavage activity of CRISPR/Cas12a, which cleaves the hairpin DNA on the electrode, releasing Fc and recovering the ECL signal. By monitoring the ECL intensity change during the "signal-off" to "signal-on" transition, quantitative detection of SDM was indirectly realized. The detection range for SDM is 1.0 × 10-14 to 1.0 × 10-7 mol L-1, with a detection limit of 7.15 × 10-15 mol L-1. The sensor was successfully applied to the detection of SDM in food and water samples. Benefiting from the catalytic cascade amplification involving multiple enzymes, the developed method demonstrated high ultrahigh sensitivity.