8. Four spheres with a radius of 1 are placed on a horizontal table, and adjacent spheres are tangent to each other (the lines connecting the centers of the spheres form a square). There is a cube whose bottom face coincides with the table, and the four vertices of its top face just touch the four spheres, respectively. Then the edge length of the cube is $\qquad$ .
Rong's matter $\frac{2}{3}$.
Analysis Let the edge length of the cube be $a$, the top face be the square $A B C D$, and the center be $O$, then $O A=\frac{\sqrt{2}}{2} a$.
By symmetry, the projection $M$ of the sphere center $O_{1}$ on the face $A B C D$ should be on the line $A C$ or $B D$, and the projection $N$ of the tangent point $P$ of the sphere $O_{1}$ with adjacent spheres on the face $A B C D$ is on the line passing through point $O$ and parallel to $A B$, thus $\sqrt{2} M N=O M=O A+A M$.

Also, $O_{1} M=1-a$, then $A M=\sqrt{O_{1} A^{2}-O_{1} M^{2}}=\sqrt{1-(1-a)^{2}}$, so $\sqrt{2}=\frac{\sqrt{2}}{2} a+\sqrt{1-(1-a)^{2}}$, rearranging gives $3 a^{2}-8 a+4=0$, solving yields $a=\frac{2}{3}$, or $a=2$ (discard), hence $a=\frac{2}{3}$.