A smart composite system based on thermosensitive polymers and photosensitive polyaniline (PANI) was constructed in this work, enabling efficient photo-driven adsorption and separation of anionic dyes within a short time. Thermosensitive copolymers (P(NIPAM-NVK)) of N-isopropylacrylamide (NIPAM) and N-vinylcarbazole (NVK) with adjustable low critical solution temperatures (LCST) were synthesized via a free radical copolymerization method. PANI was then composited with P(NIPAM-NVK) as a photothermal agent and dye adsorbent. The developed P(NIPAM-NVK)/PANI composite systems showed a rapid temperature increase under visible light irradiation, triggering the transition of P(NIPAM-NVK) from the sol state to a bulk gel state. Simultaneously, PANI and Congo Red (CR) anionic dye were efficiently encapsulated within the gel state of P(NIPAM-NVK) via intermolecular interactions, facilitating the rapid separation of aqueous CR through a direct solid-liquid process to yield clean water. The P(NIPAM-NVK