A versatile low-noise wide-range charge-sensitive preamplifier for HPGe detectors