11. Let the function
$$
f(x)=4 \sin x \cdot \sin ^{2}\left(\frac{\pi}{4}+\frac{x}{2}\right)+\cos 2 x .
$$

If $|f(x)-m|<2$ holds for $\frac{\pi}{6} \leqslant x \leqslant \frac{2 \pi}{3}$, then the range of the real number $m$ is $\qquad$
11. $(1,4)$.
$$
\begin{array}{l}
f(x)=4 \sin x \cdot \frac{1-\cos \left(\frac{\pi}{2}+x\right)}{2}+\cos 2 x \\
=2 \sin x(1+\sin x)+1-2 \sin ^{2} x=1+2 \sin x .
\end{array}
$$

When $\frac{\pi}{6} \leqslant x \leqslant \frac{2 \pi}{3}$, $|f(x)-m|<2$ always holds, which means $f(x)-2<m<f(x)+2$ always holds. Therefore, we have
$$
(f(x)-2)_{\max }<m<(f(x)+2)_{\min }.
$$

It is easy to see that $f(x)_{\max }=3, f(x)_{\min }=2$.
Thus, $1<m<4$.