/* ==========================================================================
   超级文件管理审核系统 — 深色控制台主题
   设计取向：工具型 SaaS 控制台（左侧图标轨道 + 单列工作区），
   与「政务浅色大字号」完全区分；强调色取 DeepSeek 蓝。
   ========================================================================== */

:root {
  --bg: #07080c;
  --bg-glow-1: rgba(77, 107, 254, .16);
  --bg-glow-2: rgba(34, 211, 238, .10);
  --panel: #11141c;
  --panel-2: #161a23;
  --panel-3: #1b202b;
  --line: #242a37;
  --line-soft: #1a1f29;
  --ink: #e9edf5;
  --ink-2: #a7b0c2;
  --ink-3: #69738a;
  --accent: #4d6bfe;
  --accent-2: #6e8bff;
  --accent-soft: rgba(77, 107, 254, .14);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, .12);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .12);
  --radius: 28px;
  --radius-sm: 20px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --font: "Inter", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
          system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 28px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 12% -6%, var(--bg-glow-1), transparent 65%),
    radial-gradient(620px 380px at 92% 8%, var(--bg-glow-2), transparent 60%);
  z-index: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
code {
  font-family: var(--mono);
  font-size: .92em;
  background: rgba(255, 255, 255, .06);
  padding: 4px 12px;
  border-radius: 10px;
  color: var(--accent-2);
}
[hidden] { display: none !important; }

.muted { color: var(--ink-3); }
.small { font-size: 25px; }

/* ============================== 登录 ============================== */
.auth-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
}
.auth-glow {
  position: absolute;
  width: 1240px; height: 1240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 107, 254, .22), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 840px;
  background: linear-gradient(180deg, rgba(23, 27, 36, .96), rgba(15, 18, 25, .98));
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 64px 60px 52px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.auth-brand { display: flex; align-items: center; gap: 28px; margin-bottom: 52px; }
.auth-brand .mark {
  width: 92px; height: 92px;
  display: grid; place-items: center;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #3450c9);
  box-shadow: 0 6px 20px rgba(77, 107, 254, .35);
  flex: none;
}
.auth-brand .mark svg { width: 48px; height: 48px; }
.auth-brand strong { display: block; font-size: 34px; letter-spacing: .01em; }
.auth-brand span {
  display: block;
  font-size: 23px;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 4px;
}
.auth-hint {
  margin-top: 32px;
  font-size: 24px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ============================== 布局 ============================== */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  height: 100vh;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 36px 0 32px;
  background: rgba(13, 16, 22, .86);
  border-right: 2px solid var(--line);
  backdrop-filter: blur(10px);
}

.rail-brand {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  border-radius: 24px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #3450c9);
  box-shadow: 0 6px 18px rgba(77, 107, 254, .32);
  margin-bottom: 28px;
  user-select: none;
}

.rail-nav { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: center; }

