Actually I don’t think a hot war loss to China will lead to a collapse of the US, so long as things stay conventional and don’t go full nuclear global MAD.
In the nuclear age, when two nuclear superpowers go to war directly against each other, if they can avoid total use of nukes, then neither side can totally defeat the other. Even if China absolutely owns America to a completely unrealistic degree, wipes out its entire Pacific fleet, destroys the entire USAF and owns the Pacific, invades and takes Hawaii, all America has to do is carpet nuke Hawaii to draw its nuclear red line and that’s basically the war frozen. Because if China sees you are crazy enough to carpet nuke your own territory, they cannot doubt you will be prepared to go full nuclear MAD if push any further, and so long as Chinese leadership isn’t suicidal they won’t push any further as owning the pacific west of Hawaii is basically more than they ever wanted or need.
This is the main reason western elites are so blasé about war against China. They think (I conclude rightly) that they can freeze the conflict no matter how badly they are loosing far from their mainland through nuclear brinkmanship.
They would then be able to blame the total collapse of their financial system on the war loss and redirect domestic fury at such a loss against minorities like they have always done. Basically dust off the German pre-WWII playbook to purge the country of minorities, liberals and LGBTs etc, use massive government spending on infrastructure and military rebuilding to keep the economy going, maybe annex Canada, Mexico and some Latin America countries for resources and to give the people something to cheer about to move on from their loss to the Chinese quicker. And basically build what America’s founding fathers always wanted - a white supremacist continent spanning new world. So expect religious fundamentalism to also be dialled up to 1000.
The biggest risk would be a new civil war breaking out. But to be brutally honest, the rednecks and religious nuts would absolutely curbstomp the liberals and coloureds, so there isn’t really much risk of a break up of the country due to a military stalemate.