2. Let the complex number $z=\cos \theta+i \sin \theta\left(0^{\circ} \leqslant \theta \leqslant\right.$ $\left.180^{\circ}\right)$, and the complex numbers $z, (1+i)z, 2\bar{z}$ correspond to three points $P, Q, R$ in the complex plane. When $P, Q, R$ are not collinear, the fourth vertex of the parallelogram formed by segments $PQ, PR$ is $S$. Then the maximum distance from point $S$ to the origin is $\qquad$.