12. Let the complex number $z=\cos \theta+\mathrm{i} \sin \theta, \theta \in[0, \pi]$. The three points corresponding to the complex numbers $z, (1+\mathrm{i}) z, 2 \bar{z}$ on the complex plane are $P, Q, R$ respectively. When $P, Q, R$ are not collinear, the fourth vertex of the parallelogram formed by segments $P Q$ and $P R$ is $S$. Then the maximum distance from point $S$ to the origin is $\qquad$.
12. 3