11. (20 points) Given the function
$$
f(x)=a(|\sin x|+|\cos x|)-3 \sin 2 x-7,
$$

where $a$ is a real parameter. Find all pairs $(a, n)(n \in \mathbf{Z}_{+})$ such that the function $y=f(x)$ has exactly 2019 zeros in the interval $(0, n \pi)$.
11. First, the function $f(x)$ has a period of $\pi$ and is symmetric about $x=\frac{k \pi}{2}+\frac{\pi}{4}(k \in \mathbf{Z})$.

Thus, the number of zeros of $f(x)$ in the intervals $\left(\frac{k \pi}{2}, \frac{k \pi}{2}+\frac{\pi}{4}\right)$ and $\left(\frac{k \pi}{2}+\frac{\pi}{4}, \frac{k \pi}{2}+\frac{\pi}{2}\right)$ is even. To ensure that $f(x)$ has exactly 2019 zeros in the interval $(0, n \pi)$, the endpoints of these intervals must be zeros.
If $a=7$, then
$f\left(\frac{k \pi}{2}\right)=0, f\left(\frac{k \pi}{2}+\frac{\pi}{4}\right) \neq 0$.
When $x \in\left(0, \frac{\pi}{2}\right)$,
$f(x)=7(\sin x+\cos x)-3 \sin 2 x-7$.
Let $t=\sin x+\cos x(t \in(1, \sqrt{2}])$.
Then $y=g(t)=-3 t^{2}+7 t-4=0$
$\Rightarrow t_{1}=1$ (discard), $t_{2}=\frac{4}{3}=\sqrt{2} \sin \left(x+\frac{\pi}{4}\right)$.
Thus, there are two solutions in the interval $\left(0, \frac{\pi}{2}\right)$.
When $x \in\left(\frac{\pi}{2}, \pi\right)$,
$f(x)=7(\sin x-\cos x)-3 \sin 2 x-7$.
Let $t=\sin x-\cos x(t \in(1, \sqrt{2}])$.

Then $y=g(t)=3 t^{2}+7 t-10=0$
$\Rightarrow t_{1}=1$ (discard), $t_{2}=-\frac{10}{3}$ (discard).
Thus, there are no solutions in the interval $\left(\frac{\pi}{2}, \pi\right)$.
Therefore, $f(x)$ has three zeros in the interval $(0, \pi)$.
Thus, $f(x)$ has
$3 n+(n-1)=4 n-1=2019$
zeros in the interval $(0, n \pi)$, at which point, $n=505$.
Similarly, the pairs $(a, n)$ that satisfy the condition are
$(7,505),(5 \sqrt{2}, 2019),(2 \sqrt{2}, 2019)$.