Mainstream Democrats breathed a sigh of relief in October when Hillary Clinton dominated the first debate with Bernie Sanders — but after Sunday night’s debate, they’re probably hyperventilating. Or ought to be.

The Sanders surge in the Democratic primaries, which suggests he’s on the verge of beating her in the first two states and closing in on her nationwide, was mirrored in the way he ate her lunch Sunday night. And, for good measure, gobbled up her breakfast and dinner, too.

Hillary Clinton’s goal was clear — to make the point that she’s the serious and sober candidate and Bernie Sanders is a pie-in-the-sky fantasist. Indeed, Sanders more than once said he wanted “revolutionary change.”

But if there’s one thing we’ve learned about the political mood of the United States going into 2016, it’s that the public doesn’t seem especially sober or even all that serious. The country is in a rage, Democrats as well as Republicans, at the brokenness of our politics and the stagnation of the middle class. Hillary cannot find a way to tap into that — and tapping into that is all Sanders does.

Not only did she say a few things that had Republican admakers rubbing their hands together with glee — particularly when the subject of an FBI investigation spoke the words “no individual is too big to jail.”

She also had a genuinely creepy, Michael-Corleone-in-“Godfather 2” moment when she basically said “we’re both part of the same hypocrisy” after the third man in the debate, Martin O’Malley, criticized her for raising money on Wall Street.

She really doesn’t have a choice but to position herself as the insider’s insider, really, though she could do it more artfully. She talked about how O’Malley had gotten Wall Street donations when he was head of the Democratic Governors Association. “Well,” O’Malley replied, “I’m not getting them now.”

And we know Sanders isn’t. His issue set is simple. The rich should be soaked, health care should be single-payer and banks are screwing you. The reason good things don’t happen, in his view, is that rich people control politics through our campaign finance system.

He’s not compelled to deliver the coup de grace — which is that Clinton’s career is simply another manifestation of the ailment plaguing America — because it is ragingly obvious.

Instead, he mentioned Goldman Sachs, the Wall Street financial firm, twice — to make the point that both the George W. Bush and Barack Obama administrations had a Goldman Sachs alum as Treasury secretary.

And of course Hillary Clinton took hundreds of thousands of dollars in speaking fees from the firm, which makes it difficult for her to stage a counterattack on the point.

On health care, Clinton seemed to walk into a trap. She found herself defending the charge made (by her daughter!) that Bernie Sanders would dismantle ObamaCare.

He made incredibly short work of that by saying that he voted for ObamaCare and simply wants it to be the opening step toward what he calls “Medicare For All” — meaning a single-payer government health care system.

Once again, the fact that Hillary wasn’t comfortable taking that idea on directly shows the weakness of her anti-populist approach. She would say only that to raise new health care ideas would open a can of worms in 2017 that would give Republicans a way to abolish ObamaCare.

That criticism makes no sense. After all, the scenario she was addressing would involve Sanders having been elected president and sitting in the White House — which would mean he would have veto authority over any such Republican action and that the country had decided in 2016 to move farther to the left in any case.

Sanders raised $37 million last quarter, more than Clinton did and with more individual donations than any candidate before him in American history. That has strengthened him as a candidate and it emboldened him as a debater.

Hillary’s defenders will doubtless be spinning frantically over the next few days, but anyone who says she won last night is either deluding themselves or trying to delude you.