Seven hours in line to vote? That’s outrageous in America. But many voters faced waits like that on election day because of some states’ attempts to discourage voting rather than encourage it.

The federal government has to intervene and set some rules. All Americans should have reasonable access to the polls.

California Sen. Barbara Boxer has a proposal she calls the LINE Act that could work. It would require national standards for the number of voting machines, election workers and other resources to ensure no one has to wait longer than an hour to vote.

In addition, states that had waits longer than 90 minutes in November would need to submit remedial plans.

Even an hour’s wait is a lot. Yet in some states, including Virginia, Ohio, Nevada and Florida, voters waited four hours or more, both in early voting periods and on election day. This is like a modern-day poll tax — costly for those who choose to wait and a deterrent for countless others who have to get to work or pick up a child.

President Barack Obama noticed. In his victory speech on election night, he said, “I want to thank every American who participated in this election, whether you voted for the very first time or waited in line for a very long time.”

“By the way,” he added, “we have to fix that.”

Attorney General Eric Holder said last week that national voting standards are worth considering. Boxer has urged him to see what the Justice Department can do under the Voting Rights Act of 1965.

Many of the long lines resulted from efforts in 18 or more states to limit voting. Florida is the best example. Before the election, Gov. Rick Scott signed measures that he said would combat voter fraud. The state purged voter rolls and restricted registration drives. It cut the number of early-voting days, including eliminating the Sunday before election day, when many black churches bus parishioners to the polls.

After the election, former Florida Republican party chairman Jim Greer admitted the push had nothing to do with fraud. After Obama’s victory in 2008, it was an attempt to give the GOP an electoral leg up.

Restrictions like Florida’s tend to prevent young people, minorities and the poor — in other words, Democrats — from voting.

They failed, perhaps because of a backlash.

And there is a silver lining to this cloud: It laid bare the campaign to restrict certain people from voting.

Had the strategy not been so obvious, states might have gotten away with it. Long lines are easily remedied: more early voting, mail ballots and polling places.

But the federal government has to step in because, shocking as it is, some states can’t be trusted to protect their own citizens’ constitutional rights.

Otto Warmbier was arrested in January 2016 at the end of a brief tourist visit to North Korea. He had been medically evacuated and was being treated at the University of Cincinnati Medical Center when he died at age 22.