The following laws are for your reference:
labour law
Article 50 Wages shall be paid to labourers themselves on a monthly basis in the form of currency. The wages of workers shall not be deducted or delayed without reason.
Labor Contract Law
Article 22 Where an employing unit provides special training fees and professional technical training for laborers, it may conclude an agreement with the laborers to stipulate the service period.
If the laborer violates the service period agreement, he shall pay liquidated damages to the employer in accordance with the agreement. The amount of liquidated damages shall not exceed the training expenses provided by the employer. The liquidated damages that the employer requires the laborer to pay shall not exceed the training expenses that should be shared for the unfinished part of the service period.
If the employer and the employee agree on the service period, it will not affect the employee's improvement of labor remuneration in accordance with the normal wage adjustment mechanism during the service period.
In this case, you can negotiate with the company and ask for a refund of the detained money. If not, you can complain to the local labor inspection brigade in the name of wage deduction.