/* 首屏：Three.js 魔方墙 + 轮播兜底 */
/* 默认（仅 Swiper）：高度随轮播区（#banner .swiper-slide = 54vw / max 940 / 小屏 260），不再强撑 100vh，避免与魔方全屏不一致时底部留白 */
.gpc-magic-cube-banner {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  /* 与 Three 背景略暗一档 */
  background: #161a22;
}
/* 魔方墙已就绪：与 WebGL 全视口一致 */
.gpc-magic-cube-banner.gpc-magic-cube-banner--wall-ready {
  min-height: 100vh;
  min-height: 100dvh;
}

.gpc-magic-cube-banner #gpc-magic-cube-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
}

/* 轻压暗 WebGL，略增罩层 */
.gpc-magic-cube-banner--wall-ready #gpc-magic-cube-container::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.26) 0%,
    rgba(0, 0, 0, 0.14) 45%,
    rgba(0, 0, 0, 0.42) 100%
  );
}

.gpc-magic-cube-banner #gpc-magic-cube-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* 与 #banner 内轮播同一套版式（原 CSS 只选中 #banner .swiper .swiper-slide 内节点） */
.gpc-magic-cube-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.gpc-magic-cube-overlay .container {
  width: 100%;
  min-height: 100vh;
  height: 100%;
  max-height: 940px;
  overflow: hidden;
  z-index: 5;
  position: relative;
}

.gpc-magic-cube-overlay .container .box {
  text-align: left;
  width: 100%;
  position: relative;
  z-index: 2;
  min-height: min(100vh, 940px);
}

.gpc-magic-cube-overlay .container .box .cont {
  z-index: 2;
  width: 100%;
  max-width: 1050px;
  color: #fff;
}

/* 与 main.css #banner .swiper ... .cont .title 一致 */
.gpc-magic-cube-overlay .container .box .cont .title {
  margin-top: -100px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 32px rgba(0, 0, 0, 0.55);
}

.gpc-magic-cube-overlay .container .box .cont .title p {
  color: inherit;
}

.gpc-magic-cube-overlay .container .box .moreC {
  position: absolute;
  width: 100%;
  bottom: 50px;
  left: 0;
  justify-content: center;
}

.gpc-magic-cube-overlay .container,
.gpc-magic-cube-overlay a,
.gpc-magic-cube-overlay .moreC {
  pointer-events: auto;
}

/* 未就绪时：仅显示 Swiper；魔方容器隐藏避免闪屏 */
.gpc-magic-cube-banner:not(.gpc-magic-cube-banner--wall-ready) #gpc-magic-cube-container {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.gpc-magic-cube-banner:not(.gpc-magic-cube-banner--wall-ready) .gpc-magic-cube-overlay {
  display: none;
}

/* 就绪后：隐藏轮播，显示魔方 + 覆盖层 */
.gpc-magic-cube-banner--wall-ready .gpc-magic-cube-fallback {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.gpc-magic-cube-banner--wall-ready #gpc-magic-cube-container {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.gpc-magic-cube-banner--wall-ready .gpc-magic-cube-overlay {
  display: flex;
}

.gpc-magic-cube-fallback {
  position: relative;
  z-index: 1;
  min-height: 0;
}

@media (max-width: 500px) {
  .gpc-magic-cube-overlay .container .box .cont .title {
    font-size: 24px;
    line-height: 44px;
    margin-top: 0;
  }
  .gpc-magic-cube-overlay .container .box .moreC {
    bottom: 10px;
  }
}

@media (max-width: 767px) {
  .gpc-magic-cube-overlay {
    display: none !important;
  }
  .gpc-magic-cube-banner:not(.gpc-magic-cube-banner--wall-ready) .gpc-magic-cube-overlay {
    display: none !important;
  }
}
