/* ================================================================
   Hero 3D WebGL — Full-screen immersive humanoid robot
   ================================================================ */

.hero3d-section {
  position: relative;
  width: 100%;
  /* 只扣顶部导航栏高度，让首屏尽可能占满视口 */
  height: calc(100vh - 72px);
  min-height: 600px;
  overflow: hidden;
  color: var(--text-1);
  background: radial-gradient(ellipse at 50% 60%, #0a1428 0%, #05070f 70%, #020308 100%);
}

/* Loading overlay */
.hero3d-loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0a1428 0%, #020308 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
  pointer-events: none;
}

.hero3d-loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.hero3d-loader-ring {
  width: 80px;
  height: 80px;
  border: 2px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-right-color: rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  animation: hero3d-spin 1.2s linear infinite;
  margin-bottom: 24px;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.2), inset 0 0 20px rgba(56, 189, 248, 0.08);
}

@keyframes hero3d-spin {
  to { transform: rotate(360deg); }
}

.hero3d-loader-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  color: rgba(56, 189, 248, 0.8);
  text-transform: uppercase;
}

.hero3d-loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(56, 189, 248, 0.15);
  margin-top: 16px;
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.hero3d-loader-bar::after {
  content: '';
  position: absolute;
  left: -30%;
  top: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #38bdf8, transparent);
  animation: hero3d-loader-shine 1.6s linear infinite;
}

@keyframes hero3d-loader-shine {
  to { left: 100%; }
}

/* WebGL canvas layer */
.hero3d-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* CSS fallback when WebGL unavailable */
.hero3d-fallback-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 50%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(circle at 70% 30%, rgba(232, 121, 249, 0.05), transparent 50%),
    linear-gradient(180deg, #05070f 0%, #0a1428 50%, #05070f 100%);
  animation: hero3d-fallback-pulse 8s ease-in-out infinite;
}

@keyframes hero3d-fallback-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Grid overlay */
.hero3d-grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: 0.6;
}

/* Scan line */
.hero3d-scan-line {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
  animation: hero3d-scan 6s linear infinite;
  opacity: 0.3;
}

@keyframes hero3d-scan {
  0% { top: 0; }
  100% { top: 100%; }
}

/* Vignette */
.hero3d-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(2, 3, 8, 0.7) 100%);
}

/* Corner HUD decorations */
.hero3d-hud-corner {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(56, 189, 248, 0.7);
  text-transform: uppercase;
}

.hero3d-hud-corner.tl { top: 90px; left: 32px; }
.hero3d-hud-corner.tr { top: 90px; right: 32px; text-align: right; }
.hero3d-hud-corner.bl { bottom: 100px; left: 32px; }
.hero3d-hud-corner.br { bottom: 100px; right: 32px; text-align: right; }

.hero3d-hud-corner .hud-line {
  display: block;
  line-height: 1.8;
}

.hero3d-hud-corner .hud-line strong {
  color: #38bdf8;
  font-weight: 500;
}

/* Content overlay layer */
.hero3d-content-layer {
  position: relative;
  z-index: 20;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.hero3d-content-layer > * {
  pointer-events: auto;
}

.hero3d-content-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  gap: 24px;
  align-items: center;
}

/* Left: text content — left-aligned, clear of robot */
.hero3d-text-block {
  padding-top: 0;
  z-index: 30;
  position: relative;
  min-width: 0;
}

.hero3d-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: hero3d-reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero3d-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.5);
  animation: hero3d-pulse 2s ease-in-out infinite;
}

@keyframes hero3d-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes hero3d-reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero3d-main-title {
  font-family: var(--font-display, 'Georama'), 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.05;
  margin: 0 0 24px 0;
  letter-spacing: -0.02em;
}

.hero3d-title-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  animation: hero3d-title-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero3d-title-line.delay-1 { animation-delay: 0.4s; }
.hero3d-title-line.delay-2 { animation-delay: 0.55s; }

.hero3d-title-white {
  color: #f0f4ff;
}

