From Western plot to party line, how China embraced climate science to become a green-energy powerhouse.