Microporous and mesoporous carbon nanostructures with the inverse opal lattice