Non-steroidal anti-inflammatory drugs (NSAIDs) pose potential risks to human health and ecosystems in the water cycle. Herein, Dopamine (DA), known as the "happy molecule" and "biological glue", it can interact with various drugs and " adhere " to them. In this study, DA was used as a monomer to modify chitosan (CS) under ultraviolet light through Michael addition and Schiff base reactions, resulting in a novel eco-friendly polymer (CS@PDA) with high flocculation activity for ibuprofen (IBU), representing NSAIDs. CS@PDA achieved the IBU flocculation removal rate of 91.6 %. The mechanism involves three primary forces: hydrophobic interactions, hydrogen bonding, π-π stacking among benzene rings, along with secondary forces like electrostatic neutralization. DFT calculations indicate that π-π interactions between partially parallel-stacked benzene rings are dominant in CS@PDA's flocculation of IBU. Notably, the removal efficiency of ibuprofen (IBU) in coflocculation with natural organic matter (NOM) reached 93.1 %, which was higher than that achieved by flocculating IBU alone (91.6 %). And the co-flocs exhibit greater resistance and re-flocculation capabilities under strong hydraulic stirring conditions. In this mixed mechanism, hydrogen bonding is enhanced while hydrophobic associations diminish. π-π stacking remains significant. The possible flocculation pathways among with three substances were further analyzed. This study employed a star rating methodology to quantify each force's intensity.