Solar energy-driven interfacial evaporators are promising candidates to produce fresh water from seawater and wastewater. However, the photothermal layer of the evaporators under water and the homogeneous water transport layer cause undesired heat loss and inadequate water pumping, reducing the evaporation efficiency. Herein, we report on an advanced aerogel-based interfacial evaporator with self-floating photothermal layer and gradient structured water transport layer. The photothermal aerogels are prepared by assembling phenolic nanoparticles with increasing sizes from the bottom to the top, followed by surface hydrophobic modification and photothermal layer deposition on the large-pore side of the aerogels. The hydrophilic gradient phenolic matrix provides sustained water supply and facilitates water pumping by gradient capillary effect. Meanwhile, the large-pore and hydrophobic photothermal layer can enhance light absorption by multiple scattering and self-float above water for thermal localization. Thus, the obtained aerogels achieve high light absorption of 96.8 %, excellent evaporation rate of 1.64 kg m−2 h−1 under 1 sun irradiation and good long-term stability for at least 30 cycles without solute accumulation. Moreover, the produced distilled water from seawater and acidic/alkaline wastewater is in high quality and meets the World Health Organization's stipulated safe drinking water standards.