:root {
  --bg: #f5f6fb;
  --bg-grad: radial-gradient(1200px 300px at 45% -60px, #dfe2ff 0%, rgba(223, 226, 255, 0) 70%);
  --card: #ffffff;
  --text: #1f2333;
  --muted: #8a8fa3;
  --line: #eef0f5;
  --accent: #5b5ff0;
  --accent-soft: #eceeff;
  --danger: #f2363d;
  --danger-soft: #ffe9ea;
  --ok: #18b46b;
  --ok-soft: #e7f8ef;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(40, 50, 120, .05);
  --rail: 88px;
  --ctl-line: #e3e5ef;
  --ctl-hover: #c9cde3;
  --ctl-h: 42px;
  --surface: var(--card);
  --soft: #f6f7fc;
  --track: #e9ebf5;
  --line-2: #e4e6f0;
  --text-2: #555a6e;
  --accent-soft-2: #dfe2ff;
  --accent-dim: #b7baf5;
  --rail-bg: rgba(255, 255, 255, .55);
  --wave-off: #c4c7e8;
  --seg-fs: 16px;
  --vip: #b7790b;
  --vip-soft: #fff3d6;
  font-size: 15px;
}

/* 深色主题：只换变量（设置 → 外观；data-theme 由 settings.js 写到 <html>） */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12141c;
  --bg-grad: radial-gradient(1200px 300px at 45% -60px, #20234a 0%, rgba(32, 35, 74, 0) 70%);
  --card: #1b1e2a;
  --soft: #232738;
  --track: #262a3c;
  --text: #e6e8f2;
  --text-2: #b4b8cc;
  --muted: #868ba3;
  --line: #2a2e40;
  --line-2: #343950;
  --ctl-line: #363b52;
  --ctl-hover: #4a5070;
  --accent: #8b8ef7;
  --accent-soft: #2a2d55;
  --accent-soft-2: #343872;
  --accent-dim: #4a4e8f;
  --danger-soft: #3d1f24;
  --ok-soft: #173327;
  --rail-bg: rgba(27, 30, 42, .7);
  --wave-off: #3a3f5c;
  --shadow: 0 2px 10px rgba(0, 0, 0, .3);
  --vip: #f0c35a;
  --vip-soft: #3a3014;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-grad), var(--bg);
  color: var(--text);
  /* 字体在“设置 → 外观”里选，默认系统字体（苹果为苹方 / SF） */
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: inherit; text-decoration: none; }

/* 刘海、状态栏留白：手机 App 和主屏幕应用才有，普通浏览器里是 0 */
.app { display: flex; height: 100dvh; padding-top: env(safe-area-inset-top); }

/* ---------- rail ---------- */
.rail {
  width: var(--rail); flex: none; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 48px 0 24px; background: var(--rail-bg); border-right: 1px solid var(--line);
}
.rail-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); }
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover, .rail-btn.active { background: var(--track); color: var(--accent); }
.rail-spacer { flex: 1; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #7d7ff6, #5b5ff0); display: grid; place-items: center; color: #fff; }
.avatar svg { fill: #fff; stroke: none; width: 22px; height: 22px; }

/* ---------- page ---------- */
.view { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 28px 24px 20px; gap: 16px; overflow: hidden; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.crumb { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.crumb span { color: var(--muted); }
h1 { margin: 0 0 12px; font-size: 26px; font-weight: 500; outline: none; border-radius: 6px; }
h1[contenteditable]:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-soft); }
h2 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.meta { display: flex; gap: 22px; font-size: 14px; color: var(--text-2); }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; }
.meta .accent { color: var(--accent); }
.mic-pick { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.mic-pick .cs { min-width: 240px; max-width: 320px; }
.mic-pick .cs-trigger { box-shadow: var(--shadow); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px 12px; }

/* ---------- workspace ---------- */
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.col-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.recbar { display: flex; align-items: center; gap: 12px; padding: 22px 24px; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.app.recording .rec-dot { background: var(--danger); animation: blink 1.2s infinite; }
.timer { font-variant-numeric: tabular-nums; font-size: 16px; min-width: 66px; }
.wave { flex: 1; min-width: 60px; height: 44px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); flex: none; }
.btn-ghost, .btn-danger, .btn-primary {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 22px; white-space: nowrap; flex: none;
}
.btn-ghost { border: 1px solid var(--ctl-line); color: var(--accent); background: var(--soft); }
.btn-danger { background: var(--danger); color: #fff; font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary.big { height: 54px; font-size: 17px; padding: 0 28px; border-radius: 27px; justify-content: center; }
.btn-primary svg, .btn-danger svg, .btn-ghost svg { width: 20px; height: 20px; }
button:disabled { opacity: .45; cursor: not-allowed; }

.transcript-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.transcript-card .card-head { padding-top: 26px; }
.lang-pair { display: flex; gap: 10px; }
.lang-pair label, .start-langs label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.lang-pair .cs { min-width: 150px; }

.segments { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px; scroll-behavior: smooth; }
.seg { display: grid; grid-template-columns: 86px 1fr; gap: 6px 16px; padding: 16px 8px; border-bottom: 1px solid var(--line); }
.seg-time { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.seg-speaker { color: var(--muted); font-size: 14px; grid-column: 1; }
.seg-lang {
  width: fit-content; height: fit-content; margin-top: 4px; padding: 0 5px; border-radius: 6px; background: var(--soft); color: var(--text-2);
  font-size: 11px; font-weight: 600; line-height: 18px; letter-spacing: .02em;
}
.seg-lang img { width: 14px; height: 10.5px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.seg-side { display: flex; flex-direction: column; gap: 4px; }
.seg-text { font-size: var(--seg-fs); line-height: 1.55; }
.seg-tr { color: var(--text-2); font-size: calc(var(--seg-fs) - 1px); line-height: 1.55; min-height: 1.4em; }
.seg-text .partial { color: var(--muted); }
.seg.translating .seg-tr::after { content: "▍"; color: var(--accent); animation: blink 1s infinite; }
.seg.pending .seg-text { color: var(--muted); font-style: italic; }
.seg.error .seg-tr { color: var(--danger); }
.interim { display: flex; align-items: baseline; gap: 8px; padding: 12px 34px 20px; color: var(--muted); font-style: italic; }
.interim i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .7; flex: none; align-self: center; animation: blink 1.2s infinite; }
.interim em { color: var(--text-2); font-style: normal; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 正在进行的句子：▶ 标记 + 浅底高亮 */
.seg { border-radius: 12px; transition: background .2s; }
.seg.live { background: var(--soft); }
.seg.live .seg-time::before { content: "▶ "; font-size: 10px; vertical-align: 1px; }

/* 说话人区分（设置 → 说话人区分）：按说话人编号 6 色循环 */
.seg { --spk: var(--accent); --spk-soft: #f3f4ff; }
.seg[data-spk="1"] { --spk: #4f46e5; --spk-soft: #eef0ff; }
.seg[data-spk="2"] { --spk: #0f8a6a; --spk-soft: #e7f6f0; }
.seg[data-spk="3"] { --spk: #c2410c; --spk-soft: #fdf0e6; }
.seg[data-spk="4"] { --spk: #be185d; --spk-soft: #fcebf3; }
.seg[data-spk="5"] { --spk: #0369a1; --spk-soft: #e6f2fa; }
.seg[data-spk="6"] { --spk: #7e22ce; --spk-soft: #f4ebfd; }
:is([data-spk-style="color"], [data-spk-style="bubble"]) .seg-speaker { color: var(--spk); font-weight: 500; }
[data-spk-style="color"] .seg-text { color: var(--spk); }
[data-spk-style="bubble"] .seg { border-bottom: 0; padding: 8px 8px; }
[data-spk-style="bubble"] .seg.live { background: none; }
[data-spk-style="bubble"] .seg-side {
  background: var(--spk-soft); border-left: 3px solid var(--spk); border-radius: 4px 14px 14px 14px; padding: 10px 14px;
}
[data-spk-style="bubble"] .seg.live .seg-side { box-shadow: 0 0 0 2px var(--spk-soft), 0 2px 10px rgba(40, 50, 120, .08); }

/* ---------- summary ---------- */
.summary-card { display: flex; flex-direction: column; min-height: 0; }
.summary-card h2 { font-size: 19px; }
.spark { color: var(--accent); width: 22px; height: 22px; }
.summary-actions { display: flex; align-items: center; gap: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: blink 1.4s infinite; }
.link { color: var(--accent); font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.link:hover { background: var(--accent-soft); }
.summary-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 28px 20px; line-height: 1.7; }
.summary-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 6px; }
.summary-empty .spark.big { width: 40px; height: 40px; color: var(--accent-dim); }
.summary-empty p { margin: 6px 0; }
.dots { display: flex; gap: 6px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-dim); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.export-row { display: flex; align-items: center; gap: 6px; padding: 10px 22px 14px; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.md h3 { font-size: 16px; margin: 18px 0 6px; }
.md h3:first-child { margin-top: 6px; }
.md ul { padding-left: 20px; margin: 6px 0; }
.md p { margin: 8px 0; }
.md code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- home ---------- */
.home-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.start-card { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.start-langs { display: flex; align-items: flex-end; gap: 10px; }
.start-langs label { flex: 1; }
.swap { width: var(--ctl-h); height: var(--ctl-h); border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; display: grid; place-items: center; transition: background .15s; }
.swap:hover { background: var(--accent-soft-2); }
#homeModelDesc { display: flex; flex-direction: column; gap: 2px; line-height: 1.6; font-size: 13px; }
#homeModelDesc .desc-balance { color: var(--accent); }
#homeModelDesc .desc-balance.low { color: var(--danger); font-weight: 600; }
.hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.history-card { max-height: 100%; display: flex; flex-direction: column; min-height: 0; }
.history { list-style: none; margin: 0; padding: 0 12px 12px; overflow-y: auto; }
.history li { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: 12px; cursor: pointer; }
.history li:hover { background: var(--soft); }
.history .h-main { flex: 1; min-width: 0; }
.history .h-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .h-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.history .h-del { color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.history .h-del:hover { color: var(--danger); background: var(--danger-soft); }
.history .h-empty { color: var(--muted); justify-content: center; cursor: default; }

/* ---------- caption overlay ---------- */
.caption-overlay {
  position: fixed; inset: 0; z-index: 50; background: #0d0f1a; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 6vh 6vw 10vh; gap: 2vh;
}
.caption-src { font-size: clamp(18px, 3vw, 32px); color: #a7acc8; line-height: 1.4; }
.caption-tgt { font-size: clamp(26px, 5vw, 60px); font-weight: 600; line-height: 1.35; }
.caption-close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 22px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.08); }

/* ---------- dialog / toast ---------- */
.dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(20, 20, 60, .25); }
.dialog::backdrop { background: rgba(20, 22, 40, .35); }
.dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.field input[type=url], .field input[type=password], .field input[type=email], .field input[type=text], .field input[type=number] {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ctl-line);
}
.field small { color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.status-line { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 12px; line-height: 1.6; }
.dialog menu { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 0; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px);
  background: #23263a; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

/* ---------- 账户 / 管理 ---------- */
.scroll-area { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.scroll-area > section { display: flex; flex-direction: column; gap: 12px; }
.pad { padding: 18px 22px; }
.card-title { font-weight: 600; font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.small { font-size: 13px; font-weight: 400; }
.acc-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 12px; }
.balance-card { padding: 22px; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; display: flex; flex-direction: column; gap: 6px; }
.balance-card .label { opacity: .85; font-size: 14px; }
.balance-num { font-size: 36px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.redeem { display: flex; gap: 8px; }
.redeem input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 0; color: var(--text); text-transform: uppercase; }
.redeem .btn-primary { background: var(--surface); color: var(--accent); height: 42px; }
.stats-card { padding: 18px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 22px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.wrap { white-space: normal; min-width: 160px; }
.tbl input[type=number] { width: 96px; padding: 6px 8px; border: 1px solid var(--ctl-line); border-radius: 8px; text-align: right; }
.tbl .empty-row td { color: var(--muted); text-align: center; padding: 24px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.tag.off { background: var(--soft); color: var(--muted); }
.tag.warn { background: var(--danger-soft); color: var(--danger); }
.more { margin-top: 10px; }
.search { margin-left: auto; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ctl-line); font-weight: 400; min-width: 200px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.inline-form input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ctl-line); width: 140px; }
.codes-out { width: 100%; min-height: 140px; margin-top: 14px; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 10px; font-family: ui-monospace, Consolas, monospace; }
.seg-tabs { display: flex; gap: 4px; background: var(--track); border-radius: 12px; padding: 4px; align-self: flex-start; flex-wrap: wrap; }
.seg-tabs button { padding: 8px 16px; border-radius: 9px; color: var(--text-2); }
.seg-tabs button.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.wallet { color: var(--text-2); }
.btn-xs { padding: 4px 10px; border-radius: 8px; font-size: 13px; color: var(--accent); background: var(--accent-soft); }
.btn-xs.danger { color: var(--danger); background: var(--danger-soft); }

/* 柱状图：单系列，细柱 + 4px 圆角顶部 + 2px 间隙，悬停出提示 */
.bar-chart { position: relative; height: 180px; display: flex; flex-direction: column; }
.bar-chart .plot { flex: 1; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-2); position: relative; }
.bar-chart .bar { flex: 1; min-width: 2px; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar-chart .bar i { display: block; width: 100%; max-width: 18px; margin: 0 auto; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.bar-chart .bar:hover i { background: #4338ca; }
.bar-chart .bar.zero i { background: var(--line-2); }
.bar-chart .axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 6px; }
.bar-chart .ymax { position: absolute; top: -2px; left: 0; font-size: 12px; color: var(--muted); }
.bar-chart .gridline { position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed var(--line-2); }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; background: #23263a; color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; line-height: 1.6; white-space: nowrap; }

/* 登录 */
.auth-wrap { flex: 1; display: grid; place-items: center; }
.auth-card { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.auth-brand img { width: 36px; height: 36px; }
.auth-tabs { display: flex; gap: 4px; background: var(--track); border-radius: 12px; padding: 4px; }
.auth-tabs button { flex: 1; padding: 8px; border-radius: 9px; color: var(--text-2); }
.auth-tabs button.active { background: var(--surface); color: var(--accent); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form input { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--ctl-line); }
.app.no-auth .rail { display: none; }

.mobile-tabs { display: none; }

@keyframes blink { 50% { opacity: .25; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- 手机 / 窄屏 ---------- */
@media (max-width: 900px) {
  :root { font-size: 14px; }
  .app { flex-direction: column-reverse; }
  .rail {
    width: 100%; height: calc(56px + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around;
    padding: 6px 16px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); background: var(--surface);
  }
  .rail-spacer, .avatar { display: none; }
  .view { padding: 14px 16px 10px; gap: 10px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .crumb { margin-bottom: 6px; font-size: 13px; }
  h1 { font-size: 20px; margin-bottom: 6px; }
  .meta { gap: 14px; font-size: 13px; }
  .mic-pick { font-size: 13px; }
  .mic-pick .cs { flex: 1; min-width: 0; max-width: none; }
  .mobile-tabs { display: flex; background: var(--track); border-radius: 12px; padding: 4px; }
  .mobile-tabs button { flex: 1; padding: 8px; border-radius: 9px; color: var(--text-2); }
  .mobile-tabs button.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; }
  .col-left { display: contents; }
  .recbar { order: 3; padding: 10px 12px; gap: 8px; }
  .recbar .wave { height: 34px; }
  .btn-ghost, .btn-danger { height: 38px; padding: 0 12px; }
  .btn-ghost span, .rec-dot { display: none; }
  .tab-pane { display: none; }
  .tab-pane.active { display: flex; }
  .card-head { flex-wrap: wrap; padding: 14px 14px 8px; }
  .transcript-card .card-head { padding-top: 14px; }
  .lang-pair { width: 100%; }
  .lang-pair label { flex: 1; }
  .lang-pair .cs { min-width: 0; }
  .segments { padding: 4px 12px; }
  .seg { grid-template-columns: 1fr; padding: 12px 4px; }
  .seg-meta { display: flex; gap: 10px; }
  .seg-text { font-size: calc(var(--seg-fs) - 1px); }
  .interim { padding: 10px 16px 14px; }
  .summary-body { padding: 4px 16px 16px; }
  .home-grid { grid-template-columns: 1fr; overflow-y: auto; align-content: start; }
  .acc-grid { grid-template-columns: 1fr; }
  .page-head > .btn-ghost { align-self: flex-start; }
  .stats-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { min-width: 0; width: 100%; margin-left: 0; }
  .rail { justify-content: space-between; }
  .start-card { padding: 20px; }
}
@media (max-width: 420px) {
  .btn-danger span { display: none; }
  .timer { min-width: 0; font-size: 14px; }
}
.wallet.low { color: var(--danger); font-weight: 600; }

/* 余额折算时长、用户管理 */
.balance-card .remain { opacity: .9; font-size: 14px; margin: -8px 0 12px; }
.btn-primary.btn-sm, .btn-ghost.btn-sm, .btn-danger.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 19px; }
.toolbar { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { margin-left: 0; }
.toolbar .cs, .inline-form .cs { min-width: 120px; font-weight: 400; }
.toolbar .cs-trigger, .inline-form .cs-trigger { height: 38px; }
.tbl.clickable tr[data-user] { cursor: pointer; }
.tbl.clickable tr[data-user]:hover td { background: var(--soft); }
.settings-stack { display: flex; flex-direction: column; gap: 14px; }
.field .row { display: flex; gap: 8px; align-items: center; }
.field .row input { flex: 1; min-width: 0; }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dlg-inner { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; max-height: min(86vh, 900px); overflow-y: auto; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-head h2 { margin: 0 0 4px; font-size: 20px; }
.dlg-head p { margin: 0; }
.dlg-close { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); flex: none; }
.dlg-close:hover { background: var(--soft); }
.ud-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; padding: 14px 16px; background: var(--soft); border-radius: 12px; }
#udBody { display: flex; flex-direction: column; gap: 22px; }
.ud-stats .stat b { font-size: 18px; }
.ud-section { display: flex; flex-direction: column; gap: 8px; }
.ud-section h3 { margin: 0; font-size: 15px; }
.dlg-inner .inline-form { padding: 0; flex-direction: row; gap: 10px; }
.dlg-inner .inline-form input { width: 150px; }
.ud-danger { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .toolbar { margin-left: 0; width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .cs { flex: 1; }
  .ud-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlg-inner { padding: 18px 16px; }
  .inline-form label { flex: 1 1 140px; }
  .inline-form input, .dlg-inner .inline-form input { width: 100%; }
}

/* ---------- 统一表单控件：输入框和下拉框同一套边框、悬停、聚焦样式 ---------- */
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea) { transition: border-color .15s, box-shadow .15s; }
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea):hover { border-color: var(--ctl-hover); }
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea):focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=checkbox], input[type=range] { accent-color: var(--accent); }

/* 自定义下拉框（js/select.js） */
.cs { position: relative; display: inline-flex; min-width: 0; vertical-align: middle; }
.cs-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cs.touch .cs-native { inset: 0; width: 100%; height: 100%; pointer-events: auto; cursor: pointer; font-size: 16px; }
.cs.touch .cs-trigger { pointer-events: none; }
.cs-trigger {
  flex: 1; min-width: 0; height: var(--ctl-h); display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px; border: 1px solid var(--ctl-line); border-radius: 10px; background: var(--surface);
  font-size: 14px; color: var(--text); text-align: left; transition: border-color .15s, box-shadow .15s;
}
.cs-trigger:not(:disabled):hover { border-color: var(--ctl-hover); }
.cs-trigger:focus-visible, .cs.open .cs-trigger, .cs.touch:focus-within .cs-trigger {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.cs-trigger:disabled { opacity: 1; cursor: default; background: var(--soft); }
.cs-trigger:disabled .cs-chev { display: none; }
.cs-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cs-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-sub { flex: none; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.cs-trigger .cs-sub { display: none; }
.cs.show-sub .cs-trigger .cs-sub { display: inline; margin-left: auto; }
.cs-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.cs.open .cs-chev { transform: rotate(180deg); color: var(--accent); }
.cs-badge {
  flex: none; min-width: 26px; padding: 0 5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; letter-spacing: .02em;
}
.cs-icon { flex: none; width: 22px; height: 16.5px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.cs-menu {
  position: fixed; z-index: 80; overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(30, 35, 90, .14), 0 2px 6px rgba(30, 35, 90, .06); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  animation: cs-in .12s ease-out;
}
.cs-menu[hidden] { display: none; }
.cs-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap; }
.cs-opt .cs-label { flex: 1; }
.cs-opt.active { background: var(--soft); }
.cs-opt.selected { color: var(--accent); font-weight: 600; }
.cs-opt.selected .cs-badge { background: var(--accent); color: #fff; }
.cs-opt.disabled { opacity: .45; cursor: not-allowed; }
.cs-check { width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
.cs-opt.selected .cs-check { visibility: visible; }
@keyframes cs-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- 设置页 ---------- */
.set-list { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 600; }
.set-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.choice { display: flex; gap: 4px; background: var(--track); border-radius: 10px; padding: 3px; flex: none; }
.choice button { padding: 6px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px; white-space: nowrap; }
.choice button.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line-2); transition: background .2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
.range-wrap small { color: var(--muted); min-width: 60px; }
.inline-form label.grow { flex: 1 1 260px; }
.inline-form label.grow input { width: 100%; }
#apiBaseForm + .status-line { margin-top: 14px; }
.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #7d7ff6, #5b5ff0); color: #fff; font-size: 24px; font-weight: 600;
}
.profile-name { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.preview-segs { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.sc-table td { white-space: normal; }
.sc-table.off { opacity: .5; }
.kbd-btn {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 130px;
  padding: 6px 10px; border-radius: 10px; border: 1px dashed transparent;
}
.kbd-btn:hover { border-color: var(--ctl-line); background: var(--soft); }
.kbd-btn.recording { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.kbd-btn i { color: var(--muted); font-style: normal; font-size: 12px; }
kbd {
  display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--ctl-line); border-bottom-width: 2px;
  background: var(--surface); color: var(--text); font: 600 12px/18px ui-monospace, Consolas, monospace; text-align: center;
}
.login-list { list-style: none; margin: 0; padding: 0; }
.login-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.login-list li:last-child { border-bottom: 0; }
.login-main { flex: 1; min-width: 0; }
.login-main .small { margin-top: 3px; }
.sto-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px;
  padding: 14px 16px; margin-bottom: 14px; background: var(--soft); border-radius: 12px;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-ghost.danger { color: var(--danger); }
@media (max-width: 900px) {
  .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .set-row .switch, .choice { align-self: flex-start; }
  .emo-box { justify-content: flex-start; }
  .choice { flex-wrap: wrap; }
  .sto-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 80px 1fr; }
}

/* 深色主题下的说话人颜色：文字调亮、底色调暗 */
[data-theme="dark"] .seg { --spk-soft: #25284a; }
[data-theme="dark"] .seg[data-spk="1"] { --spk: #a5a8ff; --spk-soft: #25284a; }
[data-theme="dark"] .seg[data-spk="2"] { --spk: #4fd1a5; --spk-soft: #16302a; }
[data-theme="dark"] .seg[data-spk="3"] { --spk: #fb9a5c; --spk-soft: #3a261a; }
[data-theme="dark"] .seg[data-spk="4"] { --spk: #f47cb0; --spk-soft: #3a1f2d; }
[data-theme="dark"] .seg[data-spk="5"] { --spk: #5cb8f0; --spk-soft: #16293a; }
[data-theme="dark"] .seg[data-spk="6"] { --spk: #c48af5; --spk-soft: #2e2140; }


/* ---------- 对话翻译（点按说话，面向手机） ---------- */
.conv-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 15px;
  border: 1px solid var(--ctl-line); color: var(--text-2); font-size: 13px; font-weight: 500;
}
.conv-chip svg { width: 15px; height: 15px; }
.conv-chip:hover { border-color: var(--ctl-hover); }
.conv-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dialog-entry { justify-content: center; margin-top: -8px; }
.dialog-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dialog-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.dialog-langs { display: flex; align-items: flex-end; gap: 8px; }
.dialog-langs label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.dialog-langs .cs { min-width: 140px; }
.dialog-tools { display: flex; align-items: center; gap: 8px; }
.dialog-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.dialog-list .empty small { font-size: 13px; }

/* 气泡：我（右，主色）、对方（左，绿）、第三方（左，橙）。原文小一号，译文放大加粗（给对方看/听） */
.dmsg { align-self: flex-start; max-width: 82%; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: #e7f6f0; color: var(--text); }
.dmsg.third { background: #fdf0e6; }
.dmsg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 16px 4px 16px 16px; }
[data-theme="dark"] .dmsg { background: #16302a; }
[data-theme="dark"] .dmsg.third { background: #3a261a; }
[data-theme="dark"] .dmsg.mine { background: #4f52c9; }
.dmsg-text { font-size: calc(var(--seg-fs) - 2px); line-height: 1.5; opacity: .8; }
.dmsg.pending .dmsg-text { font-style: italic; }
.dmsg.pending .dmsg-text::after { content: " ▍"; animation: blink 1s infinite; }
.dmsg-trs { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dmsg-trs:empty { display: none; }
.dmsg-tr { display: flex; align-items: flex-start; gap: 8px; font-size: calc(var(--seg-fs) + 2px); font-weight: 600; line-height: 1.45; }
.dmsg-tr img { flex: none; width: 18px; height: 13.5px; margin-top: .35em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.dmsg-tr span { flex: 1; }
.dmsg.error { background: var(--danger-soft); color: var(--danger); }
.dmsg-play {
  flex: none; width: 28px; height: 28px; margin: -2px -6px 0 0; border-radius: 50%;
  display: grid; place-items: center; color: inherit; opacity: .8;
}
.dmsg-play:hover { opacity: 1; background: rgba(127, 127, 127, .15); }
.dmsg-play svg { width: 16px; height: 16px; }

.dialog-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.dialog-bar[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.talk-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 100px; padding: 12px 8px;
  border: 2px solid #9fd9c3; border-radius: 18px; background: #f0faf6; color: var(--text);
  transition: transform .1s, background .2s, box-shadow .1s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.talk-btn.third { border-color: #f5c9a6; background: #fff6ef; }
.talk-btn.mine { border-color: var(--accent); background: var(--accent-soft); }
[data-theme="dark"] .talk-btn { background: #16302a; border-color: #2e6b55; }
[data-theme="dark"] .talk-btn.third { background: #3a261a; border-color: #7a4a2a; }
[data-theme="dark"] .talk-btn.mine { background: var(--accent-soft); border-color: var(--accent); }
.talk-btn:active { transform: scale(.97); }
.talk-flag { width: 30px; height: 22.5px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.talk-flag:not([src]), .talk-flag[src=""] { display: none; }
.talk-lang { font-size: 18px; font-weight: 600; }
.talk-sub { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
/* 录音中：红色 + 外圈随音量变大（--lv 由 dialog.js 写到 .dialog-bar 上） */
.talk-btn.recording {
  background: var(--danger); border-color: var(--danger); color: #fff;
  box-shadow: 0 0 0 calc(3px + var(--lv, 0) * 14px) var(--danger-soft);
}
.talk-btn.recording .talk-sub { color: rgba(255, 255, 255, .9); }
@media (max-width: 900px) {
  .dialog-intro { display: none; }
  .dialog-top { padding: 12px 12px 10px; }
  .dialog-langs { width: 100%; gap: 6px; }
  .dialog-langs label { flex: 1; min-width: 0; font-size: 12px; }
  .dialog-langs .cs { min-width: 0; }
  .dialog-tools { width: 100%; justify-content: space-between; }
  .dialog-list { padding: 12px; }
  .dmsg { max-width: 90%; }
  .dialog-bar { padding: 10px 12px 12px; gap: 8px; }
  .talk-btn { min-height: 112px; }
  .dialog-bar[data-n="3"] .talk-lang { font-size: 16px; }
}

/* ---------- 实时翻译开关 ---------- */
.tr-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: -8px; }
.tr-toggle b { font-weight: 600; font-size: 14px; }
.tr-toggle p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.transcript-card h2 .conv-chip { margin-left: 10px; }
/* 关闭翻译：翻译语言变灰，转写里不显示译文行和光标 */
.no-translate .lbl-tgt, .no-translate .lbl-tgt + .cs { opacity: .45; }
.no-translate .seg-tr:empty { display: none; }
.no-translate .seg.translating .seg-tr::after { content: none; }
.seg:not(.translating) .seg-tr:empty { display: none; } /* 只在等译文时占位；没有译文的句子不留空行 */

/* ---------- 首页：左栏三个入口，右栏今日统计 ---------- */
.home-grid { overflow-y: auto; padding-bottom: 8px; }

.home-grid .history-card { max-height: none; }
.home-grid .history { max-height: 420px; }
.entry-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-title > svg { width: 22px; height: 22px; color: var(--accent); }
.entry-title h2 { font-size: 18px; }
.entry-card { padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.entry-card .btn-ghost.big { justify-content: center; height: 48px; }
.entry-langs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.entry-langs span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--soft); }
.entry-langs img { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.entry-langs i { color: var(--muted); font-style: normal; }
.entry-balance { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.entry-balance b { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-balance span { color: var(--accent); font-size: 14px; }
.entry-card > .small { margin: -8px 0 0; }

.today-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; padding: 14px 16px; background: var(--soft); border-radius: 12px; }
.card-title .btn-sm svg { width: 16px; height: 16px; }

/* 今日运势 */
.fortune { margin-top: 14px; padding: 16px 18px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5); }
.fortune.flip { animation: fortune-in .45s ease-out; }
.fortune-cover { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fortune-cover p { margin: 0; flex: 1; opacity: .9; font-size: 14px; }
.fortune .btn-primary { background: #fff; color: #4f46e5; }
.fortune-title { font-size: 14px; opacity: .9; }
.fortune-head { display: flex; align-items: baseline; gap: 12px; }
.fortune-level { font-size: 30px; font-weight: 800; letter-spacing: .05em; }
.fortune-stars { color: #ffd76a; font-size: 18px; letter-spacing: 2px; }
.fortune-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 14px; }
.fortune-rows > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fortune-rows span { padding: 1px 8px; border-radius: 8px; background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 600; }
.fortune-rows img { width: 18px; height: 13.5px; border-radius: 2px; }
.fortune-comment { margin: 10px 0 0; font-size: 13px; opacity: .9; }
@keyframes fortune-in { from { transform: scale(.96); opacity: .3; } }
/* 宽屏：热力图和近 7 天柱状图并排 */
.home-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1280px) { .home-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }

/* 热力图：单色顺序色阶（浅 → 深 = 少 → 多），空白日为中性灰；深色模式由暗到亮 */
.heatmap { --h0: var(--line-2); --h1: #d4d6fc; --h2: #a5a8f7; --h3: #7175ef; --h4: #4338ca; max-width: 470px; }
[data-theme="dark"] .heatmap { --h0: #262a3c; --h1: #2f3370; --h2: #444aa8; --h3: #6669e0; --h4: #a5a8ff; }
.heat-months { display: grid; gap: 3px; margin-left: 22px; height: 16px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.heat-body { display: flex; gap: 6px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; width: 16px; font-size: 11px; line-height: 1; color: var(--muted); }
.heat-days span { display: flex; align-items: center; }
.heat-grid { flex: 1; display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 3px; }
.heat-grid i, .heat-legend i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--h0); }
.heat-grid i.future { background: none; }
.heat-grid i[data-d]:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.heatmap .l1 { background: var(--h1); }
.heatmap .l2 { background: var(--h2); }
.heatmap .l3 { background: var(--h3); }
.heatmap .l4 { background: var(--h4); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.heat-legend i { width: 11px; }
.bar-chart .axis.each span { flex: 1; text-align: center; }
.week-chart { height: 170px; }

/* 热词 / 热句 */
.hot-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.hot-words { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-word { cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 11px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.hot-word.top { font-weight: 700; font-size: 15px; }
.hot-word small { color: var(--muted); font-size: 11px; }
.hot-sentences { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.hot-sentences small { display: block; color: var(--muted); }

/* 分享 */
.share-img { display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 12px; box-shadow: var(--shadow); }
.share-dialog .btn-row { justify-content: center; margin-top: 4px; }
.share-dialog .dlg-inner > .small { text-align: center; margin: 0; }

@media (max-width: 900px) {
  .entry-card { padding: 18px 20px; }
  .today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hot-card { grid-template-columns: 1fr; }
  .heatmap { max-width: none; }
}

/* ---------- 骨架占位：数据没到时显示灰色闪动块 ---------- */
.sk {
  display: block; border-radius: 8px; color: transparent !important; list-style: none;
  background: linear-gradient(90deg, var(--line-2) 25%, var(--soft) 50%, var(--line-2) 75%) 0 0 / 300% 100%;
  animation: sk-shine 1.4s ease-in-out infinite;
}
.sk-line { height: 12px; margin: 4px 0; }
.sk-line.tall { height: 24px; margin-top: 8px; }
.sk-line.on-dark { background: linear-gradient(90deg, rgba(255,255,255,.18) 25%, rgba(255,255,255,.32) 50%, rgba(255,255,255,.18) 75%) 0 0 / 300% 100%; }
.w30 { width: 30%; } .w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w90 { width: 90%; }
.sk-chip { display: inline-block; width: 72px; height: 30px; border-radius: 15px; }
.sk-block { width: 100%; border-radius: 10px; }
.sk-block.h-heat { height: 170px; }
.sk-block.h-bars { height: 160px; }
.hot-sentences li.sk { margin-left: -20px; height: 14px; }
.entry-balance b .sk { width: 120px; }
/* 下拉框在配置加载完之前也显示骨架 */
.start-card.loading .cs-trigger, .dialog-card.loading .cs-trigger {
  pointer-events: none; border-color: transparent;
  background: linear-gradient(90deg, var(--line-2) 25%, var(--soft) 50%, var(--line-2) 75%) 0 0 / 300% 100%;
  animation: sk-shine 1.4s ease-in-out infinite;
}
.start-card.loading .cs-trigger > *, .dialog-card.loading .cs-trigger > * { visibility: hidden; }
.start-card.loading #homeModelDesc { visibility: hidden; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .start-card.loading .cs-trigger, .dialog-card.loading .cs-trigger { animation: none; } }

/* ---------- 首页交互：点某一天筛选历史、点热词看句子 ---------- */
.heat-grid i[data-d], #weekChart .bar { cursor: pointer; }
.heat-grid i.sel { outline: 2px solid var(--text); outline-offset: 1px; }
#weekChart .bar.sel i { background: #4338ca; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.hot-word:hover { border-color: var(--accent); }
.hot-word.active { background: var(--accent); color: #fff; }
.hot-word.active small { color: rgba(255, 255, 255, .8); }
.hot-sentences mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 2px; }
[data-theme="dark"] .hot-sentences mark { background: #6b5a12; }
.h-filter {
  margin-left: 10px; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
}
.h-filter:hover { background: var(--accent-soft-2); }
/* JS 还没执行（下拉框还是原生 select）时也显示骨架 */
.start-card.loading select:not(.cs-native), .dialog-card.loading select:not(.cs-native) {
  appearance: none; width: 100%; height: var(--ctl-h); border: 0; border-radius: 10px; color: transparent;
  background: linear-gradient(90deg, var(--line-2) 25%, var(--soft) 50%, var(--line-2) 75%) 0 0 / 300% 100%;
  animation: sk-shine 1.4s ease-in-out infinite;
}

/* ---------- 消费提示（设置 → 外观 可关闭） ---------- */
.hide-cost .cost { display: none !important; }
.meta-cost { color: var(--muted); }
.meta-cost:empty { display: none; }
.dmsg-meta { margin-top: 6px; font-size: 12px; opacity: .7; text-align: right; }
.spent-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; margin-top: -4px; border-radius: 12px; background: var(--soft); }
.spent-row .stat b { font-size: 16px; }

/* ================= 改版 v3：首页品牌区、新手任务、场景、定价、录制栏、设置左侧导航 ================= */
/* 卡片标题统一带小图标 */
.card-title > svg, .card-head h2 > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

/* 首页品牌区 */
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-brand { display: flex; align-items: center; gap: 14px; }
.hero-logo { width: 52px; height: 52px; border-radius: 14px; box-shadow: var(--shadow); }
.hero-title { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero-sub { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.hero-side { display: flex; align-items: center; gap: 10px; }
.theme-toggle { background: var(--surface); }
.theme-toggle .i-sun, [data-theme="dark"] .theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
.hero-user { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.hero-user-text { display: flex; flex-direction: column; line-height: 1.3; }
.hero-user-text b { font-size: 14px; }
.hero-user-text small { font-size: 12px; color: var(--accent); }
.u-avatar, .avatar, .profile-avatar { overflow: hidden; }
.u-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #7d7ff6, #5b5ff0); color: #fff; font-weight: 700;
}
.u-avatar img, .avatar img, .profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar { font-weight: 700; color: #fff; }
.avatar.has-img, .u-avatar.has-img, .profile-avatar.has-img { background: none; }

/* 今日统计、今日运势：两张卡并排 */
.today-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.today-row .fortune { margin-top: 0; }
.today-row .today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.start-card .card-title, .entry-card .card-title { margin-bottom: 0; font-size: 17px; }

/* 新手任务：逐级解锁 */
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tasks li { display: flex; gap: 12px; align-items: flex-start; }
.tasks li > i {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted);
}
.tasks li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tasks b { font-size: 14px; font-weight: 600; }
.tasks small { color: var(--muted); font-size: 12px; }
.tasks .done > i { background: var(--ok-soft); color: var(--ok); }
.tasks .done b { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.tasks .current > i { background: var(--accent); color: #fff; }
.tasks .locked { opacity: .55; }
.tasks .locked > i { font-size: 11px; }
.task-bar { display: block; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.task-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* 应用场景 */
.scenes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scene {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .1s;
}
.scene:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.scene:active { transform: scale(.99); }
.scene-top { display: flex; align-items: center; justify-content: space-between; }
.scene-group { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.scene-group.is-live { background: var(--accent-soft); color: var(--accent); }
.scene-group.is-dialog { background: var(--ok-soft); color: var(--ok); }
.scene-flags { display: flex; align-items: center; gap: 4px; }
.scene-flags img { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.scene-flags i { font-style: normal; color: var(--muted); font-size: 12px; }
.scene b { font-size: 15px; }
.scene small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.scene-go { margin-top: auto; color: var(--accent); font-size: 13px; font-weight: 600; }

/* 定价 */
.pricing { display: flex; flex-direction: column; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.price-row > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.price-row small { color: var(--muted); font-size: 12px; }
.price { text-align: right; white-space: nowrap; }
.price b { font-size: 18px; color: var(--accent); }
.pricing > p { margin: 10px 0 0; }

/* 录制栏：开始 / 继续 / 暂停 / 结束都带文字 */
.rec-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 16px; background: var(--soft); font-size: 13px; color: var(--text-2); flex: none; }
.app.recording .rec-status { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.app.paused .rec-status { background: #fff4dd; color: #a86a00; }
[data-theme="dark"] .app.paused .rec-status { background: #3a2e12; color: #ffc65a; }
.rec-main {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 23px; flex: none;
  background: var(--danger); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 14px rgba(242, 54, 61, .3);
}
.rec-main:hover { filter: brightness(1.05); }
.rec-main svg { width: 20px; height: 20px; }
.rec-main .i-play, .rec-main.resume .i-mic { display: none; }
.rec-main.resume .i-play { display: block; fill: currentColor; }

/* 设置：左侧竖排导航 */
.settings-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; align-self: start; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.set-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; text-align: left; }
.set-nav button svg { width: 18px; height: 18px; }
.set-nav button:hover { background: var(--soft); }
.set-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.profile-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.profile-actions label { cursor: pointer; }
.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voice-lang { display: inline-flex; align-items: center; gap: 6px; min-width: 96px; font-size: 14px; }
.voice-lang img { width: 20px; height: 15px; border-radius: 2px; }
.voice-row .cs { flex: 1; min-width: 200px; }
.set-row .cs { min-width: 240px; }

/* 云端朗读：选音色、语气、我的声音（克隆）；会员 */
.tag.vip { background: var(--vip-soft); color: var(--vip); }
.voice-cur { flex: 1; min-width: 0; color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 6px; }
.vcard { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.vcard:hover { border-color: var(--accent-dim); }
.vcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vcard.on { border-color: var(--accent); background: var(--accent-soft); }
.vcard.locked .vcard-main { opacity: .7; }
.vcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vcard-main b { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.vcard-main small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.vcard-play { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.vcard.on .vcard-play { background: var(--surface); }
.vcard-play.loading, #emoPreview.loading, [data-clone-play].loading { opacity: .5; pointer-events: none; }
.emo-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.emo-box .choice { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
.clone-state p { margin: 0 0 10px; }
.clone-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.clone-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-bottom: 12px; cursor: pointer; }
.clone-consent input { margin-top: 3px; }
.clone-err { color: var(--danger); font-size: 14px; }
.clone-script { margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: var(--soft); border-left: 3px solid var(--accent);
  font-size: 17px; line-height: 1.9; }
.clone-meter { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.clone-meter i { --lv: 0; position: relative; width: 120px; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.clone-meter i::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--lv) * 100%); background: var(--ok); border-radius: 4px; }
.clone-meter b { font-size: 18px; font-variant-numeric: tabular-nums; }
.vip-card { padding: 20px 22px; margin-bottom: 14px; background: linear-gradient(135deg, var(--vip-soft), var(--card) 70%); }
.vip-head { display: flex; align-items: center; gap: 14px; }
.vip-head svg { width: 40px; height: 40px; color: var(--vip); }
.vip-head div { display: flex; flex-direction: column; gap: 3px; }
.vip-head b { font-size: 20px; }
.vip-head small { color: var(--text-2); font-size: 13px; }
.vip-perks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.vip-perks li { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface); }
.vip-perks b { font-size: 14px; }
.vip-perks small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.vip-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.vip-plans:empty { display: none; }
.vip-plan { padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.vip-plan b { font-size: 15px; }
.vip-price { font-size: 26px; font-weight: 700; color: var(--vip); font-variant-numeric: tabular-nums; }
.vip-plan .btn-primary { margin-top: 6px; }
.auth-brand small { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }

@media (max-width: 900px) {
  .hero-title { font-size: 28px; }
  .hero-logo { width: 44px; height: 44px; }
  .hero-user-text { display: none; }
  .hero-user { padding: 4px; }
  .today-row, .scenes { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .set-nav { flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .set-nav button { flex: none; padding: 8px 10px; }
  /* 手机：第一行 状态 + 计时 + 字幕，第二行 带文字的大按钮 */
  .recbar { flex-wrap: wrap; }
  .recbar .wave { display: none; }
  .recbar .rec-dot { display: block; }
  .recbar .timer { margin-right: auto; }
  .recbar .rec-main, .recbar #btnPause, .recbar #btnStop { flex: 1 1 40%; justify-content: center; height: 44px; }
  .recbar .btn-ghost span, .recbar .btn-danger span { display: inline; }
  .set-row .cs { min-width: 0; width: 100%; }
}
.today-row > .card { display: flex; flex-direction: column; }
.today-row .fortune { flex: 1; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 900px) {
  .meta { flex-wrap: wrap; gap: 4px 14px; }
  .meta > span { white-space: nowrap; }
  .hero-side { margin-left: auto; }
}

/* ================= v4：笔记管理、邀请好友 ================= */
.notes-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notes-bar .search { margin-left: 0; flex: 1; min-width: 220px; max-width: 420px; padding: 10px 14px; background: var(--surface); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-content: start; }
.notes-grid .sk-block { height: 180px; }
.notes-empty { grid-column: 1 / -1; }
.note { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.note-top { display: flex; align-items: center; gap: 8px; }
.note-kind { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.note-kind.is-dialog { background: var(--ok-soft); color: var(--ok); }
.note-langs { display: inline-flex; align-items: center; gap: 4px; }
.note-langs img { width: 18px; height: 13.5px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.note-langs i { font-style: normal; color: var(--muted); font-size: 11px; }
.note-star { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.note-star:hover { background: var(--soft); }
.note-star.on { color: #f5a524; }
.note-star.on svg { fill: currentColor; }
.note-title { margin: 0; font-size: 16px; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-title:hover { color: var(--accent); }
.note-preview {
  margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; cursor: pointer; min-height: 3.1em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-meta { font-size: 12px; color: var(--muted); }
.note-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.note-export { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); margin-left: auto; }
.note-export .link { font-size: 12px; padding: 2px 4px; }

.invite-link { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.invite-link input { flex: 1; min-width: 220px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ctl-line); background: var(--soft); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.task-note { margin: 0; }

/* ---------- 邀请卡片：顶部插画 + 双方奖励 + 复制/分享 ---------- */
:root { --inv-a: #d9f6e4; --inv-b: #fff3cc; --inv-hi: #12a866; --inv-ring: rgba(255, 255, 255, .8); --inv-dark: #1f2333; --inv-dark-text: #fff; }
:root[data-theme="dark"] { --inv-a: #16352a; --inv-b: #33301a; --inv-hi: #4fd394; --inv-ring: rgba(255, 255, 255, .12); --inv-dark: #e6e8f2; --inv-dark-text: #1b1e2a; }
.inv-card { overflow: hidden; margin-bottom: 16px; }
.inv-hero {
  position: relative; min-height: 210px; padding: 52px 190px 84px 128px;
  background: linear-gradient(120deg, var(--inv-a) 0%, var(--inv-a) 45%, var(--inv-b) 100%);
}
.inv-orbit { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.inv-ring { position: absolute; border: 1.5px solid var(--inv-ring); border-radius: 50%; }
.inv-ring.r1 { width: 520px; height: 520px; left: -60px; top: 18px; }
.inv-ring.r2 { width: 340px; height: 340px; left: 30px; top: 104px; }
.inv-spark { position: absolute; width: 10px; height: 10px; background: #fff; transform: rotate(45deg); border-radius: 2px; opacity: .9; }
.inv-spark.s1 { left: 47%; top: 34px; }
.inv-spark.s2 { left: 96px; top: 96px; width: 7px; height: 7px; }
.inv-flag {
  position: absolute; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: #fff; box-shadow: 0 6px 18px rgba(30, 60, 50, .12); animation: inv-float 5s ease-in-out infinite;
}
.inv-flag img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.inv-flag.f1 { left: 30px; top: 30px; transform: rotate(-8deg); }
.inv-flag.f2 { left: 14px; top: 124px; animation-delay: -1.2s; }
.inv-flag.f3 { left: 30%; top: 8px; width: 44px; height: 44px; transform: rotate(6deg); animation-delay: -2.4s; }
.inv-flag.f3 img { width: 26px; height: 26px; }
.inv-flag.f4 { left: 58%; top: 14px; width: 42px; height: 42px; transform: rotate(10deg); animation-delay: -3.6s; }
.inv-flag.f4 img { width: 24px; height: 24px; }
@keyframes inv-float { 50% { translate: 0 -6px; } }
.inv-mascot { position: absolute; right: 30px; top: 30px; width: 136px; height: 136px; animation: inv-float 4s ease-in-out infinite; }
.inv-mascot img { width: 100%; height: 100%; filter: drop-shadow(0 10px 16px rgba(160, 110, 0, .22)); }
.inv-bubble {
  position: absolute; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #fff; color: #1f2333; box-shadow: 0 4px 12px rgba(30, 60, 50, .12);
}
.inv-bubble.b1 { left: -34px; top: 6px; border-bottom-right-radius: 3px; }
.inv-bubble.b2 { right: -10px; bottom: 6px; border-top-left-radius: 3px; background: var(--inv-hi); color: #fff; }
.inv-head { position: relative; }
.inv-head h2 { display: block; margin: 0 0 10px; font-size: 26px; line-height: 1.3; font-weight: 700; color: var(--text); }
.inv-head h2 em { display: block; font-style: normal; color: var(--inv-hi); }
.inv-head p { margin: 0; font-size: 14px; color: var(--text-2); }
.inv-head p b { color: var(--inv-hi); font-weight: 600; }
.inv-body { padding: 0 32px 22px; }
.inv-rewards {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: -56px 0 22px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 8px 24px rgba(30, 50, 90, .06);
}
.inv-rewards > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px; text-align: center; }
.inv-rewards > div + div { border-left: 1px dashed var(--line-2); }
.inv-rewards span { font-size: 14px; font-weight: 600; }
.inv-rewards b { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-rewards small { max-width: 240px; font-size: 13px; line-height: 1.65; color: var(--text-2); }
.inv-link { gap: 10px; margin-bottom: 6px; }
.inv-link input { height: 44px; padding: 0 14px; font-size: 14px; }
.inv-copy {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--inv-dark); color: var(--inv-dark-text); font-size: 15px; font-weight: 600; cursor: pointer;
}
.inv-copy:hover { opacity: .88; }
.inv-copy svg { width: 18px; height: 18px; }
.inv-code { margin: 0 0 20px; }
.inv-or { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.inv-or::before, .inv-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.inv-share { display: flex; justify-content: center; gap: 10px 28px; flex-wrap: wrap; margin-bottom: 20px; }
.inv-share button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; }
.inv-share i {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: var(--soft); border: 1px solid var(--line-2); transition: transform .15s, border-color .15s;
}
.inv-share button:hover i { transform: translateY(-2px); border-color: var(--ctl-hover); }
.inv-share svg { width: 24px; height: 24px; }
.ic-wechat svg, .ic-qq svg, .ic-weibo svg { fill: currentColor; stroke: none; }
.ic-wechat { color: #07c160; }
.ic-qq { color: #12b7f5; }
.ic-weibo { color: #e6162d; }
.ic-mail, .ic-more { color: var(--text); }
.inv-history {
  display: flex; align-items: center; gap: 6px; margin: 0 auto; padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
}
.inv-history:hover { background: var(--soft); }
.inv-history b { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 20px; }
.inv-history b:empty { display: none; }
@media (max-width: 640px) {
  .inv-hero { min-height: 0; padding: 26px 112px 78px 18px; }
  .inv-head h2 { font-size: 21px; }
  .inv-flag, .inv-ring.r2, .inv-spark.s2 { display: none; }
  .inv-mascot { right: 12px; top: 34px; width: 84px; height: 84px; }
  .inv-bubble { font-size: 11px; padding: 3px 8px; }
  .inv-bubble.b1 { left: -26px; top: -4px; }
  .inv-body { padding: 0 16px 18px; }
  .inv-rewards > div { padding: 16px 10px; }
  .inv-rewards b { font-size: 22px; }
  .inv-rewards small { font-size: 12px; }
  .inv-link input { min-width: 0; }
  .inv-copy { flex: 1 0 100%; justify-content: center; }
  .inv-share { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 10px 4px; }
  .inv-share i { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .inv-flag, .inv-mascot { animation: none; } }

/* ---------- 登录：找回密码、同意协议 ---------- */
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -6px; }
.auth-links .link { font-size: 13px; }
.auth-links > span { margin-left: auto; display: flex; gap: 2px; }
.auth-agree { align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.auth-agree input { margin-top: 4px; flex: none; }
.link-inline { color: var(--accent); }
.link-inline:hover { text-decoration: underline; }
#authResetTitle { font-size: 18px; }
#btnSendCode { flex: none; height: 40px; padding: 0 12px; }
#btnSendCode:disabled { opacity: .6; cursor: default; }

/* ---------- 记录页 AI 卡片：总结 / 问答 ---------- */
.summary-card .card-head { flex-wrap: wrap; }
.summary-card .card-head h2 { margin-right: -2px; }
.ai-tabs { display: flex; gap: 2px; background: var(--track); border-radius: 10px; padding: 3px; margin-right: auto; }
.ai-tabs button { padding: 4px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); }
.ai-tabs button.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
.summary-actions .cs { min-width: 0; font-size: 13px; }
.summary-actions .cs-trigger { height: 32px; padding: 0 28px 0 10px; }
#btnSummarize:disabled { opacity: .6; cursor: default; }
.ai-off { display: none !important; }
.ts { color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 0 5px; font-size: .88em; font-variant-numeric: tabular-nums; }
.ts:hover { background: var(--accent-soft-2); }
@keyframes seg-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.seg.flash { animation: seg-flash 1.8s ease-out; border-radius: 10px; }

.qa-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qa-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px 12px; display: flex; flex-direction: column; gap: 14px; }
.qa-item { display: flex; flex-direction: column; gap: 6px; }
.qa-q { align-self: flex-end; max-width: 85%; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; line-height: 1.6; }
.qa-a { align-self: flex-start; max-width: 95%; background: var(--soft); padding: 8px 14px; border-radius: 14px 14px 14px 4px; line-height: 1.7; }
.qa-a p:first-child, .qa-a h3:first-child { margin-top: 0; }
.qa-a p:last-child { margin-bottom: 0; }
.qa-a.pending .dots { padding: 6px 0; }
.qa-empty { margin: auto 0; text-align: center; color: var(--muted); font-size: 14px; }
.qa-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chip { padding: 6px 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.chip:hover { background: var(--accent-soft-2); }
.qa-form { display: flex; gap: 8px; padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.qa-form input { flex: 1; min-width: 0; padding: 0 14px; height: 38px; border-radius: 19px; border: 1px solid var(--ctl-line); background: var(--surface); }
.qa-form button:disabled { opacity: .6; }
@media (max-width: 900px) {
  .qa-list { padding: 4px 12px 10px; }
  .qa-form { padding: 8px 10px 10px; }
}

/* 文件识别 */
.note-kind.is-file { background: var(--track); color: var(--text-2); }
.files-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; border: 2px dashed var(--ctl-line);
  border-radius: 14px; background: var(--soft); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.picked { border-style: solid; border-color: var(--accent); }
.drop-zone svg { width: 36px; height: 36px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone b { font-weight: 600; word-break: break-all; }
.drop-zone small { color: var(--muted); font-size: 13px; }
#fileTgtRow.off { opacity: .45; pointer-events: none; }
.upload-progress { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: -8px; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.file-jobs { list-style: none; margin: 0; padding: 0; }
.file-job { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.file-job:last-child { border-bottom: 0; }
.fj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fj-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fj-main small { font-size: 12px; }
.fj-err { color: var(--danger); }
.fj-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); white-space: nowrap; }
.file-job.is-done .fj-status { color: var(--ok); }
.file-job.is-error .fj-status { color: var(--danger); }
.fj-spin { width: 12px; height: 12px; border: 2px solid var(--accent-soft-2); border-top-color: var(--accent); border-radius: 50%; animation: fj-spin .8s linear infinite; }
@keyframes fj-spin { to { transform: rotate(360deg); } }
.fj-act { display: flex; align-items: center; gap: 4px; flex: none; }
@media (max-width: 900px) {
  .files-grid { grid-template-columns: minmax(0, 1fr); }
  .file-job { flex-wrap: wrap; }
  .fj-main { flex-basis: 100%; }
}

/* ================= 设置 → 额度消耗 / 我的订单 ================= */
.acc-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acc-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; color: var(--text); transition: box-shadow .15s, transform .15s; }
.acc-link:hover { box-shadow: 0 6px 18px rgba(40, 50, 120, .1); transform: translateY(-1px); }
.acc-link > svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.acc-link div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-link small { color: var(--muted); font-size: 12px; }
.acc-link i { color: var(--muted); font-style: normal; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.usage-head .card-title { margin: 0; }
.usage-head .search { margin-left: 0; flex: 1 1 220px; max-width: 360px; }
.usage-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--soft); }
.usage-kpis .stat b { font-size: 17px; }
/* 堆叠柱：每根柱子里从下往上叠各计费项目，顶上一段圆角 */
.bar-chart.stacked { height: 220px; }
.bar-chart .bar.stack { flex-direction: column-reverse; justify-content: flex-start; align-items: center; cursor: pointer; border-radius: 6px 6px 0 0; }
.bar-chart .bar.stack i { max-width: 26px; border-radius: 0; margin: 0; min-height: 0; }
.bar-chart .bar.stack i:last-child { border-radius: 4px 4px 0 0; min-height: 1px; }
.bar-chart .bar.stack:hover { background: var(--soft); }
.bar-chart .bar.stack.sel { background: var(--accent-soft); }
.bar-chart .bar.stack.zero i { background: var(--line-2) !important; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: none; }
.tbl.clickable tr[data-id] { cursor: pointer; }
.tbl.clickable tr[data-id]:hover td { background: var(--soft); }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.muted td { color: var(--muted); }
.tbl td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--text-2); }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pager span { margin-right: auto; }
.pager button:disabled { opacity: .45; cursor: default; background: none; }
@media (max-width: 900px) {
  .usage-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-links { grid-template-columns: 1fr; }
  .bar-chart.stacked { height: 180px; }
}

/* ================= 首页 v4：左“快速开始”、右“概况”（布局固定） ================= */
.home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-col-title { display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 700; padding: 0 4px; margin-bottom: -4px; }
.home-col-title .small { font-weight: 400; }
.quick-card { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.quick-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 14px 12px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s;
}
.quick-tab svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 4px; }
.quick-tab b { font-size: 15px; }
.quick-tab small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.quick-tab:hover { border-color: var(--accent); }
.quick-tab.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.quick-pane { padding: 2px 12px 10px; display: flex; flex-direction: column; gap: 16px; }
.quick-pane > p { margin: 0; }
.quick-card .start-card { padding: 2px 12px 10px; gap: 20px; }
.quick-pane .btn-primary.big { justify-content: center; }
.home-side .today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-side .hot-card { grid-template-columns: 1fr; gap: 16px; }
.home-side .fortune { margin-top: 0; }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-card { padding: 12px; }
  .quick-pane, .quick-card .start-card { padding: 2px 4px 6px; }
  .quick-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-tab small { display: none; }
}
/* 对话翻译记录：每句的消耗 */
.seg-cost { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ================= 翻译核心：术语表、逐句校对、分享字幕、更多导出 ================= */
.start-opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: -6px; }
.start-opts .opt { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.start-opts .opt small { font-size: 12px; }
.start-opts .opt small.warn { color: var(--danger); }
.start-opts .choice { align-self: flex-start; }
.gls-pick { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.gls-pick > span { display: flex; align-items: center; gap: 8px; }
.gls-pick .link-inline { font-size: 12px; }
.dialog-langs .gls-pick { flex: 1 1 160px; }
.file-card .gls-pick { margin-top: -8px; }
.gls-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, .8fr)) auto; gap: 10px; align-items: end; margin: 6px 0 10px; }
.gls-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.gls-form input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ctl-line); min-width: 0; }
.gls-actions { display: flex; gap: 6px; align-items: center; }
.gls-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gls-tools select { height: 36px; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 0 10px; background: var(--surface); color: var(--text); }
.gls-tools .search { margin-left: 0; min-width: 180px; }
.gls-import { width: 100%; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 10px 12px; font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.gls-import-row { margin-top: 10px; }
.dlg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 逐句：悬停出现工具条（录制中不显示） */
.seg-side { position: relative; }
.seg-tools { position: absolute; top: -6px; right: 0; display: none; gap: 4px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 3px; z-index: 2; }
.seg-tools button { font-size: 12px; padding: 3px 8px; border-radius: 7px; color: var(--accent); }
.seg-tools button:hover { background: var(--accent-soft); }
.seg:hover .seg-tools, .seg:focus-within .seg-tools { display: flex; }
.app.recording .seg-tools, .app.paused .seg-tools, .seg.editing .seg-tools { display: none !important; }
.app.no-mt .mt-only, .app.no-mt #btnRetranslate { display: none !important; }
.app.recording #btnRetranslate, .app.paused #btnRetranslate { display: none; }
.seg-edited { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 0 6px; }
.seg-speaker { cursor: pointer; }
.app.recording .seg-speaker, .app.paused .seg-speaker { cursor: default; }
.seg.editing .seg-text, .seg.editing .seg-tr { display: none; }
.seg-edit { display: flex; flex-direction: column; gap: 6px; }
.seg-edit textarea { width: 100%; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 8px 10px; font: inherit; font-size: var(--seg-fs); resize: vertical; background: var(--surface); color: var(--text); }
.seg-edit .se-tr { font-size: calc(var(--seg-fs) * .92); color: var(--text-2); }
.se-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg.translating .seg-tr { opacity: .5; }
/* 分享字幕 */
.share-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.share-btn svg { width: 16px; height: 16px; }
.share-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.head-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-on { display: flex; flex-direction: column; gap: 12px; }
.share-off { padding: 6px 0; }
/* 导出 */
.export-row { flex-wrap: wrap; row-gap: 4px; }
.export-group { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
@media (max-width: 900px) {
  .start-opts, .dlg-row { grid-template-columns: 1fr; }
  .gls-form { grid-template-columns: 1fr 1fr; }
  .seg-tools { position: static; display: flex; margin-top: 6px; box-shadow: none; padding: 0; background: none; }
  .share-btn span { display: none; }
}

/* 手机 App（native.js 给 <html> 加 native / native-ios / native-android） */
.native-ios #redeemForm { display: none; } /* iOS App 只能用 App 内购买充值（App Store 规则 3.1.1） */

/* ================= v5：柚子 Yuzu 品牌、左侧栏（导航 + 最近记录）、首页横幅、场景、开始页、定价弹窗 ================= */
:root { --rail: 228px; --hero1: #6d63ff; --hero2: #4338ca; --file: #e8590c; --file-soft: #fff1e6; --yuzu: #ffc21a; }
:root[data-theme="dark"] { --hero1: #4b44c9; --hero2: #2a237d; --file: #ff922b; --file-soft: #3a2614; }

/* 左侧栏：宽屏是带文字的目录，下面是最近记录 */
.rail { align-items: stretch; gap: 2px; padding: 18px 12px 14px; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; text-align: left; }
.rail-brand img { width: 36px; height: 36px; border-radius: 10px; }
.rail-brand b { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.rail-brand small { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 4px; }
.rail-btn { width: auto; height: 40px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 14px; }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn.active { background: var(--accent-soft); font-weight: 600; }
.rail-history { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-h-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rail-h-head .link { font-size: 12px; font-weight: 400; }
.rail .history { flex: 1; min-height: 0; padding: 0; }
.rail .history li { gap: 8px; padding: 8px 8px 8px 10px; border-radius: 10px; }
.rail .history .h-title { font-size: 13.5px; }
.rail .history .h-meta { font-size: 11.5px; margin-top: 1px; }
.rail .history .h-del { opacity: 0; padding: 2px 6px; font-size: 12px; }
.rail .history li:hover .h-del { opacity: 1; }
.rail .history li.active { background: var(--accent-soft); }
.rail .history li.active .h-title { color: var(--accent); }
.rail .history .h-empty { font-size: 13px; padding: 12px; }
.h-kind { flex: none; display: grid; place-items: center; color: var(--muted); font-style: normal; }
.h-kind svg { width: 15px; height: 15px; }
.history li[data-kind=dialog] .h-kind { color: var(--ok); }
.history li[data-kind=file] .h-kind { color: var(--file); }
.rail-more { padding: 8px 12px; font-size: 13px; color: var(--accent); text-align: left; border-radius: 10px; }
.rail-more:hover { background: var(--soft); }
.rail-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.rail-foot .rail-btn { flex: 1; }
.rail-foot .avatar { flex: none; }

/* 首页：一页滚动，品牌横幅在最上面 */
.home-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 12px; }
.home-section { display: flex; flex-direction: column; gap: 14px; }
.home-hero {
  position: relative; overflow: hidden; flex: none; padding: 24px 28px; border-radius: 22px; color: #fff;
  background: radial-gradient(500px 220px at 85% -40%, rgba(255, 216, 77, .35), transparent 70%), linear-gradient(120deg, var(--hero1), var(--hero2));
  box-shadow: 0 10px 30px rgba(67, 56, 202, .25);
}
.home-hero::after { /* 背景里一片放大的柚子 */
  content: ""; position: absolute; width: 300px; height: 300px; right: 18%; top: -110px; opacity: .1; pointer-events: none;
  background: url(../logo-mark.svg) center / contain no-repeat; transform: rotate(18deg);
}
.home-hero > * { position: relative; z-index: 1; }
.hero-logo { width: 68px; height: 68px; border-radius: 0; box-shadow: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .2)); }
.hero-title { color: #fff; font-size: 38px; font-weight: 900; letter-spacing: .02em; }
.hero-title span { margin-left: 10px; font-size: 22px; font-weight: 800; letter-spacing: .01em; color: var(--yuzu); }
.hero-sub { color: rgba(255, 255, 255, .86); }
.hero-pricing {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 20px; border-radius: 21px;
  background: #fff; color: #3f37c9; font-weight: 700; font-size: 15px; box-shadow: 0 6px 18px rgba(20, 16, 90, .25);
  transition: transform .12s, box-shadow .12s;
}
.hero-pricing:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(20, 16, 90, .3); }
.hero-pricing svg { width: 18px; height: 18px; fill: var(--yuzu); stroke: #f0a400; stroke-width: 1.4; }
.home-hero .theme-toggle { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; }
.home-hero .hero-user { background: rgba(255, 255, 255, .14); box-shadow: none; color: #fff; }
.home-hero .hero-user-text small { color: #ffe27a; }

/* 应用场景：按类型配图标（实时记录 麦克风 / 对话翻译 气泡 / 文件识别 文件） */
.scenes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } /* 4 个场景：宽屏一行，窄一点 2×2 */
@media (max-width: 1380px) { .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-section > .home-col-title { flex-wrap: wrap; row-gap: 2px; }
.scene { --k: var(--accent); --k-soft: var(--accent-soft); gap: 8px; padding: 18px; border-radius: 18px; box-shadow: var(--shadow); }
.scene.is-dialog { --k: var(--ok); --k-soft: var(--ok-soft); }
.scene.is-file { --k: var(--file); --k-soft: var(--file-soft); }
.scene:hover { border-color: var(--k); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(40, 50, 120, .1); }
.scene-top { gap: 8px; justify-content: flex-start; margin-bottom: 2px; }
.scene-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--k-soft); color: var(--k); flex: none; }
.scene-icon svg { width: 21px; height: 21px; }
.scene-kind { font-size: 12px; font-weight: 700; color: var(--k); }
.scene-flags { margin-left: auto; }
.scene b { font-size: 16px; }
.scene-fits { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.scene-fits em { font-style: normal; font-size: 12px; color: var(--muted); }
.scene-fits span { padding: 2px 8px; border-radius: 8px; background: var(--soft); color: var(--text-2); font-size: 12px; }
.scene-go { color: var(--k); padding-top: 4px; }

/* 概况：宽屏三列，窄一点两列，手机一列 */
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 16px; }
.overview-grid > .card { min-width: 0; }
.ov-hot { grid-column: span 2; }
.ov-day { grid-column: 1 / -1; }
.ov-today .today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ov-fortune { display: flex; flex-direction: column; }
.ov-fortune .fortune { margin-top: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ov-day .history { padding: 0; max-height: 360px; }
.ov-day .h-kind svg { width: 17px; height: 17px; }
@media (max-width: 1280px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 实时记录开始页 */
.start-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; max-width: 1120px; }
.start-scene { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.start-scene span { font-size: 12px; font-weight: 700; color: var(--accent); }
.start-scene b { font-size: 15px; }
.start-scene small { flex-basis: 100%; color: var(--text-2); font-size: 13px; }
.tip-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; }
.tip-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tip-list li:last-child { border-bottom: 0; }
.tip-list b { font-size: 14px; }
.tip-list span { color: var(--muted); font-size: 13px; }
.tip-list.small { margin-bottom: 0; }
.tip-list.small li { flex-direction: row; gap: 8px; padding: 5px 0; border: 0; font-size: 13px; color: var(--text-2); }
.tip-list.small li::before { content: "·"; color: var(--accent); font-weight: 900; }

/* 定价弹窗 */
.pricing-dialog { width: min(580px, calc(100vw - 32px)); }
.pricing-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.pricing-examples:empty { display: none; }
.pe { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #fff8d9, #ffeaa6); }
.pe span { font-size: 12px; color: #7a5a00; }
.pe b { font-size: 20px; color: #6b3f00; }
.pe small { font-size: 12px; color: #9a7a2a; }
[data-theme="dark"] .pe { background: linear-gradient(135deg, #3a3214, #2c2610); }
[data-theme="dark"] .pe span, [data-theme="dark"] .pe small { color: #c9b36a; }
[data-theme="dark"] .pe b { color: #ffd76a; }
.pricing-notes { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.8; }
.pricing-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- 设置 → 帮助与反馈 ---------- */
.fb-form { display: flex; flex-direction: column; gap: 12px; }
.fb-form .choice { align-self: flex-start; }
.fb-form textarea {
  width: 100%; min-height: 110px; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 10px 12px;
  font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; background: var(--surface); color: var(--text);
}
.fb-attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-pick { cursor: pointer; }
.fb-row { padding: 4px 0; border-bottom: 0; }
.fb-row select {
  height: 36px; width: 280px; max-width: 100%; border-radius: 10px; border: 1px solid var(--ctl-line); padding: 0 10px;
  background: var(--surface); color: var(--text);
}
.fb-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.fb-check input { margin-top: 3px; flex: none; }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fb-list li:last-child { border-bottom: 0; }
.fb-head { display: flex; align-items: center; gap: 8px; }
.fb-head .tag:last-child { margin-left: auto; }
.fb-text { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.fb-reply {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft);
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.fb-reply b { display: block; color: var(--accent); font-size: 12px; margin-bottom: 2px; }
.fb-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 0; }

/* 手机 / 窄屏：左侧栏变成底部标签栏（图标 + 小字），最近记录去“笔记”里看 */
@media (max-width: 900px) {
  .rail { gap: 0; padding: 4px 4px env(safe-area-inset-bottom); height: calc(60px + env(safe-area-inset-bottom)); }
  .rail-brand, .rail-history { display: none; }
  .rail-foot { display: contents; }
  .rail-btn, .rail-foot .rail-btn { flex: 1 1 0; min-width: 0; height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 10px; border-radius: 10px; }
  .rail-btn svg { width: 21px; height: 21px; }
  .rail-btn span { white-space: nowrap; }
  .rail-btn:hover:not(.active) { background: none; color: var(--text-2); }
  .rail-btn.active { background: none; }
  .home-scroll { gap: 18px; }
  .home-hero { padding: 18px; border-radius: 18px; }
  .home-hero::after { width: 200px; height: 200px; right: -40px; top: -70px; }
  .hero-logo { width: 52px; height: 52px; }
  .hero-title { font-size: 30px; }
  .hero-title span { font-size: 18px; }
  .hero-side { width: 100%; }
  .hero-pricing { height: 38px; padding: 0 16px; font-size: 14px; }
  .hero-user { margin-left: auto; }
  .scenes { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-hot, .ov-day { grid-column: auto; }
  .start-grid { grid-template-columns: 1fr; }
}
