/* ==========================================================================
   Nova Voice Lab — 声波实验室
   深色底 + 青绿荧光 + 玻璃卡片；不依赖任何外部 CDN（内网 / ECS 直连可用）
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-2: #0e1524;
  --bg-3: #131d2e;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --indigo: #6366f1;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --info: #38bdf8;

  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --glass: linear-gradient(158deg, rgba(24, 36, 56, 0.86), rgba(13, 20, 34, 0.78));
  --glass-soft: linear-gradient(158deg, rgba(30, 43, 66, 0.6), rgba(14, 21, 36, 0.55));
  --shadow: 0 24px 60px -28px rgba(2, 6, 23, 0.95);
  --shadow-lift: 0 30px 80px -30px rgba(34, 211, 238, 0.35);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;

  --font: "Poppins", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0.2px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.22; }
h2 { font-size: 18px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 背景 */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(900px 600px at 88% 8%, rgba(99, 102, 241, 0.14), transparent 62%),
    radial-gradient(800px 600px at 60% 110%, rgba(163, 230, 53, 0.07), transparent 65%),
    linear-gradient(180deg, #070b14, #060a12 60%, #05080f);
}
.aurora__blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora__blob--cyan { width: 460px; height: 460px; left: -120px; top: -80px; background: rgba(34, 211, 238, 0.24); }
.aurora__blob--indigo { width: 520px; height: 520px; right: -160px; top: 60px; background: rgba(99, 102, 241, 0.22); animation-delay: -7s; }
.aurora__blob--lime { width: 380px; height: 380px; left: 38%; bottom: -200px; background: rgba(163, 230, 53, 0.14); animation-delay: -12s; }
.aurora__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(circle at 50% 0%, #000 20%, transparent 78%);
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.08); }
}

/* ---------------------------------------------------------------- 通用 */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__mark {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: var(--cyan);
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.18), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px -14px rgba(34, 211, 238, 0.8);
}
.brand__mark svg { width: 26px; height: 26px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 15px; letter-spacing: 0.4px; }
.brand__text small { font-size: 11px; color: var(--text-3); letter-spacing: 0.5px; }

.btn {
  --btn-bg: rgba(148, 163, 184, 0.08);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--text); font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, opacity 0.2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid rgba(34, 211, 238, 0.7); outline-offset: 2px; }
