China is coming out from what they call the Century of Humiliation. Pride is central to them. The Century didn't go down well.
Government-wise they are far closer to Russia. Communism and a very top-down ruling style. They think long term.
They are spreading their influence widely through economic means and that is very important to them. But it's not just about money, it's about the culture and there is a deep resentment of the West, going back over a hundred years to the terrible way the British treated them. Imperialism has created wounds that will live for a very long time.
They have achieved incredible things in the last 50 years economically. There is a price to pay, but a huge development has been and is going on.
So intuitively they are closer to Russia with an authoritarian approach, but their most lucrative trade is with the West. They also have their eyes on Taiwan and want to 'reclaim' it, as they believe it is part of their heritage (the little powerhouse of Taiwan was claimed by the people on the losing side of a huge power struggle). So Russia 'claiming' Ukraine gives a degree of legitimacy for China 'reclaiming' Taiwan.
But they did not expect, no one did, the blazing fury of the West's reaction to the invasion of Ukraine, nor the powerful sanctions. So they are trying to balance a good relationship with Russia, a fundamental incompatability with Western political systems and the economics of the whole affair.
So they're flipflopping. The highly-controlled media for the masses in China is pro-Russia. The leadership are more neutral. They give a little in one direction, they give a little in the other. They are trying to balance things and unless there is a definitive statement that they are supporting either one side or the other in the Russia/Ukraine war, I wouldn't take much notice of little bits here or there.
They really want to stay neutral.