4. In a convex quadrilateral $ABCD$, $AB=\sqrt{3}, BC=CD=DA=1$. Let $S$ and $T$ be the areas of $\triangle ABD$ and $\triangle BCD$, respectively. Then the maximum value of $S^2 + T^2$ is ( ).
(A) $\frac{8}{7}$
(B) 1
(C) $\frac{7}{8}$
(D) 2
4.C.

As shown in Figure 2, let $B D = x, \angle D A B = \theta$, and construct $C E \perp B D$. Then $\sqrt{3}-1 < x < 2$, and $E$ is the midpoint of $B D$.
$$
\begin{array}{l} 
x^{2}=1^{2}+(\sqrt{3})^{2}- \\
2 \times 1 \times \sqrt{3} \cos \theta, \\
C E^{2}= 1^{2}-\frac{x^{2}}{4} .
\end{array}
$$
Therefore, $S^{2}+T^{2}=\frac{3}{4} \sin ^{2} \theta+\frac{1}{4} x^{2}\left(1-\frac{x^{2}}{4}\right)$
$$
=-\frac{x^{4}}{8}+\frac{3 x^{2}}{4}-\frac{1}{4}=-\frac{1}{8}\left(x^{2}-3\right)^{2}+\frac{7}{8} \text {. }
$$

When $B D = \sqrt{3}$, $S^{2}+T^{2}$ reaches its maximum value $\frac{7}{8}$.