After defending the gateway to communism for 30 years, this Chinese border town has surrendered without a fight.

Shenzhen used to be known for litchi nuts and easy escapes across the border to Hong Kong, but more significantly as the dividing line between the fleshpots of capitalism and the stark egalitarianism of Mao's China.

Now, as if ceded to the British colony, it is starting to look and act like a little Hong Kong, brash and busy. Shenzhen fell not by defeat, but by the decision of China's communist leaders to adopt capitalism as a development strategy there.

Shenzhen is the largest of China's "special economic zones" set up along the southeastern coast three years ago to lure foreign capital and technology in the hope of providing jobs, training workers and producing exports for precious foreign exchange.

The zones may the boldest experiment yet by the innovators running China today. Sleepy farm communities suddenly have exploded into industrial boom towns infused with capitalist principles and an unusual degree of social freedom.

Because mixing free will and Rockefeller economics still makes for uncertain chemistry in China, the laboratory is restricted to four towns fronting the South China Sea.

For years, China tried to wall off its people from the social evils of Hong Kong by stationing soldiers along the fence that separates the British colony from Shenzhen.

Now Peking plans to spend more than $70 million to erect a high barbed-wire fence around Shenzhen to prevent Chinese living outside the special zone from entering this brave new world.

"It's as if China moved back its border a few miles to make room for Hong Kong's growth," quipped a recent visitor to Shenzhen.

Shenzhen, a quiet farming and fishing village just a few years ago, looks like a giant construction site today. Skyscrapers and tourist resorts are being built where there were rice paddies before. Where there was wasteland, factories are assembling tour buses, bottling Pepsi-Cola and making steel containers--all part of a building program that already has rung up $1.4 billion in foreign investment.

More startling in this once-frayed frontline of socialism is that Shenzhen's 160,000 residents--five times the 1979 population--are fast becoming a privileged class with higher salaries and greater personal liberty than Chinese citizens elsewhere.

A recent evening at Shenzhen's most popular nightspot, called Arts Garden, explains why an uninitiated traveler might think he mistakenly had got off the train in Hong Kong instead of southern China.

Teen-agers dressed in skin-tight Levis, floral shirts and Playboy Club sweatshirts--not a Mao suit in the crowd--bunched around electronic games, dropping coin after coin into Space Panic and Scramble.

An older crowd sat in an adjacent cafe, puffing Marlboros, sipping fruit frappes and listening to love ballads played on a huge tape cassette recorder brought by one of the partygoers.

Outside, a motorcycle gang sporting long hair and black jackets with white English lettering saying "Rider Fellow" raced down streets only recently paved. In this city of big cars, taxis and motorcycles, the bicycle--ubiquitous in most of China--seems oddly out of place.

The Westernization of Shenzhen is extraordinary by the puritanic standards of Peking, but it is tolerated in the special zones by liberal officials who believe that Chinese who live more like foreigners will work harder like foreigners.

Nowhere else in China do workers have access to the duty-free shops and watering holes normally reserved for foreigners. In Shenzhen, residents are allowed to hook up tall, fishbone antennas to their rooftops to pick up Hong Kong television, which is considered the devil's work in neighboring areas.

The relaxation of social controls has also given rise to a seamy underside of Shenzhen where prostitution, gambling, pornography and smuggling are unpleasant reminders of the foreign concessions in China earlier this century, when Western businessmen exploited the nation with little regard for Chinese social values.

"As soon as you get off the train, people rush up and offer black-market prices for Hong Kong currency," said an overseas Chinese woman with relatives in Shenzhen. "You can get twice the official rate on the black market."

Some of the most dramatic cases of official corruption revealed in the current nationwide crackdown have been found in Shenzhen, where it is said that negotiations on business deals go smoothly only after a color television changes hands.

"I could double production at my plant if I opened a Hong Kong bank account for the Chinese foreman and put in 2 percent of the profits every month," said a Hong Kong entrepreneur with Shenzhen investments.

When Chinese officials began planning special zones in the late 1970s, it was economic, not social, impact they considered. The concept was working well in other developing Asian nations and seemed ripe for China, then evolving from years of self-induced isolation.

