/* 佈景：比照「原文對照聖經」暖紙色＋深藍頂列＋金色徽章浮水印 */
:root {
  --bg: #FAF6EE; --bg2: #F0E9DB; --card: #FFFDF8; --fg: #2F3343; --fg2: #4A4F63; --muted: #67645F;
  --line: #E4DCCC; --edge: #8E8574; --accent: #8A6431; --accent-soft: rgba(196, 147, 86, .16);
  --chrome: #2F3343; --chrome-fg: #F7F1E4; --gold: #D9A466; --logo: #9C733D; --wm-opacity: .06;
  --ok: #2B7A44; --danger: #B03A2E; --warn-bg: #FBEBD3;
  --serif-zh: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
  --kai: "BiauKai", "DFKai-SB", "標楷體", "Kaiti TC", "STKaiti", var(--serif-zh);
  --ui: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --r: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 16px/1.7 var(--ui); min-height: 100vh; display: flex; flex-direction: column; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.hint { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); font-size: 14px; }
small.hint { display: block; margin-top: 2px; }

/* 浮水印 */
.watermark, .hero-logo, .brand-logo {
  background: var(--logo);
  -webkit-mask: url(../icons/emblem.svg) center / contain no-repeat; mask: url(../icons/emblem.svg) center / contain no-repeat;
}
.watermark { position: fixed; z-index: 0; left: 50%; top: 54%; width: min(78vw, 520px); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: var(--wm-opacity); pointer-events: none; }

/* 頂列 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 8px) 16px 8px; background: var(--chrome); color: var(--chrome-fg); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--gold); text-decoration: none; font: 600 16px var(--serif-zh); letter-spacing: .06em; }
.brand-logo { width: 28px; height: 28px; background: var(--gold); }
.brand-short { display: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--chrome-fg); text-decoration: none; padding: 6px 12px; border-radius: 99px; font-size: 15px; opacity: .85; }
.nav a.on, .nav a:hover { background: rgba(217, 164, 102, .18); opacity: 1; color: var(--gold); }

.page { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; flex: 1; }
.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 13px; padding: 18px 12px calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
.foot .ver { display: block; margin-top: 4px; }

/* 首頁 */
.hero { display: flex; align-items: center; gap: 28px; padding: 18px 4px 26px; }
.hero-logo { width: 150px; height: 150px; flex: none; background: var(--accent); opacity: .95; }
.kicker { font: 600 15px var(--serif-zh); color: var(--accent); letter-spacing: .3em; }
.hero h1 { font: 700 clamp(28px, 5vw, 40px)/1.3 var(--serif-zh); margin: 4px 0 10px; letter-spacing: .04em; }
.lead { margin: 0 0 16px; color: var(--fg2); max-width: 36em; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) { .hero { flex-direction: column; text-align: center; gap: 10px; } .hero-logo { width: 110px; height: 110px; } .hero-btns { justify-content: center; } }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 10px; }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.fcard h3 { margin: 2px 0 4px; font: 700 17px var(--serif-zh); }
.fcard p { margin: 0; font-size: 14px; color: var(--fg2); }
.fnum { font: 700 22px var(--serif-zh); color: var(--accent); }
.sec { font: 700 19px var(--serif-zh); margin: 26px 0 10px; }
.sec.m0 { margin: 0; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: inherit; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(47, 51, 67, .1); }
.pc-top { display: flex; flex-direction: column; }
.pc-top b { font: 700 17px var(--serif-zh); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-block; font-size: 12px; line-height: 1.6; padding: 0 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: var(--bg); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: rgba(43, 122, 68, .35); background: rgba(43, 122, 68, .07); }

