How many ranks were there in civil service in the Qing dynasty?