Low-energy Spectra of Gamma-Ray Bursts from Cooling Electrons