12. Given $B_{1}, B_{2}$ are the lower and upper vertices of the ellipse $C: \frac{x^{2}}{8}+\frac{y^{2}}{4}=1$, respectively, and a line $l$ passing through the point $A(0,-2 \sqrt{2})$ intersects the ellipse $C$ at points $P, Q$ (different from points $B_{1}, B_{2}$).
(1) If $\tan \angle B_{1} P B_{2}=2 \tan \angle B_{1} Q B_{2}$, find the equation of the line $l$;
(2) Let $R$ be the intersection point of the lines $B_{1} P$ and $B_{2} Q$. Find the value of $\overrightarrow{A R} \cdot \overrightarrow{B_{1} B_{2}}$.
(1) As shown in the figure, let $l: y=k x-2 \sqrt{2}$,
$P\left(x_{1}, y_{1}\right), Q\left(x_{2}, y_{2}\right)$, combining the equations
$$
\begin{array}{l}
\left\{\begin{array}{l}
y=k x-2 \sqrt{2}, \\
x^{2}+2 y^{2}=8
\end{array}\right. \\
\Rightarrow\left(2 k^{2}+1\right) x^{2}-8 \sqrt{2} k x+8=0 .
\end{array}
$$

Then $k_{B_{1} P}=\frac{y_{1}+2}{x_{1}}, k_{B_{2} P}=\frac{y_{1}-2}{x_{1}}$
$$
\Rightarrow \tan \angle B_{1} P B_{2}=\frac{\frac{y_{1}+2}{x_{1}}-\frac{y_{1}-2}{x_{1}}}{1+\frac{y_{1}+2}{x_{1}} \cdot \frac{y_{1}-2}{x_{1}}}=\frac{4 x_{1}}{x_{1}^{2}+\left(y_{1}+2\right)\left(y_{1}-2\right)}=\frac{4 x_{1}}{x_{1}^{2}-\frac{1}{2} x_{1}^{2}}=\frac{8}{x_{1}},
$$

Similarly, $\tan \angle B_{1} Q B_{2}=\frac{8}{x_{2}}$. Thus $\frac{8}{x_{1}}=2 \cdot \frac{8}{x_{2}} \Rightarrow x_{2}=2 x_{1}$
$$
\Rightarrow\left\{\begin{array}{l}
x_{1}+x_{2}=3 x_{1}=\frac{8 \sqrt{2} k}{2 k^{2}+1}, \\
x_{1} x_{2}=2 x_{1}^{2}=\frac{8}{2 k^{2}+1}
\end{array} \Rightarrow \frac{9}{2}=\frac{16 k^{2}}{2 k^{2}+1} \Rightarrow k^{2}=\frac{9}{14} \Rightarrow k= \pm \frac{3 \sqrt{14}}{14} .\right.
$$

Therefore, the equation of the line $l$ is $y= \pm \frac{3 \sqrt{14}}{14} x-2 \sqrt{2}$.
(2) $k_{B_{1} P}=\frac{y_{1}+2}{x_{1}} \Rightarrow B_{1} P: y=\frac{y_{1}+2}{x_{1}} x-2$, similarly, $B_{2} Q: y=\frac{y_{2}-2}{x_{2}} x+2$,

Combining $\left\{\begin{array}{l}y=\frac{y_{1}+2}{x_{1}} x-2, \\ y=\frac{y_{2}-2}{x_{2}} x+2=-\frac{x_{2}}{2\left(y_{2}+2\right)} x+2\end{array} \Rightarrow x_{R}=\frac{8 x_{1}\left(y_{2}+2\right)}{2\left(y_{1}+2\right)\left(y_{2}+2\right)+x_{1} x_{2}}\right.$,
Thus $y_{R}=\frac{8\left(y_{1}+2\right)\left(y_{2}+2\right)}{2\left(y_{1}+2\right)\left(y_{2}+2\right)+x_{1} x_{2}}-2=\frac{4\left(y_{1}+2\right)\left(y_{2}+2\right)-2 x_{1} x_{2}}{2\left(y_{1}+2\right)\left(y_{2}+2\right)+x_{1} x_{2}}$
$$
\begin{array}{l}
=\frac{4\left(k x_{1}-2 \sqrt{2}+2\right)\left(k x_{2}-2 \sqrt{2}+2\right)-2 x_{1} x_{2}}{2\left(k x_{1}-2 \sqrt{2}+2\right)\left(k x_{2}-2 \sqrt{2}+2\right)+x_{1} x_{2}} \\
=\frac{4\left[k^{2} x_{1} x_{2}-k(2 \sqrt{2}-2)\left(x_{1}+x_{2}\right)+(2 \sqrt{2}-2)^{2}\right]-2 x_{1} x_{2}}{2\left[k^{2} x_{1} x_{2}-k(2 \sqrt{2}-2)\left(x_{1}+x_{2}\right)+(2 \sqrt{2}-2)^{2}\right]+x_{1} x_{2}} \\
=\frac{2\left[2 k^{2}-4 \sqrt{2} k^{2}(\sqrt{2}-1)+(\sqrt{2}-1)^{2}\left(2 k^{2}+1\right)-1\right]}{2 k^{2}-4 \sqrt{2} k^{2}(\sqrt{2}-1)+(\sqrt{2}-1)^{2}\left(2 k^{2}+1\right)+1} \\
=\frac{2[(3-2 \sqrt{2})-1]}{(3-2 \sqrt{2})+1}=-\frac{2(2 \sqrt{2}-2)}{4-2 \sqrt{2}}=-\sqrt{2}, \text { thus } R\left(x_{R},-\sqrt{2}\right) .
\end{array}
$$

Therefore, $\overrightarrow{A R}=\left(x_{R}, \sqrt{2}\right) \Rightarrow \overrightarrow{A R} \cdot \overrightarrow{B_{1} B_{2}}=\left(x_{R}, \sqrt{2}\right) \cdot(0,4)=4 \sqrt{2}$.