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}$