/* ==========================================================================
   电话朋友 · Voice Studio 高定视觉系统
   三大主题：黑金夜语 (obsidian) · 极光丝绸 (aurora) · 暖白书房 (paper)
   双端自适应：移动端原生沉浸交互 + 桌面端宽屏工作室分栏
   ========================================================================== */

:root,
html[data-theme="obsidian"] {
  --bg: #09090c;
  --bg-2: #121118;
  --surface: rgba(255, 249, 240, 0.042);
  --surface-elevated: rgba(255, 249, 240, 0.072);
  --surface-hover: rgba(255, 249, 240, 0.09);
  --surface-solid: #16151d;
  --surface-card-mobile: rgba(24, 22, 32, 0.9);
  --surface-panel: rgba(20, 18, 26, 0.94);
  --rail-bg: rgba(15, 14, 20, 0.78);
  --dock-bg: rgba(18, 17, 24, 0.84);
  --input-bg: rgba(0, 0, 0, 0.32);
  --line: rgba(255, 245, 230, 0.092);
  --line-strong: rgba(255, 242, 222, 0.19);
  --rim: rgba(255, 250, 240, 0.09);
  --text: #faf6f0;
  --muted: #a1998f;
  --faint: #6c655d;
  --accent: #f0c588;
  --accent-2: #ff8573;
  --accent-ink: #1e130b;
  --accent-soft: rgba(240, 197, 136, 0.13);
  --accent-border: rgba(240, 197, 136, 0.42);
  --ipa: #b4beff;
  --green: #45db91;
  --green-soft: rgba(69, 219, 145, 0.14);
  --danger: #ff707a;
  --danger-soft: rgba(255, 112, 122, 0.14);
  --gradient: linear-gradient(135deg, #f8dba9 0%, #efbe7f 46%, #ff8b78 100%);
  --glow-1: rgba(235, 168, 96, 0.22);
  --glow-2: rgba(255, 118, 102, 0.15);
  --glow-3: rgba(126, 142, 215, 0.11);
  --grid-line: rgba(255, 248, 236, 0.028);
  --shadow-card: 0 18px 42px -24px rgba(0, 0, 0, 0.82), inset 0 1px 0 var(--rim);
  --shadow-float: 0 26px 56px -18px rgba(0, 0, 0, 0.88), inset 0 1px 0 rgba(255, 250, 240, 0.12);
  --bubble-romy: linear-gradient(180deg, rgba(255, 250, 242, 0.095), rgba(255, 250, 242, 0.055));
  --bubble-you: linear-gradient(135deg, rgba(240, 197, 136, 0.2), rgba(255, 133, 115, 0.14));
  --bubble-you-border: rgba(240, 197, 136, 0.3);
  --modal-scrim: rgba(4, 4, 8, 0.76);
  --modal-card-bg: linear-gradient(180deg, #1b1924 0%, #14121b 100%);
}

html[data-theme="aurora"] {
  --bg: #060913;
  --bg-2: #0d1324;
  --surface: rgba(230, 244, 255, 0.045);
  --surface-elevated: rgba(230, 244, 255, 0.08);
  --surface-hover: rgba(230, 244, 255, 0.1);
  --surface-solid: #101729;
  --surface-card-mobile: rgba(16, 24, 46, 0.9);
  --surface-panel: rgba(13, 19, 36, 0.94);
  --rail-bg: rgba(10, 15, 29, 0.8);
  --dock-bg: rgba(13, 19, 36, 0.86);
  --input-bg: rgba(2, 6, 16, 0.42);
  --line: rgba(206, 228, 255, 0.1);
  --line-strong: rgba(206, 228, 255, 0.22);
  --rim: rgba(220, 240, 255, 0.1);
  --text: #f1f6ff;
  --muted: #93a3c0;
  --faint: #5f6f8e;
  --accent: #6ce8d4;
  --accent-2: #8fa6ff;
  --accent-ink: #07191c;
  --accent-soft: rgba(108, 232, 212, 0.13);
  --accent-border: rgba(108, 232, 212, 0.44);
  --ipa: #aec0ff;
  --green: #4be3a8;
  --green-soft: rgba(75, 227, 168, 0.14);
  --danger: #ff7385;
  --danger-soft: rgba(255, 115, 133, 0.14);
  --gradient: linear-gradient(135deg, #92f7e6 0%, #63dad2 48%, #8ea4ff 100%);
  --glow-1: rgba(72, 222, 198, 0.22);
  --glow-2: rgba(116, 140, 255, 0.22);
  --glow-3: rgba(176, 132, 255, 0.13);
  --grid-line: rgba(200, 230, 255, 0.032);
  --shadow-card: 0 18px 42px -24px rgba(0, 4, 16, 0.86), inset 0 1px 0 var(--rim);
  --shadow-float: 0 26px 56px -18px rgba(0, 4, 18, 0.9), inset 0 1px 0 rgba(220, 240, 255, 0.13);
  --bubble-romy: linear-gradient(180deg, rgba(220, 238, 255, 0.1), rgba(220, 238, 255, 0.055));
  --bubble-you: linear-gradient(135deg, rgba(108, 232, 212, 0.2), rgba(143, 166, 255, 0.16));
  --bubble-you-border: rgba(108, 232, 212, 0.34);
  --modal-scrim: rgba(3, 6, 14, 0.78);
  --modal-card-bg: linear-gradient(180deg, #131b30 0%, #0d1324 100%);
}

html[data-theme="paper"] {
  --bg: #f4efe7;
  --bg-2: #ebe4d8;
  --surface: rgba(255, 253, 249, 0.82);
  --surface-elevated: #ffffff;
  --surface-hover: rgba(255, 255, 255, 0.96);
  --surface-solid: #fffdf9;
  --surface-card-mobile: rgba(255, 253, 249, 0.95);
  --surface-panel: rgba(252, 249, 243, 0.97);
  --rail-bg: rgba(252, 249, 243, 0.85);
  --dock-bg: rgba(255, 253, 249, 0.9);
  --input-bg: rgba(40, 30, 20, 0.045);
  --line: rgba(42, 33, 24, 0.095);
  --line-strong: rgba(42, 33, 24, 0.2);
  --rim: rgba(255, 255, 255, 0.88);
  --text: #1c1814;
  --muted: #655c53;
  --faint: #988e83;
  --accent: #cb573b;
  --accent-2: #de8a44;
  --accent-ink: #fffaf5;
  --accent-soft: rgba(203, 87, 59, 0.11);
  --accent-border: rgba(203, 87, 59, 0.36);
  --ipa: #5261a8;
  --green: #1f8a5b;
  --green-soft: rgba(31, 138, 91, 0.12);
  --danger: #d43f4b;
  --danger-soft: rgba(212, 63, 75, 0.12);
  --gradient: linear-gradient(135deg, #db6747 0%, #c95136 52%, #e08d4b 100%);
  --glow-1: rgba(226, 152, 102, 0.26);
  --glow-2: rgba(208, 108, 86, 0.16);
  --glow-3: rgba(114, 165, 146, 0.16);
  --grid-line: rgba(42, 33, 24, 0.032);
  --shadow-card: 0 14px 32px -22px rgba(52, 38, 24, 0.22), 0 1px 2px rgba(42, 33, 24, 0.05), inset 0 1px 0 var(--rim);
  --shadow-float: 0 22px 46px -18px rgba(42, 32, 22, 0.24), 0 2px 6px rgba(42, 33, 24, 0.06);
  --bubble-romy: #ffffff;
  --bubble-you: linear-gradient(135deg, rgba(203, 87, 59, 0.12), rgba(222, 138, 68, 0.1));
  --bubble-you-border: rgba(203, 87, 59, 0.22);
  --modal-scrim: rgba(24, 18, 12, 0.44);
  --modal-card-bg: #fffdf9;
}

:root {
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Noto Serif SC", serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Monaco, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.45s var(--ease), color 0.35s var(--ease);
}
body { overscroll-behavior: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.display-serif { font-family: var(--font-serif); letter-spacing: -0.02em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.accent-italic {
  font-style: italic;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= 氛围光影与建筑网格背景 ================= */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb-glow {
  position: absolute;
  border-radius: 50%;
  animation: slowDrift 26s ease-in-out infinite alternate;
  transition: opacity 0.9s var(--ease);
  will-change: transform, opacity;
}
.orb-glow.g1 { width: 84vmax; height: 84vmax; top: -36vmax; left: -24vmax; background: radial-gradient(circle, var(--glow-1) 0%, transparent 66%); }
.orb-glow.g2 { width: 78vmax; height: 78vmax; bottom: -38vmax; right: -22vmax; background: radial-gradient(circle, var(--glow-2) 0%, transparent 66%); animation-delay: -9s; }
.orb-glow.g3 { width: 56vmax; height: 56vmax; top: 26%; left: 48%; background: radial-gradient(circle, var(--glow-3) 0%, transparent 66%); animation-delay: -17s; }

body[data-call-state="listening"] .orb-glow.g1 { background: radial-gradient(circle, rgba(69, 219, 145, 0.24) 0%, transparent 66%); }
body[data-call-state="thinking"] .orb-glow.g2 { background: radial-gradient(circle, rgba(162, 142, 255, 0.25) 0%, transparent 66%); }
body[data-call-state="speaking"] .orb-glow.g1 { opacity: 1.35; }
body.hearing .orb-glow.g1 { background: radial-gradient(circle, rgba(69, 219, 145, 0.34) 0%, transparent 66%); }

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 0%, transparent 80%);
}
.ambient .grain {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes slowDrift { to { transform: translate(5vmax, 4vmax) scale(1.07); } }

/* ================= 通用卡片、按钮、表单 ================= */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.glow-card { position: relative; overflow: hidden; }
.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, -300px) var(--my, -300px), var(--accent-soft), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.glow-card > * { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .glow-card:hover::before { opacity: 1; }
}

.muted { color: var(--muted); font-size: 14px; line-height: 1.58; margin: 0; }
.lead { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 12px 0 24px; }
.fineprint { color: var(--faint); font-size: 12px; line-height: 1.6; margin: 6px 0 0; text-align: center; }
.error { color: var(--danger); font-size: 13.5px; min-height: 1em; margin: 0; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-elevated);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s var(--spring), background 0.22s, border-color 0.22s, box-shadow 0.25s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn.lg { padding: 15px 22px; font-size: 15.5px; border-radius: 16px; }
.btn.small { width: auto; padding: 9px 17px; font-size: 14px; border-radius: 13px; }
.btn.glass { background: var(--surface); border-color: var(--line); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.primary {
  border: none;
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 660;
  box-shadow: 0 12px 30px -12px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.3) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.65s var(--ease);
  pointer-events: none;
}
.btn.danger {
  border: 1px solid rgba(255, 112, 122, 0.4);
  background: linear-gradient(145deg, #ff6c77, #df3b4b);
  color: #fff;
  font-weight: 620;
  box-shadow: 0 10px 24px -10px rgba(223, 59, 75, 0.6);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-strong); background: var(--surface-hover); }
  .btn.primary:hover:not(:disabled) {
    background: var(--gradient);
    box-shadow: 0 16px 36px -10px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  .btn.primary:hover:not(:disabled)::after { transform: translateX(120%); }
  .btn.danger:hover:not(:disabled) { background: linear-gradient(145deg, #ff7d87, #e74656); }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.16s var(--spring);
}
.icon-btn:active { transform: scale(0.92); background: var(--surface-elevated); }
@media (hover: hover) {
  .icon-btn:hover { background: var(--surface-elevated); border-color: var(--line); color: var(--text); }
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.char-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
input, textarea, select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea { resize: vertical; line-height: 1.6; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
::placeholder { color: var(--faint); }

/* ================= 登录页与角色定制页 ================= */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px 44px;
  animation: tabIn 0.36s var(--ease);
}
.auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
}
.auth-shell {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; font-weight: 600; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 8px 20px -8px var(--accent-border); }
.brand-tag {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
}
.auth-orb-badge {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 26px 0 20px;
  display: grid;
  place-items: center;
}
.auth-orb-core {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 28px var(--accent-border), inset 0 2px 8px rgba(255, 255, 255, 0.5);
  animation: breathe 4s ease-in-out infinite;
}
.auth-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-border);
  animation: pulseRing 3s var(--ease) infinite;
}
.auth-orb-ring.r2 { animation-delay: 1.5s; }
.auth h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.15; font-weight: 700; }
.auth-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.pillar {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pillar b { display: block; font-family: var(--font-mono); font-size: 15px; color: var(--accent); }
.pillar span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.form-intro h2 { margin: 0 0 4px; font-size: 20px; font-weight: 680; }

.page-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.2; }
.page-head .icon-btn { margin: 4px 0 0 -8px; }

.char-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}
.char-preview-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.char-avatar-stage { position: relative; display: grid; place-items: center; }
.char-avatar {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  box-shadow: 0 16px 36px -12px var(--accent-border), inset 0 2px 10px rgba(255, 255, 255, 0.45);
}
.char-avatar.playing::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: pulseRing 1.4s var(--ease) infinite;
}
.char-preview-meta b { display: block; font-size: 22px; }
.char-preview-meta span { display: block; margin-top: 4px; font-size: 13px; }
.eq-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-top: 10px; opacity: 0.25; transition: opacity 0.25s; }
.eq-bars.playing { opacity: 1; }
.eq-bars i { width: 3px; height: 4px; border-radius: 99px; background: var(--accent); }
.eq-bars.playing i { animation: eqBounce 0.72s ease-in-out infinite alternate; }
.eq-bars.playing i:nth-child(2) { animation-delay: 0.14s; }
.eq-bars.playing i:nth-child(3) { animation-delay: 0.28s; }
.eq-bars.playing i:nth-child(4) { animation-delay: 0.08s; }
.eq-bars.playing i:nth-child(5) { animation-delay: 0.22s; }
@keyframes eqBounce { 0% { height: 4px; } 100% { height: 18px; } }

.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.preset-chips button {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.preset-chips button:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); }
.preset-chips button:active { transform: scale(0.95); }
.form-row-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* ================= 主应用壳：移动端单栏 + 桌面端左侧栏工作室 ================= */
.app { min-height: 100dvh; display: flex; }
.side-rail { display: none; }
.app-main { flex: 1; min-width: 0; }
.tab {
  max-width: 600px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(106px + env(safe-area-inset-bottom));
}
.tab.tab-enter { animation: tabIn 0.34s var(--ease); }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}
.tab-title { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.15; }
.tab-lead { margin: 8px 0 0; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.section-sub { font-size: 11.5px; color: var(--faint); }

/* 移动端底部悬浮导航胶囊 */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--dock-bg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-float);
  z-index: 24;
  transition: transform 0.42s var(--ease), opacity 0.3s;
}
.tabbar .tab-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  transition: transform 0.34s var(--ease), width 0.34s var(--ease), opacity 0.2s;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.tabbar button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 74px;
  padding: 8px 0 6px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: color 0.22s, transform 0.16s var(--spring);
}
.tabbar button:active { transform: scale(0.92); }
.tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.28s var(--spring); }
.tabbar button:first-child svg { fill: currentColor; stroke: none; }
.tabbar button.active { color: var(--accent); }
.tabbar button.active svg { transform: translateY(-1px) scale(1.06); }
body.in-call .tabbar { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }

