#cube {
  width: 150px;
  height: 150px;
  position: relative;
  margin: 100px auto;
  transform-style: preserve-3d;
  transform: rotateX(45deg) rotateY(45deg);
  transition: transform 0.2s ease-in-out; /* 添加过渡效果 */
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  color: white;
}

.front {
  background-color: rgba(255, 0, 0, 0.7); /* 红色 */
  transform: translateZ(75px);
}

.back {
  background-color: rgba(0, 0, 255, 0.7); /* 蓝色 */
  transform: rotateY(180deg) translateZ(75px);
}

.right {
  background-color: rgba(0, 128, 0, 0.7); /* 绿色 */
  transform: rotateY(90deg) translateZ(75px);
}

.left {
  background-color: rgba(255, 255, 0, 0.7); /* 黄色 */
  transform: rotateY(-90deg) translateZ(75px);
}

.top {
  background-color: rgba(255, 165, 0, 0.7); /* 橙色 */
  transform: rotateX(90deg) translateZ(75px);
}

.bottom {
  background-color: rgba(128, 0, 128, 0.7); /* 紫色 */
  transform: rotateX(-90deg) translateZ(75px);
}
