In the 1980s, people in China could land themselves in trouble with the government for their fashion choices.

Flared pants and bluejeans were considered “weird attire.” Some government buildings barred men with long hair and women wearing makeup and jewelry. Patrols organized by factories and schools cut flared pants and long hair with scissors.

It was the early days of China’s era of reform and opening up. The Communist Party was loosening its tight control over society little by little, and the public was pushing the limits of self-expression and individualism. The battle over the height of women’s heels and the length of men’s hair embodied the struggle.

Now the government is proposing amendments to a law that could result in detention and fines for “wearing clothing or bearing symbols in public that are detrimental to the spirit of the Chinese people and hurt the feelings of Chinese people.” What could be construed as an offense wasn’t specified.

The plan has been widely criticized, with Chinese legal scholars, journalists and businesspeople voicing their concerns over the past week. If it goes into effect, they argue, it could give the authorities the power to police anything they dislike. It would also be a big step backward in the public’s relationship with the government.

“In Chinese history, the times when clothing and hairstyles were given significant attention often corresponded to ‘bad moments in history,’ ” someone using the name Zhang Sanfeng wrote on the social media platform WeChat. “The introduction of the amendments didn’t come from nothing. It’s a response to some strange sentiments emerging in our society.” The article was widely circulated before being purged by censors.

Under the rule of China’s top leader, Xi Jinping, the government has been fixated on control — how people think, what they say online and now, what they wear.

China has built a surveillance state with modern technologies, censoring the news media and social media extensively, even banning displays of tattoos and men wearing earrings on phone and TV screens. The ideological straitjacket is closing in on the private sphere. Personal choices like what to wear are increasingly subject to the scrutiny of the police or overzealous pedestrians.

In July, an older man on a bus berated a young woman, on her way to a cosplay exposition — where people dress up as a characters from movies, books, TV shows and video games — for wearing a costume that could be considered Japanese style. A security guard at a shopping mall last month turned away a man who was dressed like a samurai. Last year, the police in the eastern city of Suzhou temporarily detained a woman for wearing a kimono.

These episodes were related to anti-Japanese sentiment instigated by the Chinese government. But the confrontations go beyond that.

Last month in Beijing, security guards cracking down on expressions of gay pride stopped people dressed in rainbow-themed clothes from entering a concert featuring the Taiwanese singer Zhang Huimei, better known as A-Mei. Also in August, people filed complaints about a concert by the Taiwanese singer Jolin Tsai because her fans displayed rainbow lights and some of the male fans dressed in what was described as “flamboyant” female clothing. Just last week the police in Shenzhen scolded a man who was livestreaming in a miniskirt. “A man wearing a skirt in public, do you think you’re positive energy?!” the police yelled at the man.

If the proposed amendments, which are open to public comment until Sept. 30, are approved by the national legislature, such incidents could result in fines of up to $680 and up to 15 days in police custody.

The law could put China in the ranks of the most socially conservative countries.

“The morality police is on the verge of coming out,” a lawyer named Guo Hui wrote on Weibo. “Do you think you can still make fun of Iran and Afghanistan?” People posted photos last week of Iranian and Afghan women wearing miniskirts and other Western-style clothes in the 1970s, before their countries were taken over by autocratic religious rulers.

Many people are concerned that the proposal doesn’t specify what would constitute an offense. The language it uses — clothing or symbols that are “detrimental to the spirit of the Chinese nation and hurt the feelings of the Chinese people” — tracks expressions the foreign ministry and official media use to voice their displeasure at Western countries and people. No one knows exactly what they mean.

I asked Ernie, the artificial intelligence chatbot released recently by China’s biggest online search company, Baidu, to define “hurting the feelings of the Chinese people.” Ernie said it didn’t know the answer and urged me to move on to other topics.

Without a clear definition, enforcement of the law would be subject to the interpretation of individual officers.

“If officials can arbitrarily expand interpretations and applications of the law based on personal preferences and ideological beliefs,” “we may not be far from the concept of ‘if you want to accuse someone, you can always find a pretext,’ ” Zhao Hong, a professor at China University of Political Science and Law in Beijing, wrote in an article posted on the news site The Paper.

She quoted online comments from people worried that if wearing a kimono could be interpreted as harming the national spirit, then what about eating Japanese food, watching anime or studying the Japanese language? Other people noted that the ban could extend to wearing a suit and tie, or xizhuang in Chinese, which means clothes from the West.

It’s hard not to think back to the time before the 1980s, when the Chinese used ration coupons to buy clothes, mostly in blue and gray. Fashion played an important part in liberalizing China’s economy.

In 1979, when the French designer Pierre Cardin held the first fashion show in China after the Cultural Revolution, the contrast between the models in haute couture and the audiences wearing mostly dark-colored Mao suits reflected a jarring gap. There was an affluent, vibrant developed world, and there was an impoverished, oppressive China.

China had to change. First it had to allow people to wear what they liked.

“The length of one’s hair, the size of one’s pants cuffs and the morality of one’s thoughts are not necessarily related,” an official magazine wrote a few months after the fashion show.

Still, for much of the 1980s, fashion was a battlefield for the power struggle between the reformist leaders and the conservatives.

In 1983, the reformist party general secretary Hu Yaobang had to urge colleagues not to “interfere in people’s clothing choices and to avoid using the term ‘weird clothing.’ ”

Western-style fashion probably didn’t take hold until 1987, when the new party chief, Zhao Ziyang, dressed in a double-breasted blue pinstripe suit, charmed the international press by chatting and answering dozens of unfiltered questions. He flashed the label of a Chinese brand inside his suit to reporters skeptical of its local origins, according to a Times dispatch from Beijing.

Both leaders were later purged but, as they envisioned, the closets of the Chinese people became fuller and more colorful. China became the world’s leading fashion manufacturer and is now a major market for luxury goods.

For many Chinese, it’s obvious that the proposed law, if implemented, could erode the personal space they regained over the past few decades.

The legislation is so unpopular that even some official media outlets are writing about the outcry.

Hu Xijin, the former editor of the official tabloid The Global Times, urged that the proposal be clarified. Many Chinese, he wrote, are worried about doing or saying the wrong things. The law should provide people with certainty and a sense of security, he wrote.

“China’s development and prosperity,” he wrote, “require an inclusive and relaxing social environment.”