UPDATE 2-Shanghai's COVID lockdown drags into 4th week, fears flicker Beijing could be next

(Adds detail on overwhelmed emergency services, estimate on COVID curbs across China)

By David Stanway and Yifan Wang

SHANGHAI, April 25 (Reuters) - Shanghai's COVID-19 lockdown misery dragged into a fourth week, as orders on Monday for mass testing in Beijing's biggest district sparked fears that the Chinese capital could be destined for a similar fate.

In their battle to stamp out the virus, authorities in Shanghai said they would reserve the harshest restrictions for smaller areas around confirmed cases, raising hopes of some respite among the millions of people currently living in strictly quarantined neighbourhoods.

"Every compound, every gate, every door must be strictly managed," Qi Keping, vice-head of Shanghai's northeastern commercial district of Yangpu, told a daily newsconference, describing the new, more targeted approach, and saying it would "better achieve differentiated prevention".

In Beijing, all 3.45 million people living or working in Chaoyang district were ordered to have three tests this week, as authorities warned that the virus had crept into the city largely undetected during the previous week, with a few dozen cases reported.

Fearing they were about to taste the misery suffered in Shanghai, many people in the capital began stockpiling food, toilet paper and other basic goods.

China stocks slumped to two year lows on heightened worries of a potential outbreak in Beijing.

Blanket restrictions over large areas have fuelled frustration and anger in Shanghai, a city of 25 million people.

Over the weekend, authorities in China's commercial capital sealed off entrances of public housing blocks and closed off entire streets with two-metre-tall green wire mesh fences, with videos circulating online showing residents protesting from their balconies.

Police in hazmat suits have been patrolling the streets, setting up road blocks and asking pedestrians to go home.

While some people are allowed to leave their homes, most living under lockdown in Shanghai are either confined to home or cannot leave their residential compound. Even those who can go out have few place to go, with shops and most other venues closed.

Explaining the need for a new approach, Qi singled out the Tongji New Village area in her district, saying that although all its 6,000 residents were under complete lockdown, only a few residential buildings were reporting positive cases and curbs could be more focused on those.

Qi spoke alongside other city officials.

One woman in Shanghai's Changning district, who declined to be named, said Qi's comments gave her something to cling on to.