IN AN underground railway station below the main public library in Shanghai is a spacious bookshop called Jifeng. It is one of the city’s most respected, but its days are numbered. A display inside the entrance (pictured, top) shows how many of them remain before the shop closes—147 as of September 6th. The authorities, it seems, have had enough of its open-minded selection of works and the talks it hosts on controversial topics.

The shop’s landlord is the library, which has told the owners that it has “no choice” but to terminate the rental contract when it expires. Customers are mourning. “I refuse to believe the dream is over…the spirit of freedom will always exist,” wrote one on the bookshop’s noticeboard. The owners, however, have made it clear that the shop is unlikely to get permission to reopen elsewhere in Shanghai for the foreseeable future.

During two decades of operation, Jifeng has tested the patience of Shanghai’s culturally conservative authorities. One of its founders was a prominent liberal academic in the heady days before the crushing of the Tiananmen Square protests in 1989. The shop’s selection of books on politics and philosophy reflects his tastes. Ever tighter controls on debate under President Xi Jinping may have added to pressure on officials in Shanghai to take action.

Yet around China, privately owned bookstores continue to defy both competition from online booksellers and heavy-handed censorship (recently curbs are reported to have been imposed on the number of foreign children’s books allowed to be published). They are cashing in on demand for something spicier than the dour offerings of state-run counterparts.

Take Fang Suo Commune, a chain which opened its first store six years ago in Guangzhou. At the time, it appeared to have little chance of success. The southern city is often scorned in China as a “cultural desert”, its residents stereotyped as having little interest in highbrow pursuits. How could such an establishment, located in an upscale shopping mall, survive?

But Commune has become an aspirational brand like Dior and Dolce & Gabbana—European fashion houses that have outlets in the same shopping centre in Guangzhou. By some estimates, almost a third of visitors to the complex enter Commune’s doorway carved from a massive single piece of ancient wood, and step into its subtly lit interior.

On entering, customers encounter a display of volumes of poetry, including Chinese translations of Seamus Heaney, an Irish Nobel laureate, and of Philip Larkin, one of Britain’s best-loved 20th-century bards. “Even though the market for poetry is very small, we put this right at the front of the store—we want people to realise this is the root of literature,” says Cheng Chen, a spokesperson. Farther inside are Chinese versions of books by Susan Sontag, an American feminist, and of Robert Pirsig’s classic novel about self-discovery, “Zen and the Art of Motorcyle Maintenance”. As in many Western bookshops, staff are chosen for their expertise in topics related to the works on sale: something rarely found among employees of state-owned shops.

Commune sells clothes, too. One corner of the shop is devoted to the Exception de Mixmind fashion brand, which was founded by the store’s owner, Mao Jihong, and has made coats for China’s first lady, Peng Liyuan. These account for 20-30% of Commune’s sales, says Ms Cheng. But books are its main business. The model is catching on. Similar stores, featuring cafés and sections selling products such as teapots and fabric bags, have been opening around the country. In 2015 Eslite, a Taiwanese chain—which pioneered 24-hour service in Taiwan’s capital, Taipei—entered the market in China with a branch in the city of Suzhou, west of Shanghai. Another one planned for Shanghai itself has not materialised, possibly for political reasons. Eslite’s shops in Taiwan regularly sell items that would be considered sensitive in China, such as a documentary on DVD about Ai Weiwei, a dissident Chinese artist. But even in Shanghai, despite Jifeng’s travails, several new, elegantly designed bookshops have opened in the past two years. They include Long Time No Read. It displays titles such as “Gay Life Stories” and “On Democracy’s Doorstep”, a permitted book about the history of universal suffrage in America. Commune, having opened branches in the south-western cities of Chongqing and Chengdu as well as in Qingdao on the coast, is planning to open another one, covering 8,000 square metres, in a mall in Shanghai next year. That, too, may test local officials’ tolerance. Like Jifeng, Commune tries to attract customers by organising talks—though not always as edgy as Jifeng’s. Speakers over the past year have included the Chinese translator of Umberto Eco’s novel, “Numero Zero”, which satirises politicians and the media; and a film director, Jia Zhangke, whose movies about the social costs of China’s boom sometimes rile the censors.

But companies like Commune are careful not to provoke the authorities too blatantly. They obtain books published abroad from a state-owned distributor, the China National Publications Import and Export Corporation (its motto: “Opening, Harmonising, Innovating, Advancing”), which prohibits anything critical of the Communist Party. “There’s nothing we can do about it,” Ms Cheng says.

In Shanghai, in a quiet side-street close to Jifeng, is a café called 1984 that looks much like a trendy bookshop (pictured, above). Its entrance hall is lined with different editions of George Orwell’s dystopian novel. But its owners are canny. “None of the books in this shop is for sale,” says a sign inside.