Draconian measures have trapped most of Shanghai's 25 million people at home for weeks as China combats the country's worst outbreak since the pandemic began.