.rail-item {
  width: 132px;
  padding: 20px 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 22px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.rail-item svg { width: 42px; height: 42px; }
.rail-item:hover { color: var(--ink); background: rgba(255, 255, 255, .045); }
.rail-item.is-active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(77, 107, 254, .38);
}
.rail-exit { margin-top: auto; }
.rail-exit:hover { color: var(--danger); background: var(--danger-soft); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 56px 32px;
  border-bottom: 2px solid var(--line);
  background: rgba(10, 12, 17, .72);
  backdrop-filter: blur(10px);
  flex: none;
}
.topbar-title h1 { font-size: 38px; }
.topbar-title p { font-size: 25px; color: var(--ink-3); margin-top: 6px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 24px;
  white-space: nowrap;
}
.chip-btn { cursor: pointer; font-family: inherit; }
.chip-btn:hover { border-color: var(--accent); color: var(--ink); }
.chip .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}
.chip .dot[data-state="ok"] { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.chip .dot[data-state="warn"] { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.chip .dot[data-state="error"] { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.chip .dot[data-state="pending"] { background: var(--ink-3); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.view-stack {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 44px 56px 80px;
  scrollbar-width: thin;
  scrollbar-color: #2a3140 transparent;
}
.view-stack::-webkit-scrollbar { width: 20px; }
.view-stack::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 12px; }

.view { display: none; animation: fade .2s ease both; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================== 通用组件 ============================== */
.panel {
  background: linear-gradient(180deg, rgba(23, 27, 37, .9), rgba(16, 19, 26, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px 40px;
  min-width: 0;
}
.panel-wide { grid-column: 1 / -1; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.panel-head h2 { font-size: 28px; letter-spacing: .01em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 72px;
  padding: 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 26px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #313a4b; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { height: 60px; padding: 0 24px; font-size: 24px; }
.btn-block { width: 100%; margin-top: 8px; }

.btn-primary {
  background: linear-gradient(145deg, var(--accent), #3d57d8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(77, 107, 254, .26);
}
.btn-primary:hover { background: linear-gradient(145deg, #5b77ff, #4560e4); }
.btn-ghost { background: transparent; }
.btn-danger-ghost { background: transparent; border-color: rgba(248, 113, 113, .35); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.field { display: block; margin-bottom: 28px; }
.field > span {
  display: block;
  font-size: 24px;
  color: var(--ink-3);
  margin-bottom: 12px;
  letter-spacing: .02em;
}
.field input, .field select, .textarea {
  width: 100%;
  height: 76px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #0c0f15;
  color: var(--ink);
  font-family: inherit;
  font-size: 27px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: none; background-image: linear-gradient(180deg, transparent, transparent); cursor: pointer; }

.input-row { display: flex; gap: 16px; }
.input-row input { flex: 1; }

.textarea {
  height: 480px;
  padding: 24px 28px;
  resize: vertical;
  line-height: 1.7;
}
.textarea::placeholder { color: #4d5566; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 25px;
  color: var(--ink-2);
  margin: 8px 0 32px;
  cursor: pointer;
}
.switch-row input { width: 32px; height: 32px; accent-color: var(--accent); }

.btn-row { display: flex; gap: 18px; flex-wrap: wrap; }

.facts { display: flex; flex-direction: column; gap: 18px; }
.facts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-size: 25px;
  padding-bottom: 18px;
  border-bottom: 2px dashed var(--line-soft);
}
.facts li:last-child { border-bottom: none; padding-bottom: 0; }
.facts span { color: var(--ink-3); flex: none; }
.facts b { font-weight: 500; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

.tag-list { display: flex; flex-wrap: wrap; gap: 14px; }
.tag {
  font-size: 24px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
}

/* ============================== 上传区 ============================== */
.dropzone {
  border: 1.5px dashed #2c3444;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 26, 35, .75), rgba(14, 17, 23, .75));
  padding: 80px 48px 68px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
  margin-bottom: 36px;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(30, 37, 54, .9), rgba(16, 20, 29, .9));
  outline: none;
}
.dropzone.is-over { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan-soft); }
.dropzone.is-busy { opacity: .6; pointer-events: none; }
.dropzone-slim { padding: 44px 40px; margin-bottom: 32px; }

.dz-icon { color: var(--accent-2); margin-bottom: 20px; }
.dz-icon svg { width: 68px; height: 68px; }
.dz-title { font-size: 30px; font-weight: 600; }
.dz-sub { font-size: 25px; color: var(--ink-2); margin-top: 10px; }
.dz-note { font-size: 23px; color: var(--ink-3); margin-top: 16px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }

/* ============================== 列表 ============================== */
.list { display: flex; flex-direction: column; gap: 16px; max-height: 520px; overflow-y: auto; }

.list-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .018);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.list-item:hover { border-color: #2f3949; background: rgba(255, 255, 255, .04); }
.list-item .name { flex: 1; min-width: 0; font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 23px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  font-size: 22px;
  padding: 4px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(52, 211, 153, .3); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, .3); }
.badge-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, .3); }
.badge-info { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(77, 107, 254, .32); }
.badge-violet { color: var(--violet); background: var(--violet-soft); border-color: rgba(167, 139, 250, .3); }

/* ============================== 审核结果 ============================== */
.result-slot { display: flex; flex-direction: column; gap: 32px; }

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.result-head .file { min-width: 0; }
.result-head .file h3 { font-size: 29px; word-break: break-all; }
.result-head .file p { font-size: 24px; color: var(--ink-3); margin-top: 8px; }

.gauge-row { display: grid; grid-template-columns: 190px 190px minmax(0, 1fr); gap: 32px; }

.gauge-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.gauge { width: 236px; height: 236px; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.gauge .track { stroke: #1d2330; }
.gauge .value { stroke: var(--accent); transition: stroke-dashoffset .6s ease, stroke .3s ease; }
.gauge-wrap { position: relative; display: grid; place-items: center; }
.gauge-num {
  position: absolute;
  font-size: 52px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.gauge-label { font-size: 24px; color: var(--ink-3); }
.gauge-title { font-size: 26px; color: var(--ink-2); }

.verdict-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.verdict-line { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.verdict-line strong { font-size: 34px; }
.verdict-line .src { font-size: 23px; color: var(--ink-3); }
.verdict-text { font-size: 26px; color: var(--ink-2); line-height: 1.75; }

.issue-list { display: flex; flex-direction: column; gap: 20px; }
.issue {
  border: 1px solid var(--line-soft);
  border-left: 6px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  background: rgba(255, 255, 255, .015);
}
.issue.sev-high { border-left-color: var(--danger); }
.issue.sev-medium { border-left-color: var(--warn); }
.issue.sev-low { border-left-color: var(--accent); }
.issue-top { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.issue-top b { font-size: 27px; font-weight: 600; }
.issue p { font-size: 25px; color: var(--ink-2); margin-top: 12px; line-height: 1.7; }
.issue .excerpt {
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .28);
  border: 1px dashed var(--line);
  font-size: 24px;
  color: #c8d0de;
  font-family: var(--mono);
  line-height: 1.65;
  word-break: break-word;
}
.issue .fix { margin-top: 14px; font-size: 25px; color: var(--ok); }
.issue .basis-tag { font-family: var(--mono); font-size: 21px; color: var(--ink-3); }

.hits-table { width: 100%; border-collapse: collapse; font-size: 25px; }
.hits-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 23px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.hits-table td {
  padding: 16px 20px;
  border-bottom: 2px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
  word-break: break-word;
}
.hits-table tr:last-child td { border-bottom: none; }
.hits-table .t { color: var(--ink); font-weight: 500; }
.hits-table .pos { font-family: var(--mono); font-size: 23px; color: var(--ink-3); white-space: nowrap; }
.hits-table .snip { color: var(--ink-2); }

details.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}
details.fold > summary {
  cursor: pointer;
  padding: 22px 28px;
  font-size: 26px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "";
  width: 12px; height: 12px;
  border-right: 3.2px solid var(--ink-3);
  border-bottom: 3.2px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
}
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary .count { margin-left: auto; font-size: 23px; color: var(--ink-3); }

details.advanced {
  border-top: 2px solid var(--line-soft);
  padding-top: 24px;
  margin: 28px 0;
}
details.advanced > summary {
  cursor: pointer;
  font-size: 25px;
  color: var(--ink-3);
  list-style: none;
  user-select: none;
  margin-bottom: 24px;
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced[open] > summary { color: var(--ink-2); margin-bottom: 28px; }

/* ============================== 改写 ============================== */
.rewrite-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; margin-bottom: 32px; }

.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.style-option {
  text-align: left;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
  color: var(--ink-2);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.style-option:hover { border-color: #313a4b; color: var(--ink); }
.style-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #fff;
}
.style-option b { display: block; font-size: 25px; font-weight: 600; }
.style-option span { display: block; font-size: 22px; color: var(--ink-3); margin-top: 6px; }
.style-option.is-active span { color: #b9c4ff; }

.rewrite-out { display: flex; flex-direction: column; gap: 24px; }
.out-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 28px 32px;
}
.out-block h3 {
  font-size: 23px;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.out-title { font-size: 34px; font-weight: 600; line-height: 1.5; }
.out-body { font-size: 27px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.out-body mark { background: var(--accent-soft); color: var(--accent-2); border-radius: 6px; padding: 0 4px; }
.out-alt { font-size: 25px; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; }

/* ============================== 设置 ============================== */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

.test-result {
  margin-top: 24px;
  padding: 22px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 25px;
  line-height: 1.7;
}
.test-result.ok { border-color: rgba(52, 211, 153, .35); background: var(--ok-soft); color: #b8f0d6; }
.test-result.bad { border-color: rgba(248, 113, 113, .35); background: var(--danger-soft); color: #ffc9c9; }

/* ============================== 状态与提示 ============================== */
.empty-state {
  padding: 108px 44px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-3);
}
.empty-state h3 { font-size: 30px; color: var(--ink-2); margin-bottom: 14px; }
.empty-state p { font-size: 25px; line-height: 1.75; max-width: 920px; margin: 0 auto; }

.spinner {
  width: 68px; height: 68px;
  border: 2.5px solid rgba(255, 255, 255, .08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-panel {
  padding: 80px 40px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.loading-panel h3 { font-size: 28px; margin-bottom: 12px; }
.loading-panel p { font-size: 25px; color: var(--ink-3); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 20px 36px;
  border-radius: 999px;
  background: #1c2230;
  border: 1px solid #2b3345;
  color: var(--ink);
  font-size: 25px;
  box-shadow: var(--shadow);
  max-width: 80vw;
  text-align: center;
}

.err-line { color: var(--danger); font-size: 25px; margin-top: 16px; }


/* ============================== 一键修改 ============================== */
.polish-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; margin-bottom: 32px; }
.textarea-lg { height: 460px; }

.sub-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 16px; }
.sub-head h3 { font-size: 26px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }

.direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.direction-option {
  text-align: left;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
  color: var(--ink-2);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .08s ease;
}
.direction-option:hover { border-color: #313a4b; color: var(--ink); }
.direction-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(77, 107, 254, .12);
}
.direction-option .d-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.direction-option b { font-size: 26px; font-weight: 600; }
.direction-option .d-tag {
  font-size: 20px;
  padding: 3px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink-3);
  white-space: nowrap;
}
.direction-option.is-active .d-tag { background: rgba(255, 255, 255, .14); color: #cfd8ff; }
.direction-option .d-desc { display: block; font-size: 22px; color: var(--ink-3); margin-top: 10px; line-height: 1.65; }
.direction-option.is-active .d-desc { color: #b9c4ff; }

.strength-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.strength-chip {
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.strength-chip:hover { border-color: #313a4b; color: var(--ink); }
.strength-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: #fff; }

.btn-lg { height: 92px; font-size: 30px; letter-spacing: .02em; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-2);
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.polish-out { display: flex; flex-direction: column; gap: 32px; }
.polish-text { font-size: 28px; line-height: 1.95; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.diff-table { width: 100%; border-collapse: collapse; font-size: 24px; }
.diff-table th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 22px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.diff-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-2);
  word-break: break-word;
}
.diff-table tr:last-child td { border-bottom: none; }
.diff-table .before { color: #ffb4b4; }
.diff-table .after { color: #9ae6c4; }
.diff-table .why { color: var(--ink-3); font-size: 22px; line-height: 1.65; }

/* ============================== 演示案例与使用说明 ============================== */
.demo-panel, .guide-panel { margin-top: 32px; }

.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.demo-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .008));
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s ease, transform .12s ease, background .16s ease;
}
.demo-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.demo-card .d-kind {
  font-size: 20px;
  color: var(--accent-2);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.demo-card b { font-size: 27px; line-height: 1.45; }
.demo-card span { font-size: 22px; color: var(--ink-3); line-height: 1.65; }
.demo-card em { font-size: 22px; color: var(--accent-2); font-style: normal; margin-top: auto; }

.guide-steps { display: flex; flex-direction: column; gap: 22px; counter-reset: step; }
.guide-steps li { position: relative; padding-left: 90px; counter-increment: step; }
.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  width: 60px; height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(77, 107, 254, .38);
  color: #cfd8ff;
  font-size: 26px;
  font-weight: 600;
}
.guide-steps b { display: block; font-size: 26px; margin-bottom: 8px; }
.guide-steps span { font-size: 24px; color: var(--ink-2); line-height: 1.85; }

/* ============================== 响应式 ============================== */
@media (max-width: 1700px) {
  .dash-grid { grid-template-columns: 1fr; }
  .rewrite-grid { grid-template-columns: 1fr; }
  .polish-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1500px) {
  .gauge-row { grid-template-columns: 380px 380px minmax(0, 1fr); }
}

@media (max-width: 1360px) {
  .gauge-row { grid-template-columns: 1fr 1fr; }
  .verdict-card { grid-column: 1 / -1; }
  .demo-grid { grid-template-columns: 1fr; }
  .direction-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 124px; }
  .rail {
    order: 2;
    flex-direction: row;
    justify-content: space-around;
    padding: 12px 16px;
    border-right: none;
    border-top: 1px solid var(--line);
  }
  .rail-brand { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; gap: 4px; }
  .rail-item { width: auto; flex: 1; padding: 12px 4px; gap: 8px; }
  .rail-item span { font-size: 20px; }
  .rail-item svg { width: 36px; height: 36px; }
  .rail-exit { margin-top: 0; }
  .main { order: 1; }
  .topbar { padding: 24px 28px; }
  .topbar-title h1 { font-size: 32px; }
  .view-stack { padding: 28px 28px 40px; }
  .style-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar-title p { display: none; }
  .topbar-right .chip:not(#apiChip) { display: none; }
  .gauge-row { grid-template-columns: 1fr; }
  .gauge-card { flex-direction: row; justify-content: center; gap: 28px; }
  .guide-steps li { padding-left: 0; padding-top: 76px; }
  .guide-steps li::before { top: 0; }
  /* 表格在窄屏内部横向滚动，避免撑破页面（保持表格列宽一致） */
  .diff-table, .hits-table { min-width: 680px; }
  .panel { overflow-x: auto; }
  details.fold > div { overflow-x: auto; }
  .rail { padding: 10px 8px; }
  .rail-item { padding: 10px 2px; gap: 6px; }
  .rail-item span { font-size: 17px; }
  .rail-item svg { width: 30px; height: 30px; }
}

@media (max-width: 560px) {
  /* 窄屏：缩小分数环，避免 gauge-card 行向排布时撑破容器 */
  .gauge { width: 180px; height: 180px; }
  .gauge-num { font-size: 42px; }
  .gauge-card { gap: 18px; padding: 20px; }
  .verdict-line strong { font-size: 30px; }
  /* 窄屏：允许标题右侧标签与列表项换行，消除横向溢出 */
  .panel-head { flex-wrap: wrap; }
  .panel-head .chip { white-space: normal; }
  .list { overflow-x: hidden; }
  .list-item { flex-wrap: wrap; }
  .list-item .name { flex: 1 1 100%; white-space: normal; overflow: visible; text-overflow: clip; }
  .facts li { flex-wrap: wrap; }
  .facts b { text-align: left; }
  /* 极窄屏只保留图标，避免 6 个导航项横向溢出 */
  .rail-item span { display: none; }
  .rail-item { padding: 14px 2px; }
  .rail { grid-template-rows: none; }
  .shell { grid-template-rows: minmax(0, 1fr) 96px; }
  .view-stack { padding: 22px 18px 32px; }
  .topbar { padding: 20px 18px; }
  .panel { padding: 26px 24px 28px; }
}
