Curved crystal spectrometer for high-resolution in-beam spectroscopy of X-rays and low-energy gamma rays