Phase Manipulation of Electromagnetic Waves with Metasurfaces and Its Applications in Nanophotonics