Confused by North Korea’s sudden hard line? Look to China for answers.

Last week Pyongyang reverted to taunts, calling Mike Pompeo’s trip there “regrettable,” saying America has a “gangster-like mindset” and denying the secretary of state a meeting with Dear Leader, who apparently was obliged to inspect a potato farm instead.

Why? As Sen. Lindsey Graham told “Fox News Sunday,” “I see China’s hands all over this,” adding, “There’s no doubt in my mind that it’s the Chinese pulling the North Koreans back.”

President Trump tweeted Monday his “confidence” that “Kim Jong-un will honor the contract we signed, even more importantly, our handshake.” (No contract, of course, was signed at the end of last month’s Singapore handshaking session.)

Then, Trump added: “China, on the other hand, may be exerting negative pressure on a deal because of our posture on Chinese Trade-Hope Not!”

Graham and Trump are right — and it’s about more than trade.

Over the weekend two US Navy destroyers sailed the Taiwan Straits. A Navy official called the exercise “routine” but a Beijing mouthpiece, the Global Times, opined it was a “psychological game”: America, according to the paper, is sending “political signals.”

Psychological games? Signals? That’s President Xi Jinping’s bailiwick, and he’s unhappy with America these days. He’s used to world leaders asking “how high” when he asks them to jump. Trump doesn’t.

Airlines around the world have by now largely changed their websites and ticketing apps so all flights to Taiwan are labeled “Taipei, China.” Beijing demanded the change as part of a renewed campaign pressuring countries to quash any hint of Taiwanese national aspirations.

Beijing sees the democratic island nation as one of its provinces. Anyone trying to treat Taiwan differently is threatened with cutting off access to China’s lucrative markets. However, US airlines, under pressure from Washington and almost alone in the world, still list Taiwan as a destination.

So Xi can’t be happy.

Meanwhile, Trump has also been threatening to, as he sees it, level the trade playing field. Washington imposed a 25 percent tax on $34 billion worth of Chinese imports on Friday. To illustrate his point, he went after the World Trade Organization’s definition of China as a “developing” nation. “Does anybody think this is fair,” he tweeted.

It isn’t. In fact, China is acting globally more like a nasty feudal lord than an ambitious serf striving for equality. And not only in Taiwan, or the rest of China’s ever-expanding backyard.

Beijing is working hard to export state capitalism. Even in Europe some wonder these days whether China offers a better governing model than our messy and chaotic democracies.

When it encounters obstacles to its aspirations of dominance, China uses all levers of power to get its way — and that’s likely how, over the weekend, a Beijing client state, North Korea, delighted Pompeo’s critics by doing a 180 on its polite-host act and stopped pretending it’s committed to true denuclearization.

The usual suspects, including some in the Trump administration, will now push the president to appease Xi: If you avoid confrontation, negotiate your proposed tariffs away and forgo big military maneuvers in Beijing’s backyard, maybe North Korea will come back to the table ready to deal.

That would be a big mistake. Under Xi, China has shown remarkable hostility to goodwill gestures. When it smells weakness, it responds by upping the pressure.

In fact, Trump may have been a bit too conciliatory toward China, treating Xi as a possible partner and hoping he’d help to denuclearize North Korea for us.

Instead, Beijing is now back to its old ways. Once again, Chinese banks and companies are brazenly violating UN Security Council sanctions. China had supported imposing those sanctions when Washington threatened to blacklist Chinese companies dealing with Pyongyang. It ceased to cooperate when these sanctions were waived to advance North Korean diplomacy.

North Korea is one of those pesky problems that need addressing. Trump has, rightly or not, gone all-in trying to negotiate it away. But North Korea is merely a tail, while China is the menacing wolf wagging it.

And he’s at the door.