Abstract
<title>Abstract</title> <p>The widespread use of moxifloxacin (MOX) has raised concerns over its environmental residues, highlighting the need for reliable trace detection methods. Herein, we report an electrochemical sensor based on an α‑ZrP/phosphorus‑nitrogen co‑doped hollow carbon spheres (α‑ZrP/PNHC) composite, where PNHC serves as a conductive scaffold to disperse α‑ZrP nanosheets and provide abundant transport pathways. DFT computations indicate that phosphorus atoms substitute into the carbon sites at the shoulder position next to pyridinic‑N, thereby injecting electrons into the carbon lattice and gently lowering the Lewis basicity of those pyridinic‑N centers. For the P‑doped pyridinic‑N site, the calculated adsorption energy amounts to − 0.745 eV, representing a moderate and ideal strength for stable enrichment without active site locking. Importantly, XPS data experimentally corroborate these findings: after P‑doping, the fraction of pyridinic‑N rises markedly from 29.90% to 38.04%, while pyrrolic‑N decreases from 27.50% to 24.80%. This enrichment of pyridinic‑N, together with its moderate adsorption energy and open configuration, provides the ideal balance between stable enrichment and active site accessibility. Owing to these synergistic structural and electronic effects, the α‑ZrP/PNHC/GCE sensor delivers a broad linear detection interval (0.03–10 µM), a low limit of detection (0.015 µM), outstanding selectivity, acceptable reproducibility, and reliable stability. Recovery experiments in tap water and honey give values ranging from 97.29% to 103.70%, verifying the method’s practical utility. This work offers a highly sensitive sensing platform for MOX and provides DFT‑guided insights into the rational design of heteroatom‑doped carbon‑based composites.</p>