  Earth's surface environment is largely influenced by its budget of major
volatile elements: carbon (C), nitrogen (N), and hydrogen (H). Although the
volatiles on Earth are thought to have been delivered by chondritic materials,
the elemental composition of the bulk silicate Earth (BSE) shows depletion in
the order of N, C, and H. Previous studies have concluded that non-chondritic
materials are needed for this depletion pattern. Here, we model the evolution
of the volatile abundances in the atmosphere, oceans, crust, mantle, and core
through the accretion history by considering elemental partitioning and impact
erosion. We show that the BSE depletion pattern can be reproduced from
continuous accretion of chondritic bodies by the partitioning of C into the
core and H storage in the magma ocean in the main accretion stage and
atmospheric erosion of N in the late accretion stage. This scenario requires a
relatively oxidized magma ocean ($\log_{10} f_{\rm O_2}$ $\gtrsim$
$\rm{IW}$$-2$, where $f_{\rm O_2}$ is the oxygen fugacity, ${\rm IW}$ is
$\log_{10} f_{\rm O_2}^{\rm IW}$, and $f_{\rm O_2}^{\rm IW}$ is $f_{\rm O_2}$
at the iron-w\"{u}stite buffer), the dominance of small impactors in the late
accretion, and the storage of H and C in oceanic water and carbonates in the
late accretion stage, all of which are naturally expected from the formation of
an Earth-sized planet in the habitable zone.
