/* ==========================================================================
   Nature2Music — Lumora 森林原稿骨架 × Aurora 液态玻璃工作区卡片
   Part A（导航 / hero / 场景切换 / 页脚 / 背景层 / 字体）严格复刻
   lumora-forest-frontend/app/globals.css；Part B（卡片与控件）保留现有优化版。
   ========================================================================== */

/* ---------- Part A · 基础与字体（原稿） ---------- */

:root {
  color-scheme: dark;
  --ink: #ffffff;
  --ink-dim: rgba(255, 255, 255, 0.88);
  --ink-faint: rgba(255, 255, 255, 0.68);
  --glass-line: rgba(255, 255, 255, 0.18);
  --e-out: cubic-bezier(0.16, 1, 0.3, 1);
  --e-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gold: #f0d9a8;
  --danger: #ffb4a1;
  /* 原稿字体栈：正文 sans（PingFang 回退），标题 Noto Serif SC / Instrument Serif（中文回退 Songti SC） */
  --sans: system-ui, -apple-system, "PingFang SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Instrument Serif", serif;
  --serif-latin: "Instrument Serif", "Noto Serif SC", "Songti SC", "STSong", serif;
  --display: var(--serif);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, body { background: #08110d; }

body {
  color: #f7f7ef;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

::selection { background: rgba(240, 217, 168, 0.35); }

/* ---------- Part A · 背景层（原稿：视频 / 电影调色 / 叠加图 / 颗粒） ---------- */
/* 与原稿唯一差异：层容器为 fixed（多屏页面需要全程森林背景），层级与动画值原样 */

.bg-stack { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #08110d; }
.bg-stack > * { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.video-stack video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s ease-in-out, transform 8s ease;
}
.video-stack video.active { opacity: 1; transform: scale(1); }
body.scene-3 .video-stack video.active { filter: brightness(.38) saturate(.8) hue-rotate(145deg) contrast(1.08); }

.cinematic-tint {
  background:
    linear-gradient(180deg, rgba(4,12,8,.45), rgba(4,9,7,.03) 38%, rgba(4,10,7,.18) 65%, rgba(3,8,6,.74)),
    linear-gradient(90deg, rgba(5,13,9,.3), transparent 45%, rgba(3,8,6,.12));
  transition: background 1s;
}
body.scene-1 .cinematic-tint { background: linear-gradient(180deg, rgba(6,14,9,.37), rgba(9,17,8,.02) 45%, rgba(5,12,8,.68)); }
body.scene-2 .cinematic-tint { background: linear-gradient(180deg, rgba(29,16,8,.36), rgba(59,31,13,.02) 42%, rgba(16,8,6,.7)); }
body.scene-3 .cinematic-tint { background: linear-gradient(180deg, rgba(3,7,15,.42), rgba(6,13,24,.12) 44%, rgba(2,6,12,.78)); }

.train-overlay {
  object-fit: cover;
  transform: translateY(0) scale(1.03);
  transform-origin: center;
  animation: train-bob 3s ease-in-out infinite;
  will-change: transform;
}

.grain {
  opacity: .075;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: grain-drift .55s steps(2) infinite;
}

@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(204,233,159,0); } 100% { box-shadow: 0 0 0 0 rgba(204,233,159,0); } }
@keyframes train-bob { 0%, 100% { transform: translateY(0) scale(1.03); } 50% { transform: translateY(-6px) scale(1.03); } }
@keyframes grain-drift {
  0% { transform: translate(0,0); } 25% { transform: translate(-1.5%,1%); }
  50% { transform: translate(1%,-1.5%); } 75% { transform: translate(1.5%,1%); } 100% { transform: translate(0,0); }
}

.page { position: relative; z-index: 1; }

/* ---------- Part A · 玻璃基元（原稿 .glass） ---------- */

.glass {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.18);
}

/* ---------- Part A · 导航（原稿） ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 42px 0;
  position: relative;
  z-index: 60;
}
.brand {
  color: white;
  text-decoration: none;
  font: italic 27px/1 "Instrument Serif", serif;
  letter-spacing: -.02em;
}
.brand span { font-size: 13px; vertical-align: top; margin-left: 2px; opacity: .75; }
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  border-radius: 999px;
  padding: 6px 7px 6px 24px;
}
.desktop-nav a, .desktop-nav .nav-item {
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .04em;
  transition: color .2s;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.desktop-nav a:hover, .desktop-nav .nav-item:hover { color: white; }

/* 原稿 .solid-button：实心浅色 pill */
.solid-button {
  border: 0;
  background: #f5f5ed;
  color: #142219;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  padding: 11px 18px;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
  transition: transform .2s, background .2s;
}
.solid-button:hover { transform: scale(1.03); background: white; }

.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; z-index: 60; padding: 0; cursor: pointer; }
.menu-toggle i { position: absolute; width: 16px; height: 1px; background: white; left: 13px; top: 18px; transition: transform .3s, top .3s; }
.menu-toggle i + i { top: 24px; }
.menu-toggle.open i { top: 21px; transform: rotate(45deg); }
.menu-toggle.open i + i { transform: rotate(-45deg); }

