A molecularly imprinted phase-change microcapsule system for bifunctional applications in waste heat recovery and targeted pollutant removal.