Although advances in wireless technologies such as miniature and wearable electronics have improved the quality of our lives, the ubiquitous use of electronics comes at the expense of increased exposure to electromagnetic (EM) radiation. Up to date, extensive efforts have been made to develop high-performance EM absorbers based on synthetic materials. However, the design of an EM absorber with both exceptional EM dissipation ability and good environmental adaptability remains a substantial challenge. Here, we report the design of a class of carbon heterostructures via hierarchical assembly of graphitized lignocellulose derived from bamboo. Specifically, the assemblies of nanofibers and nanosheets behave as a nanometer-sized antenna, which results in an enhancement of the conductive loss. In addition, we show that the composition of cellulose and lignin in the precursor significantly influences the shape of the assembly and the formation of covalent bonds, which affect the dielectric response-ability and the surface hydrophobicity (the apparent contact angle of water can reach 135°). Finally, we demonstrate that the obtained carbon heterostructure maintains its wideband EM absorption with an effective absorption frequency ranging from 12.5 to 16.7 GHz under conditions that simulate the real-world environment, including exposure to rainwater with slightly acidic/alkaline pH values. Overall, the advances reported in this work provide new design principles for the synthesis of high-performance EM absorbers that can find practical applications in real-world environments.