(1) (20 points) In $\triangle A B C$, it is known that $A B=2, A C=1$, and $\cos 2 A+$ $2 \sin ^{2} \frac{B+C}{2}=1$.
(1) Find the size of angle $A$ and the length of side $B C$;
(2) If point $P$ moves within $\triangle A B C$ (including the boundary), and the sum of the distances from point $P$ to the three sides is $d$. Let the distances from point $P$ to sides $B C$ and $C A$ be $x$ and $y$, respectively. Express $d$ in terms of $x$ and $y$, and find the range of $d$.
(1) (1) Since $\cos 2 A+2 \sin ^{2} \frac{B+C}{2}=1$, therefore
$$
\cos 2 A-\cos (B+C)=0.
$$

That is, $2 \cos ^{2} A+\cos A-1=0$, solving gives $\cos A=\frac{1}{2}$ or $\cos A=-1$.
Since $A \in(0, \pi)$, thus $A=\frac{\pi}{3}$.
By the cosine rule, we get $B C=\sqrt{A B^{2}+A C^{2}-2 A B \cdot A C \cos A}=\sqrt{3}$.
(2) Method 1 Suppose the distance from point $P$ to side $A B$ is $z$, then
$S_{\triangle A B C}=S_{\triangle P B C}+S_{\triangle P C A}+S_{\triangle P A B}=\frac{1}{2}(\sqrt{3} x+y+2 z)$.
Also, $S_{\triangle B C}=\frac{1}{2} B C \cdot C A=\frac{\sqrt{3}}{2}$, so $\frac{1}{2}(\sqrt{3} x+y+2 z)=\frac{\sqrt{3}}{2}$,
which gives $z=\frac{1}{2}(\sqrt{3}-\sqrt{3} x-y)$.
Thus, $d=x+y+z=\frac{1}{2}[(2-\sqrt{3}) x+y+\sqrt{3}]$.
Since $x, y$ satisfy $\left\{\begin{array}{l}x \geqslant 0, \\ y \geqslant 0, \\ \frac{1}{2}(\sqrt{3}-\sqrt{3} x-y) \geqslant 0,\end{array}\right.$ the range of $d$ is $\left[\frac{\sqrt{3}}{2}, \sqrt{3}\right]$

Method 2 From (1), we know that $\triangle A B C$ is a right triangle. Establish a right coordinate system as shown in the figure, then $P(x, y)$, the equation of line $A B$ is $\sqrt{3} x+y-\sqrt{3}=0$.
The distance from point $P$ to line $A B$ is
$$
z=\frac{\sqrt{3}-\sqrt{3} x-y}{2}.
$$

Thus, $d=x+y+z=\frac{1}{2}[(2-\sqrt{3}) x+y+\sqrt{3}]$.
Since $x, y$ satisfy $\left\{\begin{array}{l}x \geqslant 0, \\ y \geqslant 0, \\ \frac{\sqrt{3}-\sqrt{3} x-y}{2} \geqslant 0,\end{array}\right.$ the range of $d$ is
$$
\left[\frac{\sqrt{3}}{2}, \sqrt{3}\right]
$$