/* ---------- Part A · 移动端菜单（原稿） ---------- */

.mobile-menu {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none; opacity: 0;
  background: rgba(2,8,5,.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity .45s;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-links { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 27px; }
.mobile-links a, .mobile-links .m-item {
  color: white;
  text-decoration: none;
  font: 400 30px var(--serif);
  background: none;
  border: 0;
  cursor: pointer;
}
.mobile-links a, .mobile-links .m-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s, transform .5s;
}
.mobile-links a:nth-child(1), .mobile-links .m-item:nth-child(1) { transition-delay: .1s; }
.mobile-links a:nth-child(2), .mobile-links .m-item:nth-child(2) { transition-delay: .16s; }
.mobile-menu.open a, .mobile-menu.open .m-item { opacity: 1; transform: translateY(0); }
/* 原稿 mobile-links button：白色 pill CTA */
.mobile-links #mobile-cta {
  margin-top: 12px;
  padding: 13px 26px;
  border-radius: 99px;
  color: #142219;
  background: white;
  font: 600 15px var(--sans);
}

/* ---------- Part A · Hero（原稿） ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 110px 42px 23px;
}
.hero-copy {
  margin: auto;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  transform: translateY(16px);
}
.eyebrow {
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(255,255,255,.86);
  margin-bottom: 20px;
}
.pulse {
  width: 5px; height: 5px;
  display: inline-block;
  background: #cce99f;
  border-radius: 50%;
  margin-right: 9px;
  box-shadow: 0 0 0 0 rgba(204,233,159,.55);
  animation: pulse 2s infinite;
}
.time-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(255,255,255,.68);
}
.time-kicker span { color: white; }

.hero-title {
  margin: 0;
  max-width: 900px;
  font: 400 clamp(48px, 6.25vw, 92px)/.98 var(--serif);
  letter-spacing: -.045em;
  text-shadow: 0 2px 30px rgba(0,0,0,.16);
}
.hero-title em { font-family: var(--serif-latin); font-style: italic; font-weight: 400; color: rgba(255,255,255,.88); }

.subtitle {
  max-width: 530px;
  margin: 22px auto 25px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .035em;
}

/* 原稿 .email-form 玻璃框，内部换成 CTA 行动入口 */
.email-form {
  width: min(100%, 370px);
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 5px;
}
.hero-cta { text-decoration: none; color: inherit; }
.hero-cta .cta-hint {
  min-width: 0;
  flex: 1;
  padding: 0 15px;
  font-size: 12px;
  color: rgba(255,255,255,.58);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 原稿 .email-form button */
.hero-cta .cta-btn {
  flex: none;
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 19px;
  font-size: 12px;
  border: 0;
  background: #f5f5ed;
  color: #142219;
  border-radius: 999px;
  font-weight: 600;
  transition: transform .2s, background .2s;
}
.hero-cta:hover .cta-btn { transform: scale(1.03); background: white; }

/* ---------- Part A · 场景选择器（原稿） ---------- */

.scene-control {
  width: min(580px, 70vw);
  margin: 2px auto 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}
.scene-line { position: absolute; left: 12.5%; right: 12.5%; bottom: 5px; height: 1px; background: rgba(255,255,255,.22); }
.scene-control button {
  border: 0; color: white; background: transparent; cursor: pointer;
  position: relative; display: flex; align-items: center; flex-direction: column; gap: 3px;
  opacity: .42; transition: opacity .4s, transform .4s;
}
.scene-control button:hover, .scene-control button.active { opacity: 1; transform: translateY(-2px); }
.scene-number { font: italic 10px "Instrument Serif", serif; letter-spacing: .08em; }
.scene-name { font: 400 14px var(--serif); }
.scene-dot {
  width: 7px; height: 7px; margin-top: 6px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%; background: transparent;
  transition: background .3s, box-shadow .3s;
}
.scene-control .active .scene-dot { background: white; box-shadow: 0 0 0 4px rgba(255,255,255,.16); }

/* ---------- Part A · Hero 页脚（原稿 footer） ---------- */

.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.52);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-footer b { font-size: 13px; margin-left: 7px; color: rgba(255,255,255,.8); }