.btn--primary {
  background: linear-gradient(120deg, var(--cyan), #5eead4 55%, var(--lime));
  color: #04121a; font-weight: 600;
  box-shadow: 0 16px 34px -18px rgba(34, 211, 238, 0.9);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 22px 44px -18px rgba(34, 211, 238, 0.95); }
.btn--outline {
  background: transparent; border-color: rgba(34, 211, 238, 0.35);
  color: #c8f7ff;
}
.btn--outline:hover:not(:disabled) { background: rgba(34, 211, 238, 0.1); }
.btn--ghost { background: rgba(148, 163, 184, 0.08); border-color: var(--line); color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.btn--sm { padding: 8px 14px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn.is-busy { color: transparent; position: relative; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(4, 18, 26, 0.35); border-top-color: #04121a;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; color: var(--text-2); letter-spacing: 0.3px; }
.field input, .field select {
  width: 100%; padding: 11px 14px; border-radius: var(--r-sm);
  background: rgba(7, 11, 20, 0.62); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus, .field select:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
  background: rgba(7, 11, 20, 0.85);
}
.field select { appearance: none; cursor: pointer; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.6; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(148, 163, 184, 0.07);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; }
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}
.chip--model { border-color: rgba(34, 211, 238, 0.28); background: rgba(34, 211, 238, 0.09); color: #a5f3fc; }
.chip--model b { color: #ecfeff; }
.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2);
}
.pill--lime { color: #d9f99d; border-color: rgba(163, 230, 53, 0.32); background: rgba(163, 230, 53, 0.1); }
.pill--indigo { color: #c7d2fe; border-color: rgba(99, 102, 241, 0.34); background: rgba(99, 102, 241, 0.12); }

.segmented {
  display: grid; grid-auto-flow: column; gap: 4px; padding: 4px;
  background: rgba(7, 11, 20, 0.55); border: 1px solid var(--line);
  border-radius: 999px;
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; transition: background 0.18s ease, color 0.18s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(99, 102, 241, 0.18));
  color: #e6feff; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}
.segmented--sm { padding: 3px; }
.segmented--sm button { padding: 6px 12px; font-size: 12px; }

.glow {
  background: linear-gradient(100deg, #a5f3fc, var(--cyan) 40%, var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 42px rgba(34, 211, 238, 0.25);
}

/* ---------------------------------------------------------------- 登录 */
.page-login { display: grid; min-height: 100vh; }
.login {
  width: min(1160px, 100%); margin: auto; padding: clamp(24px, 5vw, 64px);
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.login__hero { display: flex; flex-direction: column; gap: 22px; animation: rise 0.6s ease both; }
.login__hero h1 { margin-top: 6px; }
.login__lede { max-width: 46ch; color: var(--text-2); font-size: 15px; line-height: 1.75; }

.wave-demo { display: flex; align-items: center; gap: 5px; height: 64px; }
.wave-demo span {
  width: 4px; height: 18%; border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), rgba(99, 102, 241, 0.35));
  animation: bar 1.6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}
.wave-demo span:nth-child(3n) { animation-duration: 1.1s; }
.wave-demo span:nth-child(4n) { animation-duration: 2.1s; background: linear-gradient(180deg, var(--lime), rgba(34, 211, 238, 0.3)); }
.wave-demo span:nth-child(5n) { animation-duration: 1.35s; }
.wave-demo span:nth-child(2n) { animation-delay: -0.4s; }
.wave-demo span:nth-child(7n) { animation-delay: -0.9s; }
@keyframes bar {
  0%, 100% { height: 14%; opacity: 0.55; }
  50% { height: 100%; opacity: 1; }
}

.login__steps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.login__steps li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid transparent; background: rgba(148, 163, 184, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.login__steps li:hover { border-color: var(--line); background: rgba(148, 163, 184, 0.07); transform: translateX(3px); }
.login__steps b {
  font-family: var(--mono); font-size: 12px; color: var(--cyan);
  padding-top: 2px; letter-spacing: 1px;
}
.login__steps span { font-size: 14px; font-weight: 500; }
.login__steps small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; margin-top: 2px; }

.login__panel {
  padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 20px;
  animation: rise 0.6s 0.08s ease both;
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, 0.06), 0 40px 120px -60px rgba(34, 211, 238, 0.5);
}
.login__panel form { display: flex; flex-direction: column; gap: 14px; }
.login__note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(56, 189, 248, 0.06); border: 1px solid rgba(56, 189, 248, 0.18);
  color: var(--text-2); font-size: 12px; line-height: 1.65;
}
.login__note svg { flex: none; color: var(--info); margin-top: 1px; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- 工作台 */
.page-studio { min-height: 100vh; padding: 18px clamp(14px, 3vw, 34px) 60px; }

.topbar {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; border-radius: 18px;
  background: linear-gradient(120deg, rgba(16, 26, 42, 0.92), rgba(10, 16, 28, 0.82));
}
.topbar__meta { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brand--sm .brand__mark { width: 34px; height: 34px; border-radius: 11px; }
.brand--sm .brand__mark svg { width: 22px; height: 22px; }
.brand--sm .brand__text strong { font-size: 13.5px; }
.brand--sm .brand__text small { font-size: 10.5px; }

.tabs { display: flex; gap: 6px; margin: 20px auto 0; width: min(1240px, 100%); }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-3);
  font-size: 13.5px; transition: all 0.2s ease;
}
.tab:hover { color: var(--text-2); background: rgba(148, 163, 184, 0.06); }
.tab.is-active {
  color: #e6feff; border-color: rgba(34, 211, 238, 0.3);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.16), rgba(99, 102, 241, 0.14));
  box-shadow: 0 10px 30px -18px rgba(34, 211, 238, 0.9);
}

.studio { width: min(1240px, 100%); margin: 18px auto 0; }
.view { display: none; }
.view.is-active { display: block; animation: fade 0.32s ease both; }
@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.train-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; align-items: start; }
.train-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { padding: 18px 20px; }
.card h2 { font-size: 16px; }

.step__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.step__head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.step__no {
  flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  color: var(--cyan); padding: 3px 7px; border-radius: 7px;
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.22);
}

.corpus-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat {
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--glass-soft); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.stat__label { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.4px; }
.stat b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { font-size: 11px; color: var(--text-3); }
.stat.is-ready b { color: var(--lime); }
.stat.is-short b { color: var(--warn); }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.model-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 12px 13px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid var(--line); background: rgba(148, 163, 184, 0.04);
  transition: all 0.18s ease;
}
.model-card input { position: absolute; opacity: 0; pointer-events: none; }
.model-card b { font-size: 13.5px; letter-spacing: 0.6px; }
.model-card small { font-size: 11px; color: var(--text-3); line-height: 1.45; }
.model-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.model-card.is-active, .model-card:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.16), rgba(99, 102, 241, 0.1));
  box-shadow: 0 12px 30px -20px rgba(34, 211, 238, 0.9);
}
.model-card.is-active b { color: #a5f3fc; }

.param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0 16px; }
.param-grid .field:last-child { grid-column: span 2; }

