Example 7 Let $n$ be a positive integer,
$$
S_{n}=\left\{\left(a_{1}, a_{2}, \cdots, a_{2^{n}}\right) \mid a_{i}=0,1\right\} \text {. }
$$

For $a, b \in S_{n}$,
$$
a=\left(a_{1}, a_{2}, \cdots, a_{2^{n}}\right), b=\left(b_{1}, b_{2}, \cdots, b_{2^{n}}\right) \text {, }
$$

define $d(a, b)=\sum_{i=1}^{2^{n}}\left|a_{i}-b_{i}\right|$.
If for any $a, b \in A, a \neq b$, we have $d(a, b) \geqslant 2^{n-1}$, then $A \subseteq S_{n}$ is called a "good subset".
Find the maximum value of $|A|$.
Let set $A$ contain $k$ elements whose first component is 1, denoted as $e_{1}, e_{2}, \cdots, e_{k}$. Let
$$
T=\sum_{1 \leqslant i<j \leqslant k} d\left(e_{i}, e_{j}\right) .
$$

Then $T \geqslant \mathrm{C}_{k}^{2} \cdot 2^{n-1}$.
For each component of elements $e_{1}, e_{2}, \cdots, e_{k}$, let there be $x_{i}$ ones and $k-x_{i}\left(i=1,2, \cdots, 2^{n}\right)$ zeros, where $x_{1}=k$.
$$
\begin{array}{l}
\text { Then } T=\sum_{i=1}^{2^{n}} x_{i}\left(k-x_{i}\right) \leqslant \frac{k^{2}}{4}\left(2^{n}-1\right) \\
\Rightarrow \frac{k(k-1)}{2} \times 2^{n-1} \leqslant \frac{k^{2}}{4}\left(2^{n}-1\right) \\
\Rightarrow(k-1) 2^{n-1} \leqslant \frac{k}{2}\left(2^{n}-1\right) \\
\Rightarrow k \leqslant 2^{n} .
\end{array}
$$

Similarly, the elements in set $A$ whose first component is 0 are also at most $2^{n}$.
Thus, $|A| \leqslant 2^{n+1}$.
Below, we use induction to construct an example.
When $n=1$,
$$
A_{1}=\{(0,0),(0,1),(1,0),(1,1)\} \text {. }
$$

Suppose $A_{n}=\left\{g_{1}, g_{2}, \cdots, g_{2^{n+1}}\right\}$, where
$$
g_{i}=\left(\alpha_{i 1}, \alpha_{i 2}, \cdots, \alpha_{i 2^{n}}\right)\left(i=1,2, \cdots, 2^{n+1}\right)
$$

satisfies the requirements.
$$
\begin{array}{l}
\text { Then } d\left(g_{i}, g_{j}\right) \geqslant 2^{n-1}\left(1 \leqslant i \neq j \leqslant 2^{n+1}\right) . \\
\text { Let } A_{n+1}=\left\{h_{1}, h_{2}, \cdots, h_{2^{n+1}}, c_{1}, c_{2}, \cdots, c_{2^{n+1}}\right\},
\end{array}
$$

where, $h_{i}=\left(\alpha_{i 1}, \alpha_{i 2}, \cdots, \alpha_{i 2^{n}}, \alpha_{i 1}, \cdots, \alpha_{i 2^{n}}\right)$,
$$
c_{i}=\left(\alpha_{i 1}, \alpha_{i 2}, \cdots, \alpha_{i 2^{n}}, 1-\alpha_{i 1}, 1-\alpha_{i 2}, \cdots, 1-\alpha_{i 2^{n}}\right) \text {. }
$$

We now show that $A_{n+1}$ meets the requirements, and $d=2^{n}$ or $2^{n+1}$.
For $i \neq j$,
$$
\begin{array}{l}
d\left(h_{i}, h_{j}\right)=2 d\left(g_{i}, g_{j}\right) \geqslant 2^{n}, \\
d\left(c_{i}, c_{j}\right)=2 d\left(g_{i}, g_{j}\right) \geqslant 2^{n}, \\
d\left(h_{i}, c_{i}\right)=2^{n} \\
d\left(h_{i}, c_{j}\right)=2 n+d\left(g_{i}, g_{j}\right)-d\left(g_{i}, g_{j}\right)=2^{n} .
\end{array}
$$

Therefore, the above construction meets the requirements, and
$$
\left|A_{n+1}\right|=2^{n+2} \text {. }
$$

Thus, the maximum value of $|A|$ is $2^{n+1}$.