/* ==========================================================================
   Part B — Aurora 液态玻璃工作区（保留现有优化版，原样未动）
   ========================================================================== */

/* Aurora rail 主面板卡 */
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,
    rgba(255,255,255,.20) 0%, rgba(255,255,255,.258) 24%,
    rgba(255,255,255,.252) 78%, rgba(255,255,255,.232) 100%),
    linear-gradient(180deg, rgba(4,18,27,.44) 0%, rgba(4,18,27,.30) 100%);
  backdrop-filter: blur(26px) saturate(118%);
  -webkit-backdrop-filter: blur(26px) saturate(118%);
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(4, 18, 27, 0.22), inset 0 1px rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 14px rgba(4, 18, 27, 0.55);
}

/* specular sheen 收尾：加载后扫过一次高光 */
.card::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 38%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.17) 50%, transparent 100%);
  transform: translate3d(-150%, 0, 0) skewX(-18deg);
  pointer-events: none;
  animation: sheen 1.15s var(--e-soft) 2.55s 1 both;
}
@keyframes sheen { to { transform: translate3d(260%, 0, 0) skewX(-18deg); } }

/* tool / chip 玻璃控件 */
.chip-glass, .btn-ghost, .sample-chip, .style-chip, .btn-download {
  background: rgba(255, 255, 255, 0.175);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}
.chip-glass:hover, .btn-ghost:hover, .sample-chip:hover, .style-chip:hover, .btn-download:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* ---------- ✦ 分区标签 ---------- */

.sec-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.sec-label.left { justify-content: flex-start; }
.sec-label svg { width: 12px; height: 12px; flex: none; }

/* ---------- 工作区面板 ---------- */

main.workspace {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px 90px;
}

section.panel {
  padding: 24px 26px;
  margin-bottom: 26px;
  animation: slideR 0.95s var(--e-out) both;
}
section.panel:nth-of-type(1) { animation-delay: 0.80s; }
section.panel:nth-of-type(2) { animation-delay: 0.92s; }
section.panel:nth-of-type(3) { animation-delay: 1.03s; }
section.panel:nth-of-type(4) { animation-delay: 1.14s; }
section.panel:nth-of-type(5) { animation-delay: 1.25s; }
section.panel:nth-of-type(6) { animation-delay: 1.36s; }
section.panel:nth-of-type(7) { animation-delay: 1.47s; }

@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(30px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---------- 按钮 ---------- */

.btn-ghost {
  color: var(--ink);
  padding: 0 15px;
  height: 36px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s var(--e-out), background 0.25s;
}
.btn-ghost:hover { transform: translateY(-1px) scale(1.03); }

.btn-primary, .btn-dark {
  display: block;
  width: 100%;
  border: 0;
  color: var(--ink);
  padding: 15px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  border-radius: 18px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.175);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
  transition: transform 0.25s var(--e-out), background 0.25s;
}
.btn-primary:hover, .btn-dark:hover { transform: scale(1.015); background: rgba(255, 255, 255, 0.24); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { color: var(--ink-faint); cursor: not-allowed; transform: none; }

.btn-dark { width: auto; padding: 10px 22px; font-size: 13px; letter-spacing: 0.06em; text-indent: 0; height: 36px; border-radius: 18px; }

.btn-cancel {
  background: rgba(255, 157, 138, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 180, 161, 0.45);
  color: var(--danger);
  padding: 0 20px;
  height: 36px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.2s var(--e-out), background 0.2s;
}
.btn-cancel:hover { background: rgba(255, 157, 138, 0.24); transform: scale(1.04); }

/* ---------- 上传区 ---------- */

#dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(4, 18, 27, 0.18);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
#dropzone:hover, #dropzone.dragover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.004);
}
#dropzone .dz-title { font: 500 21px var(--display); letter-spacing: 0.01em; margin-bottom: 6px; }
#dropzone .dz-sub { color: var(--ink-dim); font-size: 13.5px; }
#dropzone .dz-formats { color: var(--ink-faint); font-size: 11px; margin-top: 16px; letter-spacing: 0.14em; }

