Synchronously improved graphitization and surface area in a 3D porous carbon network as a high capacity anode material for lithium/sodium-ion batteries