/* scribe 样式：飞书式简约扁平 + 马卡龙清雅配色，深浅双主题。
   配色变量与 imggen / vidgen 同源（同一台机器上的几个系统，视觉语言一致），刻意避开紫蓝渐变。
   移动端优先：默认单列（列表和详情分两屏）；≥900px 才切成「左列表 / 右详情」两栏。 */

:root {
  --brand: #3D9A8B; --brand-hover: #348478; --brand-soft: #E7F3F1;
  --accent: #E39A70; --accent-soft: #FCF0E8;
  --ok: #52A87A; --ok-soft: #E8F5EE;
  --warn: #D9A03E; --warn-soft: #FBF2E0;
  --err: #D46A6A; --err-soft: #FBEDED;
  --bg: #F6F7F9; --card: #FFFFFF; --card-2: #FBFCFD;
  --border: #E6E9ED; --border-2: #D5DAE0;
  --text: #1F2329; --text-2: #545C66; --muted: #8B939E; --hover: #F0F2F5;
  --shadow: 0 1px 2px rgba(31,35,41,.05), 0 4px 12px rgba(31,35,41,.05);
  --shadow-lg: 0 4px 16px rgba(31,35,41,.10), 0 12px 40px rgba(31,35,41,.08);
  --radius: 10px; --radius-sm: 6px;
  --content-w: 1200px; --topbar-h: 52px;
  /* 说话人色（按第几个开口分配），浅色主题用 soft 做底、solid 做色条 */
  --s0: #6FA8DC; --s1: #E99AAE; --s2: #7CC7A4; --s3: #E9B864;
  --s4: #A89BD9; --s5: #E8927A; --s6: #7FC4DB; --s7: #B5C77A;
  --tint: 14%;
}
:root[data-theme="dark"] {
  --brand: #4FB3A2; --brand-hover: #5FC2B1; --brand-soft: #1D2E2C;
  --accent: #E5A47D; --accent-soft: #2E2620;
  --ok: #5FB98A; --ok-soft: #1C2B24;
  --warn: #E0AC55; --warn-soft: #2E2818;
  --err: #E07B7B; --err-soft: #2E2022;
  --bg: #16181B; --card: #1E2126; --card-2: #23272D;
  --border: #2C3138; --border-2: #3A4048;
  --text: #E3E6EA; --text-2: #AEB6C0; --muted: #7C858F; --hover: #262A30;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.4), 0 12px 40px rgba(0,0,0,.3);
  --s0: #7FB5E8; --s1: #F0A9BC; --s2: #8FD3B6; --s3: #F2C97E;
  --s4: #B7A9E8; --s5: #F2A48C; --s6: #92D0E6; --s7: #C3D38A;
  --tint: 18%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { display: flex; flex-direction: column; overflow: hidden; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ── 顶栏 ── */
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand-ico { width: 20px; height: 20px; color: var(--brand); }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); white-space: nowrap; }
.tab:hover { background: var(--hover); }
.tab.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.spacer { flex: 1; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--hover); color: var(--text-2); white-space: nowrap; cursor: default; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); cursor: help; }
.icon-btn { border: 0; background: none; width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border-2); background: var(--card); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn:disabled, .btn.busy { opacity: .6; cursor: not-allowed; }
.danger-text { color: var(--err) !important; }

