Silicon anodes for Li-ion batteries face challenges due to substantial volume changes and low electrical conductivity. To address these issues comprehensively, we employed electrospinning technology to integrate nitrogen-rich graphitic carbon nitride (g-({hbox {C}_3hbox {N}_4})) with graphene-like structure into carbon nanofibers (CNFs), using melamine as a precursor. This approach resulted in a hierarchical Si@g-({hbox {C}_3hbox {N}_4})/CNF composite anode that mitigates volume expansion and enhances electrical conductivity through continuous g-({hbox {C}_3hbox {N}_4}) layers surrounding Si nanoparticles, improving structural porosity, lithium-ion storage capacity, and cycling stability. Under a high current of 1A (g^{-1}), it exhibits a high reversible capacity and excellent cyclic stability. To further understand and optimize this composite material, we conducted ab initio molecular dynamics simulations to probe the structural and dynamical properties during lithiation. The results revealed that g-({hbox {C}_3hbox {N}_4}) significantly enhances capacity and stability by minimizing side reactions, suppressing irreversible capacity loss via SEI film growth regulation, and improving interfacial electrochemical reaction kinetics. Moreover, we introduced cobalt nanoparticles into the composite structure, which effectively suppressed side reactions, facilitated lithium-ion diffusion, and thereby enhanced overall electrochemical performance. Even under a substantial current of 2A (g^{-1}), both the specific capacity and cycle life have been significantly enhanced. The combination of these strategies enables silicon anodes with ultra-long-cycling stability, paving the way for practical applications in high-energy lithium-ion batteries.