The hard part of any Cinderella story is living happily ever after. But Chrysler, the Cinderella of the auto industry, seems to be doing just that.

The nation's third-largest car company, near bankruptcy in 1979, rolled back into the black in 1982 after five years of horrendous losses. It has been running at top speed ever since.

Chrysler dropped $3.5 billion during the five-year down period. But today, the company is consistently profitable and is setting sales records. Chrysler also is beating its domestic competitors in the battle to cut production costs, which means that it has a better earnings margin than its rivals, too.

Every car that Chrysler has brought to market since 1980 has been successful. And in one segment, small vans, the company is the undisputed leader in the United States.

But all through its current season of success, there have been doubts about whether the company could maintain speed. During the hard times, Chrysler severely reduced the number and kinds of cars it offered, pinning its hopes on a fleet of fuel-efficient, moderately priced models.

Now, in an era of increased foreign competition and falling oil prices, there has been some concern that Chrysler's economy-car strategy might have tied the company to yesterday's reality.

But Chrysler officials say their company has the guts to adapt to the changing marketplace. As in the past, some fancy footwork will be required.

Through the 1950s and 1960s, Chrysler and its domestic rivals got along by making bigger and faster cars, epitomized by the likes of the two-ton, tail-finned 1958 Chrysler Imperial; and 10 years later by "muscle cars" powered by giant 426-cubic-inch, V-8 engines.

But the insolent chariots went the way of the dinosaurs with the energy crises of the 1970s. The race was on for "downsizing," the creation of less-weighty cars that could meet federal and consumer demand for better fuel efficiency.

Chrysler at first responded with models like the "compact" 1977 Volare, a 3,546-lbs. affair that barely got 16 miles per gallon. Americans, dissatisfied, started turning away from Chrysler and other domestic car makers in droves.

Small, high-quality Japanese cars became the rage.

General Motors Corp. and Ford Motor Co., respectively the nation's first- and second-largest car companies, took their lumps along with Chrysler. But the two giants had enough fiscal padding to withstand the drubbing.

Chrysler nearly succumbed to the beating. And the fright forced the smaller company to move faster and farther than its bigger competitors in the downsizing race. By the 1981-model year, Chrysler was ready with its front-wheel-drive, four-cylinder, 2,592-lbs. "K" car, typified by the Plymouth Reliant and Dodge Aries.

The K models sold so well, Chrysler used their basic design turn out a series of other models. The company's biggest K-based coup was its minivans, the Voyager and Caravan, introduced in 1983 for 1984-model sales.

But with a new era of falling gasoline prices, Chrysler again found itself in a potential bind. It was being attacked on the small end by the Japanese, and was faced with a formidable array of popular big cars from GM and Ford.

Chrysler's response has been to restructure its product line again, particularly to take on GM in the lucrative middle and upper price brackets, which collectively represent about 68 percent of the domestic auto market.

Analysts who follow Chrysler believe that the company has an excellent chance to succeed.

"They certainly convinced me that they are taking some pretty effective steps" to hold onto their share of the market, said Wendy Beale, an analyst with New York-based Smith Barney, Harris Upham & Co.

Beale was one of 95 analysts who last week met with Chrysler officials in Savannah, Ga., to discuss the company's future. She wasn't the only analyst who left impressed.

Chrysler's stock climbed $2.13 a share a day after the meeting to $56.75, almost 19 times its 1981 low of $3.

Chrysler Corp. Chairman Lee A. Iacocca and a host of his top lieutenants spoke to the analysts during the one-day Savannah meeting, which included a tour of the company's newly acquired aerospace operation, Gulfstream Aerospace Corp.

"The stock reaction" the next day "was mainly due to Iacocca making some earnings projections" that were very optimistic, said another analyst who attended the meeting and who requested anonymity in an interview. "We had two previous meetings like this where Iacocca talked about what he was going to do with the company and where the company was going to go. We believed him this time because he delivered. The man has some credibility."