.samples { margin-top: 20px; }
.samples .label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 10px; }
.samples .row { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-dim);
  border-radius: 18px;
  padding: 0 15px;
  height: 36px;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.2s var(--e-out), background 0.25s, color 0.2s;
}
.sample-chip:hover { color: var(--ink); transform: translateY(-1px) scale(1.04); }
.sample-chip .spk { width: 12px; height: 12px; flex: none; opacity: 0.75; }
.sample-chip.playing {
  background: rgba(255, 255, 255, 0.88);
  color: #04121b;
  border-color: transparent;
}
.sample-chip.playing .spk { opacity: 1; animation: spk-beat 0.9s ease-in-out infinite; }
@keyframes spk-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* ---------- 实时录音 ---------- */

.upload-alt { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.upload-alt .or { color: var(--ink-faint); font-size: 12.5px; }
.rec-dot-inline {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 7px;
  vertical-align: 1px;
}

.recorder, .rec-preview {
  margin-top: 18px;
  background: rgba(4, 18, 27, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 18px 20px;
}
#record-level { width: 100%; height: 56px; display: block; }
.rec-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rec-row .mono { font-size: 13px; color: var(--ink); }
.rec-hint { color: var(--ink-faint); font-size: 12px; flex: 1; }
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex: none;
  animation: rec-pulse 1.1s ease-out infinite;
}
@keyframes rec-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 180, 161, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(255, 180, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 180, 161, 0); }
}

.rec-preview .label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 8px; }
.rec-actions { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.rec-actions .btn-dark { flex: 1; }
.rec-actions .btn-ghost { flex: none; }

#panel-upload.locked #dropzone,
#panel-upload.locked .samples,
#panel-upload.locked .upload-alt {
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.2s;
}

/* ---------- 等待动画 ---------- */

.busy-wave { display: flex; align-items: flex-end; gap: 4px; height: 40px; justify-content: center; margin: 14px 0; }
.busy-wave i { width: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); animation: breathe 1.4s ease-in-out infinite; height: 20%; }
.busy-wave i:nth-child(3n+2) { background: var(--gold); animation-delay: 0.18s; }
.busy-wave i:nth-child(3n)   { background: rgba(255, 255, 255, 0.4); animation-delay: 0.36s; }
.busy-wave i:nth-child(4n)   { background: #9fd4e8; animation-delay: 0.5s; }
@keyframes breathe { 0%, 100% { height: 16%; } 50% { height: 96%; } }
.busy-text { text-align: center; color: var(--ink-dim); font-size: 13px; letter-spacing: 0.08em; }

/* ---------- 识别结果 ---------- */

.species-card {
  display: flex;
  gap: 20px;
  align-items: center;
  background: rgba(4, 18, 27, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 22px 24px;
}
.species-icon {
  width: 52px; height: 52px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
}
.species-icon svg { width: 30px; height: 30px; stroke: var(--gold); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.species-names .zh { font: 500 26px var(--display); letter-spacing: 0.01em; line-height: 1.15; }
.species-names .en { color: var(--ink-dim); font-size: 14px; }
.species-names .sci { font-style: italic; color: var(--ink-faint); font-size: 13px; }
.species-meta { margin-top: 8px; font-size: 12px; color: var(--ink-dim); }

.confidence { margin-top: 20px; }
.confidence .bar { height: 5px; background: rgba(255, 255, 255, 0.16); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.confidence .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffffff, #f0d9a8); transition: width 0.8s var(--e-out); }
.confidence .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-dim); }
.confidence .warn { color: var(--danger); font-size: 12.5px; margin-top: 8px; }

.features { margin-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 18px; }
.features .label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 12px; }
.features ul { list-style: none; }
.features li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.features li:last-child { border-bottom: none; }
.features li .k { color: var(--ink-dim); }
.features li .v { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--ink); }
.features li .hint { display: block; color: var(--ink-faint); font-size: 11.5px; }

