5. Let $a, b, c, d$ be real numbers, and $a^{2}+b^{2}+c^{2}-$ $d^{2}+4=0$. Then the maximum value of $3 a+2 b+c-4|d|$ is ( ).
(A) $\sqrt{2}$
(B) 0
(C) $-\sqrt{2}$
(D) $-2 \sqrt{2}$
5.D.

From the problem, we have $a^{2}+b^{2}+c^{2}+2^{2}=d^{2}$, so, $4^{2} d^{2}=\left(a^{2}+b^{2}+c^{2}+2^{2}\right)\left[3^{2}+2^{2}+1^{2}+(\sqrt{2})^{2}\right]$ $\geqslant(3 a+2 b+c+2 \sqrt{2})^{2}$ (using the Cauchy-Schwarz inequality).
Thus, $4|d| \geqslant|3 a+2 b+c+2 \sqrt{2}|$
$$
\geqslant 3 a+2 b+c+2 \sqrt{2} \text {. }
$$

Therefore, $3 a+2 b+c-4|d| \leqslant-2 \sqrt{2}$, with equality holding if and only if $a=3 \sqrt{2}, b=2 \sqrt{2}, c=\sqrt{2}, d= \pm 4 \sqrt{2}$.