this is complicated
China wants a weakened RU, unable to sell energy to the West. Because that makes China the main customer for RU energy, so China can hammer RU on price and get a great deal. So for economic reasons, Russia losing the war and staying weak is a-ok for China.
Militarily, the calculus is different. China does not want NATO/US to win anything. China wants NATO involved, but focused on Europe, not looking too hard at Asia. Although it's a balance. China knows that if Japan, SK and others feel the US does not care about them, they would militarize (and probably go nuclear in a heartbeat) and China definitely does not want that.
So what is the best deal for China? Honestly I think China will go for the economics and let RU lose, so China can be Putin's boss and keep oil prices low. China knows the US and NATO are not threats to China, but China's lack of oil IS a threat.
The wildcard is some weird wing of RU getting control of RU nukes and rumbling around borders, including the China border. Stability is what China wants. China does not want Putin to disappear. Complicated for China.