/* ── 布局 ── */
.layout { flex: 1; min-height: 0; display: flex; }
.sidebar { width: 300px; flex: none; border-right: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.side-actions .btn.primary svg { color: #fff; }
.side-actions .btn.primary svg .fill { fill: #FF7B7B; }
.search { padding: 0 12px 8px; }
.search input { width: 100%; height: 32px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 0 10px; background: var(--card-2); }
.session-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.s-item { padding: 10px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.s-item:hover { background: var(--hover); }
.s-item.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.s-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.s-item .m { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-item .w { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--hover); color: var(--text-2); font-weight: 400; flex: none; }
.tag.live { background: var(--err-soft); color: var(--err); }
.tag.run { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.err { background: var(--err-soft); color: var(--err); }

.detail { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.empty-state { margin: auto; text-align: center; color: var(--text-2); padding: 24px; max-width: 460px; }
.empty-state svg { width: 48px; height: 48px; color: var(--brand); stroke-width: 1.5; }
.session { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.s-head { padding: 14px 20px 10px; border-bottom: 1px solid var(--border); background: var(--card); }
.s-head, .speakers, .transcript-inner { width: 100%; }
.s-title-row { display: flex; align-items: center; gap: 10px; }
.s-title-row h2 { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.s-title-row input { font-size: 18px; font-weight: 600; border: 1px solid var(--brand); border-radius: var(--radius-sm); padding: 0 6px; min-width: 0; flex: 1; background: var(--card); }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--hover); color: var(--text-2); flex: none; }
.badge.live { background: var(--err-soft); color: var(--err); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.s-meta { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.s-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rec-box { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 10px; height: 36px; border-radius: var(--radius); background: var(--err-soft); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
#recTime { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--err); }
.level { width: 60px; height: 6px; background: color-mix(in srgb, var(--err) 20%, transparent); border-radius: 3px; overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: var(--err); transition: width .1s; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 0 12px; height: 30px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border-2); }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 36px; z-index: 30; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; }
.menu a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); white-space: nowrap; }
.menu a:hover { background: var(--hover); }
.refine-bar { margin-top: 10px; }
.rb-text { font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.rb-text button { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; }
.rb-track { height: 4px; background: var(--hover); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.rb-track i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s; }
.refine-bar.err .rb-text { color: var(--err); }
.refine-bar.err .rb-track { display: none; }
.notice { margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 12px; white-space: pre-wrap; }
.notice.err { background: var(--err-soft); color: var(--err); }

/* ── 说话人条 ── */
.speakers { display: flex; gap: 8px; padding: 10px 20px; overflow-x: auto; flex: none; border-bottom: 1px solid var(--border); background: var(--card-2); }
.spk {
  --c: var(--s0);
  flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--card)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  max-width: 320px;
}
.spk .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.spk .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.spk .auto { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.spk .sug { font-size: 12px; white-space: nowrap; color: var(--text-2); }
.spk .sug button { border: 0; background: var(--brand); color: #fff; border-radius: 99px; padding: 0 8px; margin-left: 4px; cursor: pointer; font-size: 12px; }
.spk .sec { font-size: 11px; color: var(--muted); white-space: nowrap; }
.spk .mini { border: 0; background: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.spk .mini:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
.spk .mini svg { width: 14px; height: 14px; }
.spk input { width: 120px; border: 1px solid var(--brand); border-radius: 4px; padding: 0 6px; height: 24px; background: var(--card); }

/* 拖一个说话人到另一个上面 = 合并 */
.spk[draggable="true"] { cursor: grab; }
.spk.dragging { opacity: .45; }
.spk.drop-ok { outline: 2px dashed var(--brand); outline-offset: 2px; }
/* 合并建议 */
.hints { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 20px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.hint { display: flex; align-items: center; gap: 6px; }
.hint button { border: 0; border-radius: 99px; padding: 1px 10px; cursor: pointer; font-size: 12px; }
.hint .yes { background: var(--brand); color: #fff; }
.hint .no { background: var(--hover); color: var(--text-2); }

/* ── 转写区 ── */
.transcript { flex: 1; overflow-y: auto; padding: 12px 20px 80px; scroll-behavior: auto; }
.block { --c: var(--s0); display: flex; gap: 12px; padding: 8px 0; }
.block .bar { width: 3px; border-radius: 2px; background: var(--c); flex: none; }
.block .body { min-width: 0; flex: 1; }
.block .who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.block .who b { color: color-mix(in srgb, var(--c) 70%, var(--text)); font-size: 13px; cursor: pointer; }
.block .who time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.block .text { font-size: 15px; line-height: 1.75; word-break: break-word; }
.ln { border-radius: 3px; cursor: pointer; transition: background .15s; }
.ln:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.ln.playing { background: color-mix(in srgb, var(--c) 35%, transparent); }
.ln.edited { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
/* 上下文纠错改过的字：淡底色，悬停看原来识别的是什么 */
mark.fix { background: color-mix(in srgb, var(--ok) 22%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
mark.fix.del { background: none; color: var(--ok); font-weight: 700; }
.ln[contenteditable="true"] { background: var(--card); outline: 1px solid var(--brand); cursor: text; }
.block.unknown { --c: var(--border-2); }
.draft { color: var(--muted); font-size: 15px; padding: 4px 0 4px 15px; min-height: 1em; }
.draft:not(:empty)::after { content: "▍"; animation: blink 1s infinite; color: var(--brand); }
.to-bottom { position: absolute; right: 24px; bottom: 20px; box-shadow: var(--shadow-lg); }
.tr-empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ── 浮层：换人菜单 / 自动补全 ── */
.pop { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; min-width: 180px; max-height: 320px; overflow-y: auto; }
.pop .pi { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.pop .pi:hover, .pop .pi.sel { background: var(--hover); }
.pop .pi .dot { width: 8px; height: 8px; border-radius: 50%; }
.pop .ph { font-size: 12px; color: var(--muted); padding: 4px 10px; }
.pop mark { background: var(--accent-soft); color: var(--accent); border-radius: 2px; }

/* ── 悬停一键换人 ── */
.hoverbar { position: fixed; z-index: 55; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: min(640px, 94vw);
  padding: 4px 6px; background: var(--card); border: 1px solid var(--border); border-radius: 99px; box-shadow: var(--shadow-lg); font-size: 12px; }
.hoverbar .hb-t { color: var(--muted); padding: 0 4px 0 6px; white-space: nowrap; }
.hoverbar button { --c: var(--s0); display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 99px;
  padding: 2px 9px; cursor: pointer; background: color-mix(in srgb, var(--c) var(--tint), var(--card)); color: var(--text); white-space: nowrap; }
.hoverbar button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.hoverbar button:hover { border-color: var(--c); }
.hoverbar button.cur { outline: 2px solid var(--c); outline-offset: -2px; font-weight: 600; cursor: default; }
.hoverbar .hb-whole { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); padding: 0 6px 0 4px; border-left: 1px solid var(--border); margin-left: 2px; cursor: pointer; white-space: nowrap; }
.ln.hb-target, .block.hb-target .ln { background: color-mix(in srgb, var(--c) 22%, transparent); }

/* ── 声纹库 ── */
.persons-view { flex: 1; overflow-y: auto; padding: 20px; }
.p-head, .table-wrap { max-width: var(--content-w); margin: 0 auto; }
.p-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.p-head h2 { margin: 0; font-size: 18px; }
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 150px); }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { position: sticky; top: 0; z-index: 2; background: var(--card-2); text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap; }
.ptable th.ops { cursor: default; }
.ptable th.sorted::after { content: " ↓"; } .ptable th.sorted.asc::after { content: " ↑"; }
.ptable td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; }
.ptable td.name { font-weight: 600; cursor: text; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.ptable tr.sub td { background: var(--card-2); padding: 6px 12px 10px 28px; white-space: normal; }
.ptable .ops { text-align: right; }
.ptable .ops button { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 2px 6px; }
.ptable .ops button.del { color: var(--err); }
.samples { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.samples .smp { display: flex; gap: 10px; align-items: center; }
.samples .smp span { color: var(--text-2); }

/* ── 专有名词 ── */
.g-add { max-width: var(--content-w); margin: 0 auto 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.g-add input { flex: 1; min-width: 160px; height: 32px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 0 10px; background: var(--card); }

/* ── 弹窗 / 提示 ── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15,17,20,.4); display: grid; place-items: center; padding: 16px; }
.modal-card { width: 100%; max-width: 480px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-card h3 { margin: 0; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.modal-card input, .modal-card textarea, .modal-card select { border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--card-2); color: var(--text); resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast-wrap { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
/* 提示条只让「撤销」按钮能点，其余地方点击穿透 —— 学词提示比较长、停 8 秒，别挡住下面的菜单 */
.toast-wrap .toast { pointer-events: none; }
.toast-wrap .toast button { pointer-events: auto; }
.toast { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 8px 14px; max-width: min(560px, 92vw); white-space: pre-wrap; pointer-events: auto; }
.toast button { margin-left: 10px; border: 0; background: var(--brand); color: #fff; border-radius: 4px; padding: 1px 10px; cursor: pointer; }
.toast.ok { border-left: 3px solid var(--ok); } .toast.err { border-left: 3px solid var(--err); } .toast.warn { border-left: 3px solid var(--warn); }

/* ── 手机 ── */
.only-mobile { display: none; }
@media (max-width: 899px) {
  .only-mobile { display: grid; }
  .brand span { display: none; }
  .topbar { gap: 4px; padding: 0 8px; }
  .tabs { margin-left: 0; gap: 0; }
  .tab { padding: 6px 8px; }
  .pill { max-width: 96px; overflow: hidden; text-overflow: ellipsis; padding: 3px 8px; }
  .sidebar { width: 100%; border-right: 0; }
  .layout.show-detail .sidebar { display: none; }
  .layout:not(.show-detail) .detail { display: none; }
  .s-head { padding: 10px 12px 8px; }
  .speakers { padding: 8px 12px; }
  .transcript { padding: 8px 12px 80px; }
  .block .text { font-size: 15px; }
  .row2 { grid-template-columns: 1fr; }
  .persons-view { padding: 12px; }
  .ptable th:nth-child(4), .ptable td:nth-child(4), .ptable th:nth-child(5), .ptable td:nth-child(5) { display: none; }
}
/* 大屏：正文限宽居中，行太长不好读 */
@media (min-width: 900px) {
  .transcript > * { max-width: 980px; margin-left: auto; margin-right: auto; }
}

/* ── 登录（公网 / 手机 App）── */
.login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(360px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 28px 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.login-brand .brand-ico { width: 26px; height: 26px; color: var(--brand); }
.login-card p { margin: -6px 0 6px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.login-card input { height: 40px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 0 12px; font-size: 16px; background: var(--card-2); }
.login-card input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.login-card .btn { height: 42px; font-size: 15px; margin-top: 4px; }
.login-err { min-height: 18px; color: var(--err); font-size: 13px; }
.menu-right { right: 0; left: auto; }
.menu .menu-head { padding: 6px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* ── 手机 App（Capacitor 壳）/ 触屏 ── */
.app-only { display: none !important; }
.in-app .app-only { display: flex !important; }
.in-app label:has(#nMic) { display: none; }                 /* App 里用原生录音，不选麦克风 */
.nt-row { align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); flex-direction: row !important; }
/* 刘海 / 灵动岛 / 底部横条：内容别被挡住（viewport-fit=cover 时才有值） */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.touch .ln { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.touch .ln[contenteditable="true"] { -webkit-user-select: text; user-select: text; }
/* 长按一句弹出的底部操作面板 */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.28); display: flex; align-items: flex-end; }
.sh-card { width: 100%; background: var(--card); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
  padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
.sh-grip { width: 36px; height: 4px; border-radius: 4px; background: var(--border-2); margin: 2px auto 10px; }
.sh-quote { font-size: 14px; line-height: 1.5; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.sh-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sh-whole { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.sh-spk { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sh-spk button { --c: var(--s0); display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px;
  border: 1px solid transparent; background: color-mix(in srgb, var(--c) var(--tint), var(--card)); color: var(--text); }
.sh-spk button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.sh-spk button.cur { outline: 2px solid var(--c); outline-offset: -2px; font-weight: 600; }
.sh-ops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.sh-ops button { height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-2); color: var(--text); font-size: 14px; }
.sh-cancel { width: 100%; height: 44px; border-radius: 10px; border: 0; background: var(--hover); color: var(--text-2); font-size: 15px; }