.wave-box { margin-top: 16px; }
.wave-box .label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 8px; }
canvas.waveform {
  width: 100%;
  height: 72px;
  display: block;
  background: rgba(4, 18, 27, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  cursor: pointer;
}

/* ---------- 参数面板 ---------- */

.field { margin-bottom: 22px; }
.field > .label {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.field > .label .mono { text-transform: none; letter-spacing: 0.02em; color: var(--ink-dim); }
.style-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.style-chip {
  color: var(--ink-dim);
  border-radius: 18px;
  padding: 0 15px;
  height: 36px;
  font-size: 12.5px;
  cursor: pointer;
  transition: transform 0.2s var(--e-out), background 0.25s, color 0.2s;
}
.style-chip:hover { color: var(--ink); transform: scale(1.04); }
.style-chip.active {
  background: rgba(255, 255, 255, 0.88);
  color: #04121b;
  border-color: transparent;
  font-weight: 600;
  text-shadow: none;
}

input[type="text"], textarea {
  width: 100%;
  background: rgba(4, 18, 27, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  font-family: var(--mono);
  transition: border-color 0.18s, box-shadow 0.18s;
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}
textarea { resize: vertical; line-height: 1.55; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(4, 18, 27, 0.5);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(4, 18, 27, 0.5);
}
.field .note { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }

.prompt-preview .caption {
  font-size: 13px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(240, 217, 168, 0.14);
  border: 1px solid rgba(240, 217, 168, 0.26);
  color: var(--gold);
}
.prompt-preview details { font-size: 13px; }
.prompt-preview summary { cursor: pointer; color: var(--ink-dim); font-size: 12.5px; letter-spacing: 0.06em; }
.prompt-preview textarea {
  margin-top: 10px;
  min-height: 0;
  max-height: 320px;
  font-size: 12.5px;
  line-height: 1.75;
  padding: 14px 16px;
  background: rgba(4, 18, 27, 0.22);
  resize: none;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.prompt-preview textarea::-webkit-scrollbar { width: 5px; }
.prompt-preview textarea::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.28); border-radius: 999px; }
.prompt-preview textarea::-webkit-scrollbar-track { background: transparent; }
.prompt-preview .edited-flag { color: var(--gold); font-size: 11px; margin-left: 8px; }

/* ---------- 生成进度 ---------- */

.gen-progress { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; margin-bottom: 18px; }
.gen-progress i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.7), #f0d9a8, #ffffff, #f0d9a8, rgba(255,255,255,0.7));
  background-size: 300% 100%;
  animation: flow 2.2s linear infinite, slide 3.2s ease-in-out infinite alternate;
}
@keyframes flow { to { background-position: 300% 0; } }
@keyframes slide { from { margin-left: 0; } to { margin-left: 60%; } }

.stages { list-style: none; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.stages li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  height: 36px;
  font-size: 12.5px;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  transition: all 0.3s;
}
.stages li .dot { display: none; }
.stages li.active {
  background: rgba(255, 255, 255, 0.88);
  color: #04121b;
  border-color: transparent;
  font-weight: 600;
  text-shadow: none;
  animation: pill-pulse 1.6s ease-in-out infinite;
}
.stages li.done { background: rgba(255, 255, 255, 0.2); color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
@keyframes pill-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.gen-footer { display: flex; justify-content: space-between; align-items: center; }
.gen-footer .mono { font-size: 13px; color: var(--ink-dim); }

/* ---------- 结果区 ---------- */

.result-empty {
  border: 1.5px dashed rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.14em;
  background: rgba(4, 18, 27, 0.16);
}

.player { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.btn-play {
  width: 52px; height: 52px;
  flex: none;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--e-out), background 0.25s;
}
.btn-play:hover { transform: scale(1.08); background: rgba(255, 255, 255, 0.24); }
.btn-play svg { width: 19px; height: 19px; fill: currentColor; }
.player .time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; }
.player input[type="range"] { width: 100px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.compare .cell .label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 8px; }
.compare .cell .name { color: var(--ink-dim); text-transform: none; letter-spacing: 0; }

.downloads { display: flex; gap: 12px; margin-top: 22px; align-items: center; }
.btn-download {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 12px;
  border-radius: 18px;
  font-size: 13.5px;
  transition: transform 0.2s var(--e-out), background 0.25s;
}
.btn-download:hover { transform: translateY(-1px) scale(1.03); }
#btn-regenerate { flex: 1; height: auto; padding: 12px; }

.review { margin-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 16px; font-size: 13px; color: var(--ink-dim); }
.review .row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.review .row .k { color: var(--ink-faint); flex: none; }
.review .row .v { font-family: var(--mono); font-size: 12px; text-align: right; word-break: break-all; color: var(--ink); }

/* ---------- 历史 ---------- */

