7. (2002 National High School Competition Question) Find the range of negative values of $a$ for which the inequality $\sin ^{2} x+a \cos x+a^{2} \geqslant 1+\cos x$ holds for all $x \in \mathbf{R}$.
7. The original inequality can be transformed into
$$
\left(\cos x-\frac{a-1}{2}\right)^{2} \leqslant a^{2}+\frac{(a-1)^{2}}{4} \text {. }
$$

Since $-1 \leqslant \cos x \leqslant 1, a<0, \frac{a-1}{2}<0$,
when $\cos x=1$, the function $y=\left(\cos x-\frac{a-1}{2}\right)^{2}$ has the maximum value $\left(1-\frac{a-1}{2}\right)^{2}$.
Thus, we have $\left(1-\frac{a-1}{2}\right)^{2} \leqslant a^{2}+\frac{(a-1)^{2}}{4}$.
Solving this, we get $a \geqslant 1$ or $a \leqslant-2$. Since $a<0$, hence $a \leqslant-2$.