/* ============================================================================
   DeAI 设计系统 — 浅色纸感 · 三栏指挥台
   分层靠留白与层级，不靠边框和卡片；没有装饰性大标题；主要动作一屏内完成。
   ========================================================================== */

:root {
  color-scheme: light;
  /* 纸面 */
  --paper: #f5f4f1;
  --surface: #ffffff;
  --sunken: #edece7;
  --hover: #eceae4;
  /* 墨色 */
  --ink: #14181a;
  --muted: #5c666a;
  --quiet: #8b9498;
  --line: #e5e3dd;
  --line-strong: #d2cfc7;
  /* 唯一的强调色 */
  --accent: #0d7f63;
  --accent-ink: #0a5f4a;
  --accent-soft: #e7f2ee;
  /* 人工特征段的标注底色。别用 --accent-soft：那个太淡，铺在正文的纸色底（--paper）上
     几乎同色，标了跟没标一样（2026-09-30 海总反馈跟看不见似的）。 */
  --mark-human: #bfe3d6;
  --danger: #b5342c;
  --danger-soft: #fbecea;
  --mark-ai: var(--danger-soft);
  --warn: #8f5d12;
  --warn-soft: #faf1e0;
  /* 尺寸标尺 */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 14px;
  --h-sm: 28px;
  --h-md: 34px;
  --h-lg: 40px;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 .875rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 1.25rem; font-weight: 640; }
h2 { font-size: 1rem; font-weight: 640; }
h3 { font-size: .875rem; font-weight: 640; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
/* 选中文字的高亮。原来是 --accent-soft，太淡——铺在纸色底上几乎看不见，等于没有选中反馈
   （2026-09-30 海总反馈「选中文字很淡」）。改成强调色反白：选中哪一段一目了然，
   而且和标好 AI 之后的浅红（--mark-ai）是两种样子，不会混。 */
::selection { background: var(--accent); color: #fff; }
.muted { color: var(--muted); }
.quiet { color: var(--quiet); }
.small { font-size: .8125rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.full-width { width: 100%; }

/* ── 控件 ───────────────────────────────────────────────────────────────── */
.primary, .secondary, .ghost, .text-link, .back-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: var(--r-sm); font-weight: 560; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; height: var(--h-md); padding: 0 14px; font-size: .8125rem; }
.primary:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.secondary { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); height: var(--h-md); padding: 0 13px; font-size: .8125rem; }
.secondary:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.ghost { border: 1px solid transparent; background: transparent; color: var(--muted); height: var(--h-sm); padding: 0 9px; font-size: .8125rem; }
.ghost:hover { background: var(--hover); color: var(--ink); }
.text-link { border: 0; background: transparent; color: var(--accent); padding: 0; font-size: .8125rem; }
.text-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.back-link { border: 1px solid var(--line); background: var(--surface); color: var(--muted); height: var(--h-sm); padding: 0 10px; font-size: .8125rem; }
.back-link:hover { border-color: var(--line-strong); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--muted); font-size: .75rem; }
.field input, .field select, .field textarea {
  height: var(--h-lg); padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); outline: 0;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 状态点＋文字；不做填充色块，减少视觉噪音 */
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); font-size: .75rem; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.success, .status.active, .status.supported { color: var(--accent); }
.status.running, .status.queued, .status.uncertain, .status.untested { color: var(--warn); }
.status.failed, .status.cancelled, .status.disabled, .status.unsupported { color: var(--danger); }
.status.skipped, .status.removed, .status.archived { color: var(--quiet); }

.notice { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: var(--r-sm); font-size: .8125rem; }
.notice.ok { background: var(--accent-soft); color: var(--accent-ink); }
.copy-toast {
  position: fixed; top: calc(20px + env(safe-area-inset-top, 0px)); left: 50%;
  transform: translateX(-50%); z-index: 1000; max-width: calc(100vw - 32px);
  padding: 10px 18px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--accent-ink); font-size: .875rem;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 14%, transparent);
  overflow-wrap: anywhere; pointer-events: none;
}
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); overflow-wrap: anywhere; }

