The UN urged China not to detain people simply for taking part in peaceful protests, as Beijing tried to curb a nationwide spate of demonstrations demanding political freedoms and an end to Covid-19 lockdowns.