/* 按鈕與表單 */
.btn { border: 1px solid var(--edge); background: var(--card); color: var(--fg); border-radius: 12px; padding: 9px 16px; cursor: pointer; font-weight: 600; transition: background .15s; }
.btn:hover { background: var(--bg2); }
.btn.primary { background: var(--chrome); color: var(--chrome-fg); border-color: var(--chrome); }
.btn.primary:hover { background: #3B4055; }
.btn.install { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 5px 12px; font-size: 14px; border-radius: 10px; }
.btn.quiet, .btn.clear-field { background: transparent; border: 1px solid transparent; color: var(--muted, #6b6458); font-weight: 500; padding: 4px 10px; }
.btn.quiet:hover, .btn.clear-field:hover { background: transparent; border-color: var(--line); color: var(--fg); }
.btn.clear-field[hidden] { display: none !important; }
.trans-stale { margin: 8px 0; }

.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }
.inp { width: 100%; font: inherit; color: var(--fg); background: #fff; border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; }
.inp.sm { width: auto; padding: 5px 8px; font-size: 14px; }
input[type=color].inp { padding: 2px; height: 38px; width: 70px; }
.fld { display: block; margin: 10px 0; }
.fld > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.fld.inline { display: inline-flex; align-items: center; gap: 8px; margin: 6px 12px 6px 0; }
.fld.inline > span { margin: 0; font-weight: 500; }
.tog { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0 4px; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 14px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; color: var(--accent); }
details.card[open] > summary::before { content: '▾ '; }
details.card[open] > summary { margin-bottom: 10px; }
.notice { background: var(--bg2); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 15px; }
.notice.warn { background: var(--warn-bg); color: #7A4A12; }
.pagetitle { font: 700 26px var(--serif-zh); margin: 4px 0 16px; }

/* 專案頁 */
.phead { margin-bottom: 8px; }
.back { font-size: 14px; text-decoration: none; }
.ptitle { font: 700 24px/1.35 var(--serif-zh); margin: 4px 0 2px; }
.pmeta { color: var(--muted); font-size: 14px; }
.cloudbar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 8px 0 2px; }
.cloudbar-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cloudbar-actions { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; width: 100%; }
.cloudbar-actions .btn,
.cloudbar-actions .cloud-publish {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 8px 10px;
}
.cloud-publish { gap: 8px; font-size: 15px; cursor: pointer; border: 1px solid var(--edge); border-radius: 10px; background: var(--card); }
.cloud-publish input { width: 20px; height: 20px; flex: none; accent-color: var(--accent, #2f6f4e); }
.net-banner { display: block; background: #F3EFE4; color: var(--fg); font-size: 13px; line-height: 1.45; text-align: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.net-banner[hidden] { display: none !important; }
.net-banner.syncing { background: #E7F0E6; }

.tabs { position: sticky; top: calc(var(--safe-t) + 48px); z-index: 10; display: flex; gap: 4px; overflow-x: auto; margin: 12px -16px 16px; padding: 8px 16px; background: rgba(250, 246, 238, .93); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a { flex: none; text-decoration: none; color: var(--fg2); padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 15px; }
.tabs a.on { background: var(--chrome); color: var(--chrome-fg); }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; border: 2px dashed var(--edge); border-radius: var(--r); padding: 22px 12px; cursor: pointer; background: rgba(255, 255, 255, .5); transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--accent-soft); border-color: var(--accent); }
.drop-host { border-radius: var(--r); transition: background .15s, outline-color .15s; }
.drop-host.over { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.drop b { font: 700 17px var(--serif-zh); }
.drop span { font-size: 14px; color: var(--muted); }
.ainfo { margin-top: 10px; font-size: 14px; }
.ainfo .chip { margin-left: 6px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.split .narrowcol { max-width: none; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
/* 寬螢幕左右並排時，右邊合併預覽與左邊對齊結果同一可視高度，在框內捲動，不把整頁撐開 */
@media (min-width: 861px) {
  .split > .col:not(.narrowcol) > .doc.paper,
  .split > .col:not(.narrowcol) > textarea.doc-edit {
    max-height: 75vh;
    overflow-y: auto;
    min-height: 0;
  }
  .split > .col:not(.narrowcol) > .doc.paper .d-pt { scroll-margin-top: 8px; }
}
.col { min-width: 0; display: flex; flex-direction: column; }
.colhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; flex-wrap: wrap; }
.editor { width: 100%; min-height: 420px; flex: 1; font: 15px/1.75 var(--serif-zh); color: var(--fg); background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px; resize: vertical; }
.editor.tall { min-height: 360px; margin-top: 10px; }
.editor.short { min-height: 90px; margin-top: 8px; font-size: 14px; flex: none; resize: none; overflow: hidden; field-sizing: content; }

/* 處理流程 */
.steps { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: st; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); counter-increment: st; }
.step::before { content: counter(st); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--ui); background: var(--bg2); color: var(--fg2); }
.step.done::before { content: '✓'; background: var(--ok); color: #fff; }
.step-main { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.step-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.player { width: 100%; margin-top: 10px; }
.prog-wrap { margin-top: 12px; }
.prog-wrap .prog { margin-top: 0; }
.prog-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.prog-acts[hidden], .prog-acts:empty { display: none; }
.prog { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 30px; height: auto; padding: 4px 12px; border-radius: 10px; background: var(--bg2); overflow: hidden; margin-top: 12px; }
.prog-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #C49356, #D9A466); transition: width .3s var(--ease); }
.prog > :not(.prog-fill) { position: relative; flex: none; }
.prog.ok .prog-fill { background: rgba(43, 122, 68, .35); }
.prog.fail { background: #F6DCD8; } .prog.fail .prog-fill { display: none; }
.prog.ok .spin, .prog.fail .spin { display: none; }
.prog-txt { flex: 1 1 auto !important; min-width: 0; font-size: 13px; line-height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-pct { flex: none !important; font-size: 12px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3.2em; text-align: right; }
.prog-pct[hidden] { display: none; }
.prog-el { font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none !important; flex-shrink: 0; margin-left: auto; }
.prog.fail .prog-txt { white-space: normal; line-height: 1.5; padding: 6px 0; color: var(--danger); }
.prog.fail { height: auto; }

.diff { white-space: pre-wrap; font: 15px/1.8 var(--serif-zh); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; max-height: 70vh; overflow: auto; }
.diff.small { font-size: 14px; max-height: none; overflow: visible; }
del { color: var(--danger); background: rgba(176, 58, 46, .08); text-decoration-thickness: 1px; }
ins { color: var(--ok); background: rgba(43, 122, 68, .1); text-decoration: none; }
.corr { margin-top: 12px; font-size: 14px; }
.corr summary { cursor: pointer; font-weight: 600; }
.corr ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 320px; overflow: auto; }
.corr li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.corr li.verse { background: rgba(139, 30, 30, .04); }
.spk { display: flex; flex-wrap: wrap; margin-top: 6px; }
.qlist { display: flex; flex-direction: column; gap: 12px; }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; background: #fff; }
.qcard.accepted { border-color: rgba(43, 122, 68, .45); }
.qcard .row { flex-wrap: wrap; justify-content: flex-start; margin-top: 6px; }
.qlinks { font-size: 13px; margin-top: 4px; color: var(--muted); }

/* 匯出列 */
.xlabel { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--fg2); }
.xbar { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; align-items: center; }
.xgrp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xgrp + .xgrp { padding-left: 12px; border-left: 1px solid var(--line); }
a.xbtn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.xbtn { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
/* 下載檔案：柔和暖米 */
.xbtn-file { background: #F3EDE0; border-color: #D4C6AB; color: #5A4C36; }
.xbtn-file:hover { background: #EBE3D2; border-color: var(--accent); color: var(--accent); }
/* 傳遞：柔和鼠尾草綠 */
.xbtn-send { background: #E6F0EA; border-color: #B6C9BE; color: #2C5844; }
.xbtn-send:hover { background: #D8E7DE; border-color: #3E7A5C; color: #24563F; }
/* 發佈：主色深藍，最醒目 */
.xbtn-pub { background: var(--chrome); border-color: var(--chrome); color: var(--chrome-fg); }
.xbtn-pub:hover { background: #3B4055; border-color: #3B4055; color: #fff; }
.xbtn-file.busy:hover:disabled { background: #F3EDE0; color: #5A4C36; }
.xbtn-send.busy:hover:disabled { background: #E6F0EA; color: #2C5844; }
.xbtn-pub.busy:hover:disabled { background: var(--chrome); color: var(--chrome-fg); }
@media (max-width: 560px) {
  .xbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .xgrp + .xgrp { padding-left: 0; border-left: 0; padding-top: 8px; border-top: 1px solid var(--line); }
}

/* 合併 */
.report { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; max-height: 75vh; overflow: auto; }
.al { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px; align-items: center; padding: 5px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.al.miss { background: rgba(176, 58, 46, .05); }
.al-lab { font-weight: 700; white-space: nowrap; }
.al-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg2); }
.cands { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; font-size: 14px; }
.cand { display: flex; gap: 6px; align-items: flex-start; padding: 4px; border-radius: 8px; cursor: pointer; }
.cand:hover { background: var(--bg2); }
.legend { display: inline-flex; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.legend.big { gap: 8px; margin-bottom: 12px; font-size: 14px; }
.sw { display: inline-flex; align-items: center; gap: 4px; }
.sw i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hl { padding: 2px 10px; border-radius: 6px; }
.tbl { border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 4px 10px; text-align: left; }
.prose h3 { font: 700 18px var(--serif-zh); margin: 16px 0 6px; }
.prose li { margin: 4px 0; }

/* ===== 文件（綱目排版：比照 LSM 特會綱目） ===== */
.doc { font: 16px/1.66 var(--serif-zh); color: #000; }
.doc.paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 28px 34px; box-shadow: 0 2px 14px rgba(47, 51, 67, .06); min-height: 420px; overflow: auto; }
.doc.paper.narrow { padding: 22px 20px; }
.doc-edit-bar { margin: 8px 0 10px; gap: 8px; align-items: center; }
textarea.doc-edit { display: block; width: 100%; box-sizing: border-box; min-height: 420px; resize: vertical; font: 16px/1.66 var(--serif-zh); color: #000; }
.doc.small { font-size: 15px; min-height: 120px; }
.doc p { margin: 0; }
.d-doctitle { font: 700 18px/1.5 var(--ui); text-align: center; margin: 0 0 6px; }
.d-subject { font: 23px/1.5 var(--kai); text-align: center; margin: 0 0 10px; }
.d-msgno { font: 20px/1.5 var(--kai); text-align: center; }
.d-msgtitle { font: 20px/1.5 var(--kai); text-align: center; margin: 0 0 12px; font-weight: 400; }
.d-reading { font-size: 14px; padding-left: 2em; margin: 0 0 12px; }
.d-pt { text-align: justify; }
.d-pt .lab { display: inline-block; }
.d-pt.l1 { padding-left: 2.3em; text-indent: -2.3em; margin-top: .45em; font-family: var(--kai); font-weight: 700; }
.d-pt.l1 .lab { width: 2.3em; text-indent: 0; }
.d-pt.l2 { padding-left: 3em; text-indent: -2em; }
.d-pt.l3 { padding-left: 4em; text-indent: -2em; }
.d-pt.l4 { padding-left: 5em; text-indent: -2em; }
.d-pt.l5 { padding-left: 6em; text-indent: -2em; }
.d-pt.l2 .lab, .d-pt.l3 .lab, .d-pt.l4 .lab, .d-pt.l5 .lab { width: 2em; text-indent: 0; }
.d-pt.l3 .lab, .d-pt.l4 .lab { font-family: "Times New Roman", serif; }
.d-verses { white-space: pre-wrap; font-size: .88em; color: #8B1E1E; margin: 2px 0 4px; }
.d-verses.l1 { padding-left: 2.3em; } .d-verses.l2 { padding-left: 3em; } .d-verses.l3 { padding-left: 4em; } .d-verses.l4 { padding-left: 5em; } .d-verses.l5 { padding-left: 6em; }
.d-p, .d-quote, .d-verse { text-align: justify; margin: .35em 0; }
.d-p { text-indent: 2em; }
.d-heading { font: 700 16px var(--serif-zh); margin: .8em 0 .3em; }
.ind1 { padding-left: 2.3em; } .ind2 { padding-left: 3em; } .ind3 { padding-left: 4em; } .ind4 { padding-left: 5em; } .ind5 { padding-left: 6em; }
.d-quote { padding-right: 1em; }
.d-text { margin: .3em 0; }
.d-table { border-collapse: collapse; width: 100%; margin: .4em 0 .8em; font-size: .92em; line-height: 1.45; }
.d-table th, .d-table td { border: 1px solid #999; padding: .25em .5em; text-align: left; vertical-align: top; }
.d-table th { background: #ededed; font-weight: 700; white-space: nowrap; }
.d-table tr { break-inside: avoid; }

/* 對話框與提示 */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(16, 18, 28, .5); display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); animation: fade .2s; }
.modal-back.alert { z-index: 120; } /* 換 API 等醒目提醒：蓋在「書報引用核對」等視窗上面，關掉後回到原來的視窗 */
/* 手機：標題與按鈕固定在視窗內，只有中間內容自己捲動（不被瀏覽器工具列截掉） */
.modal { display: flex; flex-direction: column; overflow: hidden; width: min(640px, 100%); max-height: calc(100vh - 32px - var(--safe-t) - var(--safe-b)); max-height: calc(100dvh - 32px - var(--safe-t) - var(--safe-b)); background: var(--card); border-radius: 18px; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); animation: up .25s var(--ease); }
.modal.alert { border-top: 6px solid var(--danger); }
.modal h3 { flex: 0 0 auto; font: 700 19px var(--serif-zh); margin: 0 0 10px; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* 視窗內只保留 .modal-body 一個卷軸：清單、對照、文字框都隨內容長高 */
.modal-body .qlist, .modal-body .diff, .modal-body .diff.small, .modal-body .qcand-text { max-height: none; overflow: visible; }
.qhelp { margin: 0 0 12px; }
.qhelp > summary { cursor: pointer; font-size: 14px; color: var(--fg2); }
.qhelp > .hint { margin: 8px 0 0; }
.modal-btns { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.inst { text-align: center; } .inst img { border-radius: 16px; }
.isteps { text-align: left; background: var(--bg2); border-radius: 12px; padding: 10px 14px 10px 32px; line-height: 1.9; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 30px); opacity: 0; background: var(--chrome); color: var(--chrome-fg); padding: 10px 18px; border-radius: 12px; font-size: 15px; transition: .25s var(--ease); pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 列印（另存 PDF） */
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .doc { font-size: 12pt; line-height: 1.37; }
  #print-root .d-subject { font-size: 18pt; } #print-root .d-msgno, #print-root .d-msgtitle { font-size: 15.7pt; }
  #print-root .d-doctitle { font-size: 14pt; } #print-root .d-reading { font-size: 10.9pt; }
  #print-root .d-pt, #print-root .d-p { break-inside: avoid-page; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* v0.2.0：本機工具、金鑰步驟 */
.sechead { justify-content: space-between; margin: 26px 0 4px; }
.sechead .sec { margin: 0; }
.fcard.tool h3 { margin-bottom: 6px; }
.tl { margin: 0; padding-left: 18px; font-size: 14px; color: var(--fg2); }
.tl li { margin: 4px 0; }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
@media (max-width: 640px) { .ab { grid-template-columns: 1fr; } }
.keysteps { margin: 8px 0 10px; padding-left: 22px; font-size: 15px; }
.keysteps li { margin: 3px 0; }
a.btn { display: inline-block; text-decoration: none; }
@media (max-width: 520px) {
  /* 手機：網站名稱一定顯示，選單換到下一行 */
  .top { flex-wrap: wrap; row-gap: 4px; }
  .brand { flex: 1 1 100%; font-size: 15px; }
  .nav { flex: 1 1 100%; justify-content: space-between; }
  .nav a { padding: 6px 9px; font-size: 14px; }
}
.tog input.inp, .tog input[type=checkbox] { width: auto; flex: none; }
.drop.big { padding: 30px 12px; } .drop.big b { font-size: 21px; } details.adv { margin-top: 12px; font-size: 14px; } details.adv summary { cursor: pointer; color: var(--accent); }
.listhead { justify-content: space-between; margin: 4px 0 14px; }
.pagetitle.m0 { margin: 0; }
.fcard.link { display: block; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.fcard.link:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 20px rgba(47, 51, 67, .1); }
details.howto { margin-top: 22px; }
details.howto > summary { cursor: pointer; font: 700 17px var(--serif-zh); margin-bottom: 10px; }
@media (max-width: 520px) { .nav { gap: 0; } .nav a { padding: 6px 7px; font-size: 13.5px; } }

/* v0.5.0：一步步引導 */
.btn.big { padding: 13px 22px; font-size: 17px; border-radius: 14px; }
.lead.sm { font-size: 15px; margin: 2px 0 12px; }
.startcard { position: relative; padding: 22px 20px; overflow: hidden; }
.startlogo { position: absolute; right: -30px; top: -30px; width: 190px; height: 190px; opacity: .08; background: var(--accent);
  -webkit-mask: url(../icons/emblem.svg) center / contain no-repeat; mask: url(../icons/emblem.svg) center / contain no-repeat; pointer-events: none; }
.startgrid { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 0 12px; margin: 8px 0 6px; }
@media (max-width: 720px) { .startgrid { grid-template-columns: 1fr; } }
.pc-next { margin-top: 8px; font-size: 14px; color: var(--accent); font-weight: 600; }
.phead .ptitle { margin-right: 8px; }
.stepbar { list-style: none; display: flex; gap: 0; padding: 0; margin: 14px 0 16px; counter-reset: s; overflow-x: auto; scrollbar-width: none; }
.stepbar li { flex: 1; min-width: 74px; position: relative; text-align: center; }
.stepbar li::before { content: ''; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepbar li:first-child::before { display: none; }
.stepbar li.done::before, .stepbar li.on::before { background: var(--accent); }
.stepbar a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.stepbar .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); font: 700 15px var(--ui); }
.stepbar li.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepbar li.on .num { background: var(--chrome); border-color: var(--chrome); color: var(--chrome-fg); box-shadow: 0 0 0 4px rgba(196, 147, 86, .3); }
.stepbar li.on a { color: var(--fg); }
.stepcard { border: 1.5px solid var(--accent); box-shadow: 0 4px 18px rgba(138, 100, 49, .1); }
.steptitle { font: 700 20px var(--serif-zh); margin: 0; }
.stepnav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 4px; flex-wrap: wrap; }
.helpbox { background: transparent; border-style: dashed; }
.helpbox > summary { color: var(--fg2); }
.steps.compact { margin-top: 12px; }
.steps.compact .step { padding: 6px 0; }
.stepcard .drop { margin-top: 4px; }
.stepcard .xlabel { margin-top: 14px; }
.stepbar .lbl { white-space: nowrap; }
@media (max-width: 520px) { .stepbar li { min-width: 62px; } .stepbar a { font-size: 12.5px; } .stepbar .num { width: 32px; height: 32px; } .stepbar li::before { top: 15px; } }

/* ---------- 登入與管理後台 ---------- */
.loginrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0; }
.gbtn { min-height: 44px; }
.btn.line { background: #06C755; border-color: #06C755; color: #fff; border-radius: 99px; padding: 10px 20px; }
.btn.line:hover { background: #05B34C; }
img.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.chip.warn { color: #7A4A12; border-color: rgba(122, 74, 18, .35); background: var(--warn-bg); }
.keyrow { padding: 12px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: 0; }
.keyrow .inp { flex: 1 1 240px; }
.bar { height: 10px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 6px 0 10px; }
.bar i { display: block; height: 100%; background: var(--chrome); }
.ulist { display: flex; flex-direction: column; gap: 10px; }
.urow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.urow.pending { border-color: rgba(122, 74, 18, .45); background: var(--warn-bg); }
.urow .muted { font-size: 13px; margin: 4px 0; }
.urow .inp.sm { flex: 1 1 180px; }
details.card > summary { cursor: pointer; }
.installbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 28px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 公開協作與聚會管理 */
.collab-field { margin: 4px 0 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tabs a.btn { text-decoration: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; margin-top: 8px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--card); }
.gallery figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.gallery figcaption b { font-size: 13px; word-break: break-all; }
.thumbbtn { display: block; width: 100%; padding: 0; border: 0; background: var(--bg2); border-radius: 10px; cursor: pointer; min-height: 96px; color: var(--muted); }
.thumbbtn img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; display: block; }
.lightbox-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }
.filelist { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.filerow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.tablewrap { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th, .mtable td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.mtable input[type=checkbox] { width: auto; }
.detailbox { margin-top: 8px; }
.filters { align-items: center; }
.filters .inp { width: auto; flex: 1 1 220px; }
.filters select.inp { flex: 0 1 180px; }
.mtgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.mtgrid .fld.wide { grid-column: 1 / -1; }
.samplebar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px dashed var(--edge); border-radius: 14px; background: var(--card); }
.samplebar > b, .samplebar > small { grid-column: 1 / -1; }
.samplebar > .btn { width: 100%; padding: 10px 8px; white-space: nowrap; }
.samplebar > small { margin: 0; }

/* 網頁錄音 */
.btn.recbtn { background: #A3342B; border-color: #A3342B; color: #fff; }
.btn.recbtn:hover { background: #8C2B23; }
.recpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .recpick { grid-template-columns: 1fr; } }
button.drop { font: inherit; color: inherit; }
.drop.recdrop { border-color: #A3342B; }
.drop.recdrop b { color: #A3342B; }
.drop.recdrop:disabled { opacity: .5; cursor: not-allowed; }
.recinfo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg2); font-size: 14px; }
body:has(.recbar) { padding-bottom: 120px; }
.recbar { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(640px, calc(100% - 20px));
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 6px 10px; padding: 10px 14px; border-radius: 16px;
  background: var(--chrome); color: var(--chrome-fg); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); }
.recbar .rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #E5493D; animation: recblink 1.2s infinite; }
.recbar .rec-dot.off { background: #9A968E; animation: none; }
@keyframes recblink { 50% { opacity: .3; } }
.recbar .rec-state { font-weight: 600; font-size: 14px; }
.recbar .rec-time { font: 700 18px ui-monospace, Menlo, Consolas, monospace; }
.recbar .rec-lvl { grid-column: 1 / -1; order: 9; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.recbar .rec-lvl i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.recbar .rec-btns { display: flex; gap: 6px; justify-content: flex-end; grid-column: 3 / 5; }
.recbar .rec-btns .btn { background: transparent; color: var(--chrome-fg); border-color: rgba(255, 255, 255, .45); }
.recbar .rec-btns .btn.primary { background: #E5493D; border-color: #E5493D; color: #fff; }
.recbar .rec-tip { grid-column: 1 / -1; order: 10; opacity: .75; font-size: 12px; }

/* 公開閱讀頁、分享方式、網址載入 */
.choice { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0 12px; padding: 8px 12px 12px; }
.choice legend { font-weight: 700; padding: 0 6px; }
.choice label { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.choice [hidden] { display: none; }
.choice label.on { border-color: var(--accent); background: var(--accent-soft); }
.choice label input { margin-top: 4px; }
.choice small.hint { font-weight: 400; }
.urlbox { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--line); }
.kindbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
main.reader { max-width: 900px; } /* 只限制閱讀區的寬度（body 也有 reader 這個 class，不能套到整頁） */
.reader-title { font: 700 clamp(26px, 4vw, 34px)/1.35 var(--serif-zh); margin: 8px 0 0; }
.reader-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.reader-tools { margin: 14px 0; }
.reader-article { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 18px 32px; }
.reader-photos { margin-top: 18px; }
.reader-photos img { width: 100%; border-radius: 10px; }
@media (min-width: 720px) { .reader-article { padding: 36px 48px 48px; } }
@media (max-width: 520px) {
  .nav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav a { flex: none; white-space: nowrap; }
}
@media print {
  body.reader .top, body.reader .foot, body.reader .reader-tools, body.reader .watermark, body.reader .back { display: none !important; }
  body.reader { background: #fff; }
  body.reader .reader-article { border: 0; box-shadow: none; padding: 0; }
}

/* 公開閱讀頁右側綱目導覽（大點／中點磁性滑動） */
body.has-onav main.reader { padding-right: 56px; }
body.has-onav .d-pt.l1, body.has-onav .d-pt.l2 { scroll-margin-top: calc(72px + var(--safe-t)); }
.outline-nav {
  position: fixed;
  z-index: 15;
  right: max(6px, env(safe-area-inset-right, 0px), calc((100vw - min(900px, 100vw)) / 2 - 56px));
  top: max(72px, calc(var(--safe-t) + 64px));
  bottom: max(64px, calc(var(--safe-b) + 56px));
  width: 44px;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.outline-nav .onav-track {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 8px 3px;
  border-radius: 999px;
  background: rgba(255, 253, 248, .94);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(47, 51, 67, .12);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.outline-nav .onav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 20px;
  max-height: 34px;
  width: 100%;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 11px var(--ui);
  line-height: 1;
  cursor: pointer;
}
.outline-nav .onav-major { font-weight: 700; color: var(--fg2); font-size: 12px; }
.outline-nav .onav-minor { font-weight: 500; font-size: 10px; color: var(--muted); }
.outline-nav .onav-minor .onav-lab { opacity: .9; transform: scale(.95); }
.outline-nav .onav-item.on,
.outline-nav .onav-item.snap {
  color: var(--chrome);
  background: var(--accent-soft);
}
.outline-nav .onav-item.snap { box-shadow: inset 0 0 0 1.5px var(--accent); }
.outline-nav .onav-lab {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
}
.outline-nav .onav-tip {
  position: absolute;
  right: calc(100% + 8px);
  top: 0;
  z-index: 1;
  max-width: min(240px, calc(100vw - 72px));
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--chrome);
  color: var(--chrome-fg);
  font: 600 13px/1.4 var(--ui);
  box-shadow: 0 6px 20px rgba(47, 51, 67, .22);
  pointer-events: none;
  white-space: normal;
}
.outline-nav .onav-tip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-left-color: var(--chrome);
  border-right: 0;
}
@media (min-width: 1000px) {
  body.has-onav main.reader { padding-right: 16px; }
}
@media (max-width: 720px) {
  body.has-onav main.reader { padding-right: 0; }
  .outline-nav { display: none !important; }
}
@media print {
  .outline-nav, body.has-onav main.reader { padding-right: 0; }
  .outline-nav, .onav-fab, .onav-drawer, .onav-backdrop { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .outline-nav .onav-item { transition: none; }
}

/* 工具頁分頁 */
.seg { display: flex; gap: 6px; margin: 4px 0 14px; padding: 4px; border-radius: 14px; background: var(--bg2); }
.seg a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: inherit; font-weight: 600; }
.seg a.on { background: var(--card, #fff); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

/* 第 4 步合併來源：原稿／翻譯稿 */
.merge-src { margin: 0 0 12px; }
.merge-src .src-now { margin: 0 0 8px; color: var(--fg2); font-size: 15px; }
.merge-src .src-now b { color: var(--fg); }
.merge-src .hint { margin: 0; }
.merge-src-seg { margin: 0 0 8px; }
.merge-src-seg button {
  flex: 1 1 0;
  text-align: center;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.merge-src-seg button.on {
  background: var(--card, #fff);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  color: var(--chrome);
}
.merge-jump-wrap { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 12px 0 4px; }
.merge-jump-wrap .hint { margin: 0; flex: 1 1 14em; }
.merge-jump { font-weight: 700; }
@media (max-width: 560px) {
  .merge-src-seg { flex-direction: column; }
  .merge-jump-wrap { flex-direction: column; align-items: stretch; }
}
.row.center { justify-content: center; }
.drop .row { margin-top: 10px; }

/* 附圖（黑板、圖表照片） */
.d-fig { margin: 14px 0; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.d-fig img { max-width: 100%; max-height: 640px; border-radius: 4px; }
.d-fig figcaption { font-size: .9em; color: #555; margin-top: 4px; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.photogrid figure { margin: 0; padding: 6px; border-radius: 12px; background: var(--bg2); display: flex; flex-direction: column; gap: 6px; }
.photogrid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.photogrid .inp { padding: 6px 8px; font-size: 14px; }
.photogrid .row { gap: 4px; justify-content: space-between; }
.photo-note { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--gold); background: var(--bg2); border-radius: 6px; font-size: 14px; }

/* 後台「前往」捲到使用者清單時閃一下 */
.flash { animation: flashcard 1.6s ease; }
@keyframes flashcard { 0%, 60% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: none; } }

/* 背景辨識狀態 */
.jobbox { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border-left: 4px solid var(--gold); display: grid; gap: 6px; }
.jobbox .jobmsg { font-weight: 600; }
.jobbox .jobmsg.err { color: #A3342B; }
.jobbox .jobmsg.warn { color: #8a5a00; }
.jobbox .hint { font-size: 13px; }
.jobbox .jobbar { height: 6px; border-radius: 3px; background: var(--line, #e5dccb); overflow: hidden; }
.jobbox .jobbar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .4s; }
.jobbox .joblist { margin: 0; font-size: 13px; }
.jobbox .joblist li.err { color: #A3342B; }

/* 後台金鑰：名稱單獨一行 */
.keyrow .keyname { display: block; font-size: 1.05em; margin-bottom: 4px; }

/* 錄音處理方式 */
.qbox { display: grid; gap: 8px; margin-bottom: 12px; }
.qopt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line, #d9d2c3); border-radius: 12px; cursor: pointer; }
.qopt.on { border-color: var(--gold); background: var(--bg2); }
.qopt input { margin-top: 4px; accent-color: #A3342B; }
.qopt > span { display: grid; gap: 2px; }
.qopt small { color: var(--muted, #6b6558); line-height: 1.5; }

/* 下載／上傳進度圈（右下角浮動） */
.pdock { position: fixed; z-index: 190; right: max(12px, env(safe-area-inset-right, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(12px, calc(12px + var(--safe-b))); margin-left: auto; display: grid; gap: 8px; width: min(340px, calc(100vw - 24px)); max-width: calc(100vw - 24px); box-sizing: border-box; pointer-events: none; }
.pd-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--chrome); color: var(--chrome-fg); box-shadow: 0 6px 22px rgba(0, 0, 0, .22); animation: pdIn .25s var(--ease); pointer-events: auto; max-width: 100%; min-width: 0; box-sizing: border-box; }
.pd-txt { min-width: 0; overflow: hidden; }
body:has(.recbar) .pdock { bottom: calc(140px + var(--safe-b)); }
body:has(.update-banner) .pdock { bottom: calc(88px + var(--safe-b)); }
body:has(.recbar):has(.update-banner) .pdock { bottom: calc(200px + var(--safe-b)); }
@keyframes pdIn { from { opacity: 0; transform: translateY(12px); } }
.pd-ring { position: relative; flex: 0 0 44px; width: 44px; height: 44px; }
.pd-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.pd-ring circle { fill: none; stroke-width: 4; }
.pd-ring .trk { stroke: rgba(255, 255, 255, .16); }
.pd-ring .arc { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .3s var(--ease); }
.pd-ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px var(--ui); color: var(--gold); }
.pd-item.indet .pd-ring svg { animation: pdSpin 1s linear infinite; }
.pd-item.indet .pd-ring .arc { stroke-dashoffset: 80 !important; }
@keyframes pdSpin { to { transform: rotate(270deg); } }
.pd-txt { min-width: 0; flex: 1; }
.pd-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-sub { font-size: 12.5px; opacity: .85; font-variant-numeric: tabular-nums; }
.pd-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.pd-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s var(--ease); }
.pd-item.indet .pd-bar i { width: 35% !important; animation: pdSlide 1.2s ease-in-out infinite; }
@keyframes pdSlide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.pd-item.ok .pd-ring .arc { stroke: #7FC79A; } .pd-item.ok .pd-ring .pct { color: #7FC79A; } .pd-item.ok .pd-bar i { background: #7FC79A; }
.pd-item.fail { background: var(--danger); } .pd-item.fail .pd-ring .pct { color: #fff; font-size: 18px; } .pd-item.fail .pd-ring .arc { stroke: #fff; }
@media (prefers-reduced-motion: reduce) { .pd-item.indet .pd-ring svg, .pd-item.indet .pd-bar i { animation-duration: 3s; } }
.prog.has-x { padding-right: 44px; }
.prog > .prog-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 26px; border: 0; border-radius: 8px; background: rgba(47, 51, 67, .12); color: var(--fg); font-size: 14px; line-height: 1; cursor: pointer; }
.prog-x:hover { background: rgba(47, 51, 67, .22); } .prog-x:disabled { opacity: .4; }
.warnbox { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: #7A4A12; border-left: 4px solid #D9A466; }
.warnbox p { margin: 6px 0; font-size: 14.5px; line-height: 1.6; }
.warnbox.danger { background: #FCECEA; color: #7A241C; border-left-color: var(--danger); }
.hint.okline { color: var(--ok); margin: 8px 0; }
/* 第 1 步的收合區（黑板照片、分享設定） */
details.fold { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
details.fold > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--accent); transition: transform .2s var(--ease); }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > .card { margin: 0; border: 0; box-shadow: none; border-top: 1px dashed var(--line); border-radius: 0 0 var(--r) var(--r); }

/* ---------- v0.22.2：即時回饋（按鈕執行中、動向說明、載入中） ---------- */
.spin { display: inline-block; flex: none; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.15em; animation: spin .8s linear infinite; }
.spin.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: spin 2s linear infinite !important; } }
/* 按鈕：執行中＝轉圈＋動詞，不變灰到看不見 */
.btn.busy, .xbtn.busy, .link.busy, button.busy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: progress; opacity: 1; }
.btn.busy:disabled, .xbtn.busy:disabled { opacity: .88; }
.btn.busy:hover:disabled { background: var(--card); } .btn.primary.busy:hover:disabled { background: var(--chrome); }
.busy-label { min-width: 0; overflow-wrap: anywhere; text-align: center; }
.link.busy { text-decoration: none; }
button.drop.busy { flex-direction: column; gap: 6px; border-style: solid; border-color: var(--accent); }
/* 載入中的一行 */
.hint.loading { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
/* 動向說明列 */
.livestat { margin: 10px 0; padding: 8px 12px; border-radius: 12px; background: var(--bg2); border-left: 4px solid var(--gold); font-size: 14px; line-height: 1.5; min-width: 0; }
.livestat[hidden] { display: none; }
.ls-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ls-row .spin { margin-top: 3px; }
.ls-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.ls-el { flex: none; margin-left: auto; color: var(--fg2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ls-hint { margin: 2px 0 0 22px; color: var(--muted); font-size: 13px; }
.livestat.ok { border-left-color: var(--ok); } .livestat.fail { border-left-color: var(--danger); background: #F6DCD8; color: var(--danger); }
.livestat.ok .spin, .livestat.fail .spin { display: none; }
.livestat.ok .ls-row::before { content: '✓'; color: var(--ok); font-weight: 700; } .livestat.fail .ls-row::before { content: '!'; font-weight: 700; }
.livestat.ok .ls-hint, .livestat.fail .ls-hint { display: none; }
.livestat.livefloat { position: fixed; z-index: 130; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); width: min(440px, calc(100vw - 24px)); margin: 0; background: var(--chrome); color: var(--chrome-fg); border-left-color: var(--gold); box-shadow: 0 6px 22px rgba(0, 0, 0, .25); animation: pdIn .25s var(--ease); }
.livestat.livefloat .ls-el, .livestat.livefloat .ls-hint { color: rgba(247, 241, 228, .8); }
.livestat.livefloat.fail { background: var(--danger); color: #fff; } .livestat.livefloat.fail .ls-row::before { color: #fff; }
body:has(.recbar) .livestat.livefloat { bottom: calc(150px + var(--safe-b)); }
/* 查原文視窗：狀態與錯誤都在卡片裏 */
.qcard .livestat { margin: 8px 0 0; }
.qcard .qerr { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #F6DCD8; color: var(--danger); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.qcard .row .btn { min-width: 0; }
.qcard.busy-card { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217, 164, 102, .25); }
/* 畫面最上緣：有長時間工作（busyStart）時流動的細條 */
body.is-busy::before { content: ''; position: fixed; z-index: 300; left: 0; top: 0; width: 100%; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent) 0 0 / 40% 100% no-repeat; animation: busybar 1.3s linear infinite; }
@keyframes busybar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { body.is-busy::before { animation: busybar 3s linear infinite !important; } }
@media print { body.is-busy::before { display: none; } .livestat.livefloat { display: none; } }
@media (max-width: 520px) { .ls-row { flex-wrap: wrap; } .ls-el { margin-left: 22px; flex-basis: 100%; } .jobbox .jobmsg { overflow-wrap: anywhere; } }

.qstat { margin-top: 6px; }
.qstat .livestat { margin: 4px 0 0; }

/* 核對宣讀的書報：入口進度與卡片按鈕狀態 */
.btn.quote-entry { white-space: normal; text-align: start; line-height: 1.4; height: auto; max-width: 100%; overflow-wrap: anywhere; }
.qcard .btn.q-found { background: #E6F0EA; border-color: #B6C9BE; color: #2C5844; }
.qcard .btn.q-found:hover { background: #D8E7DE; border-color: #3E7A5C; color: #24563F; }
.qcard .btn.q-miss { background: var(--warn-bg); border-color: rgba(122, 74, 18, .4); color: #7A4A12; }
.qcard .btn.q-miss:hover { background: #F4D9B0; }
.qcard .btn.q-accepted { background: #2B7A44; border-color: #2B7A44; color: #fff; }
.qcard .btn.q-accepted:hover { background: #24683A; border-color: #24683A; color: #fff; }
.qcard .btn.q-kept { background: #E8E4DA; border-color: #8E8574; color: #3A3834; }
.qcard .btn.q-kept:hover { background: #DDD8CC; }
.qcard .btn.q-found.busy:hover:disabled { background: #E6F0EA; color: #2C5844; }
.qcard .btn.q-miss.busy:hover:disabled { background: var(--warn-bg); color: #7A4A12; }
.qcard .btn.q-accepted.busy:hover:disabled { background: #2B7A44; color: #fff; }
.qcard .btn.q-kept.busy:hover:disabled { background: #E8E4DA; color: #3A3834; }

/* 文字框旁複製／貼上／清空 */
.field-tools { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.btn.field-tool { background: transparent; border: 1px solid transparent; color: var(--muted, #6b6458); font-weight: 500; padding: 4px 10px; }
.btn.field-tool:hover { border-color: var(--line); color: var(--fg); }

/* 翻譯工具列：帶入合併放在翻譯按鈕旁，鼠尾草綠以和深藍主按鈕區分 */
.trans-toolbar { align-items: center; gap: 8px; }
.btn.merge-jump { background: #5E7A5A; color: #fff; border-color: #5E7A5A; }
.btn.merge-jump:hover { background: #4F684C; border-color: #4F684C; color: #fff; }
.btn.merge-jump:disabled { background: #D5DDD3; color: #7A8478; border-color: #D5DDD3; cursor: not-allowed; opacity: 1; }
textarea.trans-edit { min-height: 180px; }

.notice.info { background: var(--accent-soft); color: var(--fg); }

/* 錯誤／警告：一句話、字稍大、行距舒適 */
.toast.err { font-size: 1.08rem; font-weight: 600; line-height: 1.55; max-width: min(22rem, 90vw); padding: 14px 20px; text-align: center; white-space: normal; }
.livestat.fail, .livestat.fail .ls-txt { font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
.prog.fail .prog-txt { font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
.notice.warn { font-size: 1.05rem; line-height: 1.55; }
.qcard .qerr { font-size: 1.05rem; line-height: 1.55; }

/* 危險確認鈕（刪除等） */
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger:hover { background: #8E2E24; border-color: #8E2E24; color: #fff; }

/* 新版本提示列：不自動消失 */
.update-banner { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(640px, calc(100% - 20px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 16px; border-radius: 14px; background: #F7F1E4; color: var(--fg); border: 1px solid var(--gold); box-shadow: 0 8px 24px rgba(47, 51, 67, .16); }
.update-banner p { margin: 0; flex: 1 1 12em; font-weight: 600; font-size: 15px; line-height: 1.5; }
.update-banner-btns { display: flex; flex-wrap: wrap; gap: 8px; }
body:has(.recbar) .update-banner { bottom: calc(130px + var(--safe-b)); }

/* 手機導覽：短標籤、待核准標記，五項一眼可見 */
.nav-short { display: none; }
.nav-badge { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 99px; background: var(--gold); color: var(--chrome); font-size: 10px; font-weight: 700; line-height: 1.4; vertical-align: middle; }
@media (max-width: 520px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .top { flex-wrap: wrap; row-gap: 2px; padding: calc(var(--safe-t) + 6px) 12px 6px; }
  .brand { flex: 1 1 100%; font-size: 13px; letter-spacing: .03em; min-width: 0; align-items: flex-start; white-space: normal; }
  .brand-text { display: inline; white-space: normal; overflow: visible; text-overflow: unset; line-height: 1.3; word-break: break-word; }
  .nav { flex: 1 1 100%; display: flex; justify-content: space-between; gap: 0; overflow: visible; flex-wrap: nowrap; }
  .nav a { flex: 1 1 0; min-width: 0; text-align: center; padding: 8px 4px; font-size: 14px; font-weight: 600; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

/* 聚會列表刪除 */
.pcard-wrap { position: relative; }
.pcard-wrap .pcard { padding-right: 62px; }
.pc-del { position: absolute; top: 10px; right: 8px; z-index: 2; color: var(--danger); }
.pc-del:hover { color: #8E2E24; border-color: rgba(176, 58, 46, .35); }

/* 第 2 步校對：第幾段獨立、更好點 */
.viewer-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.viewer-chunk-row { display: flex; align-items: center; gap: 10px; }
.viewer-chunk-lab { font-weight: 700; font-size: 15px; flex: none; }
select.chunk-sel { flex: 1 1 auto; min-width: 0; }
@media (max-width: 520px) {
  .viewer-chunk-row { flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }
  .viewer-chunk-lab { font-size: 15px; }
  select.chunk-sel { font-size: 16px; min-height: 44px; width: 100%; padding: 8px 10px; }
}

/* 合併來源切換更醒目 */
.merge-src-host .merge-src { padding: 12px 14px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent-soft); margin-bottom: 12px; }
.merge-src-host .src-now { margin: 0 0 8px; font-size: 16px; }
.merge-src-seg button { min-height: 40px; padding: 8px 16px; font-weight: 700; }

/* 步驟列鎖定 */
.stepbar li.locked { opacity: .45; }
.stepbar li.locked a { pointer-events: auto; cursor: not-allowed; color: inherit; }
.stepbar li.locked .num { background: var(--bg2); color: var(--muted); }

/* 匯出下拉 */
.xmenu { position: relative; display: inline-block; }
.xmenu-btn { }
.xmenu-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 12em; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(47,51,67,.16); padding: 6px; display: none; }
.xmenu.open .xmenu-list { display: grid; gap: 2px; }
.xmenu-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.xmenu-list button:hover { background: var(--bg2); }

/* 選檔資訊 */
.filemeta { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.filemeta b { display: block; font-size: 15px; word-break: break-all; }
.filemeta .fmt { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 品質選項白話標籤 */
.qopt small.qtip { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.qopt-title { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.qopt-title b { min-width: 0; }
.qopt .qhelp { flex: none; margin-left: auto; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 99px; width: 22px; height: 22px; font-size: 12px; line-height: 20px; padding: 0; cursor: help; }

/* 其他方式 */
.other-ways { margin-top: 10px; }
.other-ways summary { cursor: pointer; font-weight: 600; }

/* 主標題換行時不截斷 */
.brand-text { line-height: 1.3; }




/* 聚會標題「⋯ 更多」（改名／刪除），觸控區至少 44×44 */
.phead-line { display: flex; align-items: flex-start; gap: 4px; }
.phead-line .ptitle { flex: 1; min-width: 0; }
.pmore { position: relative; flex: none; }
.pmore-btn { min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; font-size: 22px; line-height: 1; font-weight: 700; color: var(--fg2); background: transparent; border: 1px solid transparent; cursor: pointer; }
.pmore-btn:hover, .pmore-btn[aria-expanded="true"] { background: var(--bg2); border-color: var(--line); color: var(--fg); }
.pmore-menu { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 10em; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(47,51,67,.16); padding: 6px; display: grid; gap: 2px; }
.pmore-menu[hidden] { display: none; }
.pmore-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; min-height: 44px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.pmore-menu button:hover { background: var(--bg2); }
.pmore-menu button.danger { color: var(--danger); }

/* 第 4／5 步編輯中：匯出與切步視覺上鎖定 */
body.doc-editing .xbar button,
body.doc-editing .xmenu-btn,
body.doc-editing .merge-go a,
body.doc-editing .merge-start,
body.doc-editing .merge-src-seg button,
body.doc-editing .stepnav a,
body.doc-editing .stepbar a { opacity: .45; pointer-events: none; }
body.doc-editing .doc-edit-bar button { opacity: 1; pointer-events: auto; }

/* 首頁「其他方式」只留原生摺疊箭頭 */
.other-ways summary { list-style: revert; }

/* 第 4 步進階微調（預設收合） */
.adv-tune { margin: 12px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.adv-tune summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.merge-export { margin: 8px 0 16px; }
.pub-status { display: inline-flex; align-items: center; margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* 說明頁頂部目錄 */
.help-toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.help-toc a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 10px; border-radius: 99px; background: var(--bg2); color: var(--fg); text-decoration: none; font-size: 13px; font-weight: 600; }
.help-toc a:hover { background: var(--accent-soft); color: var(--accent); }
.card.prose h3[id] { scroll-margin-top: calc(72px + var(--safe-t)); }

/* 公開閱讀頁手機目錄按鈕與抽屜（不佔正文寬度） */
.onav-fab {
  display: none;
  position: fixed;
  z-index: 18;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(16px, calc(var(--safe-b) + 16px));
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chrome);
  color: var(--chrome-fg);
  font: 700 15px var(--ui);
  box-shadow: 0 8px 24px rgba(47, 51, 67, .22);
  cursor: pointer;
}
.onav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 18;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(47, 51, 67, .35);
  cursor: pointer;
}
.onav-drawer {
  display: none;
  position: fixed;
  z-index: 19;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 560px);
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 28px rgba(47, 51, 67, .2);
  padding: 12px 12px calc(16px + var(--safe-b));
  overflow: auto;
}
.onav-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 0 4px; }
.onav-drawer-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; font: 600 15px var(--ui); color: var(--accent); cursor: pointer; }
.onav-drawer-list { display: grid; gap: 2px; }
.onav-drawer-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; }
.onav-drawer-item.on { background: var(--accent-soft); }
.onav-drawer-item .onav-lab { flex: none; min-width: 2em; font-weight: 700; }
.onav-drawer-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  body.has-onav .onav-fab { display: inline-flex; align-items: center; justify-content: center; }
  body.has-onav .onav-drawer, body.has-onav .onav-backdrop { display: block; }
  .onav-drawer[hidden], .onav-backdrop[hidden] { display: none !important; }
}
@media (min-width: 721px) {
  .onav-fab, .onav-drawer, .onav-backdrop { display: none !important; }
}


/* 第 4／5 步編輯模式：儲存／取消固定在視窗底部，長稿不必拉回頂端 */
body.doc-editing { padding-bottom: calc(76px + var(--safe-b)); }
body.doc-editing .doc-edit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(255, 253, 248, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(47, 51, 67, .12);
}
body.doc-editing .doc-edit-bar .doc-edit-state { font-weight: 700; color: var(--fg2); }
body.doc-editing .doc-edit-bar button { opacity: 1; pointer-events: auto; min-height: 44px; min-width: 5.5em; }

/* 第 5 步已有標註時，Word／PDF 提高視覺權重 */
.xbtn-lead {
  background: var(--chrome);
  border-color: var(--chrome);
  color: var(--chrome-fg);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 22px;
}
.xbtn-lead:hover { background: #3B4055; border-color: #3B4055; color: #fff; }
.access-jump { margin-left: 4px; }

/* 對齊結果點選跳到預覽對應段落 */
.al { cursor: pointer; }
.al:hover { background: var(--accent-soft); }
.al button { cursor: pointer; }
.doc .d-pt { scroll-margin-top: calc(var(--safe-t) + 72px); }
#collab-settings { scroll-margin-top: calc(var(--safe-t) + 72px); }

.quote-zero { margin: 8px 0 0; }
.audio-q-hint { margin: 6px 0 0; }
.merge-jump-foot { display: flex; justify-content: flex-end; margin: 8px 0 4px; }
.outline-text, .outline-preview { margin: 10px 0 14px; }
@media (max-width: 560px) {
  .merge-jump-foot { justify-content: stretch; }
  .merge-jump-foot .merge-jump { width: 100%; }
}

.split-plan-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; max-height: 46vh; overflow: auto; }
.split-plan-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; }
.split-plan-row.muted { opacity: .78; }
.split-plan-row small.hint { display: block; font-weight: 400; }

/* 檔案卡片右上角刪除叉叉：觸控區至少 44px，X 形（✕），不用十字架或加號 */
.filerow, .gallery figure, .photogrid figure, .ainfo { position: relative; }
.filerow.has-x, .gallery figure.has-x, .photogrid figure.has-x, .ainfo.has-x { padding-right: 52px; }
button.file-x {
  position: absolute; top: 2px; right: 2px; z-index: 2;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: #fdecec;
  color: var(--danger, #b42318);
  font-size: 22px; font-weight: 600; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
button.file-x:hover, button.file-x:focus-visible { background: var(--danger, #b42318); color: #fff; outline: none; }
.reupload-slot { margin: 8px 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-files-intro { margin: 0 0 8px; }

/* 查原文：各網站候選 */
.qcands { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.qcand-title { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.qcand { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #FBFAF6; }
.qcand.on { border-color: rgba(43, 122, 68, .55); background: #EEF6F0; }
.qcand-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }
.qcand-ref { margin-top: 2px; overflow-wrap: anywhere; }
.qcand-text { margin-top: 6px; white-space: pre-wrap; line-height: 1.6; font-size: 14.5px; overflow-wrap: anywhere; }
.qcand .row { align-items: center; gap: 12px; }
.qcand .row .btn { min-height: 44px; }
.qcand .row a { padding: 10px 4px; }
.qsrc { font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }

/* 原檔直傳：雲端上傳進度卡 */
.cloudbox { margin-top: 10px; }
.cloudbox .hint { margin-top: 6px; }

/* 一鍵查全部（書報引用核對） */
.qbulk { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--card-2, #F6F3EE); }
.qbulk .qbrow { margin: 10px 0; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.08); }
.qbulk .qbrow .qcand-text { margin-top: 4px; font-size: 14px; }
.qbulk .chk { margin-right: 14px; cursor: pointer; }
