3. In $\triangle A B C$, $B C=a, A C=b, A B=c$. The necessary and sufficient condition for the equation $\sin ^{2} \frac{A}{2}+\sin ^{2} \frac{B}{2}+\sin ^{2} \frac{C}{2}=\cos ^{2} \frac{B}{2}$ to hold is ( ).
(A) $a+b=2 c$
(B) $b+c=2 a$
(C) $c+a=2 b$
(D) $a c=b^{2}$
3.C.

From the given, we have
$$
\frac{1-\cos A}{2}+\frac{1-\cos B}{2}+\frac{1-\cos C}{2}=\frac{1+\cos B}{2},
$$

it follows that $2 \sin \frac{B}{2}=\cos \frac{A-C}{2}$, hence $2 \sin B=\sin A+\sin C$. Therefore, $a+c=2 b$. The converse is also true.