#history-list { list-style: none; display: grid; gap: 10px; }
#history-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  font-size: 13.5px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  transition: transform 0.2s var(--e-out), background 0.2s, border-color 0.2s;
}
#history-list li:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.24); }
#history-list .h-name { font: 500 15px var(--display); min-width: 4em; }
#history-list .h-style { color: var(--ink-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-family: var(--mono); }
#history-list .h-meta { color: var(--ink-faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
#history-list .h-del {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 13px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  transition: all 0.15s;
}
#history-list .h-del:hover { color: var(--danger); border-color: rgba(255, 180, 161, 0.5); transform: scale(1.12); }
.history-empty { color: var(--ink-faint); font-size: 13px; padding: 14px 0; text-align: center; }

/* ---------- 页面页脚 ---------- */

.page-footer {
  position: relative;
  text-align: center;
  padding: 40px 24px 48px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(4, 18, 27, 0.5);
}
.page-footer .f-brand { font: italic 20px var(--serif-latin); color: rgba(255, 255, 255, 0.8); text-transform: none; letter-spacing: -.02em; margin-bottom: 10px; }
.page-footer .mono { font-size: 10px; margin-top: 8px; }

/* ---------- 弹窗 / toast ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 18, 27, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 70;
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.22));
  backdrop-filter: blur(26px) saturate(118%);
  -webkit-backdrop-filter: blur(26px) saturate(118%);
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(4, 18, 27, 0.4);
  max-width: 640px;
  width: calc(100vw - 48px);
  max-height: 80vh;
  overflow: auto;
  padding: 30px 34px;
  animation: riseIn 0.35s var(--e-out) both;
  text-shadow: 0 1px 10px rgba(4, 18, 27, 0.28);
}
.modal h3 { font: 500 22px var(--display); margin-bottom: 14px; }
.modal p, .modal li { font-size: 13.5px; color: var(--ink-dim); }
.modal p b { color: var(--ink); font-weight: 600; }
.modal ul { margin: 10px 0 10px 20px; }
.modal .cats { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.modal .cats span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 4px 13px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--ink-dim);
}
.modal .close-row { text-align: right; margin-top: 22px; }

#toast-root { position: fixed; top: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(180deg,
    rgba(255,255,255,.20) 0%, rgba(255,255,255,.24) 100%),
    linear-gradient(180deg, rgba(4,18,27,.58) 0%, rgba(4,18,27,.44) 100%);
  backdrop-filter: blur(22px) saturate(118%);
  -webkit-backdrop-filter: blur(22px) saturate(118%);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(4, 18, 27, 0.4), inset 0 1px rgba(255, 255, 255, 0.18);
  color: var(--ink);
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.55;
  max-width: 380px;
  text-shadow: 0 1px 10px rgba(4, 18, 27, 0.5);
  animation: slide-in 0.35s var(--e-out);
}
.toast::before {
  content: '';
  flex: none;
  width: 7px; height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: #ff9d8a;
  box-shadow: 0 0 8px rgba(255, 157, 138, 0.6);
}
.toast.info::before {
  background: #b8e6d9;
  box-shadow: 0 0 8px rgba(184, 230, 217, 0.6);
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

[hidden] { display: none !important; }

/* ---------- 响应式（原稿 760px / 短屏断点 + 工作区适配） ---------- */

@media (max-width: 760px) {
  .nav { padding: 22px 20px 0; }
  .desktop-nav { display: none; }
  .menu-toggle { display: block; }
  .hero { padding: 96px 20px 18px; min-height: 100svh; }
  .hero-copy { transform: translateY(8px); }
  .eyebrow { font-size: 9px; margin-bottom: 17px; }
  .hero-title { font-size: clamp(42px, 13vw, 62px); line-height: 1.06; }
  .subtitle { max-width: 335px; margin: 18px auto 20px; font-size: 12px; line-height: 1.7; }
  .scene-control { width: 100%; margin-bottom: 20px; }
  .scene-name { font-size: 13px; }
  .scene-number { font-size: 9px; }
  .hero-footer { justify-content: center; }
  .hero-footer .hf-center, .hero-footer span:last-child { display: none; }
  main.workspace { padding: 12px 16px 60px; }
  section.panel { padding: 20px; }
  .compare { grid-template-columns: 1fr; }
  .downloads { flex-direction: column; }
  .species-card { flex-direction: column; align-items: flex-start; }
  .rec-actions { flex-direction: column; }
}
@media (max-height: 700px) and (min-width: 761px) {
  .hero-copy { transform: none; }
  .eyebrow { margin-bottom: 10px; }
  .hero-title { font-size: 58px; }
  .subtitle { margin: 14px auto; }
  .scene-control { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; animation-delay: 0s !important; }
  .card::after { display: none; }
}