.run-card { display: flex; flex-direction: column; gap: 14px; }
.run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.run-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; word-break: break-all; }
.badge {
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2); background: rgba(148, 163, 184, 0.07);
  white-space: nowrap;
}
.badge[data-state="running"] { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.12); }
.badge[data-state="running"]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); margin-right: 6px; animation: blink 1.2s ease-in-out infinite;
}
.badge[data-state="succeeded"] { color: #bbf7d0; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.12); }
.badge[data-state="failed"] { color: #fecaca; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.12); }
.badge[data-state="stopped"], .badge[data-state="interrupted"] { color: #fde68a; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.1); }
@keyframes blink { 50% { opacity: 0.25; } }

.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric-row > div {
  padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(7, 11, 20, 0.4); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.metric-row span { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.6px; }
.metric-row b { font-size: 19px; font-variant-numeric: tabular-nums; }

.chart-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.legend { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-3); }
.legend__line { width: 18px; height: 2px; border-radius: 2px; background: var(--cyan); }
.legend__line--dash { background: transparent; border-top: 2px dashed var(--lime); height: 0; }

.chart-wrap {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.2), rgba(7, 11, 20, 0.55)),
    radial-gradient(600px 240px at 50% 0%, rgba(34, 211, 238, 0.09), transparent 70%);
  border: 1px solid var(--line);
  min-height: 240px;
}
.chart-wrap canvas { display: block; width: 100%; height: 300px; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-3); font-size: 12.5px; pointer-events: none;
}
.chart-empty[hidden] { display: none; }

.run-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.log { border-top: 1px solid var(--line); padding-top: 10px; }
.log summary {
  cursor: pointer; font-size: 12px; color: var(--text-3); user-select: none;
  list-style: none;
}
.log summary::-webkit-details-marker { display: none; }
.log summary::before { content: "▸ "; color: var(--cyan); }
.log[open] summary::before { content: "▾ "; }
.log pre {
  margin: 10px 0 0; padding: 12px; max-height: 220px; overflow: auto;
  background: rgba(3, 7, 14, 0.75); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-family: var(--mono); font-size: 11.5px;
  color: #cbd5e1; white-space: pre-wrap; word-break: break-all;
}

.runs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.run-list { display: flex; flex-direction: column; gap: 6px; }
.run-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent; background: rgba(148, 163, 184, 0.04);
  transition: all 0.16s ease;
}
.run-row:hover { border-color: var(--line); background: rgba(148, 163, 184, 0.08); transform: translateX(2px); }
.run-row.is-active { border-color: rgba(34, 211, 238, 0.45); background: rgba(34, 211, 238, 0.09); }
.run-row__model {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px; color: var(--cyan);
  padding: 2px 7px; border-radius: 6px; background: rgba(34, 211, 238, 0.1);
}
.run-row__id { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.run-row__acc { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.run-row__state { font-size: 11px; color: var(--text-3); }
.run-list__empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---------------------------------------------------------------- 测试台 */
.test-stage { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.test-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.test-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.mic-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px 10px 10px;
}
.mic-rings { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; pointer-events: none; }
.mic-rings span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.25); opacity: 0;
}
.mic-stage.is-listening .mic-rings span { animation: ring 2.4s ease-out infinite; }
.mic-stage.is-listening .mic-rings span:nth-child(2) { animation-delay: 0.8s; }
.mic-stage.is-listening .mic-rings span:nth-child(3) { animation-delay: 1.6s; }
@keyframes ring {
  0% { transform: scale(0.62); opacity: 0.75; }
  100% { transform: scale(1.35); opacity: 0; }
}