.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sunken); color: var(--muted); font: 500 .6875rem var(--mono); }
.section-index { color: var(--quiet); font: 500 .6875rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.dialog-panel { width: min(400px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }
.dialog-panel::backdrop { background: rgba(20, 24, 26, .38); }
.dialog-head { margin-bottom: 16px; }
.dialog-head p { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-panel form { display: flex; flex-direction: column; gap: 14px; }


/* Native submission confirmation uses the existing theme tokens. */
.rewrite-confirm { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.rewrite-confirm .dialog-head h2 { font-size: 1.125rem; }
.rewrite-confirm .dialog-head p { overflow-wrap: anywhere; }
.rewrite-confirm-summary { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); font-size: .8125rem; line-height: 1.8; }
.rewrite-confirm-cost { color: var(--ink); font-size: 1rem; }
.rewrite-confirm-cost strong { font-size: 1.5rem; color: var(--accent); }
.rewrite-confirm-summary .insufficient { color: var(--danger); }
.rewrite-confirm-rules { margin: 16px 0 0; padding-left: 1.2em; color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.rewrite-confirm-rules li + li { margin-top: 7px; }
.rewrite-confirm-footnote { margin-top: 12px; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.rewrite-confirm .dialog-actions { flex-wrap: wrap; }
.rewrite-options { display: grid; gap: 8px; margin: 18px 0; min-width: 0; }
.rewrite-options label { margin-top: 4px; color: var(--ink); font-size: .8125rem; font-weight: 600; }
.rewrite-options select { width: 100%; min-width: 0; max-width: 100%; min-height: var(--h-md); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .875rem; }
.rewrite-options select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rewrite-options select:disabled { opacity: .6; }
.rewrite-options p { font-size: .75rem; line-height: 1.7; }
.rewrite-type-note { color: var(--warn); }

/* ── 应用外壳：左栏 · 舞台 · 任务流 ───────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 316px;
  /* 行高必须显式写成 minmax(0, 1fr)：auto 行会被长正文顶高，整页再被 overflow:hidden 裁掉，
     三栏里的 overflow:auto 就永远滚不动（任务详情的原稿/终稿两栏就是这么卡住的）。 */
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.app.stream-collapsed { grid-template-columns: 68px minmax(0, 1fr) 46px; }
.app.stream-hidden { grid-template-columns: 68px minmax(0, 1fr) 0; }

.rail { display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 14px 0 12px; border-right: 1px solid var(--line); }
.rail-brand { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); cursor: pointer; }
.rail-brand .brand-mark { width: 15px; height: 15px; border: 2px solid var(--accent); border-radius: 4px; transform: rotate(-18deg); }
.rail-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.rail-item {
  position: relative;
  width: 44px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: .625rem;
}
.rail-item svg { width: 17px; height: 17px; }
.rail-item:hover { background: var(--hover); color: var(--ink); }
.rail-item.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(20, 24, 26, .06), inset 0 0 0 1px var(--line); }
.rail-foot { margin-top: auto; }
.rail-badge { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font: 600 .625rem/15px var(--mono); text-align: center; }

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.stage-bar { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.stage-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; font-weight: 640; }
/* 任务详情：顶栏整条不要——流程名/任务号/时间/环境状态在右侧任务卡片和别处都有。
   （原来想只在没告警时才收起，但环境正常时那条状态也是一直显示的，等于没收起。） */
@media (min-width: 901px) {
  body.view-task .stage-bar { display: none; }
}
/* 窄屏例外：任务流抽屉的开关住在这条栏里，栏得留着，只把文字信息去掉。 */
@media (max-width: 900px) {
  body.view-task .stage-title, body.view-task .stage-meta, body.view-task .stage-tools .status { display: none; }
}
.stage-meta { color: var(--quiet); font: .75rem var(--mono); }
.stage-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.stage-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.stage-head h1 { font-size: 1.125rem; }

/* ── 改写 ───────────────────────────────────────────────────────────────── */
.compose { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.compose textarea {
  flex: 1; min-height: 0; width: 100%; padding: 20px 22px; border: 0; outline: 0; resize: none;
  background: transparent; color: var(--ink); font: 400 .9375rem/1.9 var(--sans); letter-spacing: .01em;
}
.compose textarea::placeholder { color: var(--quiet); }
.compose-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 22px; border-top: 1px solid var(--line); }
.compose-count { color: var(--quiet); font: .75rem var(--mono); }
.compose-hint { color: var(--quiet); font-size: .75rem; }
.compose-hint.ready { color: var(--accent); }
.compose-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; min-width: 0; max-width: 100%; }
.compose-actions > .primary { flex: none; margin-left: 0; white-space: nowrap; }

/* ── 任务流（右栏） ─────────────────────────────────────────────────────── */
.stream { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.app.stream-collapsed .stream-body { display: none; }
.stream-head { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.stream-head h2 { font-size: .875rem; font-weight: 640; }
.stream-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.stream-toggle { margin-left: auto; flex: none; }
.app.stream-collapsed .stream-head { padding: 0; justify-content: center; border-bottom: 0; }
.app.stream-collapsed .stream-title { display: none; }
.app.stream-collapsed .stream-toggle { margin: 12px auto 0; }
.stream-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stream-list { flex: 1; min-height: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.stream-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); color: var(--quiet); font-size: .75rem; }
.stream-empty { padding: 26px 16px; color: var(--quiet); font-size: .8125rem; line-height: 1.7; }

.task-entry { display: grid; gap: 3px; padding: 10px 11px; border-radius: var(--r-md); cursor: pointer; }
.task-entry:hover { background: var(--hover); }
.task-entry.selected { background: var(--surface); box-shadow: 0 1px 2px rgba(20, 24, 26, .06), inset 0 0 0 1px var(--line); }
.task-card { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.task-card-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.task-card-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 560; }
.task-card-meta { display: flex; align-items: center; gap: 4px; color: var(--quiet); font: .6875rem var(--mono); }
.task-card-meta span { min-width: 0; overflow-wrap: anywhere; }
.task-card-step { color: var(--accent); font-size: .75rem; }
.task-card-reason { color: var(--danger); font-size: .75rem; overflow-wrap: anywhere; }
.copy-no-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--quiet); }
.copy-no-icon::before { content: '⧉'; font: 1.0625rem/1 sans-serif; }
.copy-no-icon:hover { background: var(--hover); color: var(--accent); }
.copy-no-icon[data-copy-state="success"]::before { content: '✓'; color: var(--accent); }
.copy-no-icon[data-copy-state="error"]::before { content: '!'; color: var(--danger); }

/* ── 全部任务（舞台内的检索页） ─────────────────────────────────────────── */
.archive { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.archive-bar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.archive-bar input[type="search"] { width: min(280px, 40vw); height: var(--h-md); padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); outline: 0; font-size: .8125rem; }
.archive-bar input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-tabs { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--sunken); }
.filter-button { border: 0; border-radius: 5px; padding: 5px 10px; background: transparent; color: var(--muted); font-size: .75rem; }
.filter-button:hover { color: var(--ink); }
.filter-button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 24, 26, .07); }
.archive-count { margin-left: auto; color: var(--quiet); font: .75rem var(--mono); }
.archive-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.archive-entry { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 22px; border-bottom: 1px solid var(--line); cursor: pointer; }
.archive-entry:hover { background: var(--paper); }
.archive-entry.selected { background: var(--accent-soft); }
.archive-row { display: grid; grid-column: 1 / -1; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.archive-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; font-weight: 560; }
.archive-entry .no { display: flex; grid-column: 2 / -1; align-items: center; gap: 4px; min-width: 0; color: var(--quiet); font: .6875rem var(--mono); }
.archive-entry .no span { min-width: 0; overflow-wrap: anywhere; }
.pagination-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 22px; border-top: 1px solid var(--line); font-size: .75rem; }
.list-empty { padding: 40px 22px; color: var(--quiet); font-size: .8375rem; line-height: 1.7; }

