4. Given integers $a, b, c, d$ satisfy
$$
27\left(3^{a}+3^{b}+3^{c}+3^{d}\right)=6888 \text {. }
$$

Then the value of $a+b+c+d$ is ( ).
(A) 4
(B) 5
(C) 6
(D) 7
4.C.

Assume $a \leqslant b \leqslant c \leqslant d$. From the given equation, we have
$$
3^{a+3}\left(1+3^{b-a}+3^{c-a}+3^{d-a}\right)=3 \times 2296 \text {. }
$$
(1) If $3^{a+3}=1$, i.e., $a=-3$, then
$$
31\left(1+3^{b+3}+3^{c+3}+3^{d+3}\right)=3 \times 2296 \text {. }
$$

Since $3^{b+3} \leqslant 3^{c+3} \leqslant 3^{d+3}$, we have
$$
3^{b+3}+3^{c+3}=2 \text {. }
$$

This implies $b=c=-3$. Thus, $3^{d+2}=2295$.
This case has no solution.
$$
\begin{array}{l}
\text { (2) If } 3^{a+3}=3 \text {, i.e., } a=-2 \text {, then } \\
1+3^{b+2}+3^{c+2}+3^{d+2}=2296 \\
\Rightarrow 3^{b}\left(1+3^{c-b}+3^{d-b}\right)=3 \times 85 \\
\Rightarrow b=1 \Rightarrow 1+3^{c-1}+3^{d-1}=85 \\
\Rightarrow 3^{c}\left(1+3^{d-c}\right)=3^{2} \times 28 \Rightarrow c=2, d=5 .
\end{array}
$$

Therefore, $a+b+c+d=-2+1+2+5=6$.