You need to look at where was women's standing in the society and culture 80, 90 years ago before the ccp.
My grandma was born in 1931, to a farmer household in a village in hebei. In that age, the culture, the believe in a significant portion of the Chinese society, was that women should abide by the husband, should stay at home, do house chores, raise kids. They don't need to study. For a commoner, if you want to teach your kid, you personally contact a teacher and the teacher decide if they want to keep the kid. Like, if the teacher says this kid looks dumb, doesn't have a future, he will not take in the kid. My grandma's foot was bounded. My great grandparents didn't sent her to the teachers. She couldn't read. She was married to my grandpa through arranged marriage.

During the ccp revolution between 1940 to 1950s, women joined the ccp, and pushed for women liberation. They campaigned for no more feet binding, no more arranged marriages, the right to learn how to read and knowledge, women should do whatever men can do, become industrialized factory workers, soldiers, no longer confined to their traditional female roles. That was Chinese women's equal rights social movement. No less significant then women movements elsewhere. The saying was "women can hold half of the sky". ccp's leaders started the messaging, it resonated with the people, and then people reinforced that messaging. This is how the political movement had strength and kept alive. You have to understand ccp's revolution became a wide scale revolution because the political goals matched with people's desires. People voted with their feet. My grandma joined the ccp as well. She campaigned and learned how to read from her activities with the ccp.

My grandparents had 5 kids, 2 girls. My grandma was always a strong supporter of the girls, encouraged them to be strong and independent, telling them to chase big dreams and do want their hearts tell them to do. My grandpa not so much. He sided with the boys much more. Like the vast majority of Chinese families before 1990s, the family was resource constraint. They could only afford to eat meat during big holidays. My grandpa would try to give the boys better pieces of the meat to eat. Same thing with cloths.

重男轻女(preferences for boys) is Chinese culture and custom issue. Its people's thinking, its the culture, not desire or mandate of the government. The government didn't tell the people to have only boys and not girls. Its the people who did that. If you want the official and legal stance, since 1950, Chinese constitution says "women enjoys same political, economic, cultural, social rights as men". Marriage law says "Both parties must be at will, no third party shall interfere". So technically, my grandpa's action of favoring boys is against the constitution. Before the 90s, there were still places that practiced arranged marriages, technically its also illegal. You could say it the government's fault for not enforcing the laws. The reality is preferences for boys is ingrained. And if the government enforces bans on practices like arranged marriage, people say its destroying traditional culture, limiting cultural freedoms.

I think the government was trying to change people's mentality and culture on gender. One of the important action was making education mandatory. This forced parents to give girls and boys both education, regardless of the social economic status of the family. And when I was going through Chinese school, we were all taught on respecting each other. Text books have many stories about heroines, women liberation, equality etc. My classes treat everyone the same, everything was based on merits. Girls did well on grades, and the teachers would tell the guys "shame, look at the girls". Many class reps were girls. At least I view girls with utmost respect. And the common saying goes "In front of women, the women is always right"

I think for the young generation of Chinese, the mentality and culture is changing. Women are very much independent. Guys showing respect to a women is the baseline. There are still gender discriminations in the workplace, like some employers are reluctant to hire girls because they fear girls would get married, have kids, take parental leave, causing hassle to the business schedules. We need to fix this. But still, female bosses, engineers, managers are pretty common. Did you know one of core founder of Douyin/Tiktok is a women? Or many team leaders and managers in China's space program are women. And lots of people today actually prefer having daughters over sons.

Compare the women's society standing in 1930 and now. Of course one shouldn't ignore all of the current problems. But one shouldn't dismiss the progress and efforts made in the past.