.mic {
  width: 124px; height: 124px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(34, 211, 238, 0.4); color: #04121a;
  background: radial-gradient(circle at 32% 26%, #a5f3fc, var(--cyan) 45%, #0e7490 100%);
  display: grid; place-items: center; position: relative; z-index: 1;
  box-shadow: 0 24px 60px -22px rgba(34, 211, 238, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.mic svg { width: 42px; height: 42px; }
.mic:hover { transform: translateY(-2px) scale(1.02); }
.mic:active { transform: scale(0.98); }
.mic:focus-visible { outline: 3px solid rgba(34, 211, 238, 0.5); outline-offset: 5px; }
.mic-stage.is-listening .mic {
  background: radial-gradient(circle at 32% 26%, #fecdd3, #fb7185 45%, #9f1239 100%);
  box-shadow: 0 24px 70px -18px rgba(251, 113, 133, 0.8);
  animation: micGlow 2s ease-in-out infinite;
}
/* 只呼吸光晕、不缩放，避免点击热区一直在动 */
@keyframes micGlow {
  0%, 100% { box-shadow: 0 24px 70px -18px rgba(251, 113, 133, 0.75), 0 0 0 0 rgba(251, 113, 133, 0.35); }
  50% { box-shadow: 0 24px 70px -18px rgba(251, 113, 133, 0.95), 0 0 0 14px rgba(251, 113, 133, 0); }
}
.mic-stage.is-hit .mic {
  background: radial-gradient(circle at 32% 26%, #ecfccb, var(--lime) 45%, #3f6212 100%);
  box-shadow: 0 0 0 10px rgba(163, 230, 53, 0.12), 0 26px 70px -18px rgba(163, 230, 53, 0.9);
}
.mic-stage.is-hit { animation: hitflash 0.5s ease; }
@keyframes hitflash {
  0% { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}

.mic-status { font-size: 14px; color: var(--text-2); min-height: 22px; text-align: center; }
.mic-status b { color: #d9f99d; }
.test-wave { width: 100%; height: 90px; opacity: 0.9; }
.test-foot { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.slider { display: flex; flex-direction: column; gap: 8px; }
.slider > span { font-size: 12px; color: var(--text-2); }
.slider b { color: var(--cyan); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.7), rgba(99, 102, 241, 0.5));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: #e6feff; border: 2px solid var(--cyan); cursor: pointer;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.15);
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: #e6feff;
  border: 2px solid var(--cyan); cursor: pointer;
}

.hits { display: flex; flex-direction: column; gap: 6px; }
.hits__empty { font-size: 12px; color: var(--text-3); }
.hit {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  font-size: 11.5px; color: var(--text-2); animation: fade 0.3s ease both;
}
.hit__time { font-family: var(--mono); color: var(--text-3); }
.hit__bar { height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); overflow: hidden; }
.hit__bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.hit__p { font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------------------------------------------------------------- 录制抽屉 */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(3, 7, 14, 0.72); backdrop-filter: blur(6px); }
.sheet__panel {
  position: relative; width: min(920px, 100%); max-height: min(88vh, 780px);
  overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  animation: rise 0.28s ease both;
}
.sheet__head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.sheet__head p { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; flex: none; cursor: pointer;
  border: 1px solid var(--line); background: rgba(148, 163, 184, 0.08);
  color: var(--text-2); font-size: 20px; line-height: 1;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* 合成语料（豆包 TTS） */
.synth {
  padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(150deg, rgba(56, 189, 248, 0.07), rgba(99, 102, 241, 0.06));
  display: flex; flex-direction: column; gap: 10px;
}
.synth__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.synth__head b { font-size: 13.5px; }
.synth__head p { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.synth__ctl {
  display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(72px, 0.5fr)) auto;
  gap: 10px; align-items: end;
}
.synth__ctl .field > span { font-size: 11px; }
.synth__ctl .field input:disabled { opacity: 0.45; cursor: not-allowed; }
.synth__ctl .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .synth__ctl { grid-template-columns: 1fr 1fr; }
  .synth__ctl .btn { grid-column: span 2; }
}

.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.record-card {
  padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--glass-soft); display: flex; flex-direction: column; gap: 10px;
}
.record-card__head { display: flex; align-items: center; justify-content: space-between; }
.record-card__head b { font-size: 14px; }
.record-btn {
  margin: 4px auto 0; width: 84px; height: 84px; border-radius: 50%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid rgba(34, 211, 238, 0.35); color: #04121a;
  background: radial-gradient(circle at 34% 28%, #a5f3fc, var(--cyan) 50%, #0e7490);
  box-shadow: 0 16px 40px -20px rgba(34, 211, 238, 0.85);
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.record-btn svg { width: 26px; height: 26px; }
.record-btn span { font-size: 10px; letter-spacing: 0.3px; }
.record-btn:hover { transform: translateY(-2px); }
.record-card[data-label="neg"] .record-btn {
  border-color: rgba(99, 102, 241, 0.45);
  background: radial-gradient(circle at 34% 28%, #c7d2fe, var(--indigo) 50%, #312e81);
  box-shadow: 0 16px 40px -20px rgba(99, 102, 241, 0.9);
  color: #eef2ff;
}
.record-card.is-recording .record-btn {
  background: radial-gradient(circle at 34% 28%, #fecdd3, #fb7185 50%, #9f1239);
  color: #fff1f2; animation: recGlow 1.6s ease-in-out infinite;
}
@keyframes recGlow {
  0%, 100% { box-shadow: 0 16px 40px -20px rgba(251, 113, 133, 0.8), 0 0 0 0 rgba(251, 113, 133, 0.3); }
  50% { box-shadow: 0 16px 40px -20px rgba(251, 113, 133, 0.95), 0 0 0 10px rgba(251, 113, 133, 0); }
}
.record-wave {
  width: 100%; height: 64px; border-radius: var(--r-sm);
  background: rgba(3, 7, 14, 0.55); border: 1px solid var(--line);
}
.record-status { font-size: 11.5px; color: var(--text-3); text-align: center; min-height: 18px; }
.record-status.is-error { color: var(--bad); }
.record-status.is-ok { color: var(--ok); }

.clip-list { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow: auto; }
.clip {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 9px; background: rgba(148, 163, 184, 0.05);
  font-size: 11.5px; color: var(--text-3);
}
.clip__play {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line);
  background: rgba(34, 211, 238, 0.08); color: #a5f3fc; display: grid; place-items: center;
}
.clip__play:hover { background: rgba(34, 211, 238, 0.18); }
.clip__name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip__tag {
  font-style: normal; font-size: 10px; letter-spacing: 0.3px;
  color: #a5f3fc; background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 1px 5px; border-radius: 999px; margin-right: 6px;
}
.clip__dur { font-variant-numeric: tabular-nums; }
.clip__del {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 4px;
}
.clip__del:hover { color: var(--bad); }

.sheet__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 11px 18px; border-radius: 999px; z-index: 90;
  background: rgba(15, 23, 42, 0.94); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(90vw, 560px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(248, 113, 113, 0.5); color: #fee2e2; }
.toast.is-ok { border-color: rgba(52, 211, 153, 0.45); color: #d1fae5; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1200px) {
  .train-grid { grid-template-columns: 350px minmax(0, 1fr); }
  .login { grid-template-columns: 1fr 0.9fr; }
}
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; gap: 32px; }
  .login__panel { order: -1; }
  .login__hero { gap: 16px; }
  .wave-demo { height: 46px; }
  .train-grid { grid-template-columns: 1fr; }
  .train-col--wide { order: 2; }
}
@media (max-width: 720px) {
  .page-studio { padding: 12px 12px 96px; }
  .topbar { border-radius: 14px; padding: 8px 10px; gap: 10px; }
  .brand__text strong { white-space: nowrap; }
  .brand--sm .brand__text small { display: none; }
  .chip { padding: 5px 9px; font-size: 11.5px; }
  .tabs {
    position: fixed; left: 12px; right: 12px; bottom: 12px; margin: 0; z-index: 40;
    padding: 6px; border-radius: 999px; background: rgba(10, 16, 28, 0.92);
    border: 1px solid var(--line); backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
  }
  .tab { flex: 1; justify-content: center; }
  .param-grid { grid-template-columns: 1fr; }
  .param-grid .field:last-child { grid-column: auto; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .record-grid { grid-template-columns: 1fr; }
  .sheet { padding: 8px; }
  .sheet__panel { max-height: 92vh; padding: 16px; }
  .mic { width: 108px; height: 108px; }
  .mic svg { width: 36px; height: 36px; }
  .chart-wrap canvas { height: 240px; }
  .run-actions { justify-content: stretch; }
  .run-actions .btn { flex: 1; }
  .run-row { grid-template-columns: auto 1fr auto; }
  .run-row__state { display: none; }
}

@media (max-width: 560px) {
  /* 极窄屏只留 logo，把横向空间让给昵称与当前模型 */
  .brand--sm .brand__text { display: none; }
  .topbar__meta { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
