.cv-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 32px 80px; scroll-padding-top: 24px; }
.cv-banners { max-width: 720px; margin: 18px auto 0; display: flex; flex-direction: column; gap: 6px; }

.paper {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  padding: 34px 0 72px;
  font-family: var(--font-doc);
  color: var(--ink);
  position: relative;
}
.doc-title { font-size: 28px; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; text-align: left; }
.doc-brief { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 26px; font-size: var(--fs-12); color: var(--ink-2); text-align: left; width: 100%; }
.doc-brief span { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-full); background: var(--paper-2); }
.doc-brief:hover span { background: var(--paper-3); }

.sec { position: relative; margin-top: 30px; scroll-margin-top: 16px; }
.sec.live::before { content: ""; position: absolute; left: -20px; top: 4px; bottom: 0; width: 2px; border-radius: 2px; background: var(--live); opacity: 0.55; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sec-title { flex: 1; font-size: 18px; font-weight: 600; line-height: 1.5; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.sec-num { font-size: 12px; font-weight: 500; color: var(--ink-3); width: 22px; height: 22px; border-radius: 6px; background: var(--paper-2); display: grid; place-items: center; flex: none; }
.sec-name { outline: none; border-radius: 3px; padding: 0 2px; }
.sec-name[contenteditable]:hover { background: var(--paper); }
.sec-name:focus { background: var(--accent-soft); }
.sec-tools { display: flex; align-items: center; gap: 2px; font-family: var(--font-ui); opacity: 0.35; transition: opacity var(--t-fast) var(--ease); }
.sec:hover .sec-tools, .sec.live .sec-tools { opacity: 1; }
.sec-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--ink-3); margin-right: 6px; }
.sec-owner { display: inline-flex; margin-left: 4px; }

