12. As shown in Figure 4, the four corners of the rectangular paper $ABCD$ are folded inward, with $EF, FG, GH, HE$ as the creases. After folding, points $A, D$ fall on point $P$ on $EG$, and points $B, C$ fall on point $Q$ on $EG$.
(1) If $EH=3, EF=4$, find the length of $EG$;
(2) If $\frac{EH}{EF}=\frac{1}{2}$, find the value of $\frac{AB}{BC}$.
12. (1) According to the problem, we have
$$
\begin{array}{l}
\triangle P H E \cong \triangle A H E \\
\Rightarrow \angle P H E=\angle A H E \\
\Rightarrow \angle P H E=\frac{1}{2} \angle A H P .
\end{array}
$$

Similarly, $\angle P H G=\frac{1}{2} \angle D H P$.
Since $\angle A H P+\angle D H P=180^{\circ}$, then
$\angle E H G=\angle P H E+\angle P H G$
$$
=\frac{1}{2}(\angle A H P+\angle D H P)=90^{\circ} \text {. }
$$

Similarly, $\angle H E F=90^{\circ}, \angle E F G=90^{\circ}$.
Thus, quadrilateral $E F G H$ is a rectangle.
Therefore, $H G=E F=4$.
In the right triangle $\triangle E H G$, since $E H=3$, we have
$$
E G=\sqrt{E H^{2}+H G^{2}}=5 \text {. }
$$
(2) From (1), in the rectangle $E F G H$, $\frac{E H}{E F}=\frac{1}{2}$. Let $E H=a$. Then
$$
H G=E F=2 a \Rightarrow E G=\sqrt{5} a \text {. }
$$

Thus, in the right triangle $\triangle E H G$,
$$
H P=\frac{E H \cdot H G}{E G}=\frac{2 \sqrt{5}}{5} a \text {. }
$$

It is easy to see that $A E=E P, E B=E Q=P G$,
$$
A H=H P=H D \text {. }
$$

Therefore, $A B=A E+E B=E G=\sqrt{5} a$,
$$
A D=A H+H D=2 H P=\frac{4 \sqrt{5}}{5} a \text {. }
$$

Thus, $\frac{A B}{B C}=\frac{A B}{A D}=\frac{5}{4}$.