The remarkable campaign was upended by a backlash against U.S. President Donald Trump, which sparked a stunning liberal resurgence.