Soviet officials and analysts, convinced of the rightness of their policies, are digging in for a prolonged period of tension with the United States.

They put the collapse of detente at President Carter's doorstep and insist the United States has no business expressing indignation over the recent events in Afghanistan. They say on the one hand that they must act to protect themselves from U.S.-inspired encirclement, and on the other that Washington will regret taking on Moscow because American power is no longer what it was.

In a series of private, unattributable conversations with middle-level Communist Party officials, the Soviets invariably came back last week to the theme that Carter's foreign policy has no continuity and this zigzagging, as they see it, is the root cause of bilateral difficulties -- not Afghanistan.

"The U.S. can't lose anything in Afghanistan, but we can lose much there," said one Soviet. "The United States should be in a more sober mood, in the sense that they shouldn't lose their sense of perspective." This man, like the others who consented to talk, staunchly backed the shrill official line that American and Chinese subversion in Afghanistan threatened vital Soviet interests, and that the Kremlin had acted in response to a legitimate request from the pro-Marxist Kabul government for aid.

These Soviets brush past the difficulties of explaining who sought Moscow's aid, of how Kabul's new leader, Babrak Karmal, mysteriously reappeared in the Afghan capital after dropping from sight months ago in Prague.

"Afghanistan has a very open border," one official said with a smile. "People make their livings smuggling across it."

And thus they reject the idea that Western distrust of the Kremlin, symbolized by Carter's questioning the veracity of Soviet leader Leonid Brezhnev's hot-line explanations of their intervention lies at the heart of deteriorat relations.

"If Carter doesn't think he got a satisfactory answer, then I can't give you one either," said one Soviet.

Instead, they say Soviet mistrust of Washington has grown since 1977 because of Carter's unpredictability and his administration's continued moves to tighten its relations with China at the expense of Moscow.

They tick off what they see as the aggravations: the March 1977 strategic arms proposals, which the Soviets angrily rejected as being a sudden, unilateral attempt to gain U.S. strategic advantage; the Carter Middle East peace initiatives shortly after Moscow and Washington had pledged themselves to seek a general Middle East peace conference; last fall's controversy over Soviet troops in Cuba; and the president's recent defense spending increases in the aftermath of the SALT II treaty signing in June.

But their suspicions perhaps center most deeply on the steadily advancing U.S.-China relationship, which the Kremlin so far has been powerless to affect.

"The capitalist world has always sought to encircle us and now we have NATO in the West, big U.S. forces being assembled in the Indian Ocean and the combination of China, Japan and America in the East. Encirclement," said one man.

Because of this Eastern relationship," we must look moore carefully at everything," said anoher. "We should never forgive ourselves if we saw what was happening a few miles from our border [in Afghanistan] and did nothing about it."

They reject the idea that the spread of direct Soviet influence to such distant countries as Angola, Mozambique, Ethiopia, South Yemen, Cambodia and Vietnam during the late 1970s has played any role in undermining Western confidence in detente. Those are simply "wars of national liberation" representing a basic new limitation of American power and influence, the Soviets believe.

"We still believe in imperative, objective factors," said one Soviet. "The capacity for the United States to act as forcefully as it did in the 1950s is much more limited now and will be or come more so in the 1980s. The U.S. is itself more vulnerable and feels itself vulnerable.

"There is no longer a vacuum of forces, no more room for expansion of U.S. culture and capital, and these are limiting factors that the U.S. public and leadership elite has not adapted to. In the beginning of the 1980s, we will meet much more instability because of U.S. political turmoil and lack of a consistent policy in relatilons with the Soviet Union."

If this notion of declining American power seems inconsistent with what these same Soviets see as increasing American attempts to encircle the Soviet Union, it is attributable to their unshakable view that their country is a nonexpansionist nation surrounded by adversaries.

In the Soviet view, detente has always been divided into political and military splheres, with the latter assuming greater importance. This is the logical underpinning of Soviet opposition "linkage" between strategic arms limitation efforts and any other bilateral issue.Carter last week specifically linked the Afghanistan invasion to his request that the Senate delay consideration of SALT II, thus committing the very offense the Soviets have railed against since national security affairs adviser Zbigniew Brzezinski first began pushing the idea.

Despite their antilinkage theories, the Soviets interviewed accepted the general idea, as one of them said, that "political detente will freeze as military detente also freezes. Everything is mixed. Military detente, the most important part, will be frozen into the 1980s and cold war rhetoric will rise."

This, they agreed separately, is the fault of the United States and its president. Meanwhile, as one said fretfully, the arms race will go on. He cited the recent NATO decision to deploy advanced Pershing II missiles in Western Europe, which has deeply angered the Soviets who made a lastditch attempt to stall the decision and for now refuse to take up an allied offer to begin European arms reduction talks until the decision is revoked.

"Once a program is funded, it is very difficult to stop," he said. "The downtrodden U.S. taxpayer is a fat goose and you can squeeze him. He'll be unhappy, but he's still fat."