Scalable fabrication of heteroatom-doped versatile hierarchical porous carbons with an all-in-one phthalonitrile precursor and their applications