China's best bet is to boil their frog slowly without it waking up. I.e. one day they want to be the biggest meanest country around and no one will have noticed. To put it more kindly: they want to resume what they see as their rightful place in the sun, being a superpower. Which is what they were until the 1500s.
There are certainly advantages to them from Putin's current warmongering. China's own questionable actions aren't very much under the spotlight and they are being courted, rather than pressured against. Taiwan would be a lot easier to invade right now (except they aren't probably ready yet).
Last, they may get a weakened Russia driven into their arms, as a junior, needy partner, but still with juicy weapon technology to be transferred.
At the same time they can't benefit from:
Western countries hashing out together a concerted plan to punish Russia. Why, it might be China next time.
The potential for re-energized NATO spending, to reach the 2% limit for example. This really hasn't been realistic since the 90s. Now?
A NATO alliance that has, for now, forgotten its days of maximum disunity under Trump and is actually acting together. Ditto with the EU forging a difficult common foreign policy for once.
If Putin doesn't pull off his Ukraine takeover very cleanly this doesn't necessarily bode much good for a Taiwan adventure of their own. At least not until they power up considerably - Taiwan is smaller and China bigger, but Taiwan's invasion requires an amphibious operation, which is way more challenging and obvious than Russia's convenient pre-positioned surrounding of Ukraine on 3 sides for "training purposes only". An indigestible Ukraine would certainly strengthen Taiwanese resolve.
China runs some benefits, but not a few risks, from military adventurism that it doesn't control. WW3 - not going to happen - is just as bad for them as for everyone else.
And most of all, this risks forcing them to declare for one side, rather than the other. Their ideological sympathy may align more with Putin's but that's not to whom Chinese factories are busy selling stuff. Now that Putin is the bad guy does China want to get too associated with it? Why not pretend to be a responsible, reasonable country instead? Talks about "understandable security concerns" and "need to get back to the negotiating table" plays to both sides and doesn't cost much.
According to a readout from China's foreign ministry, Lavrov told Wang the invasion was precipitated by the inability of the U.S. and NATO to uphold commitments made under a complicated truce agreement called the Minsk Protocol.
Examining the strategic alignment between China and Russia
Wang responded ambiguously. "China respects each country's sovereignty and territorial integrity," he said. "At the same time, we also see the Ukraine problem has a complex and particular historical state of affairs and we understand Russia's reasonable concern on security issues."
But Wang also stressed that China wanted "dialogue and negotiation," rather than military means, to solve tensions. "China's position is to thoroughly cast aside a Cold War mentality," he said.
It's doubtful China will confront Russia - that is indeed wishful thinking - but it's also not obvious it will help Putin much either. What it will certainly do is watch very closely how much the West is willing to actually do to counter Ukraine's invasion: that's very Taiwan-relevant.
Proof is in the pudding. China abstained from voting on the UN motion to "regret Russian actions" in the UN Security council on February 25th, which is not all the same thing as voting against that condemnation.