Hierarchical porous carbon with optimized mesopore structure and nitrogen doping for supercapacitor electrodes