BEIJING — All the signs of Beijing’s infernal summer are in evidence. Men playing cards on the sidewalks are sporting their “Beijing bikinis,” their shirts hoisted up over their beer bellies for better airflow, while young trendy types carry personal fans as they walk down the street.

People are cooking meat at outdoor restaurants or on little grills on the sidewalk. It’s so hot that Beijingers — usually insistent on body-temperature beverages — are even drinking their beer cold.

It could almost be any other steamy July in any other year.

But even here, where life is almost back to normal after months of strict controls, the coronavirus remains a lingering menace, lurking behind the quotidian veneer.

Restaurants and malls are open, but to enter, customers have to activate a health code on their smartphones. The code tracks their movements and determines whether they have been to any risky places. Only those with green codes are allowed in. Many offices insist on green codes, too. A red code, or even an amber one, is the scarlet letter of 2020.

You can have concerns about privacy, or you can have a functioning life. You can’t have both.

Security guards with temperature guns man the gates at supermarkets and residential compounds, pointing them at the wrists of every person who wants to enter. This is largely a formality, as the reading often does not reflect reality. This reporter has recorded temperatures in the low 80s on several occasions, yet was alive enough to walk through the gate.

Gyms are open, and movie theaters on Monday turned the lights back on, but at 30 percent capacity and with no eating or drinking allowed. Beijing’s main tourist attractions, such as the Forbidden City, require advance reservations, and masks are compulsory. They also are mandatory on public transport and in taxis.

As countries around the world try to find the balance between health and economic considerations to deal with a second or third — or in the case of the United States, first — wave of the coronavirus, China has found its sweet spot. These controls involve immediate lockdowns, mass testing and the use of surveillance technology to a degree that the ruling Communist Party could only have dreamed of when this year dawned.

When a cluster erupted around the Xinfadi food market in Beijing last month, municipal authorities confined 75,000 people to their homes and tested 11 million residents in the space of a few weeks. When traces of the virus were linked to salmon imported from Norway, they even tried to swab the throats of the fish (although it is not clear that salmon have throats).

That aside, the efforts worked. One month later, the capital has gone back to its semblance of normality.

“I think China has done pretty well in coping with the pandemic,” said Li Yue, who lives near Beijing’s historic drum and bell towers and was taking a break from the heat in the square on Monday.

The area would usually be teeming with tourists, but with the towers closed and international tourists shut out of China, it felt like any other neighborhood in the rabbit warren of hutongs, or alleys.

“Life has returned to 70 percent to 80 percent normal,” Li said. The only thing he is not able to do yet is go to the movie theater, he added, although that is changing this week.

Chinese President Xi Jinping has declared “victory” over the virus, but authorities remain combat-ready.

“Low risk ≠ zero risk,” blares one red-and-white propaganda banner near the Bell Tower. “The battle is not yet over, and no slackening in prevention and control.”

Across the square, where elderly residents gather — mostly mask-free — to play mah-jongg under the shade of the trees, another sign exhorted: “Wear a mask, wash hands frequently, ensure regular ventilation, and maintain good personal hygiene.”

Beijing’s virus-response level ticked down a notch Monday, to three, paving the way for performances and sports events to resume and for public places such as museums to operate at 50 percent capacity.

“Beijing mobilized the entire city to effectively contain the spread of the virus,” Chen Bei, deputy secretary general of the municipal government, said Monday. Beijingers must continue promoting new habits and practices to “ensure no slackening in the new normal of our epidemic control,” she said.

The same controls are being implemented in Urumqi, the capital of the Xinjiang region, where a new cluster of cases emerged last week. The city, already under strict controls as part of the central government’s efforts to repress the Uighur minority, has ground to a halt as “wartime” measures are enacted. Dozens of cases have been detected in Urumqi, where all 3.5 million residents are now being tested.

In Dalian, in China’s northeast, a new cluster discovered this week has prompted similar restrictions and testing.

But if the responses in these places follow the Beijing pattern, the virus will soon be stamped out there, too.

This makes the news out of the United States all the more puzzling for many people in China. Many express confusion at why Americans would object to wearing a mask that could help protect them, as well as surprise that there is not more-widespread testing in a country with such an advanced medical system.

“Speaking from a citizen’s perspective, I think the United States is not doing enough for its people and not caring for the interests of the masses,” said Fiona Tao, a 20-year-old university student who was practicing skateboard moves in the empty square on the other side of the Bell Tower.

She was sporting ripped jeans and American sneakers but expressed relief to be living in China, rather than in a country like the United States.

“I think each country has its own approach, so we can’t criticize them using our standards,” her friend Alexa Zhang said as she drank bubble tea. “It’s their decision not to take millions of lives seriously.”

China’s leaders, locked in a battle for global dominance with the United States, have been making sure people here know how much worse the outbreak is there. State media have reported every time the U.S. caseload and death toll have crossed another threshold, trying to turn domestic criticism of the Communist Party’s initial missteps into gratitude for its heavy-handed response.

But the numbers also help them make this case.

More than 4 million people in the United States have been infected, and more than 141,000 have died, exponentially higher than China’s officially reported 86,482 infections and 4,656 deaths. China contained the virus, which emerged in the city of Wuhan at the end of last year, by imposing draconian lockdowns and shutting down large chunks of the economy.

This was widely viewed at the time as something that only an authoritarian government could do, although it has been adopted, in varying degrees, in countries from Italy to New Zealand.

The friends sitting on their skateboards in the shadow of the Bell Tower agreed that the United States was great at many things, but that China’s political system and its collective culture made it better at dealing with epidemics.

“There’s no doubt that the United States has better education and a bigger economy,” Tao said. But looking at the coronavirus outbreak from a distance, she said, it appeared that only the rich and the powerful were protected in the United States.

“It seems like equality is not for all there,” she said.

Lyric Li and Wang Yuan contributed to this report.