Polymer nanoparticle hydrogels with autonomous affinity switching for the protection of proteins from thermal stress.