/* 馒头的批改铺 — 全站样式（令牌 + 骨架 + 组件）
   主题：书桌上的答题卡（冷灰蓝桌面 × 白试卷卡 × 阅卷朱红） */

:root {
  --desk: #edf0f5;
  --paper: #ffffff;
  --paper-soft: #f7f8fb;
  --ink: #26303e;
  --muted: #71809a;
  --line: #dde3ee;
  --line-soft: #e8edf5;
  --brand: #406be0;
  --brand-deep: #3159c5;
  --brand-tint: #edf2fe;
  --vermilion: #c9403a;
  --vermilion-deep: #a92f2a;
  --vermilion-tint: #fdf1f0;
  --ok: #2f8f5b;
  --r-card: 16px;
  --r-ctl: 10px;
  --shadow: 0 1px 2px rgba(38, 48, 62, .05), 0 12px 32px -18px rgba(38, 48, 62, .25);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(64, 107, 224, .07), transparent 60%),
    var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------------------------------------------------------- 基础组件 */
.card {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--muted); }
.field .opt { color: var(--muted); font-weight: 400; }
.field select, .field input[type="text"], .field input[type="password"], .field input[type="number"], .field input[type="search"] {
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 9px 12px; width: 100%;
  outline: none; background: #fff; font-size: 14px; font-family: var(--sans);
}
.field select:focus, .field input:focus { border-color: var(--brand); }
.field-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--r-ctl); padding: 9px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--sans); text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-deep); color: #fff; }
.btn.danger-stop { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.btn.danger-plain { background: #fff; border-color: #f3d8d6; color: var(--vermilion-deep); }
.btn.danger-plain:hover:not(:disabled) { border-color: var(--vermilion); color: var(--vermilion-deep); background: var(--vermilion-tint); }
.btn.small { padding: 6px 12px; font-size: 13px; font-weight: 500; }

.badge { display: inline-block; font-size: 11.5px; border-radius: 99px; padding: 2px 9px; margin-right: 4px; }
.badge.done { background: #e9f6ee; color: var(--ok); }
.badge.active { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
.badge.vision { background: #f3edfd; color: #6d4bc4; }
.badge.off { background: var(--paper-soft); color: var(--muted); }
.badge.ok { background: #e9f6ee; color: var(--ok); }
.badge.bad { background: var(--vermilion-tint); color: var(--vermilion-deep); }

/* ---------------------------------------------------------- 登录 / 注册门：全屏图 + 右侧玻璃面板 */
.auth-gate {
  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: flex-end; align-items: stretch;
  background: url("/static/img/login-bg.jpg") center / cover no-repeat, var(--desk);
}
.auth-panel {
  width: min(470px, 100%);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  backdrop-filter: blur(20px) saturate(1.25);
  border-left: 1px solid rgba(255, 255, 255, .65);
  box-shadow: -24px 0 70px rgba(38, 48, 62, .22);
  display: flex; flex-direction: column; justify-content: center;
  padding: 46px 46px 30px; overflow-y: auto;
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand img { width: 66px; height: 66px; }
.auth-brand-name { font-family: var(--serif); font-size: 23px; font-weight: 700; margin-top: 10px; letter-spacing: 1px; }
.auth-brand-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.auth-tabs {
  display: flex; background: rgba(247, 248, 251, .9); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 3px; margin-bottom: 18px;
}
.auth-tab {
  flex: 1; border: 0; background: none; padding: 9px 0; font-size: 14px; font-weight: 600;
  color: var(--muted); border-radius: 9px; cursor: pointer;
}
.auth-tab.on { background: #fff; color: var(--brand-deep); box-shadow: 0 1px 4px rgba(38,48,62,.14); }
.auth-panel .field { margin-bottom: 13px; }
.auth-panel .btn.primary { width: 100%; letter-spacing: 6px; margin-top: 8px; padding: 11px 0; font-size: 15px; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 22px; }

@media (max-width: 780px) {
  .auth-gate { justify-content: center; align-items: center; padding: 18px; }
  .auth-panel {
    width: 100%; max-width: 460px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 24px 70px rgba(38, 48, 62, .3); padding: 34px 30px 24px;
  }
}

/* ---------------------------------------------------------- 应用骨架 */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 216px; background: var(--paper);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; border-bottom: 1px solid var(--line-soft); }
.sb-brand img { width: 42px; height: 42px; border-radius: 12px; }
.sb-name { font-family: var(--serif); font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.sb-sub { font-size: 11px; color: var(--muted); }
.sb-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; flex: 1; }
.sb-item {
  display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; text-align: left; font-family: var(--sans);
}
.sb-item:hover { color: var(--brand); background: var(--brand-tint); }
.sb-item.on { color: var(--brand-deep); background: var(--brand-tint); }
.sb-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sb-user {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
  padding: 4px 8px; border-radius: 10px; font-family: var(--sans); text-align: left;
}
.sb-user:hover { background: var(--paper-soft); }
.user-chip {
  font-size: 12.5px; font-weight: 700; color: var(--brand-deep); background: var(--brand-tint);
  padding: 4px 10px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px;
  display: inline-block;
}
.sb-usage-hint { font-size: 11.5px; color: var(--muted); }
.sb-logout {
  border: 0; background: none; cursor: pointer; text-align: left; font-family: var(--sans);
  padding: 8px 8px; border-radius: 10px; font-size: 13px; color: var(--muted);
}
.sb-logout:hover { color: var(--vermilion-deep); background: var(--vermilion-tint); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; }
.page-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlink {
  border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer;
  padding: 0 0 6px; font-family: var(--sans); display: block;
}
.backlink:hover { color: var(--brand); }

/* ---------------------------------------------------------- 任务列表 */
.task-toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.task-search {
  flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 9px 12px; outline: none; font-size: 13.5px; font-family: var(--sans); background: #fff;
}
.task-search:focus { border-color: var(--brand); }
.task-toolbar select {
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 9px 12px;
  outline: none; background: #fff; font-size: 13.5px; color: var(--ink); font-family: var(--sans);
}
.task-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.task-table th, .task-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.task-table th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--paper-soft); }
.task-table tbody tr:hover { background: var(--paper-soft); }
.t-idx { color: var(--muted); }
.t-name { font-weight: 700; }
.t-preview { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-rubric { font-size: 12.5px; color: var(--muted); }
.t-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.t-score { color: var(--muted); }
.t-score.has { color: var(--vermilion-deep); font-weight: 800; font-family: var(--serif); }
.t-actions { text-align: right; white-space: nowrap; }
.task-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); }
.task-foot .spacer { flex: 1; }
.task-page { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 批改进行中 */
.grading-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.grading-progress { padding: 34px 30px 26px; text-align: center; }
.ring-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto 18px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line-soft); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .5s ease;
}
.ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.ring-label > span:first-child { font-family: var(--serif); font-size: 34px; font-weight: 800; }
.ring-state { font-size: 11.5px; color: var(--ok); font-weight: 600; }
.grading-tip { margin-bottom: 22px; }
.gt-title { font-family: var(--serif); font-size: 16.5px; font-weight: 700; }
.gt-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.steps {
  list-style: none; margin: 0 auto; padding: 0; display: flex; justify-content: center;
  max-width: 520px;
}
.steps li {
  flex: 1; position: relative; font-size: 12px; color: var(--muted); padding-top: 26px;
}
.steps li i {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: var(--paper-soft);
  border: 2px solid var(--line);
}
.steps li::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-soft);
}
.steps li:first-child::before { display: none; }
.steps li.done i { background: var(--ok); border-color: var(--ok); }
.steps li.done { color: var(--ok); }
.steps li.done::before, .steps li.on::before { background: var(--brand); }
.steps li.on i { border-color: var(--brand); background: var(--brand-tint); }
.steps li.on { color: var(--brand-deep); font-weight: 700; }
.grading-info { padding: 20px 22px; }
.gi-title { font-family: var(--serif); font-weight: 700; font-size: 15.5px; border-left: 3px solid var(--brand); padding-left: 9px; margin-bottom: 12px; }
.grading-info dl { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13px; }
.grading-info dt { color: var(--muted); }
.grading-info dd { margin: 0; word-break: break-all; }
.grading-info .btn { width: 100%; }

/* ---------------------------------------------------------- 报告 */
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.report-main { min-width: 0; }
.rep-tabs { display: flex; gap: 4px; padding: 12px 16px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.rep-tab {
  border: 0; background: none; cursor: pointer; font-family: var(--sans);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 9px 14px; border-radius: 10px 10px 0 0; border-bottom: 2px solid transparent;
}
.rep-tab:hover { color: var(--brand); }
.rep-tab.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.report-body { padding: 22px 26px 30px; }

.score-hero {
  display: flex; align-items: center; gap: 18px; background: var(--vermilion-tint);
  border: 1px solid #f3d8d6; border-radius: 14px; padding: 16px 22px; margin-bottom: 18px;
}
.score-num { font-family: var(--serif); font-size: 44px; font-weight: 800; color: var(--vermilion); line-height: 1; }
.score-num span { font-size: 18px; color: var(--vermilion-deep); opacity: .75; }
.score-cap { font-size: 13px; color: var(--vermilion-deep); font-weight: 600; }

.source-plain {
  font-family: var(--serif); font-size: 15px; line-height: 2; white-space: pre-wrap;
  word-break: break-word; margin: 0;
}

/* Markdown 排版（批改正文，宋体） */
.md, .rep-pane { font-family: var(--serif); font-size: 15px; line-height: 1.95; }
.rep-pane > :first-child { margin-top: 0; }
.rep-pane h2, .md h1, .md h2, .md h3 {
  font-family: var(--serif); color: var(--ink); line-height: 1.4;
  margin: 1.6em 0 .6em; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.rep-pane h2 { font-size: 18px; margin-top: 1.4em; }
.md h1 { font-size: 21px; } .md h2 { font-size: 18.5px; } .md h3 { font-size: 16.5px; }
.md strong, .rep-pane strong { color: var(--vermilion-deep); }
.md table, .rep-pane table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; line-height: 1.55; }
.md th, .md td, .rep-pane th, .rep-pane td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.md th, .rep-pane th { background: var(--paper-soft); font-weight: 700; white-space: nowrap; }
.md code, code {
  background: var(--paper-soft); border: 1px solid var(--line-soft); border-radius: 5px;
  padding: 1px 5px; font-size: 13px; font-family: ui-monospace, Consolas, "Courier New", monospace;
}
.md ul, .md ol, .rep-pane ul, .rep-pane ol { padding-left: 1.5em; }
.md li, .rep-pane li { margin: 4px 0; }
.md blockquote, .rep-pane blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--brand); background: var(--brand-tint); border-radius: 0 8px 8px 0; color: var(--ink); }