/* ================= 通话页（灵动声球舞台 + Bento 模式 + 实时字幕） ================= */
.call { display: flex; flex-direction: column; min-height: 100dvh; }
.call-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 10px;
}
.head-actions { display: flex; align-items: center; gap: 4px; }
.pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
body.in-call #idlePills { display: none; }

.quota {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px);
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
  font-weight: 560;
}
.streak svg { width: 13px; height: 13px; fill: currentColor; animation: flamePulse 2.8s ease-in-out infinite; }
@keyframes flamePulse { 50% { transform: scale(1.15); } }

.call-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px);
  font-size: 12.5px;
  animation: rise 0.35s var(--ease);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 1.8s ease-out infinite;
}
.call.muted .live-dot { background: var(--danger); animation: none; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(69, 219, 145, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(69, 219, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(69, 219, 145, 0); }
}
.call-timer { font-family: var(--font-mono); font-weight: 620; color: var(--text); }
.call-mode-badge {
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
}
.studio-presence {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.studio-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 灵动声球舞台 */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  width: 100%;
  padding: 6px 0 4px;
}
.orb-shell {
  --orb-size: 156px;
  position: relative;
  width: var(--orb-size);
  height: var(--orb-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: width 0.4s var(--ease), height 0.4s var(--ease), transform 0.25s var(--spring);
}
.orb-shell:active { transform: scale(0.95); }
@media (hover: hover) {
  .call[data-state="idle"] .orb-shell:hover { transform: scale(1.035); }
}
body.in-call .orb-shell { --orb-size: 182px; }
.call:has(.shadow-card:not([hidden])) .orb-shell,
.call:has(.scene-card:not([hidden])) .orb-shell,
.call:has(.pron-card:not([hidden])) .orb-shell { --orb-size: 120px; }
.call.show-result .orb-shell { --orb-size: 82px; }

#orbCanvas {
  position: absolute;
  inset: -22%;
  width: 144%;
  height: 144%;
  pointer-events: none;
}
.orb-monogram {
  position: relative;
  z-index: 2;
  font-size: calc(var(--orb-size) * 0.28);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0.96;
  transition: opacity 0.3s, transform 0.3s;
}
body.in-call .orb-monogram { opacity: 0.9; }

.stage-text { min-width: 0; }
.name-row { display: inline-flex; align-items: center; gap: 8px; }
.stage h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.15; }
.presence-pill {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(69, 219, 145, 0.28);
}
body.in-call .presence-pill { display: none; }

