ADSL and infection: The PDA layer enables long-term preventive release of AMPs, while the pH-responsive hydrogel layer provides on-demand MgO release during infection.