12. Given the function $f(x)=9^{x}-m \cdot 3^{x}+m+1$ is always above the $x$-axis for $x \in(0,+\infty)$. Then the range of $m$ is ( ).
(A) $2-2 \sqrt{2}<m<2+2 \sqrt{2}$
(B) $m<2$
(C) $m<2+2 \sqrt{2}$
(D) $m \geqslant 2+2 \sqrt{2}$
12. C.

Let $t=3^{x}$, the problem is transformed into
$$
\begin{array}{l}
m<\frac{t^{2}+1}{t-1}(t \in(1,+\infty)) . \\
\text { Also } \frac{t^{2}+1}{t-1}=t-1+\frac{2}{t-1}+2 \\
\geqslant 2 \sqrt{(t-1) \frac{2}{t-1}}+2=2+2 \sqrt{2},
\end{array}
$$

Therefore, $m<2+2 \sqrt{2}$.