The four areas selected were springboards for millions of overseas Chinese, who could be counted on to invest in their hometowns. Three zones, including Shenzhen, lie in Guangdong Province abutting Hong Kong, while the fourth sits to the northeast, in Fujian Province.

In late 1979, Hong Kong traders were invited to Shenzhen to take advantage of the border town's cheap labor, low rents and tax holiday--all in return for their capital and know-how.

Though initially enthusiastic, investors quickly soured on the deal when confronted with the obstacles of doing business in a town that never had so much as a tractor before.

Power blackouts idled workers for hours.

Bad roads impeded shipments of vital supplies.

Red tape and political infighting among Chinese officials turned simple decisions into nearly violent disputes.

The labor force "assigned" to projects by Shenzhen officials, who did not give foreign investors any choice, consisted of unskilled farm boys.

One vehicle assembly plant financed by a $2 million loan from Hong Kong was staffed with twice the number of workers needed. Overhead costs were so high and productivity so low that the outfit was unable to compete for work with Hong Kong companies, which could do the job for half the price.

"You were dealing with utter ignorance," said a Hong Kong investor. "People didn't know the first thing about business. The workers hadn't ever turned a screwdriver. You had to teach them everything."

Determined to make a success of the zones, China responded to the complaints with action. Hundreds of millions of dollars were earmarked for upgrading Shenzhen's infrastructure with power stations, highways, deep-water ports, training schools, an airport and direct-dial phones to Hong Kong.

New labor regulations were drafted permitting foreign investors to test and select workers from a pool of candidates, offer bonuses and other salary incentives and--something unheard of in the rest of China--fire lazy or insubordinate employes.

Shenzhen now offers waitresses the unique right to accept tips. Factory workers take home as much as $85 a month--about three times the average wage in Peking--and engineers earn $175.

Still far from ironing out its problems, Shenzhen is bullish about its future. Blueprints call for 40 high-rise buildings in a remodeled downtown, a television station, a university and housing for 1 million people by the year 2000.

The long beach front skirting Shenzhen is being planned for luxury resorts, which already have attracted interest from Club Mediterranee and Holiday Inn.

Though most investment has gone into medium- and small-sized export-processing ventures financed by Hong Kong concerns, Shenzhen is beginning to land larger deals with European companies, including a $5 million container-manufacturing plant funded by Danish investors.

Forecasters in China and Hong Kong believe the business problems of Shenzhen will be much easier to solve than the social ones.

A sizable population with daily exposure to Western ideas and life styles could be difficult to control for a strict communist regime that still considers Shenzhen part of China, political observers say.

The fight for the hearts and minds of Shenzhen began last month with the establishment of China's first Office for the Cultivation of Spiritual Civilization, which intends to inculcate socialist values through educational programs and a few rules.

The office plans to leave intact the sense of openness Shenzhen now enjoys, but it has come down hard on two outgrowths of Western society: blue movies and discos. Chinese are now told to avoid both.

"Even if our people wear bell-bottom trousers and long hair, they are still working to build socialism in China," said Li Yun, head of the new morals squad. "Our people are not so easily influenced by the bourgeois life style.

"They have been educated by the party for more than 30 years."

Other observers are not so sure Li's job will be easy. A Hong Kong investor said, "These people go home every night and watch TV ads for Napoleon brandy and Mercedes-Benz. Their expectations are sky-high. It would take the whole Chinese Army to stop so-called 'bourgeois influence.'

"Once you've tasted caviar, you can't go back to salted fish and vegetables."

Three representatives of Shenzhen's future, all 19-year-old workers, sat around a table at the Arts Garden recently and talked about their lives as citizens of China's first special economic zone.

"Sure I make more working at the printing factory than I ever could have as a farmer, but I still can't afford the things I want, such as a color TV," said one of the men.

"My goal in life is to be rich like my uncle in Hong Kong," said a second.

The third was asked if Shenzhen had given up too many socialist ideals for the almighty yuan.

"I'll stick with the current trend," he replied.