Flexible ultrathin Nitrogen-Doped carbon mediates the surface charge redistribution of a hierarchical tin disulfide nanoflake electrode for efficient capacitive deionization.