12. (14 points) In $\triangle A B C$, let the sides opposite to $\angle A$, $\angle B$, and $\angle C$ be $a$, $b$, and $c$ respectively, satisfying
$\sqrt{3} \tan A \cdot \tan B - \tan A - \tan B = \sqrt{3}$.
(1) Find the size of $\angle C$;
(2) If $c=2$, and $\triangle A B C$ is an acute triangle, find the range of $a^{2}+b^{2}$.
12. (1) From the given equation, we have
$$
\begin{array}{l}
\frac{\tan A + \tan B}{1 - \tan A \cdot \tan B} = -\sqrt{3} \\
\Rightarrow \tan (A + B) = -\sqrt{3} \\
\Rightarrow \tan C = \sqrt{3} \Rightarrow \angle C = \frac{\pi}{3}.
\end{array}
$$
(2) From (1), we know $\frac{\pi}{6} < \angle A < \frac{\pi}{2}$.
By the Law of Sines, we get
$$
\begin{array}{l}
\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} = \frac{2}{\sin 60^{\circ}} = \frac{4}{\sqrt{3}}. \\
\text{Thus, } a^{2} + b^{2} = \frac{16}{3} \left[\sin^{2} A + \sin^{2} \left(\frac{2 \pi}{3} - A\right)\right] \\
= \frac{16}{3} + \frac{8}{3} \sin \left(2 A - \frac{\pi}{6}\right). \\
\text{Also, } \frac{\pi}{6} < \angle A < \frac{\pi}{2} \\
\Rightarrow \frac{\pi}{6} < 2 \angle A - \frac{\pi}{6} < \frac{5 \pi}{6} \\
\Rightarrow \frac{1}{2} < \sin \left(2 A - \frac{\pi}{6}\right) \leqslant 1 \\
\Rightarrow \frac{20}{3} < a^{2} + b^{2} \leqslant 8.
\end{array}
$$