/* ── 任务详情（舞台内） ─────────────────────────────────────────────────── */
.detail { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.detail-identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 10px 22px 6px; }
.detail-identity strong { min-width: 0; overflow-wrap: anywhere; font-size: .875rem; font-weight: 620; }
.detail-identity span { color: var(--quiet); font: .6875rem var(--mono); }
.detail-number { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.detail .notice { margin: 12px 22px 0; }
.result { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.detail-actions { display: flex; align-items: center; gap: 8px; padding: 6px 22px 4px; }
/* 这一行现在只放返回/取消/重新提交；没有一个是可见的时候（看已完成的任务就是这样）整行收起。 */
.detail-actions:not(:has(> button:not([hidden]))) { display: none; }
.detail-actions #detail-spacer { flex: 1; }
@media (max-width: 900px) { .detail-actions { flex-wrap: wrap; padding: 10px 14px 0; } }
/* 原稿 / 终稿两栏共用这一个滚动条：一行放一对对齐块，行高取两格里高的一侧，
   所以两列天然逐段对齐，用不着脚本去同步 scrollTop。 */
.detail-panes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pane-heads { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 22px; border-bottom: 1px solid var(--line); }
/* 复制按钮住在自己那一栏的列头里：看哪栏就复制哪栏，不用在两栏之间对号。 */
.pane-head .ghost { height: 22px; padding: 0 9px; font-size: .75rem; }
/* 手指要贴着按钮，所以这一格必须自己定位（不再往上找祖先） */
.pane-head .pane-tools { display: flex; align-items: center; gap: 4px; }
/* 手指只对着「再改一轮」这一个按钮，所以定位锚点是这个按钮自己的外壳，
   不是整组工具（否则会飘到「复制终稿」那边去）。 */
.pane-head .rework-slot { position: relative; display: inline-flex; }
/* 「效果不佳再改一轮」不抢视觉：样式还是这套留白纸感的 ghost，只用强调色字 + ↻ 表明主次。
   引导交给旁边那只手指——悬空的手指滑进来按一下，按钮跟着轻轻一闪，循环提示（见 .rework-hand）。
   选择器要压过 .pane-head .ghost，否则高度和颜色会被那一条盖回去。 */
.pane-head .ghost.rework-open { height: 22px; padding: 0 10px; color: var(--accent); font-weight: 620;
  animation: rework-flash 4.4s ease-in-out infinite; }
.pane-head .ghost.rework-open:hover { background: var(--accent-soft); color: var(--accent-ink); }
.rework-open::before { content: '↻'; margin-right: 5px; font-size: .8125rem; }
/* 手指按下来的那一下，按钮轻轻闪一下——和手指的动作对上拍 */
@keyframes rework-flash {
  0%, 33% { background: transparent }
  40%, 51% { background: var(--accent-soft) }
  63%, 100% { background: transparent }
}
/* 自下而上的点击引导：真实绘制的卡通手（Fluent UI Emoji，MIT），只在完成结果里出现。
   指尖对准按钮下半部；手掌暂时悬在正文上方，但不参与排版、不阻止点击或选字。 */
.rework-hand { position: absolute; left: 34px; top: 9px; z-index: 3; width: 86px; height: 86px;
  opacity: 0; pointer-events: none; transform-origin: 38% 8%;
  filter: drop-shadow(0 7px 10px rgba(51, 57, 53, .18));
  animation: rework-hand-tap 4.4s ease-in-out infinite; }
.rework-hand-shape { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 接触时由指尖荡开一圈小波纹，位置与位图里食指顶端一致。 */
.rework-hand-ring { position: absolute; left: 28px; top: 0; width: 11px; height: 11px;
  border: 2px solid var(--accent); border-radius: 50%; opacity: 0;
  animation: rework-ripple 4.4s ease-out infinite; }
@keyframes rework-hand-tap {
  0%, 7% { opacity: 0; transform: translateY(70px) scale(.94); }
  22% { opacity: 1; transform: translateY(28px) scale(1); }
  34% { opacity: 1; transform: translateY(0) scale(1); }
  41% { opacity: 1; transform: translateY(5px) scale(.97); }
  49%, 57% { opacity: 1; transform: translateY(0) scale(1); }
  73%, 100% { opacity: 0; transform: translateY(70px) scale(.94); }
}
@keyframes rework-ripple {
  0%, 36% { opacity: 0; transform: scale(.3); }
  43% { opacity: .65; transform: scale(1); }
  55%, 100% { opacity: 0; transform: scale(2.9); }
}
@media (max-width: 900px) {
  .rework-hand { left: 34px; top: 8px; width: 64px; height: 64px; }
  .rework-hand-ring { left: 21px; top: 0; width: 9px; height: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .rework-hand { opacity: 0; animation: none; }
  .rework-hand-ring { animation: none; }
  .pane-head .ghost.rework-open { animation: none; }
}
.pane-head[data-side="source"] { border-right: 1px solid var(--line); }
.pane-head h3 { font-size: .8125rem; font-weight: 560; color: var(--muted); }
.diff-rows { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; padding: 10px 0 18px; }
/* 行号由脚本写进 --row；列由 data-side 定，所以 DOM 里整列连着排也不影响同行对齐。 */
.diff-cell { grid-row: var(--row); min-width: 0; padding: 0 22px; border-right: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .875rem/1.9 var(--sans); }
/* 原稿和终稿共用一组段落样式；不往正文插空格，空终稿的占位提示不缩进。 */
.diff-cell:not(.pane-empty) { text-indent: 2em; }
.diff-cell[data-side="source"] { grid-column: 1; }
.diff-cell[data-side="final"] { grid-column: 2; border-right: 0; }
.pane-empty { color: var(--quiet); }
.compare-tabs { display: none; }
/* 原稿/终稿的差异标注：红=改前被换掉的字，绿=改写后新写的字。 */
.diff-cell mark { border-radius: 0; padding: 0; margin: 0;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.diff-cell .diff-del { background: var(--danger-soft); color: var(--danger); }
.diff-cell .diff-ins { background: var(--accent-soft); color: var(--accent-ink); }
/* 〖〗 记号本身：留在原处，但不上色 —— 它是记号，不是被换掉的字。
   标注段和别的正文一样，没动就没颜色，动了才红/绿。 */
.diff-cell .diff-note { padding: 0; margin: 0; background: none; color: var(--quiet); }
.detail-empty { flex: 1; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--quiet); font-size: .8375rem; }

/* ── 登录 ───────────────────────────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 24px; background: var(--paper); }
.login-card { width: min(378px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 1px 3px rgba(20, 24, 26, .05); }
.login-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; font-size: .9375rem; font-weight: 660; }
.login-brand .brand-mark { width: 15px; height: 15px; border: 2px solid var(--accent); border-radius: 4px; transform: rotate(-18deg); }
.login-card h1 { margin-bottom: 5px; font-size: 1.125rem; }
.login-card .sub { margin-bottom: 20px; color: var(--muted); font-size: .8125rem; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .primary { margin-top: 4px; height: var(--h-lg); }
.login-switch { margin-top: 16px; text-align: center; font-size: .8125rem; }
.login-foot { margin-top: 22px; color: var(--quiet); font: .6875rem var(--mono); text-align: center; }

/* ── 后台 ───────────────────────────────────────────────────────────────── */
.admin-page { background: var(--paper); }
.admin-shell { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 0; height: 100dvh; overflow: hidden; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; border-right: 1px solid var(--line); overflow-y: auto; }
.admin-nav-label { padding: 0 10px 10px; color: var(--quiet); font: 500 .6875rem var(--mono); letter-spacing: .08em; }
.admin-nav button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); text-align: left; font-size: .8125rem; }
.admin-nav button:hover { background: var(--hover); color: var(--ink); }
.admin-nav button.active { background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.admin-main { min-width: 0; overflow-y: auto; padding: 26px 30px 60px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-head h1 { font-size: 1.125rem; }
.admin-head p { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.admin-panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.admin-panel + .admin-panel { margin-top: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.admin-form-grid .primary, .admin-form-grid .secondary { height: var(--h-lg); }
.admin-list { display: flex; flex-direction: column; }
.admin-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-item:last-child { border-bottom: 0; }
.admin-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-item-title { font-size: .8375rem; font-weight: 560; overflow-wrap: anywhere; }
.admin-item-sub { color: var(--quiet); font-size: .75rem; overflow-wrap: anywhere; }
.admin-item-actions { display: flex; gap: 6px; flex: none; }
.admin-item-actions .ghost, .admin-item-actions .secondary { height: var(--h-sm); padding: 0 9px; font-size: .75rem; }
.admin-empty { padding: 30px 0; color: var(--quiet); font-size: .8125rem; }
/* 标注样本：绿色片段就是被标为人工特征的那段，前后文淡一档只做上下文 */
.mark-item { align-items: flex-start; }
.mark-pick { display: flex; align-items: center; padding-top: 4px; }
.mark-pick input, .mark-all input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.mark-all { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.mark-line { font-size: .8125rem; line-height: 1.9; overflow-wrap: anywhere; }
.mark-line mark { padding: 1px 3px; border-radius: 3px; background: var(--mark-human); color: var(--accent-ink);
  box-shadow: inset 0 -2px 0 var(--accent); }
/* 一段标注可能有几百字，先折四行保证列表能扫；要看全的点「展开这条」 */
.mark-folded { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mark-more { align-self: flex-start; margin-top: 2px; padding: 0; border: 0; background: none; font-size: .75rem; cursor: pointer; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.settings-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-group:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.codebox { padding: 11px 13px; border-radius: var(--r-sm); background: var(--sunken); font: .75rem/1.7 var(--mono); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; }
.tl-head { padding: 9px 0; color: var(--muted); font-size: .75rem; border-bottom: 1px solid var(--line); }
.step-line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.step-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; flex: 1; }
.step-tools { display: flex; gap: 6px; }
.preview-block { padding: 14px; border-radius: var(--r-sm); background: var(--sunken); }
.preview-manifest { font: .75rem/1.7 var(--mono); }
.panel-meta { color: var(--quiet); font-size: .75rem; }
.flow.active { color: var(--accent); }
.flow.disabled { color: var(--quiet); }
.flow.archived { color: var(--danger); }

/* ── 窄屏：任务流收成抽屉 ───────────────────────────────────────────────── */
.drawer-toggle { display: none; }
@media (max-width: 900px) {
  /* 两行网格：上面一条横栏，下面整个舞台。不写死行高的话 auto 行会被拉伸，舞台会被顶下去。 */
  .app, .app.stream-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
  .rail { flex-direction: row; align-items: center; gap: 6px; height: 52px; padding: 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-nav { flex-direction: row; margin: 0; }
  .rail-foot { margin: 0 0 0 auto; }
  .rail-item { flex-direction: row; gap: 7px; width: auto; padding: 0 11px; }
  .rail-badge { top: 1px; right: 1px; min-width: 14px; height: 14px; font-size: .5625rem; line-height: 14px; }
  .stage { border-right: 0; }
  .stream {
    position: fixed; inset: 0 0 0 auto; z-index: 30; width: min(340px, 88vw);
    border-left: 1px solid var(--line); box-shadow: -8px 0 32px rgba(20, 24, 26, .12);
    transform: translateX(100%); visibility: hidden; transition: transform .2s ease;
  }
  /* 关着的时候同时置为不可见：跨越断点时不会出现一个没遮罩的抽屉 */
  .app.stream-open .stream { transform: none; visibility: visible; }
  .app.stream-collapsed .stream { display: none; }
  .drawer-toggle { display: inline-flex; }
  .stream-scrim { display: none; }
  .app.stream-open .stream-scrim { display: block; position: fixed; inset: 0; z-index: 29; border: 0; background: rgba(20, 24, 26, .28); }
  .stage-bar { padding: 0 14px; }
  .compose textarea { padding: 16px 14px; }
  .compose-bar { flex-wrap: wrap; padding: 10px 14px; }
  .compose-actions { flex: 1 0 100%; }
  .archive-bar { flex-wrap: wrap; padding: 12px 14px; }
  .archive-bar input[type="search"] { width: 100%; }
  .archive-entry { padding: 11px 14px; }
  .pane-heads, .diff-rows { grid-template-columns: minmax(0, 1fr); }
  .pane-head[data-side] { padding: 4px 14px; border-right: 0; }
  /* 窄屏只有一列：行号与列号全部退回自动，剩下的那一列按顺序往下排 */
  .diff-cell { grid-row: auto; grid-column: 1; padding: 0 14px; border-right: 0; }
  .compare-tabs { display: flex; gap: 2px; margin: 0 14px 10px; padding: 2px; border-radius: var(--r-sm); background: var(--sunken); }
  .compare-tabs button { flex: 1; border: 0; border-radius: 5px; padding: 6px 0; background: transparent; color: var(--muted); font-size: .8125rem; }
  .compare-tabs button.active { background: var(--surface); color: var(--ink); }
  /* 窄屏一次只显示一栏：整列（表头 + 所有格子）一起收起来，滚动条还是这一条 */
  .detail.show-source [data-side="final"], .detail:not(.show-source) [data-side="source"] { display: none; }
  .detail-identity { padding: 10px 14px 6px; }
  .stage-head { padding: 16px 14px 10px; }
  .pagination-row { padding: 9px 14px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { flex-direction: row; gap: 4px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .admin-nav-label { display: none; }
  .admin-nav button { width: auto; white-space: nowrap; }
  .admin-main { padding: 18px 14px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── 账户菜单（左栏底部） ───────────────────────────────────────────────── */
.account-menu { position: relative; }
.account-trigger { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; list-style: none; }
.account-trigger::-webkit-details-marker { display: none; }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: .8125rem; font-weight: 620; }
.account-trigger:hover .account-avatar, .account-menu[open] .account-avatar { background: var(--accent); color: #fff; }
.account-chevron, #account-name { display: none; }
.account-popover { position: absolute; left: calc(100% + 10px); bottom: 0; z-index: 40; min-width: 170px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: 0 12px 32px rgba(20, 24, 26, .14); }
.account-identity { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.account-identity strong { display: block; max-width: 240px; margin-top: 4px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; user-select: text; }
.account-popover button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-align: left; font-size: .8125rem; }
.account-popover button:hover { background: var(--hover); }

/* 舞台内的提示条与正文保持同一条内边距 */
.compose > .notice { margin: 0 22px 12px; }
.compose textarea:focus-visible { outline: 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: .9375rem; font-weight: 660; }
.brand-mark { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--accent); border-radius: 4px; transform: rotate(-18deg); }

@media (max-width: 900px) {
  .account-popover { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); }
  .compose > .notice { margin: 0 14px 10px; }
  .rail-brand { margin-right: 4px; }
}

/* 状态点：列表里只用一个小圆点表示状态，文字留给内容 */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); flex: none; }
.dot.success, .dot.active { background: var(--accent); }
.dot.running, .dot.queued { background: var(--warn); }
.dot.failed, .dot.cancelled { background: var(--danger); }

/* ── 后台：左栏与内容同套语言 ───────────────────────────────────────────── */
.admin-brand { display: flex; align-items: center; gap: 9px; padding: 0 10px 20px; font-size: .9375rem; font-weight: 660; }
.admin-nav button { display: flex; align-items: center; gap: 9px; }
.admin-nav button span:first-child { color: var(--quiet); font: .6875rem var(--mono); }
.admin-nav button.active span:first-child { color: var(--accent); }
.admin-nav-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding: 14px 10px 0; font-size: .8125rem; }
.admin-nav-foot .account-menu { margin-top: 2px; }
.admin-nav-foot .account-popover { left: 0; right: auto; top: auto; bottom: calc(100% + 8px); }
.upload-zone { display: grid; gap: 5px; justify-items: center; padding: 26px 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--paper); text-align: center; cursor: pointer; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone input { display: none; }
.upload-zone strong { font-size: .875rem; font-weight: 560; }
.upload-zone span { color: var(--quiet); font-size: .75rem; }
.upload-symbol { color: var(--accent); font-size: 1.25rem; }
.timeline { display: flex; flex-direction: column; }
.tl-item { padding: 9px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0; border: 0; color: var(--ink); font-size: .8125rem; font-weight: 560; }
.tl-time { color: var(--quiet); font: .6875rem var(--mono); font-weight: 400; }
.tl-line { margin-top: 3px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.tl-item.bad .tl-head { color: var(--danger); }
.tl-item.call .tl-head { color: var(--accent); }

/* Element Plus 跟随同一套纸感语言 */
:root {
  --el-color-primary: #0d7f63;
  --el-color-primary-light-3: #2f9a80;
  --el-color-primary-light-5: #6db8a5;
  --el-color-primary-light-7: #a9d6ca;
  --el-color-primary-light-8: #c6e4dc;
  --el-color-primary-light-9: #e7f2ee;
  --el-color-primary-dark-2: #0a5f4a;
  --el-text-color-primary: #14181a;
  --el-text-color-regular: #3d464a;
  --el-text-color-secondary: #5c666a;
  --el-border-color: #d2cfc7;
  --el-border-color-light: #e5e3dd;
  --el-border-color-lighter: #eceae4;
  --el-fill-color-blank: #ffffff;
  --el-fill-color-light: #f5f4f1;
  --el-bg-color: #ffffff;
  --el-bg-color-overlay: #ffffff;
  --el-border-radius-base: 6px;
}
.el-button { font-weight: 560; }
.el-button--small { height: var(--h-sm); }

/* ── 效果不佳再改一轮：弹窗、引导动画、AI 标注 ───────────────── */
.rework { position: relative; width: 90vw; height: 90vh; height: 90dvh;
  --ai-ink: color-mix(in srgb, var(--danger) 80%, var(--ink));
  --accent: var(--ai-ink); --accent-ink: var(--ai-ink); --accent-soft: var(--mark-ai);
  max-width: 90vw; max-height: 90dvh; min-height: 0; padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(20, 24, 26, .24); }
.rework[open] { display: flex; flex-direction: column; }
.rework::backdrop { background: rgba(20, 24, 26, .22);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); }
.rework-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.rework-head h2 { font-size: 1.0625rem; }
/* 提示要「显眼但不吵」：一条渐变底的横幅，比正文大一档，颜色用强调色。 */
.rework-hint { margin: 12px 20px 0; padding: 11px 15px; border-radius: var(--r-md); font-size: .9375rem;
  font-weight: 620; letter-spacing: .01em; color: var(--accent-ink);
  background: var(--mark-ai); }
/* 三步直说：海报式的口号不够，得把「做什么」写清楚。 */
.rework-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px; padding: 16px 20px; }
.rework-instructions { min-height: 0; min-width: 0; padding: 8px 18px 0 0;
  border-right: 1px solid var(--line); overflow-y: auto; }
.rework-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rework-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.rework-steps li { position: relative; padding: 3px 0 3px 26px; color: var(--ink); font-size: .875rem; line-height: 1.6;
  counter-increment: step; }
.rework-steps li::before { content: counter(step); position: absolute; left: 0; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font: 620 .6875rem/18px var(--sans);
  text-align: center; }
.rework-steps b { font-weight: 660; }
.rework-guide { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 18px 0 0; padding: 10px 12px;
  border-radius: var(--r-md); background: var(--mark-ai); }
.gd-caption { margin: 0; font-size: .75rem; line-height: 1.6; color: var(--muted); }
.gd-paper { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 9px 11px;
  border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
/* 示例里放的是这一版终稿的真实文字，所以高亮从哪开始、多宽都由脚本按字量出来，
   位置通过 --gd-x / --gd-w / --gd-x2 传进来（见 tasks.js 的 paintGuide）。 */
/* 文字必须画在高亮块「上面」：高亮是一层底色，不是一块盖住字的色块——
   之前写在下面，选中时字被挡没了，和实际标注（字有红色标记、字还在）对不上。 */
.gd-text { position: relative; z-index: 1; margin: 0; white-space: nowrap; overflow: hidden;
  font-size: .75rem; line-height: 1.55; color: var(--ink); }
.gd-text.gd-dim { color: var(--quiet); }
.gd-select { position: absolute; z-index: 0; left: var(--gd-x, 11px); top: 8px; height: 19px; width: 0;
  border-radius: 3px; animation: gd-sweep 4s ease-in-out infinite; }
.gd-cursor { position: absolute; z-index: 2; top: 18px; left: var(--gd-x, 11px); width: 9px; height: 9px;
  border-radius: 50%; background: var(--ai-ink); opacity: .5; animation: gd-cursor 4s ease-in-out infinite; }
/* 选中和确认标注都用红字红底，不借用主题强调色。 */
#gd-target, #main-gd-target { color: var(--ai-ink); }
.gd-pill { align-self: flex-start; padding: 6px 11px; border-radius: 999px; font-size: .75rem; color: var(--ai-ink);
  background: var(--mark-ai); box-shadow: inset 0 0 0 1px var(--ai-ink); animation: gd-pill 4s ease-in-out infinite; }
/* 整个拖选过程始终为红色；确认后只补下划线，不切换颜色。 */
@keyframes gd-sweep {
  0%, 10% { width: 0; background: var(--mark-ai); box-shadow: none; opacity: 1 }
  45%, 56% { width: var(--gd-w, 56%); background: var(--mark-ai); box-shadow: none; opacity: 1 }
  62%, 90% { width: var(--gd-w, 56%); background: var(--mark-ai); box-shadow: inset 0 -2px 0 var(--ai-ink); opacity: 1 }
  97%, 100% { width: var(--gd-w, 56%); background: var(--mark-ai); opacity: 0 }
}
@keyframes gd-cursor { 0%, 10% { left: var(--gd-x, 11px); opacity: .5 } 45%, 72% { left: var(--gd-x2, 67%); opacity: .5 } 80%, 100% { left: var(--gd-x2, 67%); opacity: 0 } }
@keyframes gd-pill { 0%, 52%, 96%, 100% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ai-ink) 30%, transparent) } 60%, 88% { box-shadow: inset 0 0 0 1px var(--ai-ink) } }
.rework-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.mark-button { height: var(--h-sm); padding: 0 14px; border: 0; border-radius: var(--r-sm); color: #fff;
  background: var(--accent); font-size: .8125rem; }
.mark-button:hover { background: var(--accent-ink); }
.rework .mark-button, #rework-mark { color: var(--ai-ink); background: var(--mark-ai); }
.rework .mark-button:hover, #rework-mark:hover { color: var(--ai-ink); background: var(--mark-ai); box-shadow: inset 0 0 0 1px var(--ai-ink); }
.rework::selection, .rework ::selection { color: var(--ai-ink); background: var(--mark-ai); }
.rework-count { color: var(--muted); font-size: .75rem; }
/* 按首尾标注：两个框就是一个范围，标完自动清空，接着标下一段。 */
.rework-finder { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.rework-finder-label { color: var(--quiet); font-size: .75rem; }
.rework-anchor { flex: 1 1 120px; min-width: 0; height: var(--h-sm); padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
  color: var(--ink); font: 400 .8125rem var(--sans); }
.rework-anchor:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.rework-finder-dash { color: var(--quiet); font-size: .75rem; }
.rework-text { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper);
  white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .9375rem/1.95 var(--sans); }
.rework-text p { margin: 0 0 10px; }
/* 只做视觉缩进，不往正文插入空格；空段落保持原有行距。 */
.rework-text p:not(:empty) { text-indent: 2em; }
.rework-text p:last-child { margin-bottom: 0; }
.rework-text mark { border-radius: 3px; padding: 1px 3px; color: var(--danger); background: var(--mark-ai);
  box-shadow: inset 0 -2px 0 var(--danger); }
.rework-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.rework-note { flex: 1; color: var(--quiet); font-size: .75rem; }
.rework-editor .notice { flex: none; margin: 0 0 10px; }
/* 额外引导盖在标注弹窗上，手动关闭前底层编辑区不可操作。 */
.rework-intro { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(20, 24, 26, .25); }
.rework-intro-card { width: min(720px, 100%); max-height: 100%; overflow-y: auto;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 18px 50px rgba(20, 24, 26, .22); }
.rework-intro-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; background: var(--surface); }
.rework-intro-label { display: block; margin-bottom: 5px; color: var(--accent); font: 620 .6875rem var(--sans); letter-spacing: .09em; }
.rework-intro-head h2 { font-size: 1.125rem; line-height: 1.45; }
.rework-intro-close { flex: none; display: grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--quiet); cursor: pointer; }
.rework-intro-close svg { display: block; }
.rework-intro-close:hover { background: var(--hover); color: var(--muted); }
.rework-intro-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rework-intro .rework-hint { margin: 16px 0 0; }
.rework-intro .rework-steps { margin-top: 16px; }
.rework-intro .rework-guide { display: flex; flex-direction: column; align-items: stretch; margin: 18px 0 0; }
.rework-intro .gd-paper { flex: 1; }
.rework-intro .gd-pill { align-self: flex-start; }
.rework-intro-foot { margin-top: 14px; color: var(--muted); font-size: .8125rem; text-align: right; }

@media (max-width: 900px) {
  .rework-head { padding: 12px 14px 0; }
  .rework-hint { margin: 9px 14px 0; }
  .rework-workspace { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
  .rework-instructions { flex: none; padding: 0; border: 0; overflow: visible; }
  .rework-instructions .rework-guide { display: none; }
  .rework-intro { padding: 12px; }
  .rework-intro-card { padding: 16px; }
  .rework-intro .rework-hint { margin-top: 12px; }
  .rework-intro .rework-guide { flex-direction: column; align-items: stretch; }
  .rework-intro .gd-pill { align-self: flex-start; }
  .rework-steps li { padding-block: 1px; font-size: .8125rem; }
  .rework-editor { flex: 1; min-height: 0; }
  .rework-text { padding: 14px; }
  .rework-foot { flex-wrap: wrap; padding: 10px 14px 12px; }
  .rework-note { flex-basis: 100%; }
}

/* 邮箱认证复用登录卡片和账户弹窗，不引入另一套视觉样式。 */
.email-code-row { display: flex; align-items: center; gap: 8px; }
.email-code-row input { flex: 1; min-width: 0; width: 0; }
.email-code-row button { flex: none; white-space: nowrap; }
.login-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
.login-card > .notice { margin-bottom: 14px; overflow-wrap: anywhere; }
.email-account-current { margin: 0 0 14px; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .login-page { padding: 16px; }
  .login-card { padding: 24px 20px; }
}
