21. As shown in Figure 2, given that the side length of square $A B C D$ is 1, and rectangle $J K H G \cong$ rectangle $E B C F$. Then $B E=(\quad$.
(A) $\frac{\sqrt{6}-2}{2}$
(B) $\frac{1}{4}$
(C) $2-\sqrt{3}$
(D) $1-\frac{\sqrt{2}}{2}$
(E) $\frac{\sqrt{3}}{6}$
21. C.

Let $B E=x, \angle K J E=\theta$.
Since rectangle $J K H G \cong$ rectangle $E B C F$, we have,
$$
\begin{array}{l}
E J=x \cos \theta, A J=\sin \theta, \\
A G=\cos \theta, D G=x \sin \theta .
\end{array}
$$

Given that the side length of square $A B C D$ is 1, thus,
$$
\begin{array}{l}
\left\{\begin{array}{l}
x+x \cos \theta+\sin \theta=1, \\
x \sin \theta+\cos \theta=1
\end{array}\right. \\
\Rightarrow \frac{1-\sin \theta}{1+\cos \theta}=\frac{1-\cos \theta}{\sin \theta} \\
\Rightarrow \sin \theta=\frac{1}{2} \Rightarrow x=2-\sqrt{3} . \\
\end{array}
$$