/* 分享的文字稿网页（用户 11-07）：照 TranscribeLink 文稿页的样式（video2txt/static/b.css 方案 B）——浅灰白底、深蓝灰字、一个品牌蓝。
   中文用系统字体（不加载外网字体，国内打开不卡）；720px 以下切成手机排版：右栏收进「更多」弹窗，底部播放器和「导出」「更多」两个按钮。 */
:root {
  --paper: #F8FAFC; --sheet: #FFFFFF; --raised: #EEF2F7; --sunk: #F1F5F9;
  --line: rgba(16, 24, 40, .13); --line-soft: rgba(16, 24, 40, .07);
  --ink: #0F172A; --ink-2: #475569; --ink-3: #5B6678;
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-soft: #E8EFFE;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --lift: 0 1px 1px rgba(15, 23, 42, .04), 0 2px 4px rgba(15, 23, 42, .06), 0 10px 24px -8px rgba(15, 23, 42, .16);
  --pop: 0 2px 4px rgba(15, 23, 42, .08), 0 14px 32px -6px rgba(15, 23, 42, .24);
}
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
.b { min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.b *, .b *::before, .b *::after { box-sizing: border-box; }
.b a { color: var(--accent); text-underline-offset: 3px; }
.b a:hover { color: var(--accent-hover); }
.b :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.b h1, .b h2, .b h3, .b p { margin: 0; }
.b button { font: inherit; color: inherit; }
.b svg { flex: none; }
.b [hidden] { display: none !important; }

/* 顶部栏 */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 32px; background: rgba(248, 250, 252, .94); border-bottom: 1px solid var(--line-soft); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 19px; font-weight: 800; }
.b .brand, .b .brand:hover { color: var(--ink); text-decoration: none; }
.brand b { color: var(--accent); font-weight: inherit; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s var(--ease), transform .12s var(--ease); }
.btn:active:not([disabled]) { transform: scale(.98); }
.b .btn-primary { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(15, 23, 42, .18), 0 4px 10px -3px rgba(37, 99, 235, .45); }
.b .btn-primary:hover { background: var(--accent-hover); color: #fff; }
.b .btn-quiet { background: var(--sheet); color: var(--ink); border-color: rgba(15, 23, 42, .14); box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .10); }
.b .btn-quiet:hover { background: var(--raised); color: var(--ink); }
.b .btn-ghost { background: transparent; color: var(--ink-2); }
.b .btn-ghost:hover { background: var(--raised); color: var(--ink); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 字 */
.h1 { font-weight: 700; font-size: 36px; line-height: 1.25; overflow-wrap: anywhere; }
.h2 { font-weight: 700; font-size: 28px; line-height: 1.2; }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
.sec { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; line-height: 1.5; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--raised); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.panel { background: var(--sheet); border: 1px solid rgba(15, 23, 42, .10); border-radius: 6px; box-shadow: var(--lift); }

/* 右栏操作 */
.side-h { margin: 0; padding: 4px 12px 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.act { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.b .act:hover { background: var(--sunk); color: var(--ink); }
.b a.act { color: var(--ink); text-decoration: none; }
.act svg { margin-top: 1px; color: var(--ink-2); }
.act > span { min-width: 0; overflow-wrap: anywhere; }
.act small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.act input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* 文稿：中间正文，右栏操作，底部播放器 */
/* 文稿短时页脚和播放器也贴在窗口底部 */
.doc-page { display: flex; flex-direction: column; }
.doc-main { flex: 1 0 auto; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 24px 80px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.doc { position: relative; flex: 999 1 560px; min-width: 0; padding: 40px 48px; }
.b .doc-meta { margin-top: 12px; }
.b .doc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tx { margin-top: 32px; }
.tx p { margin: 0 0 20px; font-size: 17px; line-height: 1.85; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.tx .who { margin-right: 8px; font-weight: 600; }
.who.s1 { color: #2563EB; } .who.s2 { color: #C2410C; } .who.s3 { color: #047857; } .who.s4 { color: #7C3AED; } .who.s5 { color: #B45309; } .who.s6 { color: #BE185D; }
/* 一句一句的文字（有音频才能点）：暂停时点一句灰底、进度条移过去；正在播的那句蓝底 */
.tx .sent { padding: 2px 0; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color .12s; }
.tx.playable .sent[data-start] { cursor: pointer; }
@media (hover: hover) { .tx.playable .sent[data-start]:hover { background: #E9EDF2; } }
.tx .sent.now { background: #E9EDF2; }
.tx.playing .sent.now { background: #D6E4FF; }
.tx .ts { display: none; margin-right: 6px; color: var(--ink-3); font-size: 15px; font-variant-numeric: tabular-nums; }
.tx.times .ts { display: inline; }
.tx.playing .sent.now .ts { color: var(--accent); }
.b .doc-foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.ops { flex: 1 1 260px; max-width: 300px; position: sticky; top: 88px; padding: 16px 8px; }
.ops .side-h.gap { margin-top: 16px; }
.share-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; padding: 8px 16px 32px; }
.b .share-foot a { color: var(--ink-3); text-decoration: none; }
.b .share-foot a:hover { color: var(--ink); text-decoration: underline; }
.missing { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 96px 24px; text-align: center; }

/* 弹窗（原生 dialog）和屏幕底部的简短提示 */
dialog.dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 28px; border: 0; border-radius: 6px; background: var(--sheet); color: var(--ink); box-shadow: 0 24px 56px rgba(16, 24, 40, .22); overflow: auto; }
dialog.dialog[open] { display: flex; flex-direction: column; gap: 16px; }
dialog.dialog::backdrop { background: rgba(15, 23, 42, .5); }
.b dialog:focus-visible { outline: 0; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head form { margin: 0; }
.dialog-head .btn-icon { margin: -8px -8px 0 0; }
.fmt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fmt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.fmt:hover { background: var(--sunk); }
.fmt:has(input:checked) { border-color: var(--accent); background: #F4F8FF; }
.fmt input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
.fmt b { font-weight: 500; font-size: 15px; color: var(--ink); }
.fmt small { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.fmt.off { opacity: .5; cursor: not-allowed; }
.fmt-set { border: 0; padding: 4px 0; }
.fmt-set:hover, .fmt-set:has(input:checked) { background: transparent; }
.b .export-note { margin-top: -6px; text-align: center; }
dialog.dialog.ops-dialog { padding: 0; gap: 0; }
.ops-dialog .dialog-head { padding: 24px 24px 8px; }
.b .ops-dialog .ops { display: block; position: static; max-width: none; padding: 0 12px 16px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.ops-dialog .side-h, .ops-dialog [data-fmt], .ops-dialog #export-more { display: none; }
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { display: inline-flex; align-items: center; min-height: 44px; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 6px; background: var(--ink); color: var(--sheet); font-size: 14px; line-height: 1.5; box-shadow: 0 8px 24px rgba(16, 24, 40, .2); }

/* 底部播放器 */
.dock { position: sticky; bottom: 0; z-index: 20; }
.player { background: var(--sheet); border-top: 1px solid rgba(16, 24, 40, .1); box-shadow: 0 -8px 24px rgba(16, 24, 40, .06); }
.player-in { display: flex; flex-direction: column; width: 100%; max-width: 1200px; margin: 0 auto; padding: 5px 32px 7px; }
.ptitle { margin: 0; text-align: center; font-weight: 600; font-size: 14px; line-height: 18px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pctl { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 1040px; margin: 0 auto; }
.pbtn { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; }
.pbtn:hover { background: var(--sunk); }
.gear { width: auto; min-width: 44px; padding: 0 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.gear[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.prog { flex: 1; min-width: 80px; margin: 0; accent-color: var(--accent); }
.ptime { flex: none; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.spd { position: relative; flex: none; }
.spmenu { position: absolute; right: 0; bottom: calc(100% + 10px); width: 184px; padding: 6px; border-radius: 6px; background: var(--sheet); border: 1px solid rgba(16, 24, 40, .08); box-shadow: var(--pop); }
.spmenu .sh { margin: 0 0 4px; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); }
.spmenu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 4px; background: transparent; font-size: 15px; color: var(--ink); cursor: pointer; text-align: left; }
.spmenu button:hover { background: var(--sunk); }
.spmenu .rd { width: 18px; height: 18px; flex: none; border-radius: 50%; background: #E2E8F0; }
.spmenu [aria-checked="true"] .rd { background: #fff; border: 5px solid var(--accent); }
.mbar { display: none; }

/* 右上角（用户 11-10）：这页只给没登录的人看，右上角是「未登录」和「登录」 */
.viewer-guest { display: inline-flex; align-items: center; gap: 12px; }
.viewer-state { font-size: 14px; color: var(--ink-3); }
.b .viewer-login { height: 36px; padding: 0 16px; font-size: 14px; }
/* 「编辑文稿」只有分享人能用（用户 11-10）：别人打开显示但点不了 */
.b .act[disabled], .b .mbar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.b .act[disabled]:hover { background: transparent; }

@media (max-width: 1080px) {
  .ops { position: static; max-width: none; flex-basis: 100%; }
}
@media (max-width: 720px) {
  .b { font-size: 16px; }
  .top { height: 56px; padding: 0 16px; }
  .h1 { font-size: 26px; }
  .doc-main { padding: 0 0 24px; gap: 0; }
  .doc { flex-basis: 100%; padding: 20px 20px 24px; border: 0; border-radius: 0; box-shadow: none; }
  .tx { margin-top: 24px; }
  .tx p { font-size: 16px; }
  .ops { display: none; }
  .share-foot { padding-bottom: 168px; }
  dialog.dialog { padding: 20px; gap: 12px; }
  dialog.dialog.export-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 6px 6px 0 0; }
  .export-dialog .h2 { font-size: 22px; }
  .dock { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sheet); box-shadow: 0 -8px 24px rgba(16, 24, 40, .06); }
  .player { border-top: 1px solid rgba(16, 24, 40, .1); box-shadow: none; }
  .player-in { padding: 8px 12px 0; }
  .ptitle, .pctl .ptime.total-d { display: none; }
  .pctl { gap: 8px; }
  .pbtn { width: 44px; height: 44px; }
  .mbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }
  .mbar .btn { height: 44px; padding: 0; font-size: 14px; }
  .mbar.mbar-one { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 8px; }
  .top .brand { flex: none; white-space: nowrap; }
  .toasts { bottom: 150px; }
}