.stream-cursor { display: inline-block; width: 10px; animation: nib 1s steps(2) infinite; color: var(--brand); }
@keyframes nib { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .stream-cursor { animation: none; }
  .ring-fg { transition: none; }
}

/* 追问面板 */
.chat-panel { display: flex; flex-direction: column; height: 560px; padding: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.chat-head .spacer { flex: 1; }
.chat-clear { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: var(--sans); }
.chat-clear:hover { color: var(--brand); }
.chat-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }
.msg-user { align-self: flex-end; max-width: 86%; background: var(--brand-tint); border: 1px solid var(--line-soft); border-radius: 12px 12px 3px 12px; padding: 9px 13px; font-size: 14px; white-space: pre-wrap; }
.msg-ai { align-self: stretch; font-family: var(--serif); font-size: 14px; line-height: 1.85; }
.msg-ai .who { display: flex; align-items: center; gap: 7px; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.msg-ai .who .chip, .chat-head .chip { background: var(--brand); color: #fff; border-radius: 6px; padding: 2px 6px; font-weight: 700; font-size: 10.5px; }
.chat-foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.chat-input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  resize: none; min-height: 44px; max-height: 150px; outline: none; font-size: 13.5px;
}
.chat-input:focus { border-color: var(--brand); }
.chat-send { flex: 0 0 auto; }

/* ---------------------------------------------------------- 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(38, 48, 62, .45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 18px;
}
.overlay.open { display: flex; }
.dialog {
  background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow);
  width: min(640px, 100%); max-height: min(80vh, 700px); display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.dialog-sm { width: min(520px, 100%); }
.dialog .dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
.dialog .dlg-head .t { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.dialog .dlg-head .d { font-size: 12.5px; color: var(--muted); }
.dialog .dlg-head .close { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.dialog .dlg-head .close:hover { background: var(--paper-soft); color: var(--ink); }
.dialog .dlg-body { padding: 6px 20px 14px; overflow-y: auto; flex: 1; min-height: 0; }
.dialog .dlg-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); }
.dialog .dlg-foot .note { flex: 1; font-size: 12.5px; color: var(--muted); }

/* 创建任务弹窗 */
.mode-tabs {
  display: flex; background: var(--paper-soft); border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 3px; margin: 8px 0 14px;
}
.mode-tab {
  flex: 1; border: 0; background: none; padding: 8px 0; font-size: 13.5px; font-weight: 600;
  color: var(--muted); border-radius: 8px; cursor: pointer; font-family: var(--sans);
}
.mode-tab.on { background: #fff; color: var(--brand-deep); box-shadow: 0 1px 3px rgba(38,48,62,.12); }
.dropzone {
  border: 1.6px dashed var(--line); border-radius: 14px; min-height: 210px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); cursor: pointer; position: relative; background: var(--paper-soft);
  margin-bottom: 14px; transition: border-color .15s ease;
}
.dropzone.on, .dropzone:hover { border-color: var(--brand); background: var(--brand-tint); }
.dropzone.drag { border-color: var(--brand); background: var(--brand-tint); }
.dropzone img { max-width: 100%; max-height: 300px; border-radius: 10px; }
.dz-hint { font-size: 11.5px; opacity: .8; margin-top: 4px; }
.dz-remove {
  position: absolute; top: 10px; right: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12px;
}
.essay-input {
  width: 100%; min-height: 200px; resize: vertical; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px; outline: none; margin-bottom: 14px;
  font-family: var(--serif); font-size: 15px; line-height: 1.9;
}
.essay-input:focus { border-color: var(--brand); }
.form-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-rows .field:first-child { grid-column: 1 / -1; }

/* 用量弹窗 */
.usage-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
.usage-card { background: var(--paper-soft); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 10px; text-align: center; }
.u-num { font-family: var(--serif); font-size: 19px; font-weight: 800; color: var(--brand-deep); }
.u-label { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.mini-table th, .mini-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.mini-table th { color: var(--muted); font-size: 12px; }
.help-body p { line-height: 1.9; margin: 8px 0; }

/* ---------------------------------------------------------- Toast */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(38, 48, 62, .92); color: #fff; border-radius: 99px;
  padding: 9px 20px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: toastIn .25s ease both; max-width: min(560px, 90vw); text-align: center;
}
.toast.err { background: rgba(169, 47, 42, .95); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------- 移动端 */
@media (max-width: 1080px) {
  .report-grid { grid-template-columns: 1fr; }
  .chat-panel { height: 460px; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static; flex-direction: row;
    align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto;
  }
  .sb-brand { border-bottom: 0; padding: 0 6px 0 0; }
  .sb-brand img { width: 34px; height: 34px; }
  .sb-name { font-size: 14px; }
  .sb-sub { display: none; }
  .sb-nav { flex-direction: row; margin: 0; flex: 1; }
  .sb-item { padding: 8px 10px; white-space: nowrap; }
  .sb-foot { border-top: 0; padding: 0; flex-direction: row; align-items: center; }
  .main { padding: 16px 14px 50px; }
  .grading-grid { grid-template-columns: 1fr; }
  .form-rows { grid-template-columns: 1fr; }
  .task-table th:nth-child(3), .task-table td:nth-child(3) { display: none; }
}

/* ---------------------------------------------------------- 打印：只打印报告主区（含全部页签） */
@media print {
  body { background: #fff; }
  .sidebar, .page-actions, .backlink, .rep-tabs, .chat-panel, #toasts, .overlay, .auth-gate { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; }
  .report-grid { display: block; }
  .report-body { padding: 0; }
  .rep-pane[hidden] { display: block; }
  .score-hero { border: 1px solid #eee; }
}

/* ---------------------------------------------------------- 密码小眼睛 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--muted);
  padding: 5px; border-radius: 7px; display: flex;
}
.pwd-eye:hover { color: var(--brand); background: var(--paper-soft); }

/* ---------------------------------------------------------- 分数配色：>70% 绿 / >50% 橙 / 其余红 */
.t-score.has.score-high, .score-hero.score-high .score-num { color: var(--ok); }
.t-score.has.score-mid, .score-hero.score-mid .score-num { color: #d97b1f; }
.t-score.has.score-low, .score-hero.score-low .score-num { color: var(--vermilion); }
.score-hero.score-high { background: #e9f6ee; border-color: #cfe9d9; }
.score-hero.score-high .score-cap { color: var(--ok); }
.score-hero.score-mid { background: #fdf4e7; border-color: #f2dfc2; }
.score-hero.score-mid .score-cap { color: #b26a12; }
.score-hero.score-low { background: var(--vermilion-tint); border-color: #f3d8d6; }
.score-hero.score-low .score-num span { color: var(--vermilion-deep); }

/* 创建任务按钮固定右上角 */
.page-head { justify-content: space-between; align-items: center; }
.page-head .page-actions { margin-left: auto; }

/* ---------------------------------------------------------- 报告页头：大返回钮 + 右上操作 */
.report-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.back-big {
  font-size: 14px; font-weight: 700; padding: 11px 20px; border-radius: 12px;
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 6px 18px -8px rgba(64, 107, 224, .8);
}
.back-big:hover:not(:disabled) { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.report-headinfo { flex: 1; min-width: 200px; }
.report-headinfo h1 { font-family: var(--serif); font-size: 21px; margin: 0 0 4px; }
.score-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 0; border-radius: 14px 14px 0 0; border-bottom: 0; }
.report-main { overflow: hidden; }
.rep-tabs { border-bottom: 1px solid var(--line-soft); }
.source-img {
  display: block; max-width: min(560px, 100%); max-height: 480px; width: auto;
  border: 1px solid var(--line); border-radius: 12px; margin: 0 auto 18px;
  box-shadow: var(--shadow);
}

/* 帮助弹窗品牌区 */
.help-brand { text-align: center; padding: 6px 0 16px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.help-brand img { width: 60px; height: 60px; }
.help-brand-name { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-top: 8px; }
.help-brand-meta { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: .5px; }

/* 追问弹窗内的聊天区 */
.chat-dialog { width: min(560px, 100%); height: min(72vh, 640px); }
.chat-dialog .dlg-body.chat-panel { display: flex; flex-direction: column; padding: 12px 16px; height: auto; }
.chat-dialog .chat-list { flex: 1; padding: 4px 2px; }