Chrysler and all domestic auto makers are facing the prospect of competing for even smaller shares of the domestic market, as more and more Japanese auto makers choose to augment their quota-restricted import sales with Japanese-nameplate cars built in the United States.

By 1995, according to a widespread prediction by domestic auto-industry analysts, the Japanese will have the capacity to build from 1 million to 1.5 million cars in this country.

Added to this competitive mix is the movement of cars from Korea, Yugoslavia, Rumania, Greece, China and other countries into the United States. Initially, most of those new cars will be aimed at the "lowest end" of the domestic new-car market, the $6,000-and-under segment.

Chrysler relies mostly on subcompacts and mid-size, front-wheel-drive cars to service the "lower" to "upper-middle" segments of the market -- for example, currently $6,207 for a base-model Omni/Horizon subcompact up to $14,910 for a "base" Chrysler Fifth Avenue sedan.

To hold on to its 12.2 percent market share in what has become an intensely competitive environment, Chrysler has to find a way to compete at the lowest and lower ends in the near term, while beefing up its muscle in the middle, auto-industry analysts say.

All of the indications are that Chrysler is moving aggressively to meet those challenges, according to David Healy, an analyst with New York-based Drexel Burnham Lambert Inc.

The key is production costs, Healy said, "and Chrysler has gotten to the point where it has the best production costs and the highest profit margins" among domestic auto makers.

Conventional wisdom in the domestic auto industry puts U.S. auto makers' per-unit production costs at about $2,000 more than the Japanese for comparable models. The Americans are expected to be at an even greater disadvantage -- although that prediction is the subject of some dispute -- in competition with the Koreans.

The American company that has the best production costs and earnings margin is the company that will stand a better chance of defending its ground against the foreigners, Healy said. Chrysler's 1985 earnings margin, based on pre-tax earnings as a percentage of sales, was 9.9 percent, compared with 4.9 percent for GM and 5.7 percent for Ford, Healy said.

Chrysler officials said that they are using that advantage, coupled with a new labor-cost and supplier-cost savings program, to protect their current market share by grabbing a part of the "lowest end" from the Koreans and the Japanese.

Chrysler's "America" car project, announced last week, epitomizes its new lowest-end strategy. Simply put, the company is offering "America" versions of its subcompact Omni/Horizon cars for $710 less than current prices, beginning in the 1987-model year.

The America will come with only two equipment packages and only three free-standing options -- air conditioning, AM/FM stereo, and an exhaust system designed to meet California auto-emissions standards. Chrysler intends to sell 232,000 America cars next year.

But the company also is investing $12.5 billion during the next years years in plant modernization and new products, including the development of a new 3-liter, V-6 engine that will be used to power the upper-end cars, said Gerald Greenwald, chairman of Chrysler Motors, the automotive division of the four-part Chrysler Corp.

Most of those new products will be "upscale" and will be aimed at the middle and upper-middle segments of the domestic market, Greenwald said. At least five of those new vehicles will be introduced at the rate of one every three months during the next 14 months, Greenwald said.

"Market share is up for grabs," said Greenwald. "In the near term, our primary concern is to hold on to market share for cars and trucks."

Greenwald said Chrysler does not entertain visions of ever again owning 25 percent of the market. "But we are determined that the seven to eight percent additional share of the market" that could go to the foreigners this year "does not come out of our hides."

"They have a lot of momentum going for them," said James A. Mateyka, an analyst with Booz-Allen Hamilton Inc. Chrysler's cost structure, also enhanced by the company's aggressive pursuit of auto parts made in non-UAW plants, puts the company in an ideal position to weather both the imports invasion and the coming downturn in auto sales, Mateyka said.

"Chrysler is a better economic model for a mature car business than any of its domestic competitors," Mateyka said. The company that six years ago subsisted on $2.4 billion in federally backed lifeline loans "now has the opportunity to go on the offensive," Mateyka said.

"When Chrysler was going bankrupt, they had plans to do this kind of thing. But they just didn't have the capital. Now, they have the capital. Their options are wide open," he said.