5. Given real numbers $a, b, c, d$ satisfy
$$
\begin{array}{l}
\sqrt{a+b+c+d}+\sqrt{a^{2}-2 a+3-b}- \\
\sqrt{b-c^{2}+4 c-8}=3 .
\end{array}
$$

Then the value of $a-b+c-d$ is ( ).
(A) $-7 \quad \square \quad$ -
(B) -8
(C) -4
(D) -6
5. A.
$$
\begin{array}{l}
\text { Given } a^{2}-2 a+3-b \geqslant 0, \\
b-c^{2}+4 c-8 \geqslant 0,
\end{array}
$$

we know
$$
\begin{array}{l}
b \leqslant-(a+1)^{2}+4 \leqslant 4, \\
b \geqslant(c-2)^{2}+4 \geqslant 4 .
\end{array}
$$

Thus, $b=4, a=-1, c=2$.
Substituting these into the known equations gives $d=4$.
Therefore, $a-b+c-d=-7$.