11. Find the range of real number $a$ such that the inequality $\sin 2 \theta-2 \sqrt{2} a \cos \left(\theta-\frac{\pi}{4}\right)-\frac{\sqrt{2} a}{\sin \left(\theta+\frac{\pi}{4}\right)}>-3-a^{2}$ holds for all $\theta \in\left[0, \frac{\pi}{2}\right]$.
Let $t=\sin \theta+\cos \theta \in[1, \sqrt{2}]$, the original inequality becomes $t^{2}-2 a t-\frac{2 a}{t}+a^{2}+2>0$. Let $f(t)=t^{2}-2 a t-\frac{2 a}{t}+a^{2}+2, f^{\prime}(t)=2 t-2 a+\frac{2 a}{t^{2}}=\frac{2\left(t^{2}-a t+a\right)}{t^{2}}$. When $\Delta=a^{2}-4 a \leqslant 0 \Rightarrow 0 \leqslant a \leqslant 4$, $f^{\prime}(t) \geqslant 0$ always holds $\Rightarrow f(t)$ is monotonically increasing, thus $f(t)_{\min }=f(1)=a^{2}-4 a+3>0 \Rightarrow a \in[0,1) \bigcup(3,4]$; when $a<0 \Rightarrow f(t)_{\min }=f(1)=a^{2}-4 a+3>0 \Rightarrow a \in(-\infty, 0)$; when $a>4$, $u=t^{2}-a t+a$ is monotonically decreasing and $u(\sqrt{2})=2-(\sqrt{2}-1) a \geqslant 0 \Rightarrow a \leqslant 2 \sqrt{2}+2$, at this time $f(t)_{\min }=f(1)=a^{2}-4 a+3>0 \Rightarrow a \in(4,2 \sqrt{2}+2]$; when $a>2 \sqrt{2}+2$, there exists $t_{0} \in(1, \sqrt{2})$, such that $u\left(t_{0}\right)=0$, thus $f(t)$ is monotonically increasing on $\left(1, t_{0}\right)$ and monotonically decreasing on $\left(t_{0}, \sqrt{2}\right)$, at this time $f(t)_{\min }=\min \{f(1), f(\sqrt{2})\}>0$
$$
\Leftrightarrow\left\{\begin{array}{l}
a^{2}-4 a+3>0, \\
a^{2}-3 \sqrt{2} a+4>0
\end{array} \Rightarrow a \in[2 \sqrt{2}+2,+\infty)\right. \text {. }
$$

In summary, the range of real number $a$ is $(-\infty, 1) \cup(3,+\infty)$.