:root {
  --ink: #10233f;
  --ink-soft: #243b5a;
  --muted: #718096;
  --muted-strong: #53657d;
  --line: #e4ebf3;
  --line-strong: #d4dfeb;
  --paper: #ffffff;
  --canvas: #f3f6fa;
  --canvas-deep: #eaf0f7;
  --navy: #0b1f3a;
  --navy-soft: #153354;
  --teal: #0f766e;
  --teal-dark: #0b5d57;
  --teal-soft: #e5f7f4;
  --blue: #3157d5;
  --blue-soft: #edf1ff;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --red: #c2414d;
  --red-soft: #fff1f3;
  --green: #13805d;
  --green-soft: #eafaf4;
  --shadow-sm: 0 6px 18px rgba(18, 37, 63, .05);
  --shadow-md: 0 18px 44px rgba(18, 37, 63, .08);
  --shadow-lg: 0 30px 80px rgba(18, 37, 63, .13);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: radial-gradient(circle at 8% 0%, rgba(15, 118, 110, .09), transparent 28rem), radial-gradient(circle at 92% 12%, rgba(49, 87, 213, .07), transparent 30rem), var(--canvas);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
.hidden { display: none !important; }
::selection { color: #fff; background: var(--teal); }
.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 34px;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(212, 223, 235, .8);
  box-shadow: 0 4px 24px rgba(18, 37, 63, .04);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  box-shadow: 0 10px 24px rgba(15, 118, 110, .24);
  font-size: 20px;
  font-weight: 800;
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { color: var(--ink); font-size: 15px; letter-spacing: .01em; }
.brand-copy span { color: var(--muted); font-size: 11px; margin-top: 3px; letter-spacing: .08em; }
.topbar-center { display: flex; justify-content: center; }
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid #d6e7e4;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(229, 247, 244, .72);
  font-size: 12px;
  font-weight: 700;
}
.template-chip::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: var(--teal); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.top-actions { display: flex; justify-content: flex-end; gap: 10px; }
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 15px;
  font-weight: 750;
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--teal), #0f8b80); box-shadow: 0 8px 18px rgba(15, 118, 110, .2); }
.button.primary:hover { background: linear-gradient(135deg, var(--teal-dark), var(--teal)); box-shadow: 0 12px 24px rgba(15, 118, 110, .24); }
.button.secondary { color: var(--ink-soft); background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.button.secondary:hover { border-color: #b9c9d9; background: #fbfdff; }
.button.ghost { color: var(--muted-strong); background: transparent; border-color: transparent; }
.button.ghost:hover { color: var(--ink); background: #f1f5f9; }
.button.danger { color: var(--red); background: #fff; border-color: #f3cbd0; }
.button.danger:hover { background: var(--red-soft); }
.button-plus { font-size: 18px; font-weight: 400; line-height: .7; }
.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted-strong);
  background: #f8fafc;
  transition: .18s ease;
}
.icon-button:hover { color: var(--teal); border-color: #b9d9d4; background: var(--teal-soft); transform: rotate(18deg); }

.workspace {
  width: min(1600px, 100%);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 292px;
  gap: 18px;
  padding: 20px;
}
.panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(212, 223, 235, .82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.task-pane, .review-sidebar { min-height: 620px; padding: 20px; overflow: hidden; }
.review-pane { display: flex; flex-direction: column; min-width: 0; min-height: 620px; overflow: hidden; }
.pane-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pane-heading strong, .pane-heading span { display: block; }
.pane-heading strong { margin-top: 4px; color: var(--ink); font-size: 17px; letter-spacing: -.01em; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.task-pane-hint { margin: 16px 0 10px; color: var(--muted); font-size: 12px; }
.task-search { width: 100%; min-height: 40px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: var(--ink); outline: none; background: #f8fafc; font-size: 12px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.task-search::placeholder { color: #9aa9bb; }
.task-search:focus { border-color: #8dcac1; background: #fff; box-shadow: 0 0 0 4px rgba(15, 118, 110, .09); }
.task-list { height: calc(100% - 76px); max-height: calc(100vh - 190px); display: grid; align-content: start; gap: 9px; overflow-y: auto; padding-right: 3px; }
.task-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 11px;
  color: var(--ink);
  text-align: left;
  background: #f8fafc;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.task-item:hover { transform: translateY(-1px); border-color: #cfe0ee; background: #fff; box-shadow: var(--shadow-sm); }
.task-item.active { border-color: #b7ded8; background: linear-gradient(145deg, #f1fbf8, #f8fffd); box-shadow: 0 10px 24px rgba(15, 118, 110, .1); }
.task-item-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--teal-dark); background: var(--teal-soft); font-size: 13px; font-weight: 800; }
.task-item-copy { min-width: 0; }
.task-item-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.task-item-copy small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-status-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 99px; background: #a9b6c6; box-shadow: 0 0 0 4px rgba(169, 182, 198, .13); }
.task-status-dot.completed { background: var(--green); box-shadow: 0 0 0 4px rgba(19, 128, 93, .12); }
.task-status-dot.failed { background: var(--red); box-shadow: 0 0 0 4px rgba(194, 65, 77, .12); }
.task-status-dot.processing, .task-status-dot.queued { background: var(--amber); box-shadow: 0 0 0 4px rgba(183, 121, 31, .12); }
.task-empty { min-height: 320px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.task-empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 19px; color: var(--teal); background: var(--teal-soft); font-size: 25px; }
.task-empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.task-empty p { max-width: 190px; margin: 0; font-size: 12px; line-height: 1.7; }
.review-header { display: flex; justify-content: space-between; gap: 18px; padding: 25px 28px 18px; }
.review-header-main { min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.breadcrumb-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--teal); box-shadow: 0 0 0 4px rgba(15, 118, 110, .09); }
.breadcrumb-sep { color: #b7c3d2; }
.review-header h1 { margin: 10px 0 7px; color: var(--ink); font-size: 25px; letter-spacing: -.03em; }
.review-header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.review-header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted-strong); background: #f8fafc; font-size: 12px; font-weight: 800; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: #a9b6c6; }
.status-pill.completed, .status-pill.ready_to_publish { color: var(--green); border-color: #bfe8d8; background: var(--green-soft); }
.status-pill.completed::before, .status-pill.ready_to_publish::before { background: var(--green); }
.status-pill.failed, .status-pill.needs_review { color: var(--red); border-color: #f1c7cd; background: var(--red-soft); }
.status-pill.failed::before, .status-pill.needs_review::before { background: var(--red); }
.status-pill.processing, .status-pill.queued { color: var(--amber); border-color: #eed7a9; background: var(--amber-soft); }
.status-pill.processing::before, .status-pill.queued::before { background: var(--amber); animation: preloadPulse 1.1s ease-in-out infinite; }
@keyframes preloadPulse { 50% { opacity: .35; transform: scale(.7); } }
.panel-tabs { display: flex; gap: 4px; margin: 0 28px 18px; padding: 4px; border-radius: 14px; background: #f1f5f9; }
.tab { flex: 1; border: 0; border-radius: 10px; padding: 10px 14px; color: var(--muted); background: transparent; font-weight: 760; transition: .18s ease; }
.tab:hover { color: var(--ink-soft); }
.tab.active { color: var(--teal-dark); background: #fff; box-shadow: 0 5px 14px rgba(18, 37, 63, .08); }
.panel-content { flex: 1; min-height: 0; padding: 0 28px 28px; overflow: auto; }
.panel-content::-webkit-scrollbar, .task-list::-webkit-scrollbar { width: 8px; }
.panel-content::-webkit-scrollbar-thumb, .task-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: #cbd7e4; background-clip: padding-box; }
.empty-state { min-height: 360px; display: grid; place-content: center; justify-items: center; padding: 32px; color: var(--muted); text-align: center; }
.empty-state::before { content: '析'; width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 22px; color: var(--teal); background: var(--teal-soft); font-size: 27px; font-weight: 800; }
.empty-state h2 { margin: 0 0 8px; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.empty-state p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.8; }
.empty { color: var(--muted); text-align: center; }

.question-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.question-list { display: grid; gap: 7px; align-content: start; padding: 4px; border-radius: 15px; background: #f5f8fb; }
.question-item { border: 1px solid transparent; border-radius: 11px; padding: 10px; color: var(--ink); text-align: left; background: transparent; transition: .18s ease; }
.question-item:hover { background: #fff; }
.question-item.active { border-color: #b7ded8; background: #fff; box-shadow: 0 6px 15px rgba(18, 37, 63, .06); }
.question-item strong { display: block; font-size: 12px; }
.question-item span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.question-detail { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.question-detail h2 { margin: 7px 0 0; font-size: 19px; letter-spacing: -.02em; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.detail-box { min-height: 112px; border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: #f8fafc; }
.detail-box h4 { margin: 0 0 8px; color: var(--teal-dark); font-size: 12px; }
.detail-box p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { border: 1px solid #d9e3f6; border-radius: 999px; padding: 4px 8px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.review-summary { display: grid; gap: 10px; }
.review-card { border: 1px solid var(--line); border-radius: 15px; padding: 14px; background: #f8fafc; }
.review-card.warning { border-color: #f0d39a; background: var(--amber-soft); }
.review-card.danger { border-color: #f1c7cd; background: var(--red-soft); }
.review-card.success { border-color: #bfe8d8; background: var(--green-soft); }
.review-card strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.review-card p { margin: 0; color: var(--muted-strong); font-size: 12px; line-height: 1.7; }
.status-list { display: grid; gap: 9px; }
.status-step { display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; }
.status-step-dot { width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid var(--line-strong); border-radius: 99px; color: transparent; background: #fff; font-size: 11px; }
.status-step.done .status-step-dot { color: #fff; border-color: var(--green); background: var(--green); }
.status-step.active .status-step-dot { color: #fff; border-color: var(--amber); background: var(--amber); animation: preloadPulse 1.1s ease-in-out infinite; }
.status-step strong { display: block; color: var(--ink); font-size: 12px; }
.status-step p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.failure-panel { padding: 24px; border: 1px solid #f1c7cd; border-radius: 18px; background: var(--red-soft); }
.failure-kicker { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.failure-panel h2 { margin: 10px 0 12px; color: #8f2634; font-size: 24px; }
.failure-panel > p { color: var(--muted-strong); line-height: 1.9; }
.failure-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin: 22px 0; }
.failure-actions div { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.7); }
.failure-actions strong, .failure-actions span { display: block; }
.failure-actions span { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dialog { width: min(780px, calc(100vw - 32px)); max-height: min(880px, calc(100vh - 32px)); padding: 0; border: 1px solid rgba(212, 223, 235, .9); border-radius: 24px; color: var(--ink); background: rgba(255,255,255,.98); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(11, 31, 58, .42); backdrop-filter: blur(8px); }
.dialog-form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-header { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, #f8fffd, #f4f8ff); }
.dialog-header h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.dialog-header p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.dialog-body { display: grid; gap: 18px; padding: 22px 28px; overflow: auto; }
.form-section { display: grid; gap: 12px; padding: 0; border: 0; }
.form-section > legend { width: 100%; margin-bottom: 1px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.task-primary-fields { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .75fr); padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #f8fffd, #f5f8ff); }
.task-primary-fields > label { align-content: start; padding: 12px 14px; border: 1px solid rgba(212, 223, 235, .85); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(18, 37, 63, .04); }
.task-primary-fields > label:focus-within { border-color: #9bd3ca; box-shadow: 0 0 0 4px rgba(15, 118, 110, .08); }
.task-primary-fields input, .task-primary-fields select { min-height: 46px; }
.task-primary-fields label > small:not(.field-error) { color: var(--muted); font-size: 10px; line-height: 1.5; }
.field-label { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; color: var(--ink-soft); font-size: 12px; font-weight: 800; line-height: 1.2; }
.dialog label { display: grid; gap: 7px; color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.dialog input, .dialog select, .dialog textarea { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; color: var(--ink); outline: none; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.dialog textarea { resize: vertical; line-height: 1.6; }
.dialog input:focus, .dialog select:focus, .dialog textarea:focus { border-color: #8dcac1; box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-row { display: flex !important; align-items: center; gap: 8px !important; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-soft); background: #f8fafc; cursor: pointer; transition: .18s ease; }
.check-row:has(input:checked) { border-color: #9bd3ca; color: var(--teal-dark); background: var(--teal-soft); box-shadow: 0 5px 14px rgba(15, 118, 110, .07); }
.check-row input { width: auto; min-height: auto; accent-color: var(--teal); }
.upload-zone { position: relative; display: grid !important; grid-template-columns: 42px minmax(0, 1fr); gap: 12px !important; align-items: center; min-height: 84px; padding: 14px; border: 1px dashed #bfd1e2; border-radius: 15px; color: var(--muted-strong) !important; background: #f8fbff; cursor: pointer; transition: .18s ease; }
.upload-zone:hover { border-color: #86c8be; background: #f2fcfa; }
.upload-zone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--teal); background: var(--teal-soft); font-size: 20px; font-weight: 800; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { color: var(--ink); font-size: 13px; }
.upload-copy small { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.upload-file-name { grid-column: 2; color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px 24px; border-top: 1px solid var(--line); background: #fbfdff; }
.form-error { border: 1px solid #f2c6cc; border-radius: 12px; padding: 11px 13px; color: var(--red); background: var(--red-soft); font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 380px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px 15px; color: #fff; background: rgba(11, 31, 58, .94); box-shadow: var(--shadow-lg); font-size: 13px; animation: toastIn .22s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 1260px) { .workspace { grid-template-columns: 260px minmax(0, 1fr); } .review-sidebar { display: none; } }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  .topbar-center { display: none; }
  .workspace { grid-template-columns: 1fr; padding: 14px; }
  .task-pane { min-height: auto; }
  .task-list { max-height: 260px; height: auto; }
  .review-pane { min-height: 640px; }
  .review-header { padding: 20px 20px 15px; }
  .panel-tabs { margin: 0 20px 15px; }
  .panel-content { padding: 0 20px 20px; }
  .question-layout { grid-template-columns: 1fr; }
  .question-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .mode-options { grid-template-columns: 1fr; }
  .task-primary-fields { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .brand-copy span { display: none; }
  .top-actions .button.ghost { display: none; }
  .review-header { flex-direction: column; }
  .review-header-actions { align-items: flex-start; }
  .detail-grid, .failure-actions { grid-template-columns: 1fr; }
  .question-list { grid-template-columns: 1fr; }
}

.reference-report { color:#173b35; }
.ref-page { width:210mm; height:297mm; min-height:297mm; margin:0 auto 18px; background:#fff; padding:14mm 15mm 13mm; position:relative; overflow:hidden; page-break-after:always; box-shadow:0 10px 30px rgba(30,78,64,.08); }
.ref-page:before { content:''; position:absolute; right:-105px; top:-110px; width:230px; height:230px; border-radius:50%; background:radial-gradient(circle,#e7f8f1,#f2fbf8 58%,transparent 60%); }
.ref-page:after { content:''; position:absolute; left:-62px; bottom:-86px; width:180px; height:180px; border-radius:50%; background:linear-gradient(135deg,#e8f4ff,#effaf5); }
.ref-content { position:static; }
.ref-content > * { position:relative; z-index:1; }
.ref-content > .ref-tail { position:absolute; z-index:2; }
.ref-page h1,.ref-page h2,.ref-page h3,.ref-page p { margin-top:0; }
.ref-page h1 { font-size:29px; line-height:1.18; margin-bottom:9px; }
.ref-page h2 { font-size:22px; line-height:1.2; margin-bottom:4px; }
.ref-page h3 { font-size:14px; margin-bottom:7px; }
.ref-page p { font-size:10.5px; line-height:1.75; color:#4f675f; }
.ref-eyebrow { font-size:9.5px; font-weight:800; letter-spacing:1.8px; color:#f28d7c; margin-bottom:7px; }
.ref-subtitle { font-size:12px; color:#71857e; line-height:1.5; }
.ref-topline { display:flex; justify-content:space-between; align-items:flex-start; border-bottom:1px solid #dfeae5; padding-bottom:10px; margin-bottom:16px; }
.ref-no { font-size:9.5px; color:#9bada7; }
.ref-rule { height:3px; width:44px; background:linear-gradient(90deg,#f28d7c,#65a7f6); border-radius:10px; margin:10px 0 14px; }
.ref-hero { display:grid; grid-template-columns:1.32fr .84fr; gap:18px; }
.ref-hero-main { background:linear-gradient(145deg,#fbfefd,#f0faf6); border:1px solid #dfeae5; border-radius:20px; padding:20px; }
.ref-hero h1 { font-size:32px; }
.ref-chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:14px; }
.ref-chip { border:1px solid #dfeae5; background:#fff; border-radius:99px; padding:5px 9px; font-size:9px; color:#58736b; }
.ref-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.ref-stat { background:#fff; border:1px solid #dfeae5; border-radius:14px; padding:12px; }
.ref-stat b { display:block; font-size:22px; color:#f28d7c; line-height:1.1; }
.ref-stat span { font-size:9px; color:#71857e; } .ref-stat small { display:block; margin-top:5px; font-size:8px; color:#98aaa4; }
.ref-layout2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ref-card { background:#fff; border:1px solid #dfeae5; border-radius:17px; padding:14px; }
.ref-card h3 { color:#244f45; } .ref-hint { font-size:8.5px; color:#98aaa4; margin-bottom:8px; }
.ref-donut-row { display:flex; align-items:center; justify-content:center; gap:14px; }
.ref-donut { width:156px; height:156px; border-radius:50%; display:grid; place-items:center; }
.ref-donut>div { width:116px; height:116px; border-radius:50%; background:white; display:grid; place-items:center; align-content:center; }
.ref-donut b { font-size:25px; color:#173b35; } .ref-donut span { font-size:10px; color:#71857e; }
.ref-legend { display:flex; flex-direction:column; gap:7px; min-width:128px; }
.ref-legend div { display:flex; align-items:center; gap:7px; font-size:9.2px; color:#546c65; }
.ref-legend i { width:8px; height:8px; border-radius:50%; } .ref-legend b { margin-left:auto; font-size:9.2px; }
.ref-bar-list { display:flex; flex-direction:column; gap:11px; }
.ref-bar-row { display:grid; grid-template-columns:126px 1fr 30px; align-items:center; gap:8px; }
.ref-bar-name { font-size:9.3px; color:#48645c; } .ref-bar-name small { display:block; color:#9bada7; font-size:8px; }
.ref-track { height:8px; background:#edf4f1; border-radius:20px; overflow:hidden; } .ref-track span { display:block; height:100%; border-radius:20px; }
.ref-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:13px; }
.ref-summary-stack { grid-template-columns:1fr; }
.ref-item { border-left:3px solid #f28d7c; background:#fbfefd; border-radius:10px; padding:10px 11px; font-size:9.4px; line-height:1.6; color:#526a63; }
.ref-table { width:100%; border-collapse:separate; border-spacing:0 4px; font-size:9.1px; }
.ref-table th { text-align:left; color:#899d96; font-size:8.3px; padding:0 7px 4px; }
.ref-table td { background:#fbfefd; border-top:1px solid #eaf1ee; border-bottom:1px solid #eaf1ee; padding:6.5px 7px; color:#50675f; line-height:1.35; }
.ref-table td b { color:#285f52; } .ref-q { font-weight:800; color:#f28d7c; font-size:10px; }
.ref-diff { display:inline-block; border-radius:7px; background:#ffe5de; color:#a95949; padding:3px 6px; font-size:8.5px; font-weight:800; }
.ref-note { background:#f7fbf9; border:1px solid #dfeae5; border-radius:16px; padding:12px 14px; font-size:9.4px; color:#61766f; line-height:1.7; }
.ref-routes { display:grid; gap:9px; } .ref-route { border-radius:14px; padding:11px; background:#f9fefc; border:1px solid #dfeae5; }
.ref-route h3 { display:inline; margin-left:8px; } .ref-route p { margin:6px 0 0 32px; font-size:9.2px; }
.ref-num { display:inline-grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#f28d7c; color:#fff; font-size:10px; font-weight:800; }
.ref-footer { position:absolute; left:15mm; right:15mm; bottom:7mm; display:flex; justify-content:space-between; color:#a1b1ab; font-size:8px; }
@page { size:A4; margin:0; }
@media print { html,body { background:#fff; } .ref-page { margin:0; box-shadow:none; } }

.reference-report .ref-content { min-height: calc(297mm - 27mm); display: flex; flex-direction: column; }
.ref-page:not(:nth-child(3)) .ref-content { height: calc(297mm - 27mm); }
.ref-layout3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.ref-tail { position: absolute; left: 15mm; right: 15mm; bottom: 14mm; margin-top: 0 !important; z-index: 2; }
.ref-page:not(:nth-child(3)) .ref-content { padding-bottom: 22mm; }
@media print { .ref-page { break-after: page; } .ref-page:last-child { break-after: auto; } }

body.standalone-report { min-width: 0 !important; width: auto !important; margin: 0 !important; background: #fff !important; }
body.standalone-report .reference-report { width: 210mm; margin: 0 auto; }
body.standalone-report .ref-page { margin: 0 auto; }

.ref-answer { min-width: 92px; color:#285f52; font-weight:700; }

/* Strict institution template report */
.strict-report { width: 100%; max-width: 188mm; margin: 0 auto; padding: 3mm 0; color: #111827; font-family: "SimSun", "Songti SC", "Noto Serif CJK SC", serif; font-size: 10pt; line-height: 1.5; }
.strict-report h1, .strict-report h2, .strict-report h3, .strict-report h4, .strict-report p { margin-top: 0; }
.strict-header { position: relative; display: flex; align-items: flex-start; justify-content: center; min-height: 22mm; margin-bottom: 3mm; padding: 0 23mm 2.5mm; border-bottom: 1pt solid #111827; }
.strict-logo { position: absolute; left: 0; top: -1mm; width: 20mm; height: 20mm; display: flex; align-items: center; justify-content: center; }
.strict-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.strict-title-block { min-width: 0; text-align: center; }
.strict-brand { text-align: center; color: #374151; font-size: 9.5pt; margin-bottom: 1mm; }
.strict-header h1 { margin-bottom: 0; text-align: center; font-size: 15.5pt; line-height: 1.35; font-weight: 700; letter-spacing: .02em; }
.strict-copy { margin-bottom: 1.2mm; text-align: justify; }
.strict-numbered { margin-bottom: .8mm; }
.strict-section-start { margin-top: 2mm; }
.strict-overview { margin-bottom: 1.5mm; }
.strict-table-wrap { width: 100%; margin: .5mm 0 3mm; }
.strict-table, .strict-band-table, .strict-review-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.strict-table { font-size: 9.1pt; line-height: 1.4; }
.strict-table thead { display: table-header-group; }
.strict-table th, .strict-table td, .strict-band-table th, .strict-band-table td, .strict-review-table th, .strict-review-table td { border: .7pt solid #111827; padding: 1mm 1.25mm; vertical-align: top; text-align: left; word-break: break-word; }
.strict-table thead th { background: #f3f4f6; text-align: center; font-weight: 700; }
.strict-table tbody tr { break-inside: avoid; page-break-inside: avoid; }
.strict-merged-label { width: 7.8%; writing-mode: vertical-rl; text-orientation: mixed; vertical-align: middle !important; text-align: center !important; letter-spacing: .12em; background: #f7f7f7 !important; font-weight: 700; }
.strict-col-label { width: 7.8%; }
.strict-col-number { width: 6.2%; }
.strict-col-point { width: 21.5%; }
.strict-col-difficulty { width: 10.5%; }
.strict-col-remark { width: 54%; }
.strict-number { text-align: center !important; }
.strict-difficulty { text-align: center !important; white-space: nowrap; letter-spacing: -.03em; }
.strict-analysis { display: block; }
.strict-analysis-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 5mm; margin: 2mm 0 2.5mm; padding: 2mm 0 1.8mm; border-top: .7pt solid #cfd8e3; border-bottom: .7pt solid #cfd8e3; break-after: avoid; page-break-after: avoid; }
.strict-analysis-heading h2 { margin: .5mm 0 0; color: #10233f; font-size: 12pt; }
.strict-analysis-heading p { max-width: 95mm; margin: 0; color: #718096; font-size: 8.5pt; line-height: 1.45; text-align: right; }
.strict-analysis-kicker { color: #0f766e; font-size: 7.2pt; font-weight: 800; letter-spacing: .14em; }
.strict-band { --band: #3157d5; --band-soft: #f2f5ff; --band-line: #d7dffb; break-inside: auto; page-break-inside: auto; }
.strict-band-low { --band: #c2414d; --band-soft: #fff4f5; --band-line: #f0c9ce; }
.strict-band-middle { --band: #b7791f; --band-soft: #fff9ed; --band-line: #efd9ae; }
.strict-band-upper { --band: #3157d5; --band-soft: #f2f5ff; --band-line: #d7dffb; }
.strict-band-high { --band: #0f766e; --band-soft: #effaf7; --band-line: #c5e8e1; }
.strict-band-label { width: 20%; background: var(--band-soft) !important; border-left: 3.5pt solid var(--band) !important; vertical-align: top !important; padding: 2.2mm !important; text-align: left !important; }
.strict-band-stage { display: inline-block; margin-bottom: 1.4mm; border-radius: 99px; padding: .8mm 1.8mm; color: #fff; background: var(--band); font-size: 7.6pt; font-weight: 800; letter-spacing: .04em; }
.strict-band-name { display: block; color: var(--band); font-size: 10.8pt; line-height: 1.3; font-weight: 800; }
.strict-band-focus-label { display: block; margin-top: 2mm; color: #718096; font-size: 7.4pt; font-weight: 700; }
.strict-band-focus { display: block; margin-top: .5mm; color: #53657d; font-size: 8.2pt; line-height: 1.4; }
.strict-band-content { width: 80%; padding: 2.2mm 2.5mm !important; }
.strict-band-goal { margin-bottom: 1.8mm; padding: 1.2mm 1.8mm; border-left: 2.5pt solid var(--band); color: #243b5a; background: var(--band-soft); font-size: 8.4pt; line-height: 1.4; }
.strict-band-goal b { margin-right: 1.2mm; color: var(--band); }
.strict-band-block { margin-top: 1.8mm; }
.strict-band-block h4 { display: flex; align-items: baseline; gap: 1.3mm; margin: 0 0 .8mm; color: var(--band); font-size: 9.3pt; font-weight: 800; }
.strict-band-block h4 small { color: #718096; font-size: 7.6pt; font-weight: 500; }
.strict-block-index { width: 13px; height: 13px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 99px; color: #fff; background: var(--band); font-size: 6.5pt; line-height: 1; }
.strict-band-block p { margin: 0 0 .7mm; color: #243b5a; font-size: 8.9pt; line-height: 1.45; text-align: justify; }
.strict-loss-list { margin: 0; }
.strict-loss-item { position: relative; padding-left: 2.6mm; }
.strict-loss-item::before { content: ''; position: absolute; left: 0; top: .62em; width: 1.1mm; height: 1.1mm; border-radius: 99px; background: var(--band); }
.strict-review-section { margin-top: 3mm; }
.strict-review-table th { width: 20%; background: #f3f4f6 !important; text-align: center !important; vertical-align: middle !important; font-size: 10.5pt; }
.strict-review-table td { width: 80%; padding: 2mm 2.5mm !important; }
.strict-review-copy p { margin-bottom: 1.4mm; text-align: justify; text-indent: 2em; }
.strict-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6mm; padding-top: 3mm; border-top: 1px solid #d1d5db; }

@page { size: A4; margin: 12mm 13mm 13mm; }

@media print {
  html, body { background: #fff !important; }
  body.standalone-report { min-width: 0 !important; width: auto !important; margin: 0 !important; }
  body.standalone-report .strict-report { width: auto; max-width: none; margin: 0; padding: 0; }
  .strict-actions { display: none !important; }
  .strict-table tr,
  .strict-review-copy p { break-inside: avoid; page-break-inside: avoid; }
  .strict-band h3,
  .strict-band h4,
  .strict-review-section h2 { break-after: avoid; page-break-after: avoid; }
}

@media (max-width: 900px) {
  .strict-report { font-size: 9.6pt; }
  .strict-table { font-size: 8.8pt; }
}

.upload-zone.is-dragging { border-color: var(--teal) !important; background: var(--teal-soft) !important; box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); transform: translateY(-1px); }

.report-viewer { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.report-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.report-viewer-toolbar strong { display: block; margin-top: 4px; color: var(--ink); font-size: 15px; }
.report-viewer-actions { display: flex; gap: 9px; }
.report-pdf-frame { width: 100%; height: calc(100vh - 280px); min-height: 720px; border: 1px solid var(--line-strong); border-radius: 17px; background: #fff; box-shadow: 0 12px 30px rgba(18, 37, 63, .08); }
@media (max-width: 900px) { .report-viewer-toolbar { flex-direction: column; align-items: flex-start; } .report-pdf-frame { height: 70vh; min-height: 520px; } }

/* ==================== 交互升级（2026-10） ==================== */
:root[data-theme="dark"] {
  --ink: #e6edf6;
  --ink-soft: #c8d5e4;
  --muted: #93a4b8;
  --muted-strong: #aebbd0;
  --line: #23324a;
  --line-strong: #2d3f5a;
  --paper: #0f1726;
  --canvas: #0a1220;
  --canvas-deep: #0c1524;
  --teal-soft: #10312d;
  --blue-soft: #16233f;
  --amber-soft: #2a2313;
  --red-soft: #2b1619;
  --green-soft: #10281f;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, .4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] body { background: radial-gradient(circle at 8% 0%, rgba(15, 118, 110, .18), transparent 28rem), radial-gradient(circle at 92% 12%, rgba(49, 87, 213, .14), transparent 30rem), var(--canvas); }
:root[data-theme="dark"] .topbar { background: rgba(13, 22, 36, .9); border-bottom-color: var(--line); }
:root[data-theme="dark"] .panel { background: rgba(17, 26, 41, .92); border-color: var(--line); }
:root[data-theme="dark"] .task-search,
:root[data-theme="dark"] .task-item,
:root[data-theme="dark"] .question-list,
:root[data-theme="dark"] .panel-tabs,
:root[data-theme="dark"] .report-viewer-toolbar { background: #121d2e; }
:root[data-theme="dark"] .task-item:hover { background: #172437; }
:root[data-theme="dark"] .task-item.active { background: linear-gradient(145deg, #102a27, #122236); border-color: #1f5a52; }
:root[data-theme="dark"] .tab.active { background: #1a273b; color: #7ee0d3; }
:root[data-theme="dark"] .task-menu .menu { background: #16233a; border-color: var(--line); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { color: var(--ink); background: #121d2e; border-color: var(--line); }
:root[data-theme="dark"] .detail-box, :root[data-theme="dark"] .question-detail { background: #121d2e; border-color: var(--line); }
:root[data-theme="dark"] .chip { background: #121d2e; border-color: var(--line); }
:root[data-theme="dark"] .chip.active { background: var(--teal-soft); border-color: #1f5a52; color: #7ee0d3; }
:root[data-theme="dark"] .report-html { background: #fff; }

.pane-heading-actions { display: flex; gap: 6px; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; margin-left: 6px; padding: 0 7px; border-radius: 999px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 800; }
.filter-row { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter-row.secondary { margin-bottom: 12px; }
.chip { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; color: var(--muted-strong); background: #f8fafc; font-size: 11px; font-weight: 700; transition: .18s ease; }
.chip:hover { border-color: #bfe0da; color: var(--teal-dark); }
.chip.active { border-color: #b7ded8; color: var(--teal-dark); background: var(--teal-soft); }
.mini-select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; color: var(--muted-strong); background: #f8fafc; font-size: 11px; }
.batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid #d9e6f3; border-radius: 12px; background: #f3f8fd; font-size: 11px; color: var(--muted-strong); }

.task-item { display: flex; align-items: stretch; gap: 4px; padding: 6px; }
.task-open { flex: 1; min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; border: 0; border-radius: 11px; padding: 5px 6px; color: inherit; text-align: left; background: transparent; }
.task-open:focus-visible { outline: 2px solid #8dcac1; outline-offset: 1px; }
.task-check { flex: none; align-self: center; width: 15px; height: 15px; accent-color: var(--teal); }
.task-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.status-text { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 800; }
.status-text::before { content: ''; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.status-text.success { color: var(--green); background: var(--green-soft); }
.status-text.info { color: var(--amber); background: var(--amber-soft); }
.status-text.warn { color: var(--amber); background: var(--amber-soft); }
.status-text.danger { color: var(--red); background: var(--red-soft); }
.status-text.muted { color: var(--muted); background: #eef2f7; }
.task-time { color: var(--muted); font-size: 10px; }
.task-menu { position: relative; display: flex; align-items: flex-start; }
.task-menu > summary { list-style: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.task-menu > summary::-webkit-details-marker { display: none; }
.task-menu[open] > summary { color: var(--ink); background: #e9f0f8; }
.task-menu .menu { position: absolute; right: 0; top: 30px; z-index: 40; min-width: 132px; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); }
.task-menu .menu button { border: 0; border-radius: 8px; padding: 8px 10px; color: var(--ink-soft); background: transparent; text-align: left; font-size: 12px; }
.task-menu .menu button:hover { background: #f1f6fb; }
.task-menu .menu button.danger { color: var(--red); }

.global-error { display: flex; align-items: center; gap: 12px; margin: 10px 20px 0; padding: 10px 14px; border: 1px solid #f1c7cd; border-radius: 14px; color: #8f2432; background: var(--red-soft); font-size: 12px; }
.global-error span:first-child { flex: 1; }
.global-progress { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 11px; font-weight: 700; }
.global-progress::before { content: ''; width: 9px; height: 9px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 99px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.is-busy .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--teal), transparent); animation: slide 1.2s linear infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.question-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.question-search { flex: 1; max-width: 320px; min-height: 36px; border: 1px solid var(--line); border-radius: 11px; padding: 7px 12px; color: var(--ink); background: #f8fafc; font-size: 12px; }
.question-count { color: var(--muted); font-size: 11px; }
.question-keyhint { margin-left: auto; color: var(--muted); font-size: 10px; }
.question-list { max-height: calc(100vh - 340px); overflow-y: auto; }
.question-detail { position: sticky; top: 12px; }
.question-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.question-detail-head h2 { margin: 8px 0 0; }
.stars { color: #d99a2b; font-size: 13px; letter-spacing: 1px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.edit-grid label { display: grid; gap: 6px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.edit-grid label.full { grid-column: 1 / -1; }
.edit-grid input, .edit-grid select, .edit-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); background: #f8fafc; font-size: 12px; }
.edit-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.hint { color: var(--muted); font-size: 11px; }

.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.report-toolbar-left { display: flex; align-items: center; gap: 8px; }
.report-preview-note { color: var(--muted); font-size: 11px; font-weight: 600; }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: #eef3f9; }
.segmented button { border: 0; border-radius: 8px; padding: 6px 12px; color: var(--muted-strong); background: transparent; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--teal-dark); background: #fff; box-shadow: 0 3px 10px rgba(18, 37, 63, .08); }
.report-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.report-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.report-meta { flex: 1; min-width: 180px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.badge { border-radius: 999px; padding: 2px 9px; font-size: 10px; font-weight: 800; }
.badge.success { color: var(--green); background: var(--green-soft); }
.badge.warn { color: var(--amber); background: var(--amber-soft); }
.history-box { display: flex; align-items: center; gap: 6px; }
.history-box select { border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; color: var(--muted-strong); background: #fff; font-size: 11px; }
.report-body { border: 1px solid var(--line-strong); border-radius: 16px; background: #fff; padding: 6px; max-height: calc(100vh - 300px); overflow: auto; }
.report-body.fullscreen { position: fixed; inset: 12px; z-index: 80; max-height: none; padding: 12px; box-shadow: var(--shadow-lg); }
.report-html { padding: 6px 10px; }
.report-pdf-frame { width: 100%; height: calc(100vh - 320px); min-height: 560px; border: 0; border-radius: 12px; background: #fff; }
.button.small { padding: 6px 11px; font-size: 11px; border-radius: 9px; }
.button.danger { color: #fff; background: var(--red); border-color: var(--red); }
.button.danger:hover { background: #a93440; }

.file-list { display: grid; gap: 6px; margin-top: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; font-size: 11px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.file-size { color: var(--muted); font-size: 10px; }
.file-remove { border: 0; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: transparent; font-size: 14px; }
.file-remove:hover { color: var(--red); background: var(--red-soft); }
.advanced { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.advanced summary { display: flex; align-items: center; gap: 9px; padding: 14px 16px; color: var(--muted-strong); font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; user-select: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; color: var(--teal-dark); background: var(--teal-soft); font-size: 15px; line-height: 1; }
.advanced[open] summary { border-bottom: 1px solid var(--line); background: #fff; }
.advanced[open] summary::before { content: '−'; }

.advanced-body { display: grid; gap: 12px; margin-top: 0; padding: 14px 16px 16px; }
.advanced-body label { display: grid; gap: 6px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.advanced-body input, .advanced-body select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; color: var(--ink); background: #fff; font-size: 12px; }
.required { display: inline-flex; align-items: center; justify-content: center; margin: 0; color: var(--red); font-size: 14px; font-weight: 800; line-height: 1; }
.field-error { color: var(--red); font-size: 10px; font-weight: 600; min-height: 0; }
.dialog-hint { margin-right: auto; color: var(--muted); font-size: 10px; }
.small-dialog { max-width: 420px; }
.report-edit-dialog { width: min(1120px, calc(100vw - 32px)); }
.report-edit-section { display: grid; gap: 13px; }
.report-edit-section h3 { margin: 0; color: var(--ink); font-size: 15px; }
.report-edit-ratio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-edit-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.report-edit-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; }
.report-edit-table th, .report-edit-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.report-edit-table th { color: var(--muted-strong); background: #f8fafc; font-size: 11px; }
.report-edit-table th:nth-child(1) { width: 72px; }
.report-edit-table th:nth-child(2) { width: 170px; }
.report-edit-table th:nth-child(3) { width: 100px; }
.report-edit-table tr:last-child td { border-bottom: 0; }
.report-edit-table input, .report-edit-table select, .report-edit-table textarea { min-height: 38px; border-radius: 9px; padding: 7px 9px; font-size: 11px; }
.report-edit-band { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.report-edit-band legend { padding: 0 8px; color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.report-edit-band small { color: var(--muted); font-size: 10px; font-weight: 500; }
.undo-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; color: #fff; background: rgba(11, 31, 58, .96); box-shadow: var(--shadow-lg); font-size: 12px; }
.undo-count { color: #fbbf24; font-variant-numeric: tabular-nums; }
.undo-bar .button { color: var(--ink); background: #fff; border-color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
#toast[data-tone="error"] { background: rgba(143, 36, 50, .96); }
#toast[data-tone="success"] { background: rgba(15, 92, 69, .96); }

@media (max-width: 1260px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .review-sidebar { display: block; grid-column: 1 / -1; min-height: 0; }
  .review-sidebar .review-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; padding: 12px; }
  .review-sidebar { grid-column: auto; }
  .task-list { max-height: 280px; height: auto; }
  .question-layout { grid-template-columns: 1fr; }
  .question-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 220px; }
  .question-detail { position: static; }
  .report-body { max-height: none; }
  .report-pdf-frame { height: 70vh; min-height: 420px; }
  .report-toolbar { align-items: flex-start; }
  .dialog-hint { display: none; }
}
@media (max-width: 600px) {
  .question-list { grid-template-columns: 1fr; }
  .report-actions { width: 100%; }
  .report-actions .button { flex: 1; }
  .filter-row { flex-wrap: wrap; }
}
/* 工作台固定视口高度（桌面端内部滚动） */
@media (min-width: 901px) {
  .workspace {
    height: calc(100vh - 76px);
    min-height: 640px;
    align-items: stretch;
  }
  .task-pane, .review-pane, .review-sidebar { height: 100%; min-height: 0; }
  .task-pane { display: flex; flex-direction: column; }
  .task-list { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; }
  .review-sidebar { overflow-y: auto; }
}
:root[data-theme="dark"] .dialog { background: #111a29; border-color: var(--line); }
:root[data-theme="dark"] .dialog-header { background: linear-gradient(145deg, #10231f, #121d2e); }
:root[data-theme="dark"] .dialog-actions { background: #0f1726; }
:root[data-theme="dark"] .report-edit-table th,
:root[data-theme="dark"] .report-edit-band { background: #121d2e; }
:root[data-theme="dark"] .advanced { background: #0f1726; }
:root[data-theme="dark"] .advanced[open] summary,
:root[data-theme="dark"] .task-primary-fields > label { background: #111a29; border-color: var(--line); }
:root[data-theme="dark"] .task-primary-fields { background: linear-gradient(145deg, #0d211e, #121b2b); border-color: var(--line); }
:root[data-theme="dark"] .report-meta-row,
:root[data-theme="dark"] .file-row,
:root[data-theme="dark"] .batch-bar,
:root[data-theme="dark"] .segmented { background: #121d2e; border-color: var(--line); }
:root[data-theme="dark"] .segmented button.active { background: #1c2a40; color: #7ee0d3; }
:root[data-theme="dark"] .global-error { background: #2b1619; color: #f3b4bd; border-color: #5a2730; }
:root[data-theme="dark"] .history-box select { background: #121d2e; color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .undo-bar { background: rgba(8, 16, 28, .97); }
/* 修复：纵向 flex 下筛选/搜索等固定行被压缩 */
@media (min-width: 901px) {
  .task-pane > .pane-heading,
  .task-pane > .task-search,
  .task-pane > .filter-row,
  .task-pane > .batch-bar { flex: 0 0 auto; }
  .task-list { flex: 1 1 0; }
}
.task-pane > .task-search,
.task-pane > .filter-row,
.task-pane > .batch-bar,
.task-pane > .pane-heading { flex-shrink: 0; }
.filter-row { align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  line-height: 1.2;
  white-space: nowrap;
}
/* 选中态更明确 */
.chip.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(15, 118, 110, .22);
}
.chip.active:hover { color: #fff; background: var(--teal-dark); border-color: var(--teal-dark); }
:root[data-theme="dark"] .chip.active { color: #fff; background: #0f766e; border-color: #0f766e; }
/* 满分规则提示 */
.score-rule { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #f8fbfd; }
.score-rule span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.score-rule strong { color: var(--ink); font-size: 12px; }
.score-rule small { color: var(--muted); font-size: 10px; line-height: 1.5; }
:root[data-theme="dark"] .score-rule { background: #0f1726; border-color: var(--line); }
.batch-actions { display: flex; align-items: center; gap: 6px; }

/* 回收站 */
#trash-button { position: relative; }
#trash-button .count-badge { position: absolute; top: -5px; right: -6px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9px; line-height: 16px; }
#trash-list { display: grid; gap: 8px; align-content: start; min-height: 160px; max-height: 420px; overflow-y: auto; }
.trash-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.trash-meta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.trash-meta strong { font-size: 13px; }
.trash-meta small { color: var(--muted); font-size: 11px; }
.trash-remaining { color: var(--amber); font-size: 11px; font-weight: 700; }
:root[data-theme="dark"] .trash-item { background: #121d2e; border-color: var(--line); }
/* 登录页 + 用户信息 */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(1060px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-lg); }
.login-hero { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 54px 48px; color: #fff; background: linear-gradient(150deg, #0b2b3a 0%, #0f766e 62%, #12907f 100%); }
.brand-mark-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 30px; background: rgba(255, 255, 255, .16); color: #fff; }
.login-hero h1 { margin: 4px 0 0; font-size: 42px; letter-spacing: .1em; }
.hero-tagline { margin: 0; font-size: 15px; opacity: .92; }
.hero-points { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 13px; opacity: .95; }
.hero-points li::before { content: '✓'; margin-right: 8px; color: #a7f3d0; }
.login-card { padding: 44px 44px 32px; background: #fff; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border-radius: 12px; background: #f1f5f9; }
.auth-tabs button { border: 0; border-radius: 9px; padding: 9px; color: var(--muted); background: transparent; font-weight: 800; }
.auth-tabs button.active { color: var(--teal-dark); background: #fff; box-shadow: 0 4px 12px rgba(18, 37, 63, .08); }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.auth-form input { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 9px 12px; color: var(--ink); background: #fff; }
.auth-form input:focus { border-color: #8dcac1; box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); outline: none; }
.auth-form small { color: var(--muted); font-size: 10px; font-weight: 500; }
.auth-form .field-error { color: var(--red); font-size: 10px; font-weight: 600; }
.auth-form input[aria-invalid="true"] { border-color: #dc7b86; box-shadow: 0 0 0 3px rgba(190, 58, 75, .08); }
.auth-form .check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.auth-form .check-row input { width: auto; min-height: 0; }
.auth-submit { min-height: 44px; margin-top: 4px; }
.password-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.password-meter span { height: 4px; border-radius: 99px; background: #e5ebf3; transition: background .2s ease; }
.password-meter[data-score="1"] span:nth-child(1) { background: #d97706; }
.password-meter[data-score="2"] span:nth-child(-n+2) { background: #4b9e7f; }
.password-meter[data-score="3"] span { background: #0f766e; }
.login-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; font-size: 12px; font-weight: 700; }
.user-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12px; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="dark"] .login-shell,
:root[data-theme="dark"] .login-card { background: #111a29; border-color: var(--line); }
:root[data-theme="dark"] .auth-tabs { background: #0c1524; }
:root[data-theme="dark"] .auth-tabs button.active { background: #1a273b; color: #7ee0d3; }
:root[data-theme="dark"] .user-chip { background: #121d2e; border-color: var(--line); }
@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { padding: 30px 28px; }
  .login-hero h1 { font-size: 30px; }
  .hero-points { display: none; }
  .login-card { padding: 26px 22px; }
}