Ms. Li prevailed in arbitration but lost when the company appealed in court. She is fighting that and another legal dispute: the company has sued Ms. Li, her husband, a Chinese reporter and a newspaper that wrote about her case for defamation, seeking $1 million in damages.

Li Wei, the chief executive of Keyrin, disputed Ms. Li’s story, saying that it was “completely inconsistent with the facts” and that she did not show up for work. “In the last three years, 11 female employees have had babies,” Mr. Li said. “This is the best evidence that we treat our female employees well.”

It might look like the time has never been better for working mothers in China. Faced with an aging population, officials have abolished the country’s one-child policy. Some local authorities have extended maternity leaves or considered tax breaks to encourage women to have a second child.

But experts see a paradox in China’s approach. The country, the world’s second-largest economy after the United States, needs more children because of its shrinking population and says it wants women to work, but it offers few incentives for working mothers. Female participation in the labor force has fallen since the 1990s, and the pay gap between women and men has widened.

China, like the United States, does not subsidize maternity leave. Companies tend to equate leave with lost revenue: They get nothing when mothers take time off. Legal complaints filed by mothers show tha t local authorities did not investigate reports of bias or firings, although the country itself seems to be rethinking some workplace standards.

This year, the Supreme People’s Court created a legal category called employment equality that allowed women to report gender bias. A small number of pregnant women are using that to make claims.