Tuning metal catalysts via nitrogen-doped nanocarbons for energy chemistry: from metal nanoparticles to single metal sites