Example 35 (1999 Shanghai High School Competition Question) Let $a, b, c, d$ be four distinct real numbers such that $\frac{a}{b}+\frac{b}{c}+\frac{c}{d}+\frac{d}{a}=4$, and $a c=b d$. Find the maximum value of $\frac{a}{c}+\frac{b}{d}+\frac{c}{a}+\frac{d}{b}$.
Let $x=\frac{a}{b}, y=\frac{b}{c}$, from the condition $a c=b d$, we get $\frac{c}{d}=\frac{b}{a}=\frac{1}{x}, \frac{d}{a}=\frac{c}{b}=\frac{1}{y}$. The problem is reduced to finding the maximum value of $S=x y+\frac{y}{x}+\frac{1}{x y}+\frac{x}{y}$ under the conditions $x \neq 1, y \neq 1, x+y+\frac{1}{x}+\frac{1}{y}=4$.

Since $S=\left(x+\frac{1}{x}\right)\left(y+\frac{1}{y}\right)$, and for $t>0$, $t+\frac{1}{t} \geqslant 2$, when $t>0, y<0$, we have
$$
y+\frac{1}{y} \leqslant-2, x+\frac{1}{x}=4-\left(y+\frac{1}{y}\right) \geqslant 6,
$$

Therefore, $S=\left(x+\frac{1}{x}\right)\left(y+\frac{1}{y}\right) \leqslant-12$, with equality when $y=-1, x=3 \pm 2 \sqrt{2}$. Specifically, when $a=2+2 \sqrt{2}, b=1, c=-1, d=-3-2 \sqrt{2}$, equality holds, so the maximum value sought is -12.