That's a fundamental misunderstanding of the role of carriers today and going forward. They're not primarily for fighting a war with China or Russia.
The reason China is building them and looking to add more in the coming years, is for the same reason the US has them. China knows the US could sink a carrier and yet they're building them anyway. Why?
It's about global force projection. The point isn't to set them up in front of China or Russia as convenient targets and let them get sunk. You mostly want to use carriers directly against weaker adversaries. A war with China or Russia that involves sinking a US carrier, would be the start of WW3, and millions of people would probably die. Carriers getting sunk is not a primary concern at all in that scenario (it's down the list, with nuclear war jumping to the top).
You're touching on something unspoken but very present in the modern US military machine. It's great for wrecking anyone who isn't on the short list of China, Russia, the EU, Japan and maybe India. Every other nation could see their infrastructure and military devastated within a month, with little they could do to stop it. (See Libya for one example.)
But the American people aren't being sold a military that can act as the international equivalent of mafia leg-breakers. We're told, again and again, that we are paying for a military that is "the best" and that can, if needed, stand up to our global peers and near-peers and win. There's a disconnect between rhetoric and expenditures on the one hand, and demonstrated performance, capabilities, and operational plans on the other hand.
That seems like a huge problem to me. At the least, it's a massive fraud being perpetrated on the American public. And at worst, it might lead to a terrible conflict as decision-makers operate with very inaccurate assessments of what our military is really capable of.
I think a few other posters have touched on this, but: IMO there is no such thing as preparing for an extended physical war with China, Russia, or (worst case) current allies such as the EU. Any war of serious consequence between large nuclear powers is game over for both. Even if one "wins," they'll be left in such a state of devastation that every other country left on the planet will handily surpass them, if there's even a habitable planet afterwards.
I'd be surprised if our lawmakers, who mostly grew up in the era of MAD (mutually assured destruction) with the USSR, aren't aware of this. That's in part why there's such a focus on preventing unfriendly countries such as Iran from developing nuclear weapons... And it's why Iran wants them so badly: a large enough nuclear arsenal is a free pass from the "leg-breakers" you describe, because — one hopes — no one would be mad enough to start a war of MAD.
Currently, the military is still extremely useful in projecting force and securing access to important trade routes and resources. Threat of nuclear weapons isn't a good fit there, because you'd immediately destroy whatever you were trying to retain access to. Most of the global superpowers are thus locked in a giant Mexican standoff, where their militaries need to remain powerful enough to at least project the ability to fight and win small battles (and are stuck in an arms race against each other on that front), but can't reasonably expect to be able to topple each other — only gain relative advantage in the global economy via a long, slow game of securing access to better resources, trade agreements, or capital, and subtly undermining or attempting to destabilize each other via psychological warfare (election interference), economic warfare (tariffs, IP theft, etc), or hacking.
The reason China is building them and looking to add more in the coming years, is for the same reason the US has them. China knows the US could sink a carrier and yet they're building them anyway. Why?
It's about global force projection. The point isn't to set them up in front of China or Russia as convenient targets and let them get sunk. You mostly want to use carriers directly against weaker adversaries. A war with China or Russia that involves sinking a US carrier, would be the start of WW3, and millions of people would probably die. Carriers getting sunk is not a primary concern at all in that scenario (it's down the list, with nuclear war jumping to the top).