Four. (Total 20 points) Find the range of real number $a$ such that the inequality $\sin 2 \theta-(2 \sqrt{2}+\sqrt{2} a) \sin \left(\theta+\frac{\pi}{4}\right)-\frac{2 \sqrt{2}}{\cos \left(\theta-\frac{\pi}{4}\right)}>$ $-3-2 a$, holds for all $\theta \in\left[0, \frac{\pi}{2}\right]$.
Let $x=\sin \theta+\cos \theta, \theta \in\left[0, \frac{\pi}{2}\right]$, then $x \in[1, \sqrt{2}]$.
$$
\begin{array}{l}
\because \sin 2 \theta=x^{2}-1, \\
\sin \left(\theta+\frac{\pi}{4}\right)=\cos \left(\theta-\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2} x,
\end{array}
$$
$\therefore$ the original inequality becomes
$$
x^{2}-1-(2+a) x-\frac{4}{x}+3+2 a>0,
$$

which simplifies to $(x-2)\left(x+\frac{2}{x}-a\right)>0$.
$$
\because x \in[1, \sqrt{2}], \therefore x+\frac{2}{x}-ax+\frac{2}{x}, x \in[1, \sqrt{2}]$.
Let $f(x)=x+\frac{2}{x}$, we know that $f(x)$ is decreasing on $[1, \sqrt{2}]$.
Then $f(x)_{\text {max }}=f(1)=3$.
Hence $a>f(x)_{\max }$, i.e., $a>3$.