.status-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 5px;
  min-height: 22px;
}
.status { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* 7 段实时声波条 */
.voice-wave {
  display: none;
  align-items: center;
  gap: 3px;
  height: 18px;
}
body.in-call .voice-wave { display: inline-flex; }
.voice-wave i {
  display: block;
  width: 2.5px;
  height: 16px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleY(0.25);
  transform-origin: center;
  will-change: transform;
  transition: transform 0.08s linear, background 0.3s;
}
.call[data-state="listening"] .voice-wave i { background: var(--green); }
.call[data-state="thinking"] .voice-wave i {
  background: var(--ipa);
  animation: thinkWave 1.15s ease-in-out infinite;
}
.call[data-state="thinking"] .voice-wave i:nth-child(2) { animation-delay: 0.1s; }
.call[data-state="thinking"] .voice-wave i:nth-child(3) { animation-delay: 0.2s; }
.call[data-state="thinking"] .voice-wave i:nth-child(4) { animation-delay: 0.3s; }
.call[data-state="thinking"] .voice-wave i:nth-child(5) { animation-delay: 0.4s; }
.call[data-state="thinking"] .voice-wave i:nth-child(6) { animation-delay: 0.5s; }
.call[data-state="thinking"] .voice-wave i:nth-child(7) { animation-delay: 0.6s; }
.call.muted .voice-wave { opacity: 0.28; }
@keyframes thinkWave {
  0%, 100% { transform: scaleY(0.25); opacity: 0.45; }
  50% { transform: scaleY(0.95); opacity: 1; }
}

.back-home {
  margin-top: 4px;
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-elevated);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: transform 0.16s var(--spring), background 0.2s;
}
.back-home:active { transform: scale(0.95); }

/* 雕塑感拨号胶囊（空闲态） + 三键控制坞（通话态） */
.call-foot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.call-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 26px 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--accent-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 660;
  cursor: pointer;
  box-shadow: 0 16px 38px -12px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition: transform 0.2s var(--spring), box-shadow 0.28s, width 0.35s var(--ease), padding 0.35s var(--ease), background 0.3s;
}
.call-button:active { transform: scale(0.94); }
@media (hover: hover) {
  .call-button:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 22px 44px -12px var(--accent-border), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
}
.call-btn-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
}
.call-btn-icon svg { width: 17px; height: 17px; fill: currentColor; transition: transform 0.38s var(--spring); }
.call-btn-label { white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* 通话中：拨号胶囊化为红色圆形挂断键 */
body.in-call .call-button {
  width: 62px;
  height: 62px;
  padding: 0;
  background: linear-gradient(145deg, #ff707e, #df3649);
  color: #fff;
  box-shadow: 0 16px 36px -10px rgba(223, 54, 73, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
body.in-call .call-btn-icon { background: transparent; width: auto; height: auto; }
body.in-call .call-btn-icon svg { width: 26px; height: 26px; transform: rotate(135deg); }
body.in-call .call-btn-label { display: none; }

.call-aux {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  animation: msgPop 0.3s var(--spring);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.16s var(--spring);
}
.call-aux:active { transform: scale(0.9); }
@media (hover: hover) {
  .call-aux:hover { background: var(--surface-hover); border-color: var(--accent-border); }
}
.call-aux svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.call-aux .mic-off { display: none; }
.call-aux.muted { background: var(--danger-soft); border-color: rgba(255, 112, 122, 0.5); color: var(--danger); }
.call-aux.muted .mic-on { display: none; }
.call-aux.muted .mic-off { display: block; }
.call-aux.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

.text-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  padding: 5px 6px 5px 16px;
  border-radius: 999px;
  animation: rise 0.25s var(--ease);
}
.text-drawer input { border: none; background: transparent; padding: 8px 0; font-size: 14.5px; box-shadow: none !important; }
.send-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: var(--accent-ink);
  cursor: pointer;
  transition: transform 0.16s var(--spring);
}
.send-btn:active { transform: scale(0.9); }
.send-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= 首页：今日推荐 + 2×3 高定 Bento 模式卡 ================= */
.home { animation: rise 0.4s var(--ease); }
body.in-call .home, body.in-call .note, .call.show-result .home { display: none; }

.plan { margin-bottom: 22px; }
.plan-list { display: flex; flex-direction: column; gap: 9px; }
.plan-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.24s, background 0.24s, transform 0.18s var(--spring);
  animation: staggerIn 0.36s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.plan-item:active { transform: scale(0.98); }
@media (hover: hover) {
  .plan-item:hover { border-color: var(--accent-border); background: var(--surface-hover); transform: translateY(-2px); }
  .plan-item:hover .plan-go { transform: translateX(2px) scale(1.06); background: var(--gradient); color: var(--accent-ink); }
}
.plan-ic {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.plan-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.plan-text { flex: 1; min-width: 0; }
.plan-text b { display: block; font-size: 14.5px; font-weight: 620; }
.plan-text small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  transition: transform 0.22s var(--spring), background 0.24s, color 0.24s;
}
.plan-go svg { width: 14px; height: 14px; fill: currentColor; }

/* 2 列宽敞 Bento 模式卡（不再挤成 3 列截断文字） */
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 15px 15px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: visible;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.24s, background 0.24s, transform 0.2s var(--spring), box-shadow 0.25s;
}
.mode-card:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .mode-card:hover:not(.locked) {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: var(--surface-hover);
  }
}
.mode-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}
.mode-ic {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--spring);
}
.mode-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mode-picker-tag {
  font-size: 11px;
  font-weight: 560;
  color: var(--faint);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mode-pill-active {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.22s, transform 0.22s var(--spring);
}
.mode-card b { font-size: 15px; font-weight: 640; margin-bottom: 3px; }
.mode-card span[data-desc] {
  width: 100%;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-card.active {
  border-color: var(--accent-border);
  background: linear-gradient(150deg, var(--accent-soft), var(--surface-elevated));
  box-shadow: 0 14px 32px -18px var(--accent-border), inset 0 1px 0 var(--rim);
}
.mode-card.active .mode-ic {
  background: var(--gradient);
  border-color: transparent;
  color: var(--accent-ink);
  transform: scale(1.05);
}
.mode-card.active .mode-pill-active { opacity: 1; transform: scale(1); }
.mode-card.active .mode-picker-tag { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.mode-card.locked { opacity: 0.45; }
.modes .badge {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--gradient);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  font-style: normal;
  line-height: 21px;
  text-align: center;
  box-shadow: 0 6px 14px -4px var(--accent-border);
  z-index: 4;
}

/* ================= 实时字幕区 ================= */
.transcript-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 80px;
}
.call[data-state="idle"]:not(.show-result) .transcript-wrap { display: none; }
.call.show-result .transcript-wrap { flex: none; min-height: 0; }

.transcript-head {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.transcript-head small { color: var(--faint); font-weight: 400; font-size: 12px; }

.transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 2px 10px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}
.call.show-result .transcript {
  flex: none;
  overflow: visible;
  mask-image: none;
  -webkit-mask-image: none;
  padding-top: 4px;
}

.scroll-bottom {
  position: absolute;
  right: 10px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  z-index: 4;
  animation: rise 0.24s var(--ease);
}
.scroll-bottom svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.line {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 19px;
  font-size: 15.5px;
  line-height: 1.56;
  word-break: break-word;
  animation: msgPop 0.32s var(--ease);
}
@keyframes msgPop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.line.romy {
  align-self: flex-start;
  background: var(--bubble-romy);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.line.you {
  align-self: flex-end;
  background: var(--bubble-you);
  border: 1px solid var(--bubble-you-border);
  border-bottom-right-radius: 6px;
}
.line.system { align-self: center; padding: 4px 12px; color: var(--faint); font-size: 12px; }
.line .translate {
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  vertical-align: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.line .translate:hover:not(:disabled) { border-color: var(--accent-border); color: var(--accent); }

.listen {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 5px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--accent);
  vertical-align: middle;
  cursor: pointer;
}
.listen:hover { background: var(--accent-soft); }
.listen .speaker { margin-left: 0; }

.w { cursor: pointer; border-radius: 5px; padding: 0 1px; transition: background 0.16s; }
.w:hover { background: var(--accent-soft); }
.line.mixed .w { text-decoration: underline dotted var(--accent-border); text-underline-offset: 4px; }
.w.on { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }

.word-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 9px;
  width: 100%;
  margin: 7px 0 0;
  padding: 7px 0 0;
  border: none;
  border-top: 1px dashed var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  animation: rise 0.22s var(--ease);
}
.word-info b { font-weight: 660; }
.word-info .speaker { color: var(--accent); align-self: center; }
.tap-hint, .link-hint { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--faint); font-size: 12px; }
.speaker { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; margin-left: 5px; opacity: 0.85; flex: none; }

