Phase-resolved gamma-ray spectroscopy of the Crab pulsar observed by POLAR