Public security in China is generally trustworthy, and it is possible to travel even at night in well-lit areas of big cities. There are no vicious crimes like robbery, but it must be reminded that petty thefts do occur in some crowded areas. Therefore, please keep a watch on your wallets, mobile phones, cameras, and jewelry - the main targets of thieves at all times, and carry your bag within sight.
In terms of traffic, it is indeed not safe in China, a country with a large population and throngs of vehicles, especially when crossing the road. As in many Asian countries, major Chinese cities do not enforce well the rule of vehicles yielding to pedestrians, let alone those small cities with fewer traffic lights. Hence, always be sure to watch out for e-bikes, motorcycles, and bicycles, even if you are crossing on a green pedestrian light.