18. Let $p$ be a prime, and $p \equiv 1(\bmod 12)$. Find the number of tuples $(a, b, c, d)$ satisfying:
(1) $a, b, c, d \in\{0,1,2, \cdots, p-1\}$;
(2) $a^{2}+b^{2} \equiv c^{3}+d^{3}(\bmod p)$.
18. Under the condition $p \equiv 1(\bmod 12)$, first prove the following lemma.

Lemma 1: The number of integer pairs $(x, y)$ that satisfy $x^{2}+y^{2} \equiv 0(\bmod p), x, y \in\{0,1,2, \cdots, p-1\}$ is $2 p-1$.

Since $p \equiv 1(\bmod 4)$, we know that -1 is a quadratic residue modulo $p$, so there exists $u$ such that $u^{2} \equiv -1(\bmod p)$. Therefore, if $x^{2} \equiv -y^{2}(\bmod p)$, then $x^{2} \equiv (u y)^{2}(\bmod p)$, so $p \mid (x - u y)$ or $p \mid (x + u y)$. This indicates that for each $y \in \{1,2, \cdots, p-1\}$, there are exactly two different $x (x \equiv u y$ or $-u y(\bmod p)) \in \{1,2, \cdots, p-1\}$ such that $x^{2} + y^{2} \equiv 0(\bmod p)$, and when $y \equiv 0(\bmod p)$, only $x \equiv 0(\bmod p)$ satisfies $x^{2} + y^{2} \equiv 0(\bmod p)$. Lemma 1 is proved.

Lemma 2: For a given $k \in \{1,2, \cdots, p-1\}$, the number of integer pairs $(x, y)$ that satisfy $x^{2} + y^{2} \equiv k(\bmod p), x, y \in \{0,1,2, \cdots, p-1\}$ is $p-1$.

Notice that the number of integer pairs $(r, t)$ that satisfy $r t \equiv k(\bmod p)$ is $p-1$, where $r, t \in \{0,1,2, \cdots, p-1\}$ (since $k \neq 0(\bmod p)$, when $t$ takes $1,2, \cdots, p-1$, $r \equiv t^{-1} k(\bmod p)$ is determined). Therefore, for $x^{2} + y^{2} \equiv k(\bmod p)$, using $u^{2} \equiv -1(\bmod p)$ from Lemma 1, we have
$$(x - u y)(x + u y) \equiv k(\bmod p)$$

Thus, $(x - u y, x + u y) = (r, t)$ has $p-1$ pairs. When $r, t$ are determined,
$$x \equiv 2^{-1}(r + t)(\bmod p), y \equiv (2 u)^{-1}(t - r)(\bmod p)$$

are also determined, so Lemma 2 is proved.
Lemma 3: The number of integer pairs $(x, y)$ that satisfy $x^{3} + y^{3} \equiv 0(\bmod p), x, y \in \{0,1,2, \cdots, p-1\}$ is $3 p - 2$.

When $y = 0$, we must have $x = 0$; when $y \neq 0$, for a given $y$, by Lagrange's theorem, $x^{3} \equiv -y^{3}(\bmod p)$ has at most three solutions. On the other hand, taking a primitive root $g$ modulo $p$, since $p \equiv 1(\bmod 3)$, $1, g^{\frac{p-1}{3}}, g^{\frac{2(p-1)}{3}}$ are the three distinct solutions of the equation $t^{3} \equiv 1(\bmod p)$, so
$$x \equiv -y, -g^{\frac{p-1}{3}} y, -g^{\frac{2(p-1)}{3}} y(\bmod p)$$

are the three distinct solutions of $x^{3} \equiv -y^{3}(\bmod p)$. Therefore, Lemma 3 is proved.
Returning to the original problem. By Lemma 3, there are $3 p - 2$ pairs $(c, d)$ that satisfy $c^{3} + d^{3} \equiv 0(\bmod p)$, and for each such pair $(a, b)$, there are $2 p - 1$ pairs (Lemma 1), i.e., the number of $(a, b, c, d)$ that satisfy $a^{2} + b^{2} \equiv c^{3} + d^{3} \equiv 0(\bmod p)$ is $(3 p - 2)(2 p - 1)$.

By Lemma 3, there are $p^{2} - (3 p - 2)$ pairs $(c, d)$ such that $c^{3} + d^{3} \not\equiv 0(\bmod p)$, and for each such pair $(c, d)$, by Lemma 2, the corresponding $(a, b)$ has $p - 1$ pairs.

In summary, the number of tuples $(a, b, c, d)$ that satisfy the conditions is $(3 p - 2)(2 p - 1) + (p^{2} - 3 p + 2)(p - 1) = p^{3} + 2 p^{2} - 2 p$.