5. As shown in Figure 1, in the equilateral $\triangle ABC$, $O$ is its center. A line through $O$ intersects sides $AB$ and $AC$ at points $D$ and $E$, respectively. Let $BC=a$, $AE=x$. If $AD=\frac{ax}{\sqrt{3}(a-x)}$, then $\frac{DO}{OE}$ equals ( ).
(A) $\sqrt{3}$
(B) $\frac{1+\sqrt{3}}{2}$
(C) $\sqrt{3}-1$
(D) $2 \sqrt{3}-2$
5.B.

As shown in Figure 5, connect $B O$ and extend it to intersect $A E$ at point $H$, then $A H=\frac{a}{2}, H E=x-\frac{a}{2}$.

Connect $A O$, then $A O$ bisects $\angle D A E$. By the Angle Bisector Theorem, we have
$$
\begin{array}{l}
\frac{D O}{O E}=\frac{A D}{A E} \\
=\frac{a}{\sqrt{3}(a-x)} .
\end{array}
$$

For $\triangle A D E$ and its transversal $B O H$, apply Menelaus' Theorem to get
$$
\frac{D O}{O E} \cdot \frac{E H}{H A} \cdot \frac{A B}{B D}=1,
$$

which is
$\frac{a}{\sqrt{3}(a-x)} \cdot \frac{x-\frac{a}{2}}{\frac{a}{2}} \cdot \frac{a}{a-\frac{a x}{\sqrt{3}(a-x)}}=1$.
Simplifying, we get $(3+\sqrt{3}) x=(\sqrt{3}+1) a$, or
$$
\frac{x}{a}=\frac{1+\sqrt{3}}{3+\sqrt{3}}=\frac{\sqrt{3}}{3} \text {. }
$$

Thus, $\frac{D O}{O E}=\frac{a}{\sqrt{3}(a-x)}=\frac{1+\sqrt{3}}{2}$.