A multifunctional covalent organic framework with localized radicals for selective ion capture and photocatalysis