.line.saved {
  align-self: center;
  max-width: 92%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 8px;
  padding: 10px 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent-border);
  font-size: 14px;
  color: var(--muted);
}
.line.saved small { flex: 0 0 100%; text-align: center; font-size: 11px; color: var(--accent); letter-spacing: 0.05em; }
.line.saved b { color: var(--text); font-size: 15.5px; font-weight: 660; }
.line.saved[data-speak] { cursor: pointer; }
.line.saved .speaker { color: var(--accent); align-self: center; margin-left: 0; }
.ipa { color: var(--ipa); font-family: "Lucida Sans Unicode", "Noto Sans", "Segoe UI", system-ui, sans-serif; font-size: 13.5px; }
.line .translation { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 14px; animation: rise 0.24s var(--ease); }

[data-speak] { transition: opacity 0.2s, transform 0.16s var(--spring), background 0.2s; }
[data-speak].playing { animation: speakPulse 0.85s ease-in-out infinite; }
@keyframes speakPulse { 50% { opacity: 0.55; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes staggerIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 50% { transform: scale(1.045); } }
@keyframes pulseRing { 0% { transform: scale(0.95); opacity: 0.72; } 100% { transform: scale(1.42); opacity: 0; } }

/* 跟读 / 发音 / 场景任务卡 */
.shadow-card, .pron-card, .scene-card {
  width: 100%;
  margin-top: 12px;
  padding: 15px 17px;
  animation: msgPop 0.34s var(--ease);
}
.shadow-label { display: flex; justify-content: space-between; margin: 0 0 7px; color: var(--faint); font-size: 12px; letter-spacing: 0.06em; }
.shadow-sentence { margin: 0; font-size: 19px; font-weight: 620; line-height: 1.54; }
.shadow-note { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.shadow-prev { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; line-height: 1.7; }
.shadow-prev::before { content: "上一句 "; color: var(--faint); font-size: 12px; }
.lk {
  display: inline-block;
  width: 0.6em;
  height: 0.36em;
  margin: 0 -0.05em;
  vertical-align: -0.36em;
  border: solid var(--accent);
  border-width: 0 0 1.6px;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.shadow-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.shadow-links .links-title { flex: 0 0 100%; color: var(--faint); font-size: 12px; }
.shadow-links .link-group { font-weight: 600; white-space: nowrap; }
.shadow-links .ipa { margin-left: 6px; font-weight: 400; }
.shadow-links small { margin-left: 6px; color: var(--faint); font-size: 11.5px; font-weight: 400; }

.pron-word {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  padding: 4px 8px;
  margin-left: -8px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pron-word:hover { background: var(--surface-elevated); }
.pron-word .speaker { width: 18px; height: 18px; color: var(--accent); align-self: center; margin-left: 0; }
.pron-word b { font-size: 24px; font-weight: 700; }
.pron-word .ipa { font-size: 15px; }
.pron-tries { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.pron-tries:empty { display: none; }
.pron-tries .try {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  animation: msgPop 0.28s var(--spring);
}
.pron-tries .try b { margin: 0 3px 0 6px; font-size: 14px; }
.pron-tries .try.ok, .pron-tries .try.ok b { color: var(--green); border-color: rgba(69, 219, 145, 0.38); background: var(--green-soft); }
.pron-tries .try.bad b { color: var(--danger); }

.scene-you { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.scene-tasks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.scene-tasks li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.5; }
.scene-tasks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border: 1.5px solid var(--faint); border-radius: 50%; }
.scene-tasks li.done::before { content: "✓"; border-color: var(--green); background: var(--green); color: #091811; font-size: 11px; font-weight: 800; line-height: 15px; text-align: center; }
.scene-tasks li.missed { color: var(--muted); }

.sw { display: inline-block; margin-right: 0.28em; }
.sw.ok { color: var(--green); }
.sw.bad { color: var(--danger); vertical-align: top; }
.sw.bad sup { margin-left: 1px; font-size: 10px; font-weight: 500; opacity: 0.85; }
.sw.bad .ipa { display: block; margin-top: -3px; font-size: 12px; font-weight: 400; line-height: 1.3; }

/* ================= 生词本 + 3D 交互闪卡 ================= */
.view-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  gap: 4px;
}
.view-toggle button {
  padding: 7px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.view-toggle button.active {
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.3);
}

.review-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.review-stat { display: flex; align-items: center; gap: 16px; }
.review-stat strong { display: block; font-size: 15.5px; margin-bottom: 2px; }
.big-number {
  margin: 0;
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.words-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.segmented {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--input-bg);
}
.seg-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 11px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), width 0.3s var(--ease), opacity 0.2s;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.segmented button {
  position: relative;
  z-index: 1;
  padding: 9px 10px;
  border: none;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 520;
  cursor: pointer;
  transition: color 0.22s;
}
.segmented button b { font-family: var(--font-mono); font-size: 12.5px; margin-left: 4px; opacity: 0.85; }
.segmented button.active { color: var(--text); }

.search-box { position: relative; display: flex; align-items: center; }
.search-box svg {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-box input { padding: 10px 36px 10px 38px; border-radius: 14px; font-size: 14.5px; background: var(--surface); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--surface-elevated);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* 3D 交互闪卡样式 */
.flashcard-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 8px 0 16px;
  animation: tabIn 0.34s var(--ease);
}
.fc-progress-row {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}
.fc-track { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-elevated); overflow: hidden; }
.fc-track i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--gradient); transition: width 0.4s var(--ease); }
.fc-tip { font-size: 12px; }

