China has warned the US it could take "firm counter-measures" if Washington continues to show support for pro-democracy protesters in Hong Kong.