/* 单栏阅读布局：顶栏 → 当前视图；全文每行用三列网格（时间 / 说话人 / 文字），底部浮一个播放条 */
:root {
  --bg: #f5f6f3; --panel: #ffffff; --fg: #1c2320; --muted: #66706b; --line: #dde2de; --hover: #eef1ed;
  --accent: #1f5f4f; --accent-bg: #dcece6;
  --ai: #2c5d8a; --ai-bg: #dfe9f4; --part: #1f5f4f; --part-bg: #dcece6; --env: #7d8580;
  --warn: #8a5a00; --warn-bg: #fbefd2; --bad: #9a3b32;
  --f-body: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --f-display: "Noto Serif SC", "Songti SC", serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131816; --panel: #1a201e; --fg: #e2e7e4; --muted: #8f9995; --line: #2b3431; --hover: #222a27;
    --accent: #8fd3bd; --accent-bg: #1f3a32;
    --ai: #9cc3ea; --ai-bg: #1d2e40; --part: #8fd3bd; --part-bg: #1f3a32; --env: #9aa39f;
    --warn: #f0c56b; --warn-bg: #3a2f17; --bad: #f0a198;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.65 var(--f-body); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in, .main { max-width: 900px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top-in { display: flex; align-items: center; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand { font: 600 18px var(--f-display); text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.nav a.on { color: var(--fg); background: var(--hover); }
.jobchip { font-size: 13px; color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.run { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot.run { animation: none; } }

.main { padding-block: 24px 120px; display: flex; flex-direction: column; gap: 20px; }
h1 { font: 600 24px/1.35 var(--f-display); margin: 0; text-wrap: balance; }
h2 { font: 600 16px/1.4 var(--f-body); margin: 0; }
.sub { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn:disabled { opacity: .5; cursor: default; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 每天 */
.days { display: flex; flex-direction: column; gap: 12px; }
.day { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.day:hover { border-color: var(--accent); }
.day-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.day-date { font: 600 18px var(--f-display); }
.day-sum { margin: 8px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.strip { position: relative; height: 14px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.strip span { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.axis { display: flex; justify-content: space-between; font: 11px var(--f-mono); color: var(--muted); margin-top: 2px; }

/* 某一天：总结 → highlight → 全文 */
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec p { margin: 0; max-width: 68ch; }
.hls { display: flex; flex-direction: column; gap: 12px; }
.hl { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hl h3 { margin: 0; font: 600 16px/1.4 var(--f-body); }
.hl-list { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.hour { font: 600 13px var(--f-mono); color: var(--muted); padding: 14px 4px 4px; border-bottom: 1px solid var(--line); }

/* 全文 */
.tools { position: sticky; top: 53px; z-index: 10; background: var(--bg); padding-block: 8px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools label { font-size: 13px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.lines { display: flex; flex-direction: column; }
.ln { scroll-margin-top: 140px; display: grid; grid-template-columns: 5.2em 6.5em 1fr; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--line); align-items: baseline; border-radius: 4px; }
.ln.inhl { box-shadow: inset 3px 0 0 var(--accent); }
.ln.flash { background: var(--accent-bg); }
.ln.playing { background: var(--accent-bg); }
.ln.env .txt { color: var(--muted); font-size: 13px; }
.t { font: 12px var(--f-mono); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.t:hover { color: var(--accent); text-decoration: underline; }
.who { font-size: 12px; font-weight: 500; border: 1px solid transparent; background: var(--hover); border-radius: 5px; padding: 1px 6px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-self: start; }
.who:hover { border-color: var(--accent); }
.who.me { color: var(--accent); background: var(--accent-bg); }
.who.named { color: var(--ai); background: var(--ai-bg); }
.who.manual::after { content: " ✓"; }
.who.envw { color: var(--env); background: none; cursor: default; }
.txt { min-width: 0; overflow-wrap: anywhere; }
.orig { display: block; font-size: 12px; color: var(--muted); text-decoration: line-through; }
.sugg { font-size: 12px; margin-left: 6px; color: var(--ai); border: 1px dashed var(--ai); border-radius: 5px; padding: 0 6px; background: none; cursor: pointer; }
@media (max-width: 560px) { .ln { grid-template-columns: 4.6em 1fr; } .ln .txt { grid-column: 1 / -1; } }

/* 指定说话人弹层 */
.pop { position: absolute; z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pop h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.pop .people { display: flex; flex-wrap: wrap; gap: 6px; }
.pop .people button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 2px 12px; cursor: pointer; font-size: 14px; }
.pop .people button:hover, .pop .people button.cur { border-color: var(--accent); color: var(--accent); }
.pop input[type=text] { width: 100%; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.pop .scope { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* 上传、任务 */
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 32px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-bg); }
.bar { height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; width: 100%; }
.bar span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.job { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.st { font-size: 12px; border-radius: 4px; padding: 1px 7px; }
.st-succeeded { color: var(--part); background: var(--part-bg); }
.st-running, .st-queued { color: var(--ai); background: var(--ai-bg); }
.st-failed, .st-interrupted { color: var(--bad); background: var(--warn-bg); }
pre.log { font: 12px/1.6 var(--f-mono); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 320px; overflow: auto; white-space: pre-wrap; margin: 0; }
.ppl { display: flex; flex-direction: column; }
.ppl > div { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }

.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--panel); border-top: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; gap: 12px; align-items: center; }
.player audio { flex: 1; min-width: 0; height: 32px; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