.fc-scene {
  width: 100%;
  max-width: 520px;
  perspective: 1200px;
}
.fc-card {
  position: relative;
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.62s var(--spring);
  cursor: pointer;
  outline: none;
}
.fc-card.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute;
  inset: 0;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 26px;
  background: var(--surface-elevated);
  border-color: var(--line-strong);
}
.fc-back { transform: rotateY(180deg); background: linear-gradient(155deg, var(--accent-soft), var(--surface-elevated)); border-color: var(--accent-border); }
.fc-badge {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.fc-word { margin: 0; font-size: clamp(28px, 5vw, 38px); font-weight: 700; line-height: 1.25; }
.fc-word.is-sentence { font-size: 21px; line-height: 1.5; }
.fc-ipa { font-size: 16px; }
.fc-actions { display: flex; gap: 10px; margin-top: 6px; }
.fc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.fc-action-btn:hover { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.fc-action-btn:active { transform: scale(0.95); }
.fc-action-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fc-meaning { margin: 0; font-size: 22px; font-weight: 650; line-height: 1.45; }
.fc-example { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; font-style: italic; line-height: 1.6; max-width: 420px; }
.fc-hint { position: absolute; bottom: 16px; font-size: 12px; color: var(--faint); }
.fc-nav { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* 词条列表 */
.word-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 11px; }
.word {
  padding: 16px 18px;
  animation: staggerIn 0.34s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 10) * 35ms);
  transition: transform 0.24s var(--ease), opacity 0.24s, border-color 0.22s;
}
.word.removing { opacity: 0; transform: translateX(28px) scale(0.96); pointer-events: none; }
@media (hover: hover) { .word:hover { border-color: var(--line-strong); } }
.word-top { display: flex; align-items: baseline; gap: 8px; }
.word-top strong { font-family: var(--font-serif); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.word-top .meaning { color: var(--muted); font-size: 14px; flex: 1; }
.word-top .icon-btn.speak { margin: -6px -2px -6px -4px; color: var(--accent); align-self: center; }
.word-top .icon-btn.mic { margin: -6px -2px -6px -4px; color: var(--ipa); align-self: center; }
.word-top .icon-btn { width: 32px; height: 32px; margin: -6px -8px -6px 0; color: var(--faint); }
.word-top .icon-btn svg { width: 16px; height: 16px; }
.word.sentence .word-top { flex-wrap: wrap; align-items: center; row-gap: 6px; }
.word.sentence .word-top strong { flex: 1; font-family: var(--font); font-size: 16px; font-weight: 600; line-height: 1.48; }
.word.sentence .word-top .meaning { order: 5; flex: 0 0 100%; }
.word p.ipa { margin: 4px 0 0; }
.word .example { margin: 7px 0 0; color: var(--faint); font-size: 13.5px; font-style: italic; line-height: 1.55; }
.word-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; font-size: 12px; color: var(--faint); }
.dots { display: flex; gap: 4px; }
.dots i { width: 18px; height: 4.5px; border-radius: 3px; background: var(--line-strong); }
.dots i.on { background: var(--gradient); }
.tag { padding: 2px 9px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-weight: 540; }
.tag.due { background: var(--accent-soft); color: var(--accent); }
.tag.good { background: var(--green-soft); color: var(--green); }
.empty { grid-column: 1 / -1; padding: 48px 20px; text-align: center; color: var(--faint); font-size: 14px; line-height: 1.8; }

