    :root { color-scheme: light; font-family: "Microsoft YaHei", Arial, sans-serif; }
    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    body { margin: 0; background: #f5f7fb; color: #172033; }
    header { min-height: 86px; display: grid; grid-template-columns: minmax(260px, auto) minmax(360px, 1fr) minmax(360px, auto); gap: 14px; align-items: center; padding: 10px 18px; border-bottom: 1px solid #d9deea; background: #fff; }
    .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
    h1 { font-size: 18px; margin: 0; font-weight: 700; }
    button { border: 1px solid #1d4ed8; background: #1d4ed8; color: white; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
    button.secondary { background: #fff; color: #1d4ed8; }
    /* 禁用不是"正在忙"。`wait` 那个转圈光标在暗示"等一下就好了"，
       而这些按钮多半是**条件不满足**（没导入 PDF、没总结要点），等不来。 */
    button:disabled { opacity: .55; cursor: not-allowed; }
    input { width: 100%; border: 1px solid #cfd6e4; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
    /* 三栏宽度走自定义属性，拖动时由 JS 写在 main 的 style 上（行内样式压过这里的默认值）。
       媒体查询**只改默认值**，不再各写一份 grid-template-columns —— 那样一改就要改四处，
       而且用户拖过之后媒体查询还会把他拖的宽度顶掉。 */
    main { height: calc(100vh - 86px); display: grid; --left-width: 260px; --right-width: 520px; grid-template-columns: var(--left-width) 10px minmax(360px, 1fr) 10px var(--right-width); gap: 0; }
    body.left-collapsed main { grid-template-columns: 0 10px minmax(360px, 1fr) 10px var(--right-width); }
    body.right-collapsed main { grid-template-columns: var(--left-width) 10px minmax(360px, 1fr) 10px 0; }
    body.left-collapsed.right-collapsed main { grid-template-columns: 0 10px minmax(360px, 1fr) 10px 0; }
    body.left-collapsed .left, body.right-collapsed .right { padding: 0; border-right: 0; overflow: hidden; }
    aside, section { overflow: auto; border-right: 1px solid #d9deea; background: #fff; }
    .center { display: flex; flex-direction: column; overflow: hidden; container: center-reader / inline-size; }
    .center-toolbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #d9deea; background: #fff; }
    .center-tabs { flex: 0 0 auto; display: flex; gap: 2px; }
    .center-tab { height: 30px; border: 0; background: transparent; color: #475467; padding: 0 8px; font-size: 13px; white-space: nowrap; }
    .center-tab:hover { color: #1d4ed8; background: #f8fafc; }
    .center-tab.active { background: #eef4ff; color: #1d4ed8; font-weight: 700; }
    #pages { flex: 1 1 auto; height: auto; min-height: 0; overflow: hidden; }
    .pdf-pane, .reader-pane { height: 100%; min-height: 0; overflow: auto; }
    .pdf-pane { display: flex; flex-direction: column; }
    .left { padding: 14px; }
    .left-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
    .left-header h2 { margin: 0; font-size: 20px; }
    .left-import-button { flex: 0 0 auto; min-height: 30px; padding: 5px 8px; font-size: 12px; white-space: nowrap; }
    .file-header-actions { display: flex; gap: 5px; }
    .file-import-hint { margin: -4px 0 12px; color: #667085; font-size: 12px; line-height: 1.6; }
    .left.drag-over { background: #edf4ff; box-shadow: inset 0 0 0 2px #2563eb; }
    .file-management-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 8px 0; border-bottom: 1px solid #dbe2ef; margin-bottom: 6px; }
    .file-select-all { display: flex; align-items: center; gap: 4px; font-size: 12px; }
    .file-select-all input, .file-checkbox { width: 15px; height: 15px; margin: 0; flex: 0 0 auto; padding: 0; }
    .file-management-bar button { padding: 4px 7px; font-size: 12px; margin-left: auto; }
    .doc-manage { display: flex; align-items: start; gap: 7px; }
    .doc-manage .file-checkbox { margin-top: 3px; }
    .doc-content { min-width: 0; flex: 1; }
    .doc-title strong { overflow-wrap: anywhere; }
    .doc.selected { box-shadow: inset 3px 0 0 #698bd5; }
    .file-operation-notice { background: #fffbeb; border: 1px solid #facc15; border-radius: 6px; margin-bottom: 10px; padding: 8px; font-size: 12px; line-height: 1.6; }
    .file-operation-notice button { margin-top: 6px; padding: 4px 8px; font-size: 12px; }
    .file-action-card { max-width: 660px; }
    .file-action-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #dbe2ef; }
    .file-action-error { margin: 0 20px 10px; }
    .file-conflict-tools { display: flex; gap: 8px; margin: 12px 0; }
    .file-conflict-row { padding: 12px 0; border-top: 1px solid #e5e7eb; }
    .file-conflict-row p { margin: 4px 0 8px; overflow-wrap: anywhere; }
    .file-conflict-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
    .file-conflict-choice label { display: inline-flex; align-items: center; gap: 4px; }
    .file-conflict-choice input[type="radio"] { width: 14px; margin: 0; padding: 0; }
    .file-conflict-name { margin: 8px 0 0; }
    .file-remove-list { max-height: 200px; overflow: auto; padding-left: 22px; overflow-wrap: anywhere; }
    /* 两根拖柄。`touch-action: none` 是 pointer 事件拖拽的必需项：
       不写的话触摸板/触屏上浏览器会把移动当成滚动，pointermove 直接断流。 */
    .pane-splitter { position: relative; display: flex; align-items: center; justify-content: center; background: #fff; border-right: 1px solid #d9deea; cursor: col-resize; touch-action: none; user-select: none; }
    .pane-splitter::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); border-radius: 2px; background: transparent; transition: background .12s; }
    .pane-splitter:hover::before, .pane-splitter.dragging::before { background: #1d4ed8; }
    /* 拖动期间给整页盖上 col-resize，免得指针飘到 PDF 上变成文本光标 */
    body.pane-resizing { cursor: col-resize; user-select: none; }
    .left-collapse-toggle { position: relative; z-index: 1; width: 22px; height: 54px; padding: 0; border-radius: 999px; border-color: #cfd6e4; background: #fff; color: #1d4ed8; box-shadow: 0 4px 12px rgba(15, 23, 42, .10); font-size: 14px; line-height: 1; cursor: pointer; }
    .left-collapse-toggle:hover { border-color: #1d4ed8; background: #eef4ff; }
    /* 右栏收起后拖柄就贴在视口右边缘上，而按钮比 10px 的拖柄宽一倍 ——
       不往回挪的话有一半在屏幕外，等于「收起了就展不回来」。 */
    body.right-collapsed #rightSplitter .left-collapse-toggle { transform: translateX(-8px); }
    .right { padding: 14px 14px 120px; scroll-padding-bottom: 120px; }
    .right-scroll-top { position: fixed; right: 24px; bottom: 88px; z-index: 45; width: 42px; height: 42px; padding: 0; border-radius: 999px; background: #fff; color: #1d4ed8; box-shadow: 0 10px 24px rgba(15, 23, 42, .18); font-weight: 700; }
    .doc { padding: 12px 14px; border: 1px solid #dbe2ef; border-radius: 6px; margin-bottom: 10px; cursor: pointer; background: #fbfcff; }
    .doc:hover { border-color: #8aa7e8; }
    .doc.active { border-color: #1d4ed8; background: #eef4ff; }
    .doc-title { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
    .pdf-status { flex: 0 0 auto; display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px; font-size: 11px; border: 1px solid #dbe2ef; background: #f8fafc; color: #344054; }
    .pdf-status.not-imported { background: #f3f4f6; color: #4b5563; }
    .pdf-status.need-ocr, .pdf-status.ocr-failed { background: #fffbeb; color: #92400e; border-color: #fbbf24; }
    .pdf-status.need-summary { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
    .pdf-status.summarizing { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
    .pdf-status.partial-summary { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
    .pdf-status.summary-done { background: #dcfce7; color: #166534; border-color: #86efac; }
    .muted { color: #667085; font-size: 12px; }
    .workflow-stepper { display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); gap: 6px; min-width: 420px; }
    .workflow-step { border-color: #dbe2ef; background: #fff; color: #344054; padding: 7px 8px; text-align: left; min-height: 48px; }
    .workflow-step.active { border-color: #1d4ed8; background: #eef4ff; color: #1d4ed8; font-weight: 700; }
    .workflow-step small { display: block; color: #667085; font-weight: 400; margin-top: 2px; }
    /* 曾经是 repeat(6, 92px) 的定死网格。按钮清单一变（现在是主按钮 + 一键 + 更多操作）
       就对不上，而主按钮的文案还会随状态变长（「开始识别文字（245 页待识别）」）——
       定宽的结果是文字被切掉。改成按内容排，放不下就换行。 */
    .stage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: stretch; }
    .stage-actions > button { white-space: nowrap; }
    #primaryStageAction { font-weight: 700; }
    .stage-actions button { width: 92px; min-height: 32px; padding: 5px 6px; white-space: normal; font-size: 12px; line-height: 1.25; }
    .stage-actions #status { grid-column: 1 / -1; justify-self: end; }
    .page { margin: 16px; padding: 16px; background: #fff; border: 1px solid #dbe2ef; border-radius: 6px; }
    .page h2 { margin: 0 0 10px; font-size: 15px; }
    .page img { display: block; width: 100%; max-width: 980px; margin: 0 auto; background: #fff; }
    .page .page-meta { margin-bottom: 10px; }
    .page.highlight { outline: 3px solid #f59e0b; background: #fffbeb; }
    .pdf-frame { width: 100%; height: 100%; min-height: 0; flex: 1 1 auto; border: 0; background: #fff; display: block; }
    .pdf-js-viewer { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: #eef1f6; }
    /* 工具与页签共享一排；按中栏实际宽度响应，拖动分隔栏同样生效。 */
    .pdf-js-toolbar { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; }
    .pdf-js-toolbar > * { flex: 0 0 auto; }
    .pdf-js-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 30px; border: 0; padding: 0 6px; background: transparent; color: #475467; font-size: 12px; white-space: nowrap; }
    .pdf-js-toolbar button:hover { background: #eef4ff; color: #1d4ed8; }
    .center-toolbar button:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 1px; }
    .pdf-toolbar-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
    .pdf-page-controls { display: flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid #e4e7ec; white-space: nowrap; }
    .pdf-js-toolbar input { margin: 0; }
    .pdf-js-page-input { width: 4.5ch; min-width: 32px; height: 28px; padding: 3px; text-align: center; font-size: 12px; color: #344054; appearance: textfield; }
    .pdf-js-page-input::-webkit-inner-spin-button, .pdf-js-page-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
    .pdf-zoom-controls { display: flex; gap: 1px; }
    .pdf-js-toolbar .pdf-icon-button { width: 28px; padding: 0; }
    .pdf-js-toolbar .pdf-search-controls { flex: 1 1 166px; display: flex; align-items: center; min-width: 166px; max-width: 262px; height: 30px; gap: 2px; padding: 0 2px; border: 1px solid #cfd6e4; border-radius: 5px; background: #fff; }
    .pdf-search-controls:focus-within { border-color: #7da2f1; box-shadow: 0 0 0 2px #eef4ff; }
    .pdf-search-controls .pdf-js-search { flex: 1 1 44px; width: auto; min-width: 44px; height: 26px; padding: 0 2px; border: 0; border-radius: 0; outline: none; color: #344054; font-size: 12px; }
    .pdf-js-search::-webkit-search-cancel-button { -webkit-appearance: none; }
    .pdf-search-results { display: flex; align-items: center; gap: 0; }
    .pdf-search-results .pdf-icon-button { width: 24px; height: 26px; }
    .pdf-js-search-count { padding: 0 3px; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .pdf-js-toolbar .pdf-search-toggle { display: none; }
    #pdfEvidenceMapToggle[aria-pressed="true"], .pdf-search-toggle[aria-expanded="true"] { background: #eef4ff; color: #1d4ed8; }
    #pdfEvidenceMapToggle[aria-busy="true"] { color: #667085; }
    @container center-reader (max-width: 700px) {
      .center-toolbar { flex-wrap: wrap; gap: 5px; padding: 7px 8px; }
      .center-tabs { flex-basis: 100%; }
      .pdf-js-toolbar { flex-basis: 100%; flex-wrap: wrap; justify-content: space-between; gap: 5px 8px; }
      .pdf-page-controls { border-left: 0; padding-left: 0; }
      .pdf-js-toolbar .pdf-search-toggle { display: inline-flex; }
      .pdf-js-toolbar .pdf-search-controls { display: none; }
      .pdf-js-toolbar[data-search-open="true"] .pdf-search-controls { display: flex; order: 1; flex-basis: 100%; min-width: 0; max-width: none; }
    }
    .pdf-js-container-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
    .pdf-js-container { position: absolute; inset: 0; overflow: auto; background: #80858f; }
    .pdf-js-container .pdfViewer { --page-margin: 10px auto; --page-border: 1px solid rgba(15, 23, 42, .18); padding: 10px 0 24px; }
    .pdf-js-status { flex: 0 0 auto; padding: 5px 10px; color: #667085; font-size: 12px; border-top: 1px solid #d9deea; background: #fff; }
    .pdf-js-page-surface { position: absolute; z-index: 2; pointer-events: none; line-height: 0; }
    .pdf-js-page-number { position: absolute; left: 10px; top: 8px; z-index: 3; padding: 2px 7px; border-radius: 999px; background: rgba(17, 24, 39, .64); color: #fff; font-size: 12px; pointer-events: none; }
    .pdf-js-highlight-layer { position: absolute; pointer-events: none; }
    .pdf-js-current-highlight-layer { z-index: 3; }
    .pdf-js-map-highlight-layer { z-index: 2; }
    .pdf-js-highlight-box { position: absolute; border: 2px solid #f59e0b; background: rgba(250, 204, 21, .28); box-shadow: 0 0 0 1px rgba(146, 64, 14, .24); }
    .pdf-js-map-highlight-box { position: absolute; border: 1px solid #2563eb; background: rgba(37, 99, 235, .12); box-shadow: 0 0 0 1px rgba(37, 99, 235, .14); }
    .pdf-js-clickable-highlight { pointer-events: auto; cursor: pointer; }
    .pdf-js-clickable-highlight:hover, .pdf-js-clickable-highlight:focus-visible { border-color: #1d4ed8; background: rgba(59, 130, 246, .24); outline: 2px solid rgba(29, 78, 216, .36); outline-offset: 1px; }
    .pdf-js-map-marker { position: absolute; min-width: 22px; height: 20px; padding: 0 5px; border: 0; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: 11px; line-height: 20px; transform: translate(-30%, -115%); pointer-events: auto; cursor: pointer; box-shadow: 0 6px 16px rgba(15, 23, 42, .22); }
    .pdf-highlight-viewer { padding: 0 0 24px; background: #f3f5f9; }
    .pdf-highlight-stage { width: min(980px, calc(100% - 28px)); margin: 14px auto; position: relative; background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .16); }
    .pdf-highlight-stage img { display: block; width: 100%; height: auto; }
    .pdf-highlight-box { position: absolute; z-index: 2; border: 2px solid #f59e0b; background: rgba(250, 204, 21, .28); box-shadow: 0 0 0 1px rgba(146, 64, 14, .24); pointer-events: none; }
    .pdf-highlight-empty { width: min(980px, calc(100% - 28px)); margin: 10px auto 0; color: #92400e; font-size: 13px; }
    .summary-toolbar { padding-top: 6px; }
    .summary-toolbar #summarySearch { margin-bottom: 4px; padding: 7px 9px; font-size: 13px; }
    .summary-scope-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
    .summary-disclosure { flex: 0 0 auto; border-color: transparent; background: transparent; color: #475467; padding: 5px 0 5px 6px; font-size: 12px; white-space: nowrap; }
    .summary-disclosure::before { content: '▸'; display: inline-block; margin-right: 4px; }
    .summary-disclosure[aria-expanded="true"]::before { content: '▾'; }
    .summary-disclosure:hover, .summary-disclosure[aria-expanded="true"] { color: #1d4ed8; }
    .summary-filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 7px 9px; border: 1px solid #bfdbfe; border-radius: 6px; background: #eff6ff; color: #1e3a8a; font-size: 12px; }
    .summary-filter-banner button { padding: 3px 7px; font-size: 12px; }
    .selected-page-summary { border: 1px solid #dbe2ef; border-radius: 6px; background: #fbfcff; margin-bottom: 8px; }
    .selected-page-summary > label { display: block; padding: 7px 9px; font-size: 12px; font-weight: 700; }
    .selected-page-controls { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 0 8px 8px; align-items: start; }
    .selected-page-controls input { min-width: 0; margin: 0; font-size: 12px; }
    .selected-page-controls button { padding: 6px 9px; white-space: nowrap; }
    textarea { width: 100%; min-height: 82px; resize: vertical; border: 1px solid #cfd6e4; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; font-family: inherit; }
    .right-home { display: grid; gap: 10px; margin: 10px 0 14px; }
    .right-card { width: 100%; text-align: left; border: 1px solid #dbe2ef; background: #fbfcff; color: #172033; padding: 12px; border-radius: 6px; }
    .right-card:hover { border-color: #8aa7e8; background: #f4f7ff; }
    .right-card strong { display: block; margin-bottom: 4px; font-size: 15px; }
    .right-card span { display: block; line-height: 1.45; }
    .workflow-card { border: 1px solid #dbe2ef; background: #fbfcff; border-radius: 6px; padding: 12px; }
    .workflow-card h3 { margin: 0 0 6px; font-size: 15px; }
    .workflow-nav { display: grid; gap: 8px; }
    .workflow-detail { border: 1px solid #dbe2ef; border-radius: 6px; background: #fff; }
    .workflow-detail summary { cursor: pointer; padding: 9px 10px; font-weight: 700; }
    .workflow-detail div { padding: 0 10px 10px; line-height: 1.55; }
    .subpage-header { position: sticky; top: 0; z-index: 9; display: flex; align-items: center; gap: 8px; min-height: 42px; margin: 0; padding: 8px 0; background: #fff; border-bottom: 1px solid #edf1f7; }
    .subpage-header strong { font-size: 15px; }
    .subpage-header button { padding: 6px 10px; }
    /* 状态筛选是**条件**（可叠加，复选框），上面的 .scope-tabs 是**范围**
       （互斥，页签）—— 视觉上也别让它俩看起来是一类控件。 */
    .summary-status-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 2px 0 0; font-size: 12px; color: #344054; }
    #summaryStatusCount { margin-left: auto; white-space: nowrap; }
    /* nowrap：右栏窄到 300px 时「未核验」被拆成两行，一行筛选条占掉三行高。
       宁可整行换行（外层 flex-wrap 管着），也不许把一个标签劈开。 */
    .summary-status-filters label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
    .summary-status-filters input { margin: 0; }
    .scope-tabs { display: flex; gap: 4px; }
    .scope-tab { border-color: transparent; background: #fff; color: #344054; padding: 5px 9px; font-size: 12px; white-space: nowrap; }
    .scope-tab.active { border-color: #1d4ed8; background: #eef4ff; color: #1d4ed8; font-weight: 700; }
    .status-chip { position: relative; border: 1px solid #dbe2ef; border-radius: 6px; padding: 8px 10px; background: #fbfcff; cursor: default; max-width: 220px; }
    .status-chip strong { display: block; margin-top: 3px; font-size: 15px; line-height: 1.25; overflow: hidden; overflow-wrap: normal; text-overflow: ellipsis; white-space: nowrap; }
    header .status-chip { width: 210px; max-width: 210px; padding: 5px 9px; }
    header .status-chip strong { font-size: 14px; margin-top: 1px; }
    .status-popover { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; padding: 10px; border: 1px solid #cfd6e4; border-radius: 6px; background: #fff; box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
    header .status-popover { right: auto; width: min(720px, calc(100vw - 24px)); }
    .status-chip:hover .status-popover { display: block; }
    .full-ranges-grid { column-width: 120px; column-gap: 18px; overflow: visible; word-break: break-all; margin: 4px 0 10px; color: #101828; line-height: 1.55; }
    .coverage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
    .metric { border: 1px solid #dbe2ef; border-radius: 6px; padding: 8px; background: #fbfcff; }
    .metric strong { display: block; font-size: 16px; }
    .point { border: 1px solid #dbe2ef; border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fff; }
    .point:hover { border-color: #8aa7e8; }
    .point h3 { margin: 0 0 8px; font-size: 15px; padding-right: 52px; }
    .summary-number-pair { float: right; display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
    .summary-number-separator { color: #98a2b3; font-size: 12px; }
    .summary-number { font-size: 12px; font-weight: 700; color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
    .summary-number[data-kind="global"] { color: #047857; background: #ecfdf3; border-color: #a7f3d0; }
    .summary-number[data-active="false"] { color: #667085; background: #f8fafc; border-color: #dbe2ef; font-weight: 600; }
    .point-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .point-actions button { padding: 4px 8px; font-size: 12px; }
    .summary-edit { min-height: 72px; margin: 8px 0 0; font-size: 13px; }
    .summary-editor { margin-top: 8px; border-top: 1px solid #edf1f7; }
    .summary-editor > summary { padding: 7px 0 2px; cursor: pointer; color: #1d4ed8; font-size: 12px; }
    .summary-editor-actions { display: flex; justify-content: flex-end; gap: 6px; padding-bottom: 6px; }
    .point-more { position: relative; }
    .point-more > summary { list-style: none; cursor: pointer; border: 1px solid #cfd6e4; border-radius: 5px; padding: 4px 8px; color: #344054; background: #fff; font-size: 12px; }
    .point-more > summary::-webkit-details-marker { display: none; }
    .point-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 12; width: 170px; display: grid; gap: 3px; padding: 6px; border: 1px solid #cfd6e4; border-radius: 6px; background: #fff; box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
    .point-more-menu button { width: 100%; text-align: left; border-color: transparent; background: #fff; color: #344054; }
    .qa-turn { border: 1px solid #dbe2ef; border-radius: 6px; padding: 12px; margin-bottom: 10px; background: #fff; }
    .qa-question { font-weight: 700; margin-bottom: 8px; }
    .qa-answer { line-height: 1.55; margin-bottom: 10px; white-space: pre-wrap; }
    .markdown-output { line-height: 1.72; white-space: normal; color: #172033; }
    .markdown-output h1 { margin: 4px 0 12px; font-size: 21px; letter-spacing: .3px; }
    .markdown-output h2 { margin: 22px 0 9px; padding-bottom: 6px; border-bottom: 1px solid #edf1f7; font-size: 18px; }
    .markdown-output h2:first-child { margin-top: 4px; }
    .markdown-output h3 { margin: 16px 0 7px; padding-left: 8px; border-left: 3px solid #1d4ed8; font-size: 15px; }
    .markdown-output h4 { margin: 12px 0 6px; font-size: 14px; color: #334155; }
    .markdown-output p { margin: 0 0 9px; }
    .markdown-output ul, .markdown-output ol { margin: 0 0 10px 20px; padding: 0; }
    .markdown-output li { margin-bottom: 6px; }
    /* 缩进的二级列表(强制措施那种一项多条的字段) */
    .markdown-output li > ul { margin: 5px 0 0 18px; list-style: circle; }
    .markdown-output li > ul li { margin-bottom: 3px; }
    /* 模板里每章开头那句「> 说明：…」——给律师看的,压低一档但不藏起来 */
    .markdown-output blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #cbd5e1; border-radius: 0 4px 4px 0; background: #f8fafc; color: #475569; font-size: 13px; line-height: 1.6; }
    .markdown-output blockquote p { margin: 0 0 4px; }
    .markdown-output blockquote p:last-child { margin-bottom: 0; }
    .markdown-output hr { margin: 18px 0; border: 0; border-top: 1px solid #e5eaf2; }
    .markdown-output strong { font-weight: 700; color: #111827; }
    .markdown-output .inline-citation { margin: 0 3px; padding: 2px 6px; font-size: 12px; border-radius: 4px; }
    .streaming-cursor { display: inline-block; width: 7px; height: 1.1em; margin-left: 3px; border-radius: 999px; background: #1d4ed8; vertical-align: -2px; animation: blink 1s steps(2, start) infinite; }
    @keyframes blink { 50% { opacity: .18; } }
    .qa-float { position: fixed; right: 18px; bottom: 18px; z-index: 50; touch-action: none; }
    .qa-float.dragging { cursor: grabbing; }
    .qa-float-toggle { width: 58px; height: 58px; min-width: 58px; border-radius: 999px; padding: 0; display: grid; place-items: center; gap: 0; box-shadow: 0 10px 24px rgba(15, 23, 42, .18); font-weight: 700; }
    .qa-assistant { display: grid; place-items: center; width: 100%; height: 100%; line-height: 1.05; }
    .qa-assistant strong { font-size: 15px; }
    .qa-assistant span { font-size: 11px; opacity: .88; }
    .qa-float-panel { position: absolute; right: 0; bottom: 48px; width: min(420px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 90px)); display: flex; flex-direction: column; border: 1px solid #cfd6e4; border-radius: 8px; background: #fff; box-shadow: 0 18px 42px rgba(15, 23, 42, .22); overflow: hidden; }
    .qa-float-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #edf1f7; }
    .qa-float-body { padding: 10px; overflow: auto; }
    .qa-float textarea { min-height: 76px; margin-bottom: 8px; }
    .draft-section { margin-bottom: 16px; }
    .draft-section h3 { font-size: 15px; margin: 0 0 8px; }
    .draft-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; margin-bottom: 10px; }
    .draft-actions button { padding: 7px 8px; }
    /* 终稿那排按钮是当页签用的，`active` 类一直在挂，但直到 2026-08-19
       都没有一条对应规则 —— 四个页签长得一模一样，律师看不出自己在哪一栏。 */
    .draft-actions button.active { border-color: #1d4ed8; background: #eef4ff; color: #1d4ed8; font-weight: 700; }
    /* 素材的排法切换。它跟上面那排页签不是一类东西（页签换「看什么」，
       它换「同一批东西怎么排」），所以独占一行、小一号。

       **它必须待在 `.draft-actions` 外面**，这不是排版偏好，是 auto-fit 的硬约束：
       那个网格是 `repeat(auto-fit, minmax(88px, 1fr))`，860px 宽的中间栏会生成
       约 9 条轨道。只有 3 个页签时 auto-fit 把 6 条**空轨道塌陷**掉，
       三个按钮各占约 286px；一旦这个元素带着 `grid-column: 1 / -1` 挤进去，
       **就没有空轨道了、一条都不塌陷**，三个页签当场缩到约 95px ——
       表现就是律师说的「切到终稿素材时按钮尺寸会变很多」。 */
    .final-sort-toggle { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
    .final-sort-toggle button { padding: 4px 10px; font-size: 12px; }
    /* 终稿自由稿。两份文档的切换 —— 跟上面那排页签同一个视觉语言，
       但小一号：它换的是"看哪一份"，不是"看什么东西"。 */
    .free-draft-views { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
    .free-draft-views button { padding: 4px 12px; font-size: 12px; }
    .free-draft-views button.active { border-color: #1d4ed8; background: #eef4ff; color: #1d4ed8; font-weight: 700; }
    .free-draft-editor {
      display: block; width: 100%; min-height: 60vh; box-sizing: border-box;
      padding: 14px 16px; border: 1px solid #dbe2ef; border-radius: 6px; background: #fff;
      font-family: inherit; font-size: 14px; line-height: 1.8; resize: vertical;
    }
    /* 保存条常驻在底边：律师往下拉的时候它不动，而 sticky 是**跟着这一栏**的，
       右侧栏拖宽时它自然跟着左移 —— 用 fixed 的话就得自己算位置。 */
    .free-draft-savebar {
      position: sticky; bottom: 0; z-index: 5;
      display: flex; align-items: center; justify-content: flex-end; gap: 10px;
      margin-top: 8px; padding: 10px 2px;
      background: linear-gradient(to bottom, rgba(247, 249, 252, 0), #f7f9fc 40%);
    }
    .draft-report { border: 1px solid #dbe2ef; border-radius: 6px; background: #fff; padding: 12px; margin-bottom: 12px; line-height: 1.65; }
    .draft-report h3 { margin: 0 0 8px; font-size: 15px; }
    .draft-report p { margin: 0 0 8px; }
    .draft-details { border: 1px solid #dbe2ef; border-radius: 6px; background: #fff; margin-bottom: 8px; }
    .draft-details summary { padding: 10px 12px; cursor: pointer; font-weight: 700; }
    .draft-details[open] summary { border-bottom: 1px solid #edf1f7; }
    .case-synopsis { padding: 12px; line-height: 1.7; }
    .case-synopsis p { margin: 0 0 10px; }
    .case-synopsis p:last-child { margin-bottom: 0; }
    .case-synopsis-note { color: #64748b; font-size: 12px; }
    .center-case-synopsis { max-width: 860px; margin: 0 auto 12px; }
    .draft-node { border: 1px solid #dbe2ef; border-radius: 6px; padding: 10px; margin-bottom: 8px; background: #fff; }
    .draft-node textarea { min-height: 70px; margin-top: 8px; }
    .center-reader { position: relative; height: 100%; overflow: auto; padding: 24px; background: #fff; }
    .center-reader article { max-width: 860px; margin: 0 auto; line-height: 1.75; font-size: 15px; }
    .report-list { margin: 8px 0 0; padding-left: 20px; }
    .report-list li { margin-bottom: 10px; }
    .timeline-item { position: relative; border-left: 3px solid #1d4ed8; padding: 0 0 14px 14px; margin-left: 8px; }
    .timeline-item strong { display: block; margin-bottom: 4px; }
    .warning { border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
    .citation { border: 1px solid #dbe2ef; border-left: 3px solid #1d4ed8; border-radius: 6px; padding: 8px; margin-top: 8px; cursor: pointer; background: #fbfcff; }
    .citation:hover { border-color: #8aa7e8; }
    .citation-list { margin-top: 8px; border: 1px solid #dbe2ef; border-radius: 6px; background: #fbfcff; }
    .citation-list summary { padding: 6px 8px; cursor: pointer; font-size: 12px; color: #344054; }
    .citation-row { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: start; padding: 6px 8px; border-top: 1px solid #edf1f7; }
    .citation-link { padding: 3px 7px; border-radius: 4px; font-size: 12px; line-height: 1.35; white-space: nowrap; }
    .citation-row .quote { margin-top: 0; font-size: 12px; }
    .citation-mark { display: inline-block; font-size: 11px; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
    .citation-mark.exact { background: #dcfce7; color: #166534; }
    .citation-mark.loose { background: #fef3c7; color: #92400e; }
    .citation-mark.miss { background: #fee2e2; color: #991b1b; }
    .badge { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 8px; margin-bottom: 8px; }
    .ok { background: #dcfce7; color: #166534; }
    .bad { background: #fee2e2; color: #991b1b; }
    /* 「只能出工作稿」既不是成功也不是错误 —— 它是一个**成立的状态**，
       只是比正式稿弱一档。用红色会让律师以为自己做错了什么。 */
    .warn { background: #fef3c7; color: #92400e; }
    .quote { color: #344054; border-left: 3px solid #d0d5dd; padding-left: 8px; margin-top: 8px; font-size: 13px; }
    .error { color: #991b1b; margin-top: 8px; font-size: 13px; }
    .progress { margin: 8px 0 12px; height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
    .progress > div { height: 100%; background: #1d4ed8; width: 0%; transition: width .25s ease; }
    #importProgress { display: none; width: 120px; margin: 0 0 0 8px; height: 6px; vertical-align: middle; }
    #importProgress.show { display: inline-block; }
    /* 上传进度那一行整体默认不占位；开始上传才显示。
       不用 visibility —— 那样空着的时候仍然把文件列表往下推。 */
    .import-progress-row { display: none; align-items: center; gap: 8px; margin: 8px 0 4px; }
    .import-progress-row.show { display: flex; }
    .import-progress-row #importProgress { margin: 0; flex: 1 1 auto; min-width: 60px; }
    #importProgressText { font-size: 12px; white-space: nowrap; }
    .import-cancel { padding: 2px 8px; font-size: 12px; line-height: 1.6; }

    /* Lawyer workspace shell */
    body { overflow: hidden; background: #f3f5f8; }
    /* 窄窗口兜底：视口小于工作台最小宽度时允许横向滚动，
       内容保持完整不挤压（显示器/缩放差异下的最后防线）。 */
    html { overflow-x: auto; }
    @media (max-width: 981px) {
      html { min-width: 982px; }
    }
    header { height: 62px; min-height: 62px; grid-template-columns: minmax(460px, 1.15fr) minmax(390px, 1fr) auto; gap: 18px; padding: 0 16px; }
    .case-context { display: grid; grid-template-columns: 32px minmax(88px, 1fr) minmax(140px, 180px) 150px; align-items: center; gap: 8px; min-width: 0; }
    .app-mark { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: #1d4ed8; color: #fff; font-weight: 800; }
    .case-context-copy { min-width: 0; }
    .case-context-copy small { display: block; overflow: hidden; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .case-context h1 { overflow: hidden; margin: 1px 0 0; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
    .case-context #coverage { min-width: 0; }
    header .status-chip { width: 150px; max-width: 150px; }
    main { height: calc(100vh - 100px); --left-width: 248px; --right-width: 440px; }
    .workflow-stepper { grid-template-columns: repeat(3, minmax(112px, 1fr)); gap: 2px; min-width: 390px; padding: 3px; border: 1px solid #dbe2ef; border-radius: 7px; background: #f8fafc; }
    .workflow-step { min-height: 42px; padding: 7px 10px; border: 0; background: transparent; color: #475467; text-align: center; }
    .workflow-step.active { border: 0; background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
    .workflow-step small { margin-top: 1px; font-size: 11px; }
    .stage-actions { display: flex; justify-content: flex-end; gap: 7px; align-items: center; }
    .stage-actions button { width: auto; min-height: 34px; padding: 6px 10px; white-space: nowrap; font-size: 12px; }
    .stage-actions #status { display: none; }
    .stage-more { position: relative; }
    .stage-more > summary { list-style: none; cursor: pointer; border: 1px solid #cfd6e4; border-radius: 6px; padding: 8px 10px; color: #344054; background: #fff; font-size: 12px; }
    .stage-more > summary::-webkit-details-marker { display: none; }
    .stage-menu-content { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 264px; display: grid; gap: 4px; padding: 8px; border: 1px solid #cfd6e4; border-radius: 7px; background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .18); }
    .stage-menu-content button { width: 100%; text-align: left; border-color: transparent; background: #fff; color: #344054; }
    .stage-menu-content button:hover { background: #f1f5f9; }
    .left { padding: 12px 10px; }
    .doc { padding: 9px 10px; margin-bottom: 4px; border-color: transparent; background: transparent; }
    .right { padding: 0 12px 80px; scroll-padding-bottom: 80px; }
    .right-context-header { position: sticky; top: 0; z-index: 10; margin: 0 -12px 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #d9deea; }
    .right-context-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
    .right-context-row h2 { margin: 0; font-size: 16px; }
    #rightContextMeta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 12px; }
    .right-mode-tabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: #f1f5f9; }
    .right-mode-tab { border: 0; background: transparent; color: #475467; padding: 5px 7px; font-size: 13px; white-space: nowrap; }
    .right-mode-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); font-weight: 700; }
    .subpage-header { display: none; }
    .right-scroll-top { right: 18px; bottom: 52px; width: 36px; height: 36px; }
    .qa-float { bottom: 48px; }
    .task-dock { height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-top: 1px solid #d9deea; background: #fff; color: #475467; font-size: 12px; }
    .task-dock > strong { color: #172033; white-space: nowrap; }
    .task-dock-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .task-dock details { position: relative; margin-left: auto; }
    .task-dock summary { cursor: pointer; color: #1d4ed8; white-space: nowrap; }
    /* z-index 必须高过那两个浮动按钮（qa-float 50 / right-scroll-top 45）——
       它们就悬在右下角，正是这个面板展开的地方。原先这里**一个 z-index 都没有**，
       于是面板短的时候看不出来，错误信息一多、面板往上长，就被那两个按钮和
       右栏的 sticky 表头（7/9/10）戳穿。 */
    .task-dock-details { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 60; width: min(520px, calc(100vw - 28px)); max-height: 420px; overflow: auto; padding: 12px; border: 1px solid #cfd6e4; border-radius: 7px; background: #fff; box-shadow: 0 14px 36px rgba(15, 23, 42, .2); }
    @media (max-width: 1180px) {
      header { grid-template-columns: minmax(410px, 1fr) minmax(350px, .9fr) auto; gap: 10px; }
      .case-context { grid-template-columns: 32px minmax(64px, 1fr) minmax(130px, 150px) 136px; }
      header .status-chip { width: 136px; max-width: 136px; }
      main { --left-width: 220px; --right-width: 380px; }
      .workflow-stepper { min-width: 350px; }
      .case-context-copy small { display: none; }
    }

/* 案件切换条：换案件走整页重载，避免逐个清理内存里按案件缓存的东西 */
.case-bar { display: flex; gap: 6px; align-items: center; min-width: 0; margin-left: 0; }
/* 案件名可以很长，而 <select> 的原生下拉箭头是画在右内边距里的 ——
   不给它留出位置，长名字就直接压在箭头上。右边留 22px 给箭头，
   截断交给 ellipsis；全名靠 renderCaseBar 挂的 title 还能看到。 */
.case-bar select { width: 100%; min-width: 0; max-width: 112px; padding: 4px 22px 4px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.case-bar button { white-space: nowrap; padding: 6px 8px; }
/* 新建 / 改名 / 删除收进 ⋯ 菜单：案件条那一列只有 140–180px，平铺放不下。
   菜单本体复用 .stage-more / .stage-menu-content，这里只管触发点的尺寸。 */
.case-more { flex: 0 0 auto; }
.case-more > summary { padding: 6px 9px; line-height: 1; letter-spacing: 1px; }
.case-more .stage-menu-content { width: 190px; }
/* 删除是唯一不可撤销的动作，配色上就该和旁边两个分开 */
.stage-menu-content .case-delete { color: #b91c1c; }
.stage-menu-content .case-delete:hover { background: #fef2f2; }

/* 登录 / 邀请码注册。整页接管，工作台的栅格不参与，所以这里自成一套居中布局。
   配色一律取自上面已有的色板（#1d4ed8 / #f5f7fb / #667085 / 6px 圆角），
   目的是让它看起来像同一个应用的一部分，而不是一个单独的登录站。 */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; padding: 26px 24px 20px; border: 1px solid #dbe2ef; border-radius: 10px; background: #fff; box-shadow: 0 14px 40px rgba(15, 23, 42, .08); }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #667085; font-size: 12px; }
.auth-card h2 { margin: 14px 0 18px; font-size: 20px; }
.auth-card label { display: block; margin-bottom: 5px; font-size: 12px; color: #344054; }
.auth-card input { margin-bottom: 14px; }
.auth-card button[type="submit"] { width: 100%; margin-top: 4px; padding: 10px; font-size: 14px; }
.auth-card .muted { margin: 12px 0 0; line-height: 1.6; }
.auth-switch a { color: #1d4ed8; }
/* 失败提示。红字加浅红底，和输入框区分开 —— 律师多半是在密码输错时看到它，
   要一眼能找到。文案一律来自后端，前端不改写、不细分（见 app.js 的红线①）。 */
.auth-error { margin-bottom: 12px; padding: 9px 11px; border: 1px solid #fca5a5; border-radius: 6px; background: #fef2f2; color: #b91c1c; font-size: 13px; line-height: 1.5; }

/* 停机横幅。琥珀色而不是红色：这不是错误，是"服务在收尾，你已经做的都保得住"。
   红色会让律师以为出事了，第一反应是刷新页面 —— 而刷新解决不了任何问题。 */
.drain-banner { padding: 10px 16px; border-bottom: 1px solid #f0c36d; background: #fff8e6; color: #7a5200; font-size: 13px; line-height: 1.5; }
.drain-banner[hidden] { display: none; }
/* 完成提示 toast（方案 4 4D）：页面内默认通知，不打断律师正在做的任何事。 */
.summary-toast { position: fixed; right: 18px; bottom: 18px; z-index: 999; max-width: 420px; padding: 12px 16px; border-radius: 8px; background: #1f6f43; color: #fff; font-size: 14px; line-height: 1.5; box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; }
.summary-toast.show { opacity: 1; transform: translateY(0); }
.summary-toast[hidden] { display: none; }

/* 「更多操作」菜单里的登录态 */
.menu-divider { height: 0; margin: 6px 2px; border: 0; border-top: 1px solid #e5e9f2; }
/* 单行、超长省略：给「当前登录：xxx」这种一行一个值的用。 */
.menu-note { padding: 0 8px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 成句的说明必须整句看得见。用 .menu-note 的话，
   「未识别页只用于上次中断后的续跑，本产品永不使用文字层」会被截成半句 ——
   而被吃掉的正好是最要紧的后半句。 */
.menu-hint { padding: 2px 8px 6px; line-height: 1.5; font-size: 12px; white-space: normal; }
.menu-hint strong { color: #b45309; }

/* 个人设置覆盖层。用覆盖层而不是整页替换（登录页那种）：律师可能正在核验，
   改完名字要能回到原来的位置，不该被冲掉。 */
/* 模态层要压住所有东西，包括上面那个 z-index 60 的处理详情面板。 */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; background: rgba(15, 23, 42, .38); overflow-y: auto; }
.overlay[hidden] { display: none; }
.overlay-card { width: 100%; max-width: 560px; border: 1px solid #dbe2ef; border-radius: 10px; background: #fff; box-shadow: 0 18px 48px rgba(15, 23, 42, .18); }
.overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e5e9f2; }
.overlay-head h2 { margin: 0; font-size: 17px; }
.overlay-body { padding: 4px 20px 20px; }
.pdf-password-card { max-width: 420px; }
.pdf-password-body { display: grid; gap: 10px; padding-top: 16px; }
.pdf-password-body p { margin: 0; }
.pdf-password-body input { width: 100%; box-sizing: border-box; }
.pdf-password-error { color: #b42318; font-size: 13px; }
.pdf-password-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.profile-section { padding: 16px 0; border-bottom: 1px solid #eef1f6; }
.profile-section:last-child { border-bottom: 0; padding-bottom: 4px; }
.profile-section h3 { margin: 0 0 4px; font-size: 14px; }
.profile-section .hint { margin: 0 0 10px; font-size: 12px; color: #667085; line-height: 1.6; }
.profile-section label { display: block; margin-bottom: 4px; font-size: 12px; color: #344054; }
.profile-section input { width: 100%; margin-bottom: 10px; }
.profile-row { display: flex; gap: 8px; align-items: flex-start; }
.profile-row input { flex: 1; }

/* 每个小节各有一条反馈行。**不共用一条** —— 共用的话改完名字的提示会盖掉
   改密码那边的报错，而这两件事的后果完全不同。 */
.profile-note { margin: 0; padding: 8px 10px; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.profile-note[hidden] { display: none; }
.profile-note.ok { border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857; }
.profile-note.bad { border: 1px solid #fca5a5; background: #fef2f2; color: #b91c1c; }

.invite-list { margin: 10px 0 0; padding: 0; list-style: none; }
.invite-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #eef1f6; font-size: 12px; }
.invite-code { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.invite-state { color: #667085; white-space: nowrap; }
.invite-state.used { color: #047857; }
.invite-state.expired { color: #b45309; }

/* 初稿逐条编辑区（2026-08-18）。章 / 节的小标题只在换组时打一次，
   否则 50 条条目会被标题淹掉；2026-08-20 起那一组还能整个收起来。 */
.draft-entries { margin-bottom: 12px; }
/* 分组标题。**不复用 `.draft-details`** —— 那是带边框的白盒子，
   而终稿这一侧整个列表本来就装在一个 `.draft-details` 里，套两层就成了盒中盒。
   这里只要一条能点的小标题，视觉上跟原先的 `.draft-entry-heading` 一致。 */
.draft-entry-group { margin-bottom: 4px; }
/* 不设 display:flex —— summary 的展开三角只在 `display: list-item` 下画得出来，
   而这一行是否可点全靠那个三角。数量用 span 拉开，不用 gap。 */
.draft-entry-group > summary { margin: 14px 0 6px; padding: 2px 0; cursor: pointer; font-size: 13px; font-weight: 700; color: #475467; }
.draft-entry-group:first-of-type > summary { margin-top: 0; }
.draft-entry-group > summary:hover { color: #1d4ed8; }
.draft-entry-group > summary .muted { margin-left: 8px; font-weight: 400; font-size: 12px; }
.draft-status { padding: 10px; margin-bottom: 10px; border: 1px solid #dbe2ef; border-radius: 6px; background: #fbfcff; }
.draft-status .warning { margin-top: 6px; }
.draft-status button { margin-top: 8px; }
/* 每条初稿的抬头：位置名 + 状态徽标。改过之后正文只显示改后的，
   AI 原话不再另放一份（只读的位置是中间栏那份渲染好的整篇），要回去点「还原」。 */
.draft-entry-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.draft-entry-head .badge { margin-bottom: 0; }
.draft-entry-head .entry-note { color: #166534; font-size: 12px; }
.draft-entry-text { margin-top: 6px; white-space: pre-wrap; }
.entry-authorship-note { margin: 6px 0; line-height: 1.6; }
.entry-review { margin-top: 8px; padding: 8px; border: 1px solid #e5e7eb; border-radius: 6px; }
.entry-review-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.entry-review-actions button { font-size: 12px; padding: 4px 8px; }
.reference-citations { background: #f9fafb; border-color: #e5e7eb; }
.reference-note { margin: 0 8px 8px; }
.draft-node .summary-editor-actions { justify-content: flex-end; padding-bottom: 0; padding-top: 8px; }
/* 清单末尾的加号。缩进一点，读起来是「挂在上面这组下面」，不是又一个条目。 */
.draft-list-add { margin: -2px 0 10px; padding-left: 10px; }
.draft-list-add button { padding: 4px 10px; font-size: 12px; color: #475467; border-color: #dbe2ef; }
.draft-list-add button:hover { color: #1d4ed8; border-color: #8aa7e8; }
/* 两份文档之间的搬运按钮：送入终稿 / 送回初稿。弱化，正文才是主角。 */
.entry-transfer { margin-top: 8px; }
.entry-transfer button { padding: 3px 9px; font-size: 12px; }
.final-blanks summary { cursor: pointer; font-size: 12px; color: #1d4ed8; padding: 4px 0; }
.final-blank-row { display: grid; gap: 3px; padding: 5px 0; border-top: 1px solid #edf1f7; font-size: 12px; justify-items: start; }
/* 终稿的标题行：标题在左，导出顶到最右。
   导出不是第四个视图，所以它不站在下面那排页签里；`flex: 1` 加在 h2 上
   而不是给按钮 `margin-left: auto`，这样「N 份只能出工作稿」那句提示
   跟按钮一起靠右、中间不会被撑开一段空白。 */
.final-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.final-head h2 { flex: 1; margin: 0; }
.final-export { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.profile-toggle { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; cursor: pointer; }
/* 送入终稿的确认弹窗。`.hint` 在这里也要能用 —— 它原先只在
   `.profile-section` 下面有规则，弹窗不在那个容器里。 */
/* 导出弹窗的三行。一行 = 一份交付物：名字 + 闸门结论 + 两个格式。 */
.export-row { padding: 12px 0; border-bottom: 1px solid #edf1f7; }
.export-row:last-of-type { border-bottom: 0; }
.export-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.export-row-actions { display: flex; gap: 8px; }
.export-row-actions button { min-width: 78px; }
.export-why { margin-top: 8px; }
.export-why summary { font-size: 12px; color: #667085; cursor: pointer; }
.push-final-summary { margin: 12px 0 4px; line-height: 1.7; }
.push-final-summary p { margin: 0 0 8px; }
.push-final-summary .hint, #pushFinalOverlay .hint { margin: 0 0 10px; font-size: 12px; color: #667085; line-height: 1.6; }
.push-final-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.profile-toggle input { width: auto; margin: 0; }
.warning details > summary { cursor: pointer; padding: 4px 0; }
button.secondary.danger { color: #b42318; border-color: #f0c2bd; }
button.secondary.danger:hover { background: #fef3f2; }

/* One selected-material collection and one review report. */
.report-workspace { max-width: 940px; margin: 0 auto; }
.report-workspace .final-head { align-items: flex-start; gap: 16px; }
.report-workspace .final-head h2 { margin: 0; font-size: 23px; letter-spacing: .05em; }
.report-workspace .final-head p { margin: 7px 0 14px; font-size: 12px; line-height: 1.8; }
.report-toolbar, .report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-toolbar { justify-content: space-between; margin: 10px 0 14px; padding: 9px 0; border-bottom: 1px solid #e4e9f2; }
.report-toolbar .muted, .report-actions button { font-size: 12px; }
.report-actions button { padding: 6px 9px; }
.report-toolbar button.active { background: #edf3ff; color: #2455c5; border-color: #a7bce9; }
/* Offset the reader's 24px padding so text cannot scroll above the pinned bar. */
.report-edit-controls { position: sticky; top: -24px; z-index: 4; margin-bottom: 14px; background: #fff; }
.report-edit-controls[hidden] { display: none; }
.report-edit-toolbar { margin: 0; padding: 10px 0; align-items: flex-start; }
.report-edit-toolbar > .muted { flex: 1 1 260px; min-width: 0; line-height: 1.7; overflow-wrap: anywhere; }
.report-edit-toolbar > .report-actions { flex: 0 1 auto; max-width: 100%; }
.report-paper { padding: 30px 34px; min-height: 490px; background: white; border: 1px solid #dce2eb; box-shadow: 0 2px 9px #17203308; font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.report-paper h1, .report-paper h2, .report-paper h3 { line-height: 1.6; margin: 22px 0 12px; }
.report-paper > :first-child { margin-top: 0; }
.report-paper p { margin: 0 0 14px; }
.report-full-editor { white-space: pre-wrap; outline: none; }
.report-full-editor:focus { border-color: #6991de; box-shadow: 0 0 0 2px #2455c515; }
.report-section-editor { background: #f7f9fc; padding: 16px; border: 1px solid #dce2eb; }
.report-section-block { margin: 0 0 18px; }
.report-section-block label { font-size: 12px; color: #62708a; display: block; margin-bottom: 6px; }
.report-section-block textarea, .report-material-editor textarea, .report-manual-text { display: block; width: 100%; min-height: 105px; resize: vertical; border: 1px solid #cbd5e5; border-radius: 5px; background: #fff; padding: 10px 12px; color: #172033; font: inherit; line-height: 1.8; }
.report-section-block[data-kind="heading"] textarea { min-height: 48px; }
.report-section-block .muted { display: block; margin-top: 5px; font-size: 11px; }
.report-empty { padding: 46px 20px; text-align: center; color: #617087; line-height: 1.8; }
.report-empty h3 { color: #172033; margin: 15px 0 8px; font-size: 18px; }
.report-empty p { max-width: 430px; margin: 0 auto 20px; font-size: 13px; }
.report-empty-icon { width: 48px; height: 48px; margin: auto; border-radius: 9px; background: #edf3ff; color: #2455c5; display: grid; place-items: center; font-size: 24px; }
/* The selected list keeps one heading per topic and a shared 16px text inset. */
#finalDraft { padding: 0 16px 16px; }
#finalPanelActions { flex-wrap: wrap; gap: 8px; padding-inline: 16px; margin-bottom: 4px; }
#finalPanelActions > button { font-size: 12px; padding: 6px 9px; }
.report-material-panel { border: 0; background: transparent; }
.report-material-intro { padding: 12px 0 16px; }
.report-material-count { color: #526179; font-size: 12px; font-weight: 600; }
.report-material-intro p { font-size: 12px; line-height: 1.8; margin: 6px 0 0; overflow-wrap: anywhere; }
.report-material-group { overflow: visible; border: 0; background: transparent; margin: 0 0 20px; }
.report-material-group > h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 9px 0; font-size: 13px; line-height: 1.6; font-weight: 600; color: #344054; border-bottom: 1px solid #dfe5ef; overflow-wrap: anywhere; }
.report-material-group > h3 > span { flex: 0 0 auto; color: #8290a6; font-size: 11px; font-weight: 400; }
.report-material { padding: 12px 0; border-bottom: 1px solid #eef1f6; min-width: 0; }
.report-material:last-child { border-bottom: 0; }
.report-material strong { font-size: 13px; font-weight: 600; line-height: 1.85; overflow-wrap: anywhere; }
.report-material-text { white-space: pre-wrap; line-height: 1.85; margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.report-material-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.report-material-line > strong::after { content: '：'; }
.report-material-line > .report-material-text { flex: 1 1 80px; min-width: 0; margin: 0; }
.report-material-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; min-width: 0; }
.report-material-origin { color: #7a879a; font-size: 11px; line-height: 1.6; }
.report-material-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
button.report-text-action { padding: 3px 0; min-height: 26px; border: 0; border-radius: 3px; background: transparent; color: #64738b; font-size: 12px; line-height: 1.6; }
button.report-text-action:hover { color: #1d4ed8; background: #f1f5fc; }
button.report-text-action:focus-visible { outline: 2px solid #517bd3; outline-offset: 3px; }
.report-source { min-width: 0; max-width: 100%; font-size: 11px; line-height: 1.7; margin: 0; color: #65748a; }
.report-source p { margin: 0; }
.report-source .citation-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 11px; padding: 2px 5px; text-align: left; }
.report-material-foot > details.report-source { flex: 1 0 100%; }
.report-material-foot > details.report-source > summary { cursor: pointer; font-weight: 400; }
.report-material-editor { padding: 12px; margin-top: 10px; background: #f5f8fc; border-radius: 5px; }
.report-material-editor label { font-size: 12px; }
.report-material-editor .report-actions { justify-content: flex-end; margin-top: 8px; }
.report-materials-workspace { width: 100%; max-width: 920px; margin: 0 auto; }
.report-materials-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.report-materials-heading > div { flex: 1 1 240px; }
.report-materials-heading h2 { margin: 0 0 8px; font-size: 21px; font-weight: 600; }
.report-materials-heading p { margin: 0; font-size: 12px; line-height: 1.8; }
.report-materials-heading button { font-size: 12px; }
.report-materials-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid #e5eaf2; border-bottom: 1px solid #e5eaf2; }
.report-materials-tools input { flex: 1 1 170px; min-width: 0; width: auto; margin: 0; font: inherit; font-size: 12px; }
.report-materials-tools select { flex: 0 1 180px; min-width: 100px; max-width: 100%; padding: 8px 10px; border: 1px solid #cfd6e4; border-radius: 6px; background: #fff; color: #344054; font: inherit; font-size: 12px; }
.report-materials-tools .report-actions { margin-left: auto; }
.report-materials-workspace .report-material { padding: 16px 0; }
.report-materials-workspace .report-material-text { font-size: 14px; }
.report-filter-empty { padding: 28px 0; }
.report-overview { padding: 20px 0; line-height: 1.8; }
.report-overview > strong { font-size: 16px; }
.report-overview .muted { font-size: 13px; }
.report-process { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px 0; margin-top: 15px; color: #65748a; font-size: 12px; border-top: 1px solid #e5eaf2; }
.report-process span:not(:last-child)::after { content: ' →'; color: #a0adbf; margin-left: 8px; }
.report-legacy { margin: 16px 0; padding: 12px 0; border-top: 1px solid #e5eaf2; font-size: 12px; }
.report-legacy summary { cursor: pointer; color: #637087; }
.report-legacy-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }
.report-legacy-row button { font-size: 11px; padding: 5px 7px; }
.report-candidate-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 14px; background: #edf3ff; border: 1px solid #d1ddf7; color: #365383; font-size: 12px; margin: 12px 0; }
.report-candidate-note { color: #805517; background: #fff8e9; padding: 10px 12px; font-size: 12px; line-height: 1.8; }
#reviewReportOverlay { --report-modal-gap: clamp(12px, 4vh, 40px); padding: var(--report-modal-gap) 16px; overflow: hidden; }
.report-modal { width: min(840px, 100%); max-width: 840px; display: flex; flex-direction: column; max-height: calc(100vh - 2 * var(--report-modal-gap)); max-height: calc(100dvh - 2 * var(--report-modal-gap)); overflow: hidden; }
.report-modal > .overlay-head, .report-modal > .report-modal-actions { flex: 0 0 auto; }
.report-modal .overlay-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; line-height: 1.8; }
.report-modal .overlay-body > p { margin: 0 0 16px; }
.report-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 15px 20px; border-top: 1px solid #e5eaf2; }
.report-style-options { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
button.report-style-option { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; text-align: left; gap: 4px 16px; width: 100%; border-color: #d7e0ee; background: #fff; color: #172033; padding: 18px 20px; line-height: 1.8; }
button.report-style-option:hover { border-color: #7499de; background: #f6f9ff; }
button.report-style-option:focus-visible { outline: 2px solid #517bd3; outline-offset: 2px; }
.report-style-option strong { grid-row: span 2; font-size: 16px; font-weight: 600; color: #244d96; }
.report-style-option span { font-size: 13px; }
.report-style-option small { color: #748197; font-size: 11px; }
.report-section-block[data-field-path] { padding: 12px; background: #fff; border: 1px solid #e1e7f0; border-radius: 5px; }
.report-section-block[data-field-path] > label { font-weight: 600; color: #344054; }
.report-structured-preview h2, .report-structured-preview h3 { padding-bottom: 8px; border-bottom: 1px solid #e5eaf2; }
.report-candidate-paper { border-top: 1px solid #e5eaf2; padding: 18px 5px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.95; }
.report-stream { font: inherit; font-size: 13px; white-space: pre-wrap; max-height: 55vh; overflow: auto; padding: 15px; background: #f7f9fc; border: 1px solid #e1e7f0; }
.report-manual-text { min-height: 220px; margin: 8px 0 14px; }
@media (max-width: 680px) { button.report-style-option { grid-template-columns: 1fr; gap: 6px; padding: 16px; } .report-style-option strong { grid-row: auto; } .report-paper { padding: 22px 18px; } }