.hero3d-title-gradient {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 40%, #e879f9 80%, #38bdf8 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* 同时运行“入场 reveal”和“渐变流动”，避免后者覆盖前者导致第二行永久隐藏 */
  animation:
    hero3d-title-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards,
    hero3d-gradient-shift 6s ease-in-out 1.6s infinite;
  filter: drop-shadow(0 0 30px rgba(56, 189, 248, 0.3));
}

@keyframes hero3d-title-reveal {
  0% {
    opacity: 0;
    transform: translateY(100%);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

@keyframes hero3d-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero3d-subtitle {
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 32px 0;
  max-width: 520px;
  opacity: 0;
  transform: translateY(20px);
  animation: hero3d-reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

.hero3d-subtitle strong {
  color: var(--text-1);
  font-weight: 600;
}

/* Search box */
.hero3d-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 20, 40, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 6px 6px 6px 20px;
  max-width: 520px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: hero3d-reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero3d-search-box:focus-within {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15), inset 0 0 20px rgba(56, 189, 248, 0.05);
}

.hero3d-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 15px;
  font-family: inherit;
  padding: 12px 0;
}

.hero3d-search-box input::placeholder {
  color: var(--text-3);
}

.hero3d-search-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: #020308;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.hero3d-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
}

/* CTA group */
.hero3d-cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
  animation: hero3d-reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.hero3d-cta-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.1));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  color: #e0f2fe;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.hero3d-cta-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.hero3d-cta-primary:hover {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3), inset 0 0 20px rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
}

.hero3d-cta-primary:hover::before {
  left: 120%;
}

.hero3d-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: rgba(10, 20, 40, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.hero3d-cta-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-1);
  transform: translateY(-2px);
}

/* Trust badges */
.hero3d-trust-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: hero3d-reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
}

.hero3d-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.hero3d-trust-item .check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* Right side: shape tabs float in robot display area */
.hero3d-right-panel {
  position: relative;
  height: 100%;
  min-height: 400px;
  pointer-events: none;
}

.hero3d-shape-tabs {
  position: absolute;
  top: 120px;
  right: 24px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.shape-tab {
  padding: 10px 18px;
  background: rgba(10, 20, 40, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
}

.shape-tab:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-1);
}

.shape-tab.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.shape-tab .tab-en {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  opacity: 0.6;
  font-family: var(--font-mono);
  margin-top: 2px;
  letter-spacing: 0.1em;
}

.shape-tab.active .tab-en {
  color: rgba(56, 189, 248, 0.7);
}

/* Bottom stats bar */
.hero3d-stats-bar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1px;
  overflow: hidden;
  opacity: 0;
  animation: hero3d-stats-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}

@keyframes hero3d-stats-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hero3d-stat-cell {
  padding: 14px 28px;
  background: rgba(10, 20, 40, 0.5);
  text-align: center;
  min-width: 140px;
}

.hero3d-stat-num {
  font-family: var(--font-display, 'Georama'), sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  background: linear-gradient(135deg, #f0f4ff 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero3d-stat-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Custom cursor (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .hero3d-custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.8);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
    transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, opacity 0.25s ease;
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .hero3d-custom-cursor.hover {
    width: 40px;
    height: 40px;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.6);
  }

  .hero3d-cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.3);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    will-change: transform;
  }

  .hero3d-cursor-ring.hover {
    width: 60px;
    height: 60px;
    border-color: rgba(56, 189, 248, 0.6);
  }
}

/* Scroll hint */
.hero3d-scroll-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  pointer-events: none;
  opacity: 0;
  animation: hero3d-reveal-up 0.8s ease 1.8s forwards;
}

.hero3d-scroll-hint .mouse {
  width: 22px;
  height: 34px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  position: relative;
}

.hero3d-scroll-hint .mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: #38bdf8;
  border-radius: 2px;
  animation: hero3d-wheel 1.6s ease-in-out infinite;
}

@keyframes hero3d-wheel {
  0%, 100% { top: 6px; opacity: 1; }
  50% { top: 18px; opacity: 0.3; }
}