.skeleton-card {
  height: 98px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ================= 练习总结（编辑感日志风） ================= */
.call .note { padding: 20px; margin-top: 14px; animation: rise 0.4s var(--ease); }
.note h3 { margin: 0 0 14px; font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
.fix {
  position: relative;
  padding: 13px 14px 13px 16px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.fix::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(to bottom, var(--danger), var(--green));
}
.fix .wrong { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--danger); font-size: 14px; }
.fix .right { margin-top: 5px; color: var(--text); font-weight: 620; font-size: 15.5px; }
button.right { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: none; background: none; font-family: inherit; text-align: left; cursor: pointer; }
button.right .speaker { color: var(--accent); }
.fix .reason { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.fix .tag { margin-left: 8px; font-size: 11px; text-decoration: none; display: inline-block; }
.last-time { margin-top: 5px; color: var(--faint); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  transition: transform 0.16s var(--spring), border-color 0.2s, background 0.2s;
}
.word-chip { background: var(--accent-soft); border-color: var(--accent-border); color: var(--text); }
button.chip { font: inherit; font-size: 13px; cursor: pointer; }
button.chip:active { transform: scale(0.95); }
@media (hover: hover) {
  button.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
}
button.chip small { margin-left: 3px; opacity: 0.72; font-size: 11.5px; }
.note-end { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 14px; line-height: 1.65; }
.note-waiting { margin: 0; color: var(--muted); font-size: 14px; }
.note-waiting::after { content: "…"; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.note-list { display: flex; flex-direction: column; gap: 12px; }
.note-list .note { padding: 0; overflow: hidden; animation: staggerIn 0.36s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.note-list summary { display: flex; align-items: center; gap: 12px; padding: 17px 18px; list-style: none; cursor: pointer; transition: background 0.2s; }
.note-list summary:hover { background: var(--surface-hover); }
.note-list summary::-webkit-details-marker { display: none; }
.note-title { flex: 1; min-width: 0; }
.note-title b { display: block; font-size: 15.5px; font-weight: 640; }
.note-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-list summary time { flex: none; font-family: var(--font-mono); color: var(--faint); font-size: 12px; }
.note-list summary svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.32s var(--ease), stroke 0.2s; }
.note-list details[open] summary svg { transform: rotate(90deg); stroke: var(--accent); }
.note-body { padding: 4px 18px 20px; border-top: 1px solid var(--line); animation: rise 0.28s var(--ease); }
.note-body > :first-child { margin-top: 16px; }
.summary-what { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.summary-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.summary-stats span {
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.summary-stats b { margin-right: 5px; font-family: var(--font-serif); color: var(--text); font-size: 20px; font-weight: 700; }
.summary-section { margin-top: 16px; }
.summary-section .label { margin: 0 0 8px; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.summary-text { margin: 0; font-size: 14.5px; line-height: 1.62; }

/* ================= 我的空间（仪表盘） ================= */
.me-top-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.profile { display: flex; align-items: center; gap: 15px; padding: 20px; }
.mini-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: var(--accent-ink);
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 12px 26px -10px var(--accent-border);
}
.profile-name { margin: 0 0 3px; font-size: 22px; font-weight: 700; }
.profile-text { flex: 1; min-width: 0; }

/* 环形额度表盘 */
.quota-gauge-card { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.quota-gauge { position: relative; width: 76px; height: 76px; flex: none; display: grid; place-items: center; }
.quota-gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.quota-gauge circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.qg-bg { stroke: var(--line-strong); }
.qg-fg { stroke: var(--accent); transition: stroke-dashoffset 0.8s var(--ease); }
.quota-gauge b { font-size: 12px; font-weight: 650; text-align: center; line-height: 1.2; }
.quota-gauge-info { flex: 1; min-width: 0; }
.quota-gauge-info > span { display: block; font-size: 14.5px; font-weight: 620; }
.quota-gauge-info > small { display: block; margin-top: 2px; font-size: 12px; }
.bar { height: 6px; margin-top: 10px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--gradient); transition: width 0.75s var(--ease); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 12px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; transition: transform 0.2s var(--ease), border-color 0.2s; }
@media (hover: hover) { .stat:hover { transform: translateY(-2px); border-color: var(--line-strong); } }
.stat b { font-size: 36px; font-weight: 700; line-height: 1.05; }
.stat span { color: var(--muted); font-size: 12.5px; }

.me-panels-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.panel { padding: 20px; margin-bottom: 12px; }
.me-panels-grid .panel { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.panel-head span { color: var(--faint); font-size: 12px; }
.panel .chips { margin-top: 0; }

/* 近 7 天节律柱状图 */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.week .value {
  height: 22px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.week .track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, transparent 49%, var(--line) 50%, transparent 51%);
}
.week .track i {
  width: min(26px, 60%);
  border-radius: 7px 7px 2px 2px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-bottom: none;
  transition: height 0.68s var(--ease), background 0.25s, filter 0.25s, border-color 0.25s;
}
.week .day { margin-top: 8px; transition: color 0.2s; }
.week button.on .value { opacity: 1; transform: translateY(0); }
.week button.on .track i { background: var(--gradient); border-color: transparent; filter: drop-shadow(0 0 10px var(--accent-border)); }
.week button.on .day { color: var(--text); font-weight: 620; }

.weak-list { display: flex; flex-direction: column; gap: 16px; }
.weak-top { display: flex; align-items: center; gap: 10px; }
.weak-top b { font-size: 14.5px; font-weight: 620; }
.weak-top .count { flex: 1; font-family: var(--font-mono); color: var(--muted); font-size: 12px; }
.weak-top button {
  padding: 5px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.16s var(--spring);
}
.weak-top button:hover { background: var(--gradient); color: var(--accent-ink); border-color: transparent; }
.weak-meter { height: 5px; margin-top: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.weak-meter i { display: block; height: 100%; border-radius: 3px; background: var(--gradient); transition: width 0.72s var(--ease); }
.weak-example { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.weak-example s { color: var(--faint); text-decoration-color: var(--danger); }

/* 主题切换与交互音效偏好 */
.theme-picker { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 16px; }
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.16s var(--spring);
}
.theme-swatch:active { transform: scale(0.97); }
.theme-swatch.active { border-color: var(--accent-border); background: var(--accent-soft); }
.sw-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; border: 2px solid rgba(255, 255, 255, 0.25); }
.sw-obsidian { background: linear-gradient(135deg, #17151f 35%, #f0c588 100%); }
.sw-aurora { background: linear-gradient(135deg, #0b132b 35%, #6ce8d4 100%); }
.sw-paper { background: linear-gradient(135deg, #f4efe7 35%, #cb573b 100%); border-color: rgba(42, 33, 24, 0.2); }
.theme-swatch b { display: block; font-size: 14px; font-weight: 620; }
.theme-swatch small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pref-row + .pref-row { margin-top: 14px; }
.pref-row b { display: block; font-size: 14.5px; }
.pref-row p { margin-top: 2px; font-size: 12.5px; }
.toggle-pill {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--input-bg);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.toggle-pill i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.28s var(--spring), background 0.25s;
}
.toggle-pill[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-border); }
.toggle-pill[aria-checked="true"] i { transform: translateX(20px); background: var(--accent); }

.me-device-row { display: flex; flex-direction: column; gap: 10px; }
.link-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; animation: rise 0.32s var(--ease); }
.link-input-row { display: flex; gap: 10px; align-items: center; }
.link-input-row input { flex: 1; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* ================= 念一遍打分面板 & 底部弹窗 ================= */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--modal-scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.24s var(--ease);
  transition: opacity 0.22s var(--ease);
}
.sheet.closing { opacity: 0; pointer-events: none; }
.sheet-panel {
  width: 100%;
  max-width: 600px;
  max-height: 85dvh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 10px 20px max(26px, env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  background: var(--surface-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-float);
  animation: slide-up 0.36s var(--ease);
  transition: transform 0.24s var(--ease);
  will-change: transform;
}
.sheet-panel::-webkit-scrollbar { display: none; }
.sheet.closing .sheet-panel { transform: translateY(100%); }
.sheet-grip { width: 42px; height: 5px; margin: 2px auto 14px; border-radius: 3px; background: var(--line-strong); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet h2 { margin: 0 0 6px; font-size: 23px; font-weight: 700; }

.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sheet .section-label { display: block; margin: 20px 0 -4px 4px; }
.scenario {
  position: relative;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.16s var(--spring);
}
.scenario:active { transform: scale(0.96); }
@media (hover: hover) { .scenario:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-1px); } }
.scenario.active { border-color: var(--accent-border); background: var(--accent-soft); }
.scenario b { display: block; font-size: 14.5px; font-weight: 630; }
.scenario span { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.48; }
.scenario .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-style: normal;
  font-size: 17px;
}
.scenario .remove:hover { background: var(--danger-soft); color: var(--danger); }
.scenario:has(.remove) b { padding-right: 20px; }

.scene-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.scene-form textarea { resize: none; font-size: 15px; }
.scene-form .error:empty { display: none; }
.scene-form .btn { align-self: flex-end; }
.again { display: block; width: 100%; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }

/* 念一遍面板 */
.read-panel { text-align: center; position: relative; }
.read-head { display: flex; align-items: center; justify-content: space-between; }
.read-target { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }
.read-target .pron-word { justify-content: center; margin-left: 0; }
.read-target .pron-word b { font-family: var(--font-serif); font-size: 34px; }
.read-target .pron-word .ipa { font-size: 17px; }
.read-sentence { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.6; text-align: left; }
.read-meaning { margin: 8px 0 0; font-size: 14px; }
.read-result { position: relative; margin-top: 16px; animation: msgPop 0.35s var(--spring); }

.score-ring { position: relative; width: 94px; height: 94px; margin: 0 auto 10px; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 6.5; stroke-linecap: round; }
.score-ring .ring-bg { stroke: var(--line-strong); }
.score-ring .ring-fg { transition: stroke-dashoffset 0.78s var(--ease); }
.score-ring.ok .ring-fg { stroke: var(--green); }
.score-ring.bad .ring-fg { stroke: var(--danger); }
.score-ring strong { font-family: var(--font-serif); font-size: 32px; font-weight: 700; }
.score-ring.ok strong { color: var(--green); }
.score-ring.bad strong { color: var(--danger); }
.read-verdict { margin: 0; font-size: 17px; font-weight: 650; }
.read-verdict.ok { color: var(--green); }
.read-verdict.bad { color: var(--danger); }
.read-tip { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.read-result .chip { margin-top: 12px; }
.read-panel .pron-tries { justify-content: center; margin-top: 14px; }
.read-mic-wrap { display: flex; justify-content: center; margin-top: 22px; }
.read-mic {
  --level: 0;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 14px 32px -10px var(--accent-border), 0 0 0 calc(var(--level) * 20px) rgba(69, 219, 145, 0.24);
  transition: box-shadow 0.09s, opacity 0.2s, transform 0.16s var(--spring), background 0.3s;
}
.read-mic:active { transform: scale(0.92); }
.read-mic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.read-mic[data-stage="listening"], .read-mic[data-stage="hearing"] { background: linear-gradient(145deg, #5ce8a3, #27b870); color: #071b11; }
.read-mic[data-stage="listening"] { animation: breathe 1.6s ease-in-out infinite; }
.read-mic[data-stage="starting"], .read-mic[data-stage="scoring"] { opacity: 0.55; }
.read-status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }

.sparkle {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFly 0.85s var(--ease) forwards;
}
@keyframes sparkleFly {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; }
}

/* ================= 确认弹窗 & Toast ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--modal-scrim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade 0.2s var(--ease);
  transition: opacity 0.2s var(--ease);
}
.modal.closing { opacity: 0; pointer-events: none; }
.modal-card {
  width: 100%;
  max-width: 356px;
  padding: 24px 22px 20px;
  background: var(--modal-card-bg);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-float);
  animation: modalPop 0.28s var(--spring);
}
@keyframes modalPop { from { opacity: 0; transform: scale(0.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toast-host {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 540;
  box-shadow: var(--shadow-float);
  animation: toastIn 0.3s var(--spring);
  transition: opacity 0.24s, transform 0.24s var(--ease);
}
.toast.ok { border-color: rgba(69, 219, 145, 0.5); color: var(--green); }
.toast.err { border-color: rgba(255, 112, 122, 0.5); color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-10px) scale(0.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }

.wechat-tip { position: sticky; top: 0; z-index: 60; padding: 10px 16px; background: #ffcc4d; color: #3b2d00; font-size: 14px; text-align: center; }

/* ================= 角色定制工作室：精选原型 / AI 捏人 / 调音台 / 口令分享 ================= */
.char-studio-top {
  padding: 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.char-studio-divider { height: 1px; background: var(--line); }
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.arch-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s, transform 0.18s var(--spring);
}
.arch-card:active { transform: scale(0.96); }
@media (hover: hover) { .arch-card:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateY(-2px); } }
.arch-card.active { border-color: var(--accent-border); background: var(--accent-soft); }
.arch-top { display: flex; align-items: center; gap: 9px; width: 100%; }
.arch-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  flex: none;
}
.arch-card b { font-size: 14.5px; font-weight: 640; }
.arch-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }

.ai-char-form { display: flex; flex-direction: column; gap: 8px; }
.ai-char-row { display: flex; gap: 10px; align-items: center; }
.ai-char-row input { flex: 1; font-size: 14.5px; padding: 11px 14px; }
.ai-char-form .error:empty { display: none; }

.char-preview-tagline { margin: 4px 0 4px; font-size: 13px; color: var(--accent); font-weight: 520; }
.char-preview-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.char-preview-tags span {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.share-char-box { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; padding-top: 8px; border-top: 1px solid var(--line); }
.import-char-form { display: flex; gap: 8px; width: 100%; }
.import-char-form input { flex: 1; padding: 9px 11px; font-family: var(--font-mono); font-size: 12px; }

.tuner-group { display: flex; flex-direction: column; gap: 8px; }
.tuner-title { font-size: 13px; font-weight: 560; color: var(--muted); }
.tuner-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tuner-pill {
  padding: 8px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s var(--spring);
}
.tuner-pill:active { transform: scale(0.96); }
.tuner-pill b { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.tuner-pill small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.tuner-pill.active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.tuner-pill.active b { color: var(--accent); }
.tuner-pill.active small { color: var(--muted); }
.tuner-pills.multi .tuner-pill { border-radius: 999px; padding: 6px 13px; }
.tuner-pills.multi .tuner-pill.active { font-weight: 600; }

/* ================= 首页语音留言条 ================= */
.voicemail {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  margin-bottom: 18px;
  border-color: var(--accent-border);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  animation: msgPop 0.36s var(--ease);
}
.vm-play {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px var(--accent-border);
  transition: transform 0.16s var(--spring);
}
.vm-play:active { transform: scale(0.92); }
.vm-play svg { width: 17px; height: 17px; fill: currentColor; margin-left: 2px; }
.vm-play.playing { animation: breathe 1s ease-in-out infinite; }
.vm-body { flex: 1; min-width: 0; }
.vm-head { display: flex; align-items: center; gap: 7px; }
.vm-head b { font-size: 13px; font-weight: 640; color: var(--accent); }
.vm-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}
.vm-body p { margin: 3px 0 0; font-size: 13.5px; color: var(--text); line-height: 1.48; }
.vm-reply {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.vm-reply:hover { background: var(--gradient); color: var(--accent-ink); border-color: transparent; }

/* ================= 通话中「💡 帮我接话」灵感托盘 + 慢速重听 ================= */
.hint-tray {
  width: 100%;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 20px;
  border-color: var(--accent-border);
  background: var(--surface-panel);
  animation: rise 0.26s var(--ease);
}
.hint-tray-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.icon-btn.sm { width: 26px; height: 26px; font-size: 16px; border-radius: 8px; }
.hint-tray-body { display: flex; flex-direction: column; gap: 8px; }
.hint-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.hint-item-text { flex: 1; min-width: 0; text-align: left; }
.hint-en { display: block; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.hint-zh { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.hint-speak {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.hint-speak .speaker { margin: 0; }

.listen-slow {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  vertical-align: 1px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.listen-slow:hover { border-color: var(--accent-border); color: var(--accent); }

/* ================= 生词本：磨耳朵连播 + 情景来源标签 ================= */
.words-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#playlistBtn.active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.word.playlist-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.context-tag { font-size: 11.5px; color: var(--faint); margin-top: 5px; }

/* ================= 声音小票分享弹窗 ================= */
.receipt-btn { margin-top: 14px; }
.receipt-modal-card { max-width: 420px; padding: 18px 20px 20px; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.receipt-head h3 { margin: 0; }
.receipt-preview-wrap {
  max-height: 62dvh;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.receipt-preview-wrap img { display: block; width: 100%; height: auto; }

/* ================= 每日打卡系统（顶部胶囊 + 首页打卡条 + 月度日历） ================= */
.checkin-pill {
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s var(--spring), background 0.22s, border-color 0.22s, box-shadow 0.25s;
}
.checkin-pill:active { transform: scale(0.94); }
.checkin-pill.unchecked {
  background: var(--gradient);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 660;
  box-shadow: 0 6px 18px -6px var(--accent-border);
}
.checkin-pill.unchecked svg { animation: none; }

.checkin-card {
  padding: 16px 18px;
  margin-bottom: 18px;
  animation: rise 0.36s var(--ease);
}
.checkin-card.done {
  padding: 13px 16px;
  background: var(--surface);
}
.checkin-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.checkin-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.checkin-quote-en {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.42;
}
.checkin-quote-zh { margin: 3px 0 0; font-size: 12.5px; }
.checkin-action { flex: none; align-self: center; }

.checkin-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.ck-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--faint);
}
.ck-day i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--faint);
  transition: transform 0.28s var(--spring), background 0.25s, color 0.25s, border-color 0.25s;
}
.ck-day.today span { color: var(--text); font-weight: 600; }
.ck-day.today i { border-style: solid; border-color: var(--accent-border); color: var(--text); }
.ck-day.on i {
  border-style: solid;
  border-color: transparent;
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 750;
  box-shadow: 0 4px 12px -4px var(--accent-border);
}

.stat-clickable { cursor: pointer; }
.stat-clickable span { color: var(--accent); font-weight: 540; }

/* 打卡月历弹窗 */
.checkin-sheet-panel { display: flex; flex-direction: column; gap: 14px; }
.cal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.cal-stat b { font-size: 32px; font-weight: 700; line-height: 1.05; color: var(--accent); }
.cal-stat span { font-size: 12px; color: var(--muted); }

.cal-box { padding: 16px; }
.cal-month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cal-month-head b { font-size: 15.5px; font-weight: 660; }
.cal-month-head span { font-size: 11.5px; }
.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.cal-weekdays { margin-bottom: 6px; font-size: 11.5px; color: var(--faint); }
.cal-cell {
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid transparent;
}
.cal-cell.pad { background: transparent; pointer-events: none; }
.cal-cell.today { border-color: var(--accent-border); color: var(--text); font-weight: 700; }
.cal-cell.checked {
  background: var(--gradient);
  color: var(--accent-ink);
  font-weight: 750;
  border-color: transparent;
  box-shadow: 0 6px 14px -5px var(--accent-border);
}

.cal-note-form { display: flex; gap: 8px; align-items: center; }
.cal-note-form input { flex: 1; padding: 10px 14px; font-size: 14px; }

/* ================= 生词本二级筛选、触底分批加载与回到顶部 ================= */
.words-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -4px 0 14px;
}
.subfilter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.subfilter-pills button {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}
.subfilter-pills button:active { transform: scale(0.95); }
.subfilter-pills button b { font-family: var(--font-mono); font-size: 11.5px; margin-left: 3px; opacity: 0.8; }
.subfilter-pills button.active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.words-summary { font-size: 11.5px; color: var(--faint); }

.word-sentinel {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}

.words-back-top {
  position: fixed;
  right: max(18px, calc(50vw - 500px));
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 22;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--surface-solid);
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 620;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  animation: rise 0.24s var(--ease);
}
@media (min-width: 900px) {
  .words-back-top { bottom: 32px; right: 36px; }
}

/* ================= 自适应流畅省电模式（仅在低配/掉帧设备或手动开启时生效） ================= */
html.perf-lite .orb-glow { animation: none; will-change: auto; }
html.perf-lite .ambient .grain { display: none; }
html.perf-lite .ambient-grid { mask-image: none; -webkit-mask-image: none; opacity: 0.55; }
html.perf-lite .transcript { mask-image: none; -webkit-mask-image: none; }

html.perf-lite .card,
html.perf-lite .plan-item,
html.perf-lite .mode-card,
html.perf-lite .quota,
html.perf-lite .call-meta,
html.perf-lite .call-aux,
html.perf-lite .sheet,
html.perf-lite .sheet-panel,
html.perf-lite .modal,
html.perf-lite .side-rail,
html.perf-lite .studio-presence,
html.perf-lite .transcript-wrap {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.perf-lite .card:not(.voicemail):not(.modal-card),
html.perf-lite .plan-item,
html.perf-lite .mode-card:not(.active),
html.perf-lite .quota:not(.streak),
html.perf-lite .call-meta,
html.perf-lite .call-aux:not(.muted):not(.active),
html.perf-lite .studio-presence,
html.perf-lite .transcript-wrap {
  background: var(--surface-card-mobile);
}
html.perf-lite .voicemail { background: linear-gradient(135deg, var(--accent-soft), var(--surface-card-mobile)); }
html.perf-lite .mode-card.active { background: linear-gradient(150deg, var(--accent-soft), var(--surface-card-mobile)); }
html.perf-lite .tabbar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.perf-lite body.in-call .tabbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ================= 移动端通话中紧凑一屏布局 ================= */
@media (max-width: 899px) {
  body.in-call .call { height: 100dvh; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  body.in-call .call-head { min-height: 34px; margin-bottom: 4px; }
  body.in-call .head-actions { display: none; }
  body.in-call .studio-grid { flex: 1; min-height: 0; gap: 6px; }
  body.in-call .studio-presence { flex: none; }
  body.in-call .studio-workspace { flex: 1; min-height: 0; }
  body.in-call .stage { gap: 6px; padding: 0; }
  body.in-call .stage h1 { font-size: 22px; }
  body.in-call .status-row { margin-top: 2px; min-height: 18px; }
  body.in-call .status { font-size: 13.5px; }
  body.in-call .orb-shell { --orb-size: 132px; }
  body.in-call .call:has(.shadow-card:not([hidden])) .orb-shell,
  body.in-call .call:has(.scene-card:not([hidden])) .orb-shell,
  body.in-call .call:has(.pron-card:not([hidden])) .orb-shell { --orb-size: 76px; }
  body.in-call .shadow-card,
  body.in-call .pron-card,
  body.in-call .scene-card { margin-top: 6px; padding: 10px 13px; }
  body.in-call .shadow-label { margin-bottom: 4px; font-size: 11.5px; }
  body.in-call .scene-you { margin-bottom: 5px; font-size: 12.5px; line-height: 1.4; }
  body.in-call .scene-tasks { gap: 4px; }
  body.in-call .scene-tasks li { font-size: 13px; line-height: 1.4; padding-left: 22px; }
  body.in-call .scene-tasks li::before { top: 2px; width: 14px; height: 14px; line-height: 13px; }
  body.in-call .transcript { padding: 8px 2px 10px; gap: 8px; }
  body.in-call .call-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 16px max(14px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 68%, transparent);
    z-index: 12;
  }
  body.in-call .transcript-wrap { padding-bottom: 84px; }
  body.in-call:has(#textDrawer:not([hidden])) .transcript-wrap { padding-bottom: 140px; }
}

/* ================= 桌面宽屏工作室布局 (>= 900px) ================= */
@media (min-width: 900px) {
  .mobile-only, .tabbar { display: none !important; }

  .auth-shell { grid-template-columns: 1.15fr 0.85fr; gap: 56px; }
  .char-layout { grid-template-columns: 280px 1fr; gap: 22px; align-items: start; }
  .form-row-2 { grid-template-columns: 1fr 1fr; }

  /* 左侧固定导航轨 */
  .side-rail {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: 236px;
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 24px 16px 20px;
    border-right: 1px solid var(--line);
    background: var(--rail-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 15;
    transition: opacity 0.3s;
  }
  .rail-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 22px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .rail-brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 8px 18px -6px var(--accent-border); }
  .rail-brand strong { display: block; font-size: 15.5px; font-weight: 680; }
  .rail-brand small { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); letter-spacing: 0.08em; }

  .rail-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .rail-nav button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14.5px;
    font-weight: 540;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.16s var(--spring);
  }
  .rail-nav button:hover:not(.active) { background: var(--surface); color: var(--text); }
  .rail-nav button:active { transform: scale(0.98); }
  .rail-nav button.active {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--text);
    font-weight: 620;
  }
  .rail-nav button.active svg { color: var(--accent); }
  .rail-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .rail-nav button:first-child svg { fill: currentColor; stroke: none; }
  .rail-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--gradient);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 20px;
    text-align: center;
  }

  .rail-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .rail-util {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }
  .rail-util:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
  .rail-util svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body.sfx-off .sfx-on-icon { display: none; }
  body:not(.sfx-off) .sfx-off-icon { display: none; }
  body.in-call .side-rail { opacity: 0.45; pointer-events: none; }

  .tab {
    max-width: 1060px;
    padding: 28px 36px 48px;
  }

  /* 通话页双栏工作室舞台 */
  .studio-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(400px, 1.15fr);
    gap: 28px;
    align-items: start;
    margin-top: 12px;
  }
  .studio-presence {
    position: sticky;
    top: 24px;
    padding: 32px 26px 26px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
  }
  .orb-shell { --orb-size: 196px; }
  body.in-call .orb-shell { --orb-size: 214px; }
  .call:has(.shadow-card:not([hidden])) .orb-shell,
  .call:has(.scene-card:not([hidden])) .orb-shell,
  .call:has(.pron-card:not([hidden])) .orb-shell { --orb-size: 138px; }

  body.in-call .transcript-wrap {
    height: calc(100dvh - 122px);
    border-radius: 26px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    overflow: hidden;
  }
  body.in-call .transcript-head { display: flex; }
  body.in-call .transcript { padding: 18px 20px 20px; }

  /* 生词本工具栏 & 双列网格 */
  .words-toolbar { flex-direction: row; align-items: center; }
  .words-toolbar .segmented { width: 340px; flex: none; }
  .words-toolbar .search-box { flex: 1; }
  .word-list { grid-template-columns: repeat(2, 1fr); gap: 13px; }

  /* 我的空间仪表盘网格 */
  .me-top-grid { grid-template-columns: 1.2fr 1fr; gap: 14px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .me-panels-grid { grid-template-columns: 1.15fr 1fr; gap: 14px; }
  .theme-picker { grid-template-columns: repeat(3, 1fr); }

  /* 桌面端弹窗改为优雅居中浮窗 */
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel {
    border-bottom: 1px solid var(--line-strong);
    border-radius: 28px;
    max-height: 82dvh;
    padding: 18px 24px 26px;
    animation: modalPop 0.3s var(--spring);
  }
  .sheet.closing .sheet-panel { transform: scale(0.95) translateY(14px); }
  .sheet-grip { display: none; }
}

@media (max-height: 700px) and (max-width: 899px) {
  .orb-shell { --orb-size: 124px; }
  .stage h1 { font-size: 26px; }
  .mode-card { padding: 12px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
