7. Given that the complex number $z$ satisfies $|z|=1$, then the maximum value of $\left|z^{3}-3 z-2\right|$ is $\qquad$ .
$$
\begin{array}{l}
\text { Let } z=\cos \theta+\mathrm{i} \sin \theta \text {, then } z^{3}-3 z-2=\cos 3 \theta-3 \cos \theta-2+\mathrm{i}(\sin 3 \theta-3 \sin \theta) \\
=4 \cos ^{3} \theta-6 \cos \theta-2-4 \mathrm{i} \sin ^{3} \theta,
\end{array}
$$

Thus, $\left|z^{3}-3 z-2\right|^{2}=\left(4 \cos ^{3} \theta-6 \cos \theta-2\right)^{2}+16 \sin ^{6} \theta$
$$
=4\left(4 \cos ^{6} \theta+4 \sin ^{6} \theta+9 \cos ^{2} \theta+1-12 \cos ^{4} \theta-4 \cos ^{3} \theta+6 \cos \theta\right)
$$
$$
=4\left(-4 \cos ^{3} \theta-3 \cos ^{2} \theta+6 \cos \theta+5\right) \text {. }
$$

Let $t=\cos \theta \in[-1,1], f(t)=-4 t^{3}-3 t^{2}+6 t+5, f^{\prime}(t)=-6\left(2 t^{2}+t-1\right)$ $=-6(2 t-1)(t+1) \Rightarrow f(t)$ is monotonically increasing on $\left(-1, \frac{1}{2}\right)$ and monotonically decreasing on $\left(\frac{1}{2}, 1\right)$,
and $f(-1)=0, f\left(\frac{1}{2}\right)=\frac{27}{4}, f(1)=4$. Therefore, the maximum value of $\left|z^{3}-3 z-2\right|$ is $3 \sqrt{3}$.