There are three kinds of detention: public security detention, judicial custody and so on. It is an administrative compulsory measure, and the close relatives of the parties can visit; Criminal detention is a criminal compulsory measure, and only lawyers entrusted by the parties or appointed by the court can meet with it.
This is clearly stipulated in China's Criminal Procedure Law, Civil Procedure Law and Public Security Punishment Law.