.blk { position: relative; }
.blk-p { font-size: 15.5px; line-height: 1.9; text-align: left; margin: 0 0 12px; outline: none; border-radius: 2px; min-height: 1em; color: #1d2939; }
.blk-p:empty::before { content: "输入内容，或输入 / 调出命令"; color: var(--ink-4); font-family: var(--font-ui); font-size: 14px; }
.blk-p[contenteditable]:focus { background: linear-gradient(transparent, transparent); }
.prov { position: absolute; left: -18px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: transparent; cursor: help; }
.blk:hover .prov { background: var(--ink-4); }
.blk:hover .prov.ai { background: var(--ai); }
.blk:hover .prov.agent { background: var(--ink); }
.prov::after { content: ""; position: absolute; inset: -6px; }

.blk-table { margin: 18px 0 22px; font-family: var(--font-ui); position: relative; }
.blk-table table { width: 100%; font-size: 13.5px; border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.blk-table th { text-align: left; padding: 9px 12px; font-weight: 500; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.blk-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.blk-table td:not(:first-child), .blk-table th:not(:first-child) { text-align: right; }
.blk-table figcaption { font-size: var(--fs-12); color: var(--ink-3); text-align: center; margin-top: 8px; }
.blk-table tr:last-child td { border-bottom: 0; }
.blk-comment { position: absolute; right: -40px; top: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 10px; background: var(--hl); color: #7a5b00; font-size: 11px; font-weight: 600; }

.pins { display: flex; flex-direction: column; gap: 4px; margin: -2px 0 12px; }
.pin { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: var(--fs-12); color: var(--ink-3); padding: 5px 8px; border-radius: var(--r-sm); background: var(--paper); text-align: left; max-width: 100%; }
.pin b { color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.pin:hover { background: var(--paper-2); }

.gap { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-family: var(--font-ui); font-size: var(--fs-13); }

.sec-empty { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--line-2); font-family: var(--font-ui); }
.intent-ph { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; color: var(--ink-3); line-height: 1.7; }
.intent-ph .icon { margin-top: 5px; color: var(--ink-4); }

.add-sec { display: flex; align-items: center; gap: 6px; margin-top: 32px; padding: 10px 0; width: 100%; border-top: 1px dashed var(--line); font-family: var(--font-ui); font-size: var(--fs-13); color: var(--ink-4); }
.add-sec:hover { color: var(--accent); }

/* inline marks */
.claim { border-radius: 2px; transition: background var(--t-fast) var(--ease); }
.cite {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft-2);
  border-radius: 5px;
  padding: 1px 4px;
  margin: 0 1px 0 1px;
  cursor: pointer;
  vertical-align: super;
  line-height: 1;
  text-indent: 0;
  user-select: none;
  white-space: nowrap;
}
.cite:hover { background: var(--accent); color: #fff; }
.cite.changed { color: var(--stale); background: var(--stale-soft); }
.cite.restricted { color: var(--ink-3); background: var(--paper-2); }

.rule-mark { text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 5px; cursor: pointer; }
.rule-mark.blocking { text-decoration-color: var(--bad); }
.rule-mark.should_fix { text-decoration-color: #d9a85a; }
.rule-mark.consider { text-decoration-color: #9fb2d6; }
.sg-mark { border-bottom: 2px dotted var(--accent-2); cursor: pointer; }
.sg { cursor: pointer; }
.sg del { color: var(--bad); text-decoration-thickness: 1px; background: var(--bad-soft); }
.sg ins { color: var(--ok); text-decoration: none; background: var(--ok-soft); border-bottom: 1px solid var(--ok); }
.cm-mark { background: var(--hl); border-bottom: 2px solid #e6cf86; cursor: pointer; padding: 1px 0; }
.cm-mark.question { background: var(--stale-soft); border-bottom-color: #d6a9c3; }
.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--hl-2); box-shadow: 0 0 0 4px var(--hl-2); } 100% { background: transparent; box-shadow: none; } }
.ghost-inline { color: var(--ink-4); font-style: italic; }
.ghost-inline::after { content: "Tab"; font-family: var(--font-ui); font-style: normal; font-size: 10px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 3px; margin-left: 4px; vertical-align: 2px; }

/* evidence view */
.mode-evidence .claim.ev { padding: 1px 1px; cursor: pointer; }
.mode-evidence .blk-p, .mode-review .blk-p { text-align: left; }
.ev-supported { background: rgba(59, 143, 104, 0.1); box-shadow: inset 0 -2px 0 rgba(59, 143, 104, 0.5); }
.ev-partial { background: rgba(185, 122, 39, 0.1); box-shadow: inset 0 -2px 0 rgba(217, 168, 90, 0.8); }
.ev-contradicted { background: rgba(198, 90, 80, 0.1); box-shadow: inset 0 -2px 0 var(--bad); }
.ev-none { background: transparent; box-shadow: inset 0 -2px 0 var(--bad); text-decoration: underline dashed var(--bad); text-underline-offset: 6px; }
.ev-uncited { background: var(--paper-2); box-shadow: inset 0 -2px 0 var(--ink-4); }
.ev-stale { background: rgba(164, 90, 133, 0.09); box-shadow: inset 0 -2px 0 var(--stale); }
.ev-unavailable { background: var(--paper-2); color: var(--ink-3); }
.ev-needs_recheck { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent-2); }
.ev-judgment { box-shadow: inset 0 -2px 0 var(--ink-3); }
.claim.dim { background: transparent !important; box-shadow: none !important; text-decoration: none !important; opacity: 0.6; }
.mode-evidence .cite { font-size: 10.5px; padding: 1px 5px; }

.ev-legend { margin: 0 -32px; display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; align-items: center; gap: 6px; padding: 10px 32px; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-12); position: sticky; top: 0; z-index: 3; }
.ev-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full); color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; border: 1px solid transparent; background: var(--paper-2) !important; }
.ev-chip i { width: 8px; height: 8px; border-radius: 2px; }
.ev-chip b { font-weight: 500; color: var(--ink); }
.ev-chip:hover { background: var(--paper-2); }
.ev-chip.on { border-color: var(--accent-2); }
.ev-chip.ev-supported, .ev-chip.ev-partial, .ev-chip.ev-contradicted, .ev-chip.ev-none, .ev-chip.ev-uncited, .ev-chip.ev-stale, .ev-chip.ev-needs_recheck, .ev-chip.ev-judgment { background: transparent; box-shadow: none; text-decoration: none; }
.ev-chip.ev-supported i { background: var(--ok); }
.ev-chip.ev-partial i { background: #d9a85a; }
.ev-chip.ev-contradicted i { background: var(--bad); }
.ev-chip.ev-none i { background: transparent; border: 1.5px dashed var(--bad); }
.ev-chip.ev-uncited i { background: var(--ink-4); }
.ev-chip.ev-stale i { background: var(--stale); }
.ev-chip.ev-needs_recheck i { background: var(--accent-2); }
.ev-chip.ev-judgment i { background: var(--ink-3); }

/* proposal block */
.pp { margin: 6px 0 16px; border-radius: 12px; border: 1px solid var(--ai-soft-2); background: var(--ai-soft); overflow: hidden; animation: fade-up var(--t-med) var(--ease) both; }
.pp.agent { border-color: var(--line); background: var(--surface-2); }
.pp-head { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--ai-soft-2); background: rgba(255,255,255,0.6); }
.pp-badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); font-weight: 600; color: var(--ai); }
.pp.agent .pp-badge { color: var(--ink); }
.pp-why { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-11); color: var(--ink-3); padding: 2px 6px; border-radius: 4px; }
.pp-why:hover { background: var(--paper-2); color: var(--ink); }
.pp-text { padding: 12px 16px 14px; font-size: 15.5px; line-height: 1.9; color: var(--ai-ink); white-space: pre-wrap; }
.pp.ghost .pp-text { color: #6f66a8; }
.pp.streaming .pp-text::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--ai); vertical-align: -3px; margin-left: 2px; animation: pulse 0.9s infinite; }
.pp.streaming { border-color: var(--ai); }
.pp-table { margin: 10px 16px 14px; width: calc(100% - 32px); font-size: 13px; }
.pp-table th, .pp-table td { padding: 6px 8px; border-bottom: 1px solid var(--ai-soft-2); text-align: left; }
.pp .kbd { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3); color: #fff; height: 16px; min-width: 14px; font-size: 10px; }

.why-list { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-13); }
.why-list li { display: flex; gap: 6px; align-items: center; }
.why-list .icon { color: var(--ok); }

/* floating cards (citation / claim / item) */
.cc { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cc-claim { font-size: 15px; font-weight: 500; line-height: 1.7; }
.cc-src { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper-2); }
.cc-passage { margin-top: 8px; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.cc-passage.locked { font-family: var(--font-ui); font-size: var(--fs-13); color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.cc-passage del, .psg-text del, .diff del { color: var(--bad); background: var(--bad-soft); }
.cc-passage ins, .psg-text ins, .diff ins { color: var(--ok); background: var(--ok-soft); text-decoration: none; }
.cc-passage ins, .psg-text ins { display: block; margin-top: 4px; }

/* selection toolbar */
.seltb { position: fixed; z-index: var(--z-pop); background: #101828; border-radius: 12px; box-shadow: var(--sh-3); padding: 4px; animation: fade-up var(--t-fast) var(--ease) both; }
.seltb-row { display: flex; align-items: center; gap: 1px; }
.seltb button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border-radius: 8px; color: #d0d5dd; font-size: var(--fs-12); font-weight: 500; }
.seltb button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.seltb button .icon { width: 13px; height: 13px; }
.seltb-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.15); margin: 0 3px; }
.seltb-ask { color: #c9c1f2 !important; }
.seltb-input { display: flex; align-items: center; gap: 6px; padding: 2px 2px 2px 8px; color: #d9dde5; }
.seltb-input input { width: 280px; height: 28px; border: 0; background: transparent; color: #fff; font-size: var(--fs-13); }
.seltb-input input::placeholder { color: #8890a0; }

/* footer */
.cv-foot { flex: none; display: flex; align-items: center; gap: 14px; height: 32px; padding: 0 20px; border-top: 1px solid var(--line-soft); font-size: var(--fs-12); color: var(--ink-3); background: var(--surface); font-variant-numeric: tabular-nums; }
.cv-foot .icon { color: var(--ok); }

/* bilingual */
.bi { max-width: 1080px; margin: 18px auto 0; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.bi-gloss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bi-term { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); color: var(--ink-2); padding: 2px 8px; border-radius: var(--r-full); background: var(--paper-2); }
.bi-term b { font-weight: 600; color: var(--ink); }
.bi-head { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-12); font-weight: 600; color: var(--ink-3); }
.bi-head span { padding: 0 28px; }
.bi-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-soft); }
.bi-row.changed { background: var(--surface-2); }
.bi-src, .bi-tgt { padding: 16px 28px; }
.bi-src { border-right: 1px solid var(--line-soft); font-size: 14.5px; line-height: 1.9; color: var(--ink-2); }
.bi-src del { color: var(--ink-4); display: block; }
.bi-src ins { text-decoration: none; display: block; color: var(--ink); background: var(--stale-soft); margin-top: 6px; padding: 2px 4px; border-radius: 3px; }
.bi-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: var(--fs-11); font-weight: 600; color: var(--stale); margin-bottom: 6px; }
.bi-tgt .blk-p { font-size: 14.5px; line-height: 1.8; text-indent: 0; text-align: left; margin: 0; }
.bi-tgt .pp { margin-top: 10px; }
.bi-tgt .pp-text { font-size: 14.5px; line-height: 1.75; }
