3. Let $x_{i} \geqslant 0(1 \leqslant i \leqslant n), \sum_{i=1}^{n} x_{i}=\pi, n \geqslant 2$. Find the maximum value of $F=\sum_{i=1}^{n} \sin ^{2} x_{i}$.
3. When $n=2$, $x_{1}+x_{2}=\pi, F=\sin ^{2} x_{1}+\sin ^{2} x_{2}=2 \sin ^{2} x_{1} \leqslant 2$. The equality holds when $x_{1}=x_{2}=\frac{\pi}{2}$. When $n \geqslant 3$, let $x_{3}, x_{4}, \cdots, x_{n}$ be constants, then $x_{1}+x_{2}$ is also a constant. Consider $A=\sin ^{2} x_{1}+\sin ^{2} x_{2}, 2-2 A=1-2 \sin ^{2} x_{1}+1-2 \sin ^{2} x_{2}=$ $\cos 2 x_{1}+\cos 2 x_{2}=2 \cos \left(x_{1}+x_{2}\right) \cos \left(x_{1}-x_{2}\right)$. To find the smoothing tool, we examine the extremum of $\cos \left(x_{1}-x_{2}\right)$ and the sign of $\cos \left(x_{1}+x_{2}\right)$. Note that when $x_{1}+x_{2} \leqslant \frac{\pi}{2}$, $\cos \left(x_{1}+x_{2}\right) \geqslant 0$, and when $x_{1}+x_{2}>\frac{\pi}{2}$, $\cos \left(x_{1}+x_{2}\right)<0$. When $x_{1}+x_{2}>\frac{\pi}{2}$, the smaller $\left|x_{1}-x_{2}\right|$, the larger $A$. At this point, we need $x_{1}=x_{2}$. The smoothing tool is $\left(x_{1}, x_{2}\right) \rightarrow$ $\left(\frac{x_{1}+x_{2}}{2}, \frac{x_{1}+x_{2}}{2}\right)$. To ensure the existence of $x_{1}$ and $x_{2}$ such that $x_{1}+x_{2} \leqslant \frac{\pi}{2}$, a sufficient condition is $n \geqslant 4$. Thus, when $n \geqslant 4$, we can use the following smoothing tool. Lemma: If $0 \leqslant x_{1}, x_{2} \leqslant \frac{\pi}{2}$, and $x_{1}+x_{2} \leqslant \frac{\pi}{2}$, then $\sin ^{2} x_{1}+\sin ^{2} x_{2} \leqslant \sin ^{2}\left(x_{1}+x_{2}\right)$. In fact, from $0 \leqslant x_{1}, x_{2} \leqslant \frac{\pi}{2}$ and $x_{1}+x_{2} \leqslant \frac{\pi}{2}$, we know that $\left|x_{1}-x_{2}\right| \leqslant\left|x_{1}+x_{2}\right| \leqslant \frac{\pi}{2}$. Therefore, $\cos \left(x_{1}-x_{2}\right) \geqslant \cos \left(x_{1}+x_{2}\right)$, so $2-2\left(\sin ^{2} x_{1}+\sin ^{2} x_{2}\right)=\cos 2 x_{1}+\cos 2 x_{2}=2 \cos \left(x_{1}+x_{2}\right) \cos \left(x_{1}-x_{2}\right) \geqslant 2 \cos \left(x_{1}+x_{2}\right) \cos \left(x_{1}+x_{2}\right)=2 \cos ^{2}\left(x_{1}+x_{2}\right)=2\left[1-\sin ^{2}\left(x_{1}+x_{2}\right)\right]=$ $2-2 \sin ^{2}\left(x_{1}+x_{2}\right)$, rearranging, the lemma is proved. We now discuss the cases. When $n=3$, if the three angles are $\left(\frac{\pi}{2}, \frac{\pi}{2}, 0\right)$, then adjusting to $\left(\frac{\pi}{2}, \frac{\pi}{4}, \frac{\pi}{4}\right)$, the value of $F$ increases from 2 to $1+\sqrt{2}$, so we can assume $x_{1} \leqslant x_{2} \leqslant x_{3}$, and $\left(x_{1}, x_{2}, x_{3}\right) \neq\left(0, \frac{\pi}{2}, \frac{\pi}{2}\right)$. Then $x_{2}>\frac{\pi}{2}$, $x_{1} \leqslant \frac{\pi}{3} \leqslant x_{3}$. Smoothing $\left(x_{1}, x_{2}, x_{3}\right)$ to $\left(\frac{\pi}{3}, x_{2}, x_{1}+x_{3}-\frac{\pi}{3}\right)$, by the above discussion, $F$ increases. Another smoothing transformation yields $\left(\frac{\pi}{3}, \frac{\pi}{3}, \frac{\pi}{3}\right)$, so $F \leqslant \frac{9}{4}$. When $n \geqslant 4$, assume $x_{1} \geqslant x_{2} \geqslant \cdots \geqslant x_{n-1} \geqslant x_{n}$, then there must be two angles: $x_{n-1}+x_{n} \leqslant \frac{\pi}{2}$. By the lemma, $F=\sin ^{2} x_{1}+\cdots+\sin ^{2} x_{n-1}+\sin ^{2} x_{n} \geqslant \sin ^{2} x_{1}+\sin ^{2} x_{2}+\cdots+\sin ^{2}\left(x_{n-1}+x_{n}\right)=$ $\sin ^{2} x_{1}^{\prime}+\cdots+\sin ^{2} x_{n-2}^{\prime}+\sin ^{2} x_{n-1}^{\prime}$ (where $x_{1}^{\prime}, x_{2}^{\prime}, \cdots, x_{n-2}^{\prime}, x_{n-1}^{\prime}$ are $x_{1}$, $x_{2}, \cdots, x_{n-2}, x_{n-1}+x_{n}$ in descending order). If $n-1 \geqslant 4$, then there must be two angles: $x_{n-2}^{\prime}+x_{n-1}^{\prime} \leqslant \frac{\pi}{2}$. Continue using the lemma for the above transformation, at most $n-3$ times, the variable set can be transformed into $\left(x_{1}^{\prime}, x_{2}^{\prime}, x_{3}^{\prime}, 0,0, \cdots, 0\right)$. Using the result when $n=3$, we know that $F \leqslant \frac{9}{4}$, the equality holds when $x_{1}=x_{2}=x_{3}=\frac{\pi}{3}, x_{4}=x_{5}=\cdots=x_{n}=0$. Therefore, when $n=2$, the maximum value of $F$ is 2; when $n>2$, the maximum value of $F$ is $\frac{9}{4}$.