/* ============================================================
   Power AI — 首屏实验室（Hero Lab）
   覆盖：滚动叙事「数据长成大模型」、能量之声
   说明：本文件只新增样式，不改动 main.css
   ============================================================ */

/* ============================================================
   功能 2：滚动叙事「数据长成大模型」
   ============================================================ */
.morph {
  position: relative;
  height: 320vh;
  background: linear-gradient(to bottom, var(--bg) 0%, #F2F7FA 40%, var(--bg) 100%);
  z-index: 1;
}
.morph-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.morph-stage { position: absolute; inset: 0; }
.morph-stage canvas { display: block; }

/* 阶段标签 */
.morph-labels { position: relative; z-index: 2; pointer-events: none; width: 100%; }
.morph-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 48px));
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}
.ml-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--energy-deep);
  margin-bottom: 12px;
}
.ml-text {
  display: block;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* 点睛文案（终章浮现） */
.morph-caption {
  position: absolute;
  left: 50%;
  bottom: 12vh;
  transform: translateX(-50%);
  z-index: 2;
  width: min(620px, calc(100vw - 48px));
  text-align: center;
  font-size: clamp(15px, 1.7vw, 19px);
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

/* 进度仪（mono） */
.morph-meter {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  pointer-events: none;
}
.mm-track {
  width: 120px;
  height: 2px;
  background: var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.mm-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--energy-deep), var(--energy));
}
.mm-num { font-size: 11.5px; letter-spacing: 0.14em; color: var(--ink-faint); min-width: 34px; }

/* 动效降级：静态四帧图文 */
.morph-static { display: none; }
.morph.morph-reduced { height: auto; padding: 90px 24px; }
.morph.morph-reduced .morph-pin { display: none; }
.morph.morph-reduced .morph-static {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.morph-frame {
  background: var(--bg-pure);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
  text-align: center;
}
.mf-visual {
  height: 110px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  background-color: #F4F9FB;
  background-repeat: no-repeat;
  background-position: center;
}
/* 四帧分别以纯 CSS 渐变描绘：混沌数据 → 站点簇 → 机线框 → 稳定核 */
.mf-data {
  background-image:
    radial-gradient(circle at 22% 30%, rgba(0, 194, 209, 0.5) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 22%, rgba(8, 145, 178, 0.45) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 66%, rgba(11, 43, 69, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 58%, rgba(0, 194, 209, 0.4) 0 3px, transparent 4px),
    radial-gradient(circle at 12% 74%, rgba(8, 145, 178, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 42%, rgba(0, 194, 209, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 33% 84%, rgba(11, 43, 69, 0.3) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 84%, rgba(0, 194, 209, 0.3) 0 2px, transparent 3px);
}
.mf-stations {
  background-image:
    radial-gradient(circle at 26% 34%, rgba(0, 194, 209, 0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 52% 62%, rgba(0, 194, 209, 0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 76% 30%, rgba(0, 194, 209, 0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 72%, rgba(8, 145, 178, 0.5) 0 8px, transparent 9px),
    radial-gradient(circle at 30% 76%, rgba(8, 145, 178, 0.5) 0 8px, transparent 9px);
}
.mf-machines {
  background-image:
    linear-gradient(rgba(8, 145, 178, 0.35), rgba(8, 145, 178, 0.35)),
    linear-gradient(rgba(8, 145, 178, 0.35), rgba(8, 145, 178, 0.35)),
    radial-gradient(circle at 32% 50%, transparent 14px, rgba(0, 194, 209, 0.5) 15px 17px, transparent 18px),
    linear-gradient(rgba(0, 194, 209, 0.3), rgba(0, 194, 209, 0.3));
  background-size: 42% 2px, 2px 46%, 100% 100%, 24% 52%;
  background-position: 54% 50%, 50% 50%, center, 76% 50%;
}
.mf-model {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(127, 233, 242, 0.85) 0 10px, rgba(0, 194, 209, 0.4) 11px 22px, rgba(0, 194, 209, 0.12) 23px 36px, transparent 37px);
}
.mf-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--energy-deep);
  margin-bottom: 8px;
}
.mf-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.mf-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }

/* ============================================================
   功能 3：能量之声开关
   ============================================================ */
.voice-toggle {
  position: absolute;
  right: clamp(20px, 4vw, 44px);
  bottom: 84px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}
.voice-toggle:hover { border-color: var(--energy); color: var(--energy-deep); box-shadow: var(--shadow-card); }
.voice-toggle:focus-visible { outline: 2px solid var(--energy); outline-offset: 2px; }
.voice-toggle svg { width: 16px; height: 16px; display: block; }
.voice-toggle .vt-bars rect { transition: fill 0.3s; }
.voice-toggle[aria-pressed="true"] {
  border-color: var(--energy);
  color: var(--energy-deep);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 194, 209, 0.25), var(--shadow-lift);
}
.voice-toggle[aria-pressed="true"] .vt-dot {
  fill: var(--energy);
  filter: drop-shadow(0 0 5px var(--energy));
}
.vt-dot { fill: var(--ink-faint); }

/* 开启后声波柱轻微起伏（ reduced-motion 时由媒体查询禁用动画） */
.voice-toggle[aria-pressed="true"] .vt-b1 { animation: vtBar 1.1s ease-in-out infinite; }
.voice-toggle[aria-pressed="true"] .vt-b2 { animation: vtBar 1.1s ease-in-out 0.18s infinite; }
.voice-toggle[aria-pressed="true"] .vt-b3 { animation: vtBar 1.1s ease-in-out 0.36s infinite; }
@keyframes vtBar {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}
.vt-bars rect { transform-origin: center; transform-box: fill-box; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 960px) {
  .morph.morph-reduced .morph-static { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .voice-toggle { bottom: 96px; right: 16px; padding: 9px 14px; }
  .voice-toggle .vt-text { display: none; }
  .morph-meter { right: 16px; bottom: 24px; }
}
@media (max-width: 560px) {
  .morph.morph-reduced .morph-static { grid-template-columns: 1fr; }
  .hero-def-sub { margin-bottom: 24px; }
  .hero-actions { margin-top: 24px; }
}

/* ============================================================
   动效降级
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .voice-toggle { display: none; }
  .voice-toggle[aria-pressed="true"] .vt-b1,
  .voice-toggle[aria-pressed="true"] .vt-b2,
  .voice-toggle[aria-pressed="true"] .vt-b3 { animation: none; }
}
