Its gaze fixed on the prize of becoming rich and strong, China has spent the past 40 years as a risk-averse bully. Quick to inflict pain on smaller powers, it has been more cautious around any country capable of punching back. Recently, however, China's risk calculations have seemed to change.

First Yang Jiechi, the Communist Party's foreign-policy chief, lectured American diplomats at a bilateral meeting in Alaska, pointing out the failings of American democracy. That earned him hero status back home.

Then China imposed sanctions on British, Canadian and European Union (EU) politicians, diplomats, academics, lawyers and democracy campaigners. Those sweeping curbs were in retaliation for narrower Western sanctions targeting officials accused of repressing Muslims.

China's foreign ministry declares that horrors such as the Atlantic slave trade, colonialism and the Holocaust, as well as the deaths of so many Americans and Europeans from COVID-19, should make Western governments ashamed to question China's record on human rights.

Such performance-nationalism is watched by Western diplomats in Beijing with dismay. Envoys have been summoned for late-night scoldings by Chinese officials, to be informed that this is not the China of 120 years ago when foreign armies and gunboats forced the country's last, tottering imperial dynasty to open the country wider to outsiders. Some diplomats talk of living through a turning-point in Chinese foreign policy.

History buffs debate whether the moment more closely resembles the rise of an angry, revisionist Japan in the 1930s, or that of Germany when steely ambition led it to war in 1914. A veteran diplomat bleakly suggests that China's rulers view the West as ill-disciplined, weak and venal, and are seeking to bring it to heel, like a dog.

In Washington and other capitals it is not hard to hear voices suggesting that China is making rash, clumsy mistakes. Surely China sees that it is souring public opinion across the West, they murmur. There is puzzlement about how China now views its recent draft accord with the EU, the Comprehensive Investment Agreement, which it had appeared so eager to conclude. That pact's ratification by the European Parliament is now on ice, and possibly entombed in permafrost, as a result of China's sanctions on several Euro-legislators.

In reality, Chinese leaders, if their own words and writings are any guide, think that assertiveness is rational. First, they believe that China has numbers on its side as a world order emerges in which developing countries demand, and are accorded, more sway. At the United Nations, most member states reliably support China as an irreplaceable source of loans, infrastructure and affordable technology, including surveillance kit for nervous autocracies. Second, China is increasingly sure that America is in long-term, irreversible decline, even if other Western countries are too arrogant and racist to accept that "the East is rising, and the West is in decline", as Chinese leaders put it. China is now applying calculated doses of pain to shock Westerners into realizing that the old, American-led order is ending.

China's rulers are majoritarians. Their hold on power involves convincing most citizens that prosperity, security and national strength require iron-fisted, one-party rule. They unblushingly put the interests of the many over those of the few, whether those individuals are farmers evicted to build a dam, ethnic minorities re-educated to become biddable workers, or dissenters who must be silenced. China is a hard challenge for liberal democrats precisely because its tyranny in the name of the majority is backed by lots of Chinese, albeit at a terrible cost to outliers and minorities. Today, Chinese ideas about global governance sound like a majoritarian world order.

As one European diplomat sees it, at least part of China's establishment is convinced that the liberal order established after 1945 — built around universal human rights, norms and rules that bind the strong and weak alike — is an obstacle to China's rise. Such revisionists are "convinced that China will not achieve its goals if it plays by the rules," he says.

Diplomats describe a China that is hubristic and paranoid. They say some Chinese officials are convinced that the EU will soon drop its Xinjiang-related sanctions, because Europe cannot recover from the pandemic without Chinese growth. Other Chinese officials worry that their country is making too many enemies, and tell diplomats as much. Alas, they are outnumbered by those who blame China's unpopularity on Western resentment of Chinese success.

China's rulers are duly preparing for a protracted struggle. The risks are clear, both for China and the West.