Self-switchable catalysis by a nature-inspired polymer nanoreactor containing Pt nanoparticles