/* ========================================
   WebGL 3D画廊样式 - 独立模块
   ======================================== */

/* 画廊容器 */
.gallery-3d {
  background: var(--dark-bg);
  padding: 0;
  position: relative;
  min-height: 80vh;
}

/* 顶部控制栏 */
.gallery-topbar {
  position: absolute;
  top: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.14));
  backdrop-filter: blur(14px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.gallery-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.gallery-logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #60a5fa, #7c3aed);
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.55);
}

.gallery-brand-text .gallery-t {
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
}

.gallery-brand-text .gallery-s {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.gallery-actions {
  display: flex;
  gap: 10px;
}

.gallery-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
  font-size: 14px;
  font-family: inherit;
}

.gallery-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

/* 画廊舞台 */
.gallery-stage {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 600px;
}

#galleryCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

/* HUD 信息栏 */
.gallery-hud {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  z-index: 100;
  padding: 12px 14px;
  width: min(520px, calc(100% - 4rem));
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  border-radius: 16px;
}

.gallery-hud-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.gallery-hud-sub {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

/* 加载动画 */
.gallery-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 200;
  background: radial-gradient(circle at 40% 30%, rgba(124, 58, 237, 0.16), rgba(0, 0, 0, 0.65));
}

.gallery-spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: gallery-spin 1s linear infinite;
}

@keyframes gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

.gallery-loading-text {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

/* 错误提示 */
.gallery-error {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 300;
  padding: 14px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(14px);
}

.gallery-error-title {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.gallery-error-text {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .gallery-topbar {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .gallery-brand-text .gallery-t {
    font-size: 0.9rem;
  }

  .gallery-brand-text .gallery-s {
    font-size: 11px;
  }

  .gallery-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .gallery-stage {
    height: 70vh;
    min-height: 500px;
  }

  .gallery-hud {
    left: 1rem;
    bottom: 1rem;
    width: calc(100% - 2rem);
    padding: 10px 12px;
  }

  .gallery-hud-title {
    font-size: 12px;
  }

  .gallery-hud-sub {
    font-size: 11px;
  }

  .gallery-error {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-topbar {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .gallery-stage {
    height: 60vh;
    min-height: 400px;
  }

  .gallery-spinner {
    width: 38px;
    height: 38px;
  }

  .gallery-loading-text {
    font-size: 12px;
  }
}

/* ========================================
   案例信息面板 - 艺术馆玻璃态
   ======================================== */
.case-panel {
  position: fixed;
  right: 2rem;
  bottom: 8rem;
  width: 360px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(30, 41, 59, 0.55));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  z-index: 150;
}

.case-panel.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.case-year {
  font-size: 13px;
  font-weight: 600;
  color: rgba(96, 165, 250, 0.92);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.case-title {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  margin-bottom: 12px;
}

.case-type {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  background: rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 14px;
}

.case-service {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.case-hint {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  opacity: 1;
  transition: opacity 0.6s ease, transform 0.6s ease;
  cursor: pointer;
  user-select: none;
}

.case-hint:hover {
  color: rgba(255, 255, 255, 0.85);
}

.case-hint.hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* ========================================
   模式选择界面 - 艺术馆级入口
   ======================================== */
.mode-select {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.95));
  backdrop-filter: blur(18px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}

.mode-box {
  padding: 48px 56px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
}

.mode-box h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.95);
}

.mode-box p {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.mode-box button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-box button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* ========================================
   全屏按钮
   ======================================== */
.gallery-fullscreen-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.gallery-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.gallery-fullscreen-btn svg {
  transition: transform 0.3s ease;
}

.gallery-fullscreen-btn:hover svg {
  transform: scale(1.1);
}

/* 全屏状态下的样式 */
.gallery-stage:-webkit-full-screen,
.gallery-stage:-moz-full-screen,
.gallery-stage:fullscreen {
  width: 100vw;
  height: 100vh;
}

.gallery-stage:-webkit-full-screen canvas,
.gallery-stage:-moz-full-screen canvas,
.gallery-stage:fullscreen canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 响应式适配 - 案例面板 */
@media (max-width: 768px) {
  .case-panel {
    right: 1rem;
    bottom: 6rem;
    width: calc(100% - 2rem);
    max-width: 340px;
    padding: 18px;
  }
  
  .mode-box {
    padding: 36px 28px;
    width: calc(100% - 2rem);
    max-width: 380px;
  }
  
  .gallery-fullscreen-btn {
    bottom: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
  }

  .case-year {
    font-size: 12px;
  }

  .case-title {
    font-size: 16px;
  }

  .case-type {
    font-size: 12px;
    padding: 5px 10px;
  }

  .case-service {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .case-panel {
    right: 0.5rem;
    bottom: 5rem;
    width: calc(100% - 1rem);
    padding: 16px;
  }

  .case-year {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .case-title {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .case-type {
    font-size: 11px;
    padding: 4px 8px;
    margin-bottom: 12px;
  }

  .case-service {
    font-size: 12px;
    padding-top: 10px;
  }
}