/* Responsive */
@media (max-width: 1280px) {
  .hero3d-content-inner {
    padding: 0 32px;
    gap: 32px;
  }
  .hero3d-stat-cell {
    padding: 12px 20px;
    min-width: 110px;
  }
  .hero3d-stat-num { font-size: 22px; }
}

@media (max-width: 1024px) {
  .hero3d-content-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero3d-text-block {
    padding-top: 0;
    z-index: 30;
    position: relative;
  }
  .hero3d-subtitle { margin: 0 auto 24px auto; }
  .hero3d-search-box { margin: 0 auto 24px auto; }
  .hero3d-cta-group { justify-content: center; }
  .hero3d-trust-row { justify-content: center; }
  .hero3d-shape-tabs {
    top: auto;
    bottom: 180px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90vw;
  }
  .shape-tab { font-size: 11px; padding: 8px 14px; }
  .shape-tab .tab-en { display: none; }
  .hero3d-hud-corner { display: none; }
}

@media (max-width: 768px) {
  .hero3d-section { min-height: 620px; }
  /* 上半屏留给 3D 机器人，文字内容从机器人下方自然排列 */
  .hero3d-content-layer {
    justify-content: flex-start;
    padding-bottom: 88px;
  }
  .hero3d-content-inner {
    padding: 42vh 18px 0;
    grid-template-columns: 1fr;
    text-align: center;
    align-items: start;
  }
  .hero3d-text-block { width: 100%; min-width: 0; }
  .hero3d-kicker { justify-content: center; margin-bottom: 10px; font-size: 10px; }
  .hero3d-main-title { font-size: clamp(26px, 8vw, 36px); line-height: 1.08; }
  .hero3d-title-line { white-space: normal; }
  .hero3d-subtitle { margin: 10px auto 12px auto; font-size: 12.5px; max-width: 100%; line-height: 1.55; }
  .hero3d-search-box { max-width: 100%; width: 100%; margin: 0 auto 12px auto; padding: 4px 4px 4px 14px; }
  .hero3d-search-box input { font-size: 14px; min-width: 0; width: 100%; padding: 10px 0; }
  .hero3d-search-btn { padding: 10px 14px; font-size: 13px; flex-shrink: 0; }
  .hero3d-cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    gap: 10px;
    margin: 0 auto 12px auto;
  }
  .hero3d-cta-primary, .hero3d-cta-secondary {
    justify-content: center;
    padding: 12px 18px;
    width: 100%;
  }
  .hero3d-trust-row { gap: 6px 12px; justify-content: center; }
  .hero3d-trust-item { font-size: 10px; }
  /* 形态切换横排，置于数据条上方，可横向滑动不溢出 */
  .hero3d-shape-tabs {
    top: auto;
    bottom: 62px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    width: calc(100% - 16px);
    max-width: 560px;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .shape-tab { font-size: 11px; padding: 7px 12px; white-space: nowrap; }
  .shape-tab .tab-en { display: none; }
  /* 数据条全宽四格均分，不溢出 */
  .hero3d-stats-bar {
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
    animation-name: hero3d-stats-in-m;
  }
  .hero3d-stat-cell { padding: 8px 2px; min-width: 0; flex: 1 1 0; }
  .hero3d-stat-num { font-size: 16px; }
  .hero3d-stat-label { font-size: 9px; letter-spacing: 0; white-space: nowrap; }
  .hero3d-scroll-hint { display: none; }
}

@keyframes hero3d-stats-in-m {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 390px) {
  .hero3d-section { min-height: 600px; }
  .hero3d-content-inner { padding: 40vh 14px 0; }
  .hero3d-main-title { font-size: clamp(23px, 7.2vw, 29px); }
  .hero3d-subtitle { font-size: 12px; }
  .hero3d-search-btn { padding: 10px 12px; font-size: 12px; }
  .hero3d-stat-cell { padding: 7px 1px; }
  .hero3d-stat-num { font-size: 15px; }
  .hero3d-stat-label { font-size: 8px; }
  .shape-tab { font-size: 10px; padding: 6px 9px; }
}
