/* ThyroPADA 临床科研工作台：浅色、克制、可扫描、长期使用。 */
:root {
  color-scheme: light;

  --bg: #f5f7f4;
  --bg-soft: #eef3ef;
  --surface: #fbfcfa;
  --surface-strong: #fdfefb;
  --surface-muted: #f1f5f2;

  --text: #16211e;
  --text-soft: #465650;
  --text-muted: #6b7873;

  --primary: #0b5f59;
  --primary-hover: #084a45;
  --primary-soft: #e0efea;
  --success: #236f4d;
  --success-soft: #e5f2eb;
  --warning: #7c641f;
  --warning-soft: #f3edd6;
  --danger: #a43b35;
  --danger-soft: #f5e6e3;

  --line: #d9e2dd;
  --line-strong: #bac8c2;
  --focus: rgba(11, 95, 89, 0.18);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.page-backdrop {
  display: none;
}

a {
  color: var(--primary);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: var(--space-2);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: 0;
}

h2 {
  margin-bottom: var(--space-3);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 660;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0;
}

code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--primary-hover);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.hidden {
  display: none !important;
}

/* ===== Page frame ===== */
.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  max-width: 1220px;
  margin: 0 auto;
  padding: 26px 32px 14px;
}

.site-header.compact {
  padding-top: 20px;
}

.brand-lockup {
  max-width: 760px;
}

.brand-lockup::before {
  display: none;
}

.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-copy,
.hero-text {
  margin-bottom: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.page-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: var(--space-4) 32px 56px;
}

.page-shell > .panel + .panel,
.page-shell > .hidden + .panel,
.page-shell > .panel + .hidden,
.page-shell > #body-after-auth > .panel + .panel {
  margin-top: var(--space-4);
}

.panel {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.panel-head h2 {
  margin-bottom: 0;
}

.save-status {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.save-status-detail {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.header-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-weight: 580;
}

.nav-link:hover {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--primary-hover);
}

/* ===== Forms ===== */
.form-grid {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 620;
}

.field input,
.field textarea,
.field select,
.pending-row select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.pending-row select:hover {
  border-color: #95a7a0;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.pending-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #879590;
}

.check-field {
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.check-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.check-field span {
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-weight: 620;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
}

.btn:hover {
  border-color: #95a7a0;
  background: var(--surface-muted);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #f8fbf9;
}

.btn-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: #f8fbf9;
}

.btn-danger {
  border-color: #d3aaa5;
  background: var(--danger-soft);
  color: #842b27;
}

.btn-danger:hover {
  border-color: #bd7f78;
  background: #efd6d2;
}

/* ===== Feedback / status ===== */
.feedback {
  margin: 0;
  min-height: 1.4em;
  color: var(--danger);
  font-size: 13px;
}

.feedback[data-kind="success"] {
  color: var(--success);
}

.chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  vertical-align: middle;
}

h2 .chip {
  margin-left: var(--space-2);
}

.chip-success {
  border-color: #b7d5c4;
  background: var(--success-soft);
  color: #1d6042;
}

.chip-muted {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.chip-danger {
  border-color: #e1b6b0;
  background: var(--danger-soft);
  color: #842b27;
}

.chip-warning {
  border-color: #d8c885;
  background: var(--warning-soft);
  color: #675116;
}

/* ===== Auth pages ===== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 20px;
}

.auth-panel {
  width: min(100%, 420px);
  max-width: 420px;
}

.auth-panel::after {
  display: none;
}

.auth-title {
  margin: 0 0 var(--space-2);
  font-size: 26px;
}

.auth-foot {
  margin: var(--space-5) 0 0;
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

/* ===== Home / task cards ===== */
.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.tasks-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.task-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  transition: border-color 120ms ease, background 120ms ease;
}

.task-card:hover {
  border-color: var(--line-strong);
  background: #fcfdfb;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.task-card h3 {
  margin: 0;
  font-size: 17px;
}

.task-progress-summary {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.task-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 12px;
}

.task-progress-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 680;
}

.task-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #dfe7e3;
}

.task-progress-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 160ms ease-out;
}

.task-progress-action {
  display: flex;
  justify-content: flex-end;
}

.task-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.task-card-batched {
  min-height: 0;
}

.batch-list {
  display: grid;
  gap: var(--space-2);
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.batch-row-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.batch-row-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.batch-row-title strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.batch-actions {
  justify-content: flex-end;
}

.history-subtext {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.metric-stack {
  display: grid;
  gap: 6px;
}

.metric-stack div {
  display: grid;
  gap: 2px;
}

.metric-stack span {
  color: var(--text-muted);
  font-size: 12px;
}

.metric-stack strong {
  font-size: 14px;
  font-weight: 640;
}

/* ===== Tables ===== */
#history-root,
#users-root,
#attempts-root {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.history-table th,
.history-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.history-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  background: var(--surface-muted);
}

.history-table .chip,
.history-table button[data-attempt-detail],
.person-card-body .history-table td:last-child,
.person-card-body .history-table td:nth-child(2) {
  white-space: nowrap;
}

.attempt-detail-table th,
.attempt-detail-table td {
  white-space: nowrap;
}

.attempt-detail-table td:nth-last-child(3) {
  white-space: normal;
  min-width: 170px;
  max-width: 280px;
  overflow-wrap: anywhere;
}

.history-table tr:hover td {
  background: #f9fbf9;
}

.attempt-detail-row > td {
  padding: 14px;
  background: var(--surface);
}

.attempt-detail {
  display: grid;
  gap: var(--space-3);
}

.attempt-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: var(--space-2);
}

.attempt-metrics div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.attempt-metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.attempt-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.25;
}

.auc-curve-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.auc-curve-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.auc-curve-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.auc-curve {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  color: var(--primary);
  overflow: visible;
}

.auc-curve line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.auc-grid line {
  stroke: var(--line);
  stroke-dasharray: 4 5;
}

.auc-grid text,
.auc-axis-label {
  fill: var(--text-muted);
  font-size: 11px;
}

.auc-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-auc-line 700ms ease-out forwards;
}

.auc-point {
  fill: var(--surface-strong);
  stroke: currentColor;
  stroke-width: 2;
}

.auc-empty {
  display: grid;
  min-height: 110px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
}

.attempt-detail-table {
  min-width: 980px;
  background: var(--surface-strong);
}

.attempt-thumb {
  display: block;
  width: 64px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #111b19;
  object-fit: cover;
}

/* ===== Author task page ===== */
.upload-zone {
  margin: var(--space-4) 0;
  padding: 24px 18px;
  border: 1px dashed #9dafaa;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  text-align: center;
  transition: background 120ms ease, border-color 120ms ease;
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.pending-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.pending-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.pending-row img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #111b19;
}

.pending-thumb {
  display: grid;
  width: 80px;
  height: 80px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #111b19;
  color: var(--muted);
  font-size: 13px;
}

.pending-row-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.pending-row-body strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.question-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.question-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #111b19;
}

.question-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

/* ===== Quiz layout ===== */
.quiz-shell {
  display: grid;
  grid-template-columns: minmax(280px, 318px) minmax(0, 1fr);
  gap: var(--space-4);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px 56px;
}

.quiz-sidebar {
  position: sticky;
  top: 16px;
  height: fit-content;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.summary-grid.quiz-metrics {
  grid-template-columns: 1fr 1fr;
  margin-bottom: var(--space-4);
}

.summary-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.summary-card strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.progress-block {
  margin-bottom: var(--space-4);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #dfe7e3;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 160ms ease-out;
}

.nav-block .nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.nav-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.question-nav,
.nav-group {
  display: grid;
  gap: var(--space-3);
}

.nav-group {
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.nav-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-group-title strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.nav-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}

.nav-empty {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.nav-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nav-pill:hover {
  border-color: var(--primary);
  color: var(--primary-hover);
}

.nav-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #f8fbf9;
}

.nav-pill.answered {
  border-color: #b7d5c4;
  background: var(--success-soft);
  color: #1d6042;
}

.nav-pill.reviewed {
  border-color: #d8c885;
  background: var(--warning-soft);
  color: #675116;
}

.nav-pill.unanswered-alert {
  border-color: #e07a7a;
  background: #fdeeee;
  color: #8f1f1f;
  box-shadow: 0 0 0 1px rgba(224, 122, 122, 0.35);
}

.nav-pill.active.unanswered-alert {
  border-color: #c94a4a;
  background: #e85d5d;
  color: #fff;
}

.nav-pill.active.answered,
.nav-pill.active.reviewed {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: #f8fbf9;
}

.question-nav-help {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.case-panel {
  position: relative;
  overflow: hidden;
}

.network-state {
  margin: -4px 0 var(--space-4);
  padding: 9px 11px;
  border: 1px solid #d9a7a3;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: #842b27;
  font-size: 13px;
}

.case-panel::before {
  display: none;
}

.case-panel .case-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.feedback-summary {
  margin-bottom: var(--space-4);
}

.feedback-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 900px) {
  .feedback-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.review-toggle.is-on {
  border-color: #d8c885;
  background: var(--warning-soft);
  color: #675116;
}

.case-meta-grid {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.meta-card {
  min-width: 128px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.meta-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.meta-card strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.image-grid {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.image-grid.single {
  grid-template-columns: 1fr;
}

.image-stage {
  position: relative;
}

.image-tile {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #263634;
  border-radius: var(--radius-lg);
  background: #101917;
  cursor: zoom-in;
}

.image-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #101917;
  color: #e8eeeb;
  text-align: center;
}

.image-error p {
  margin: 0;
  color: #d5ddd9;
  font-size: 14px;
}

.image-error .actions {
  justify-content: center;
}

.image-tile img {
  display: block;
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
}

.image-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  margin: 0;
  border-radius: var(--radius-lg);
  background: rgba(16, 25, 23, 0.72);
  color: #d5ddd9;
  font-size: 14px;
  font-weight: 620;
  pointer-events: none;
}

.image-feedback-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}

.image-feedback-btn {
  min-height: 36px;
  padding: 0 var(--space-4);
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
}

.image-feedback-btn.is-on[data-value="unclear"] {
  border-color: #c9b56a;
  background: var(--warning-soft);
  color: #675116;
}

.image-feedback-btn.is-on[data-value="incorrect"] {
  border-color: #d9a7a3;
  background: var(--danger-soft);
  color: #8a332e;
}

.answer-block {
  margin-bottom: var(--space-4);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.shortcut-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.option-pill {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font-weight: 620;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.option-pill:hover {
  border-color: var(--primary);
}

.option-pill input {
  display: none;
}

.option-pill.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.scale-option {
  flex: 1 1 150px;
  justify-content: flex-start;
  min-width: 0;
}

.option-key {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.option-pill.selected .option-key {
  border-color: var(--primary);
  background: var(--primary);
  color: #f8fbf9;
}

.note-field {
  margin-bottom: var(--space-4);
}

.action-dock {
  position: sticky;
  bottom: 12px;
  z-index: 6;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.intro-list {
  margin: 0 0 var(--space-4);
  padding-left: 1.2em;
  color: var(--text-soft);
  font-size: 14px;
}

.intro-list li + li {
  margin-top: 6px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-3);
  padding: 18px;
  background: rgba(11, 19, 17, 0.9);
}

.lightbox-stage {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.lightbox-stage.is-draggable {
  cursor: move;
}

.lightbox-stage img {
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
  will-change: transform;
}

.lightbox-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
  pointer-events: none;
}

.lightbox-tool,
.lightbox-close {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fbf9;
  cursor: pointer;
  pointer-events: auto;
  font: inherit;
  font-weight: 620;
}

.lightbox-tool:hover,
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Admin tabs / modal / filter ===== */
.tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.admin-view-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.admin-view-toggle .tab {
  min-height: 32px;
  padding: 5px 10px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
}

.admin-view-toggle .tab.active {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.tab {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text-soft);
  font: inherit;
  font-weight: 620;
  cursor: pointer;
}

.tab:hover {
  border-color: var(--primary);
  color: var(--primary-hover);
}

.tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.filter-grid .actions {
  display: flex;
  gap: var(--space-2);
}

.summary-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-head {
  margin-bottom: 10px;
}

.summary-table {
  min-width: 980px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 31, 28, 0.46);
}

body.profile-gate-active {
  overflow: hidden;
}

.modal-card {
  width: 100%;
  max-width: 520px;
}

.submit-review-card {
  max-width: 720px;
  max-height: min(720px, 90vh);
  overflow: auto;
}

.submit-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.submit-review-list {
  display: grid;
  gap: var(--space-4);
}

.submit-review-section {
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.submit-review-section h3 {
  margin-bottom: var(--space-2);
}

.submit-review-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* ===== Result page ===== */
.result-completion-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border: 1px solid #b7d5c4;
  border-radius: var(--radius-md);
  background: var(--success-soft);
}

.result-completion-banner h2 {
  margin-bottom: var(--space-2);
  color: #1d6042;
}

.result-actions {
  justify-content: flex-end;
  flex-shrink: 0;
}

.result-completion-banner > .feedback {
  flex-basis: 100%;
}

.result-summary {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: 4px 0;
}

.big-score {
  display: flex;
  min-width: 170px;
  flex-direction: column;
  align-items: flex-start;
}

.big-score strong {
  color: var(--primary-hover);
  font-size: 52px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.big-score span {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.result-summary .summary-grid {
  flex: 1;
  min-width: 280px;
}

.result-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.result-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.result-img {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #111b19;
  cursor: zoom-in;
}

.result-img img {
  display: block;
  width: 180px;
  height: 130px;
  object-fit: cover;
}

.result-row-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.result-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.result-row-head .eyebrow {
  margin-bottom: 0;
}

.row-line {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  margin: 0;
}

.row-line span {
  min-width: 80px;
  color: var(--text-muted);
  font-size: 13px;
}

.row-line strong {
  font-size: 15px;
}

.row-note {
  margin: var(--space-1) 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

@media (max-width: 1000px) {
  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .quiz-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-header.compact {
    align-items: flex-start;
    padding: 22px 18px 10px;
    flex-direction: column;
  }

  .page-shell,
  .quiz-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .panel {
    padding: 18px;
  }

  .auth-shell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 32px;
  }

  .auth-panel {
    width: calc(100vw - 32px);
    max-width: none;
  }

  .btn,
  .tab,
  .nav-link {
    min-height: 44px;
  }

  .field input,
  .field textarea,
  .field select,
  .pending-row select {
    min-height: 44px;
  }

  .nav-pill {
    min-height: 40px;
  }

  .panel-head,
  .case-panel .case-head,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .save-status {
    justify-items: start;
    text-align: left;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .pending-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .pending-row img {
    width: 64px;
    height: 64px;
  }

  .pending-row .btn {
    grid-column: 1 / -1;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .result-completion-banner {
    flex-direction: column;
  }

  .result-actions {
    justify-content: flex-start;
  }

  .result-img img {
    width: 100%;
    height: 180px;
  }

  .row-line {
    flex-direction: column;
    gap: 2px;
  }

  .action-dock {
    position: sticky;
    bottom: 0;
    margin: var(--space-4) -18px 0;
    padding: 10px 18px 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .quiz-main {
    order: 1;
  }

  .quiz-sidebar {
    order: 2;
  }

  .batch-row {
    grid-template-columns: 1fr;
  }

  .batch-actions {
    justify-content: flex-start;
  }

  .task-progress-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .attempt-metrics {
    grid-template-columns: repeat(2, minmax(132px, 150px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes draw-auc-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* ===== 密码显隐、灯箱倍率与题库存储工具条 ===== */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-wrap input {
  padding-right: 64px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  min-height: 30px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pw-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lightbox {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
}

.lightbox-scale {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-right: auto;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fbf9;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lightbox-caption {
  margin: 0 auto;
  max-width: min(92vw, 760px);
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.82);
  color: #f4f3ef;
  font-size: 12.5px;
  text-align: center;
}

.question-storage-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.questions-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.pager-info {
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.q-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.q-card-meta .eyebrow {
  margin: 0;
}

.sha-chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font: 600 11px/1.4 "Cascadia Mono", Consolas, monospace;
  cursor: pointer;
}

.sha-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .field input,
  .field textarea,
  .field select,
  .pending-row select {
    font-size: 16px;
  }

  .lightbox-tool,
  .lightbox-close {
    min-height: 44px;
    padding: 8px 11px;
    font-size: 13px;
  }
}

/* ===== Admin 按人聚合与多维走势图表 ===== */
.admin-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cohort-charts-grid,
.user-charts-grid,
.detail-curves-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.chart-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.chart-sub {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.chart-legend-item i {
  display: inline-block;
  width: 14px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--primary);
}

.chart-legend-item.is-dashed i {
  height: 0;
  border-top: 2px dashed #6b7280;
  background: none;
}

.chart-legend-item.series-ai i { background: #2545c7; }
.chart-legend-item.series-amber i { background: #b7791f; }
.chart-legend-item.series-good i { background: #257a54; }
.chart-legend-item.series-bad i { background: #ad3f3a; }
.chart-legend-item.series-peer-0 i { background: #64748b; }
.chart-legend-item.series-peer-1 i { background: #0f766e; }
.chart-legend-item.series-peer-2 i { background: #9333ea; }
.chart-legend-item.series-peer-3 i { background: #b45309; }

.chart-svg-wrap {
  width: 100%;
  overflow: hidden;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-grid line {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}

.chart-grid text,
.chart-x-label,
.chart-ref text {
  fill: var(--text-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.chart-ref line {
  stroke: #b9c2be;
  stroke-dasharray: 5 4;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: var(--primary);
  opacity: 0.08;
}

.chart-point {
  fill: var(--surface-strong);
  stroke: var(--primary);
  stroke-width: 2;
  cursor: pointer;
  transition: r 120ms ease;
}

.chart-point:hover {
  r: 5.5;
}

.chart-series.is-dashed .chart-line {
  stroke: #6b7280;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.chart-series.is-dashed .chart-point {
  stroke: #6b7280;
}

.chart-series.series-ai .chart-line,
.chart-series.series-ai .chart-point { stroke: #2545c7; }
.chart-series.series-ai .chart-area { fill: #2545c7; }

.chart-series.series-amber .chart-line,
.chart-series.series-amber .chart-point { stroke: #b7791f; }
.chart-series.series-amber .chart-area { fill: #b7791f; }

.chart-series.series-peer-0 .chart-line,
.chart-series.series-peer-0 .chart-point { stroke: #64748b; stroke-width: 1.4; opacity: 0.65; }
.chart-series.series-peer-1 .chart-line,
.chart-series.series-peer-1 .chart-point { stroke: #0f766e; stroke-width: 1.4; opacity: 0.65; }
.chart-series.series-peer-2 .chart-line,
.chart-series.series-peer-2 .chart-point { stroke: #7c3aed; stroke-width: 1.4; opacity: 0.55; }
.chart-series.series-peer-3 .chart-line,
.chart-series.series-peer-3 .chart-point { stroke: #b45309; stroke-width: 1.4; opacity: 0.55; }

.chart-hover-readout {
  margin: 6px 0 0;
  min-height: 18px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* 受试者对比条形图 */
.reader-bars-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}

.reader-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 140px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.reader-bar-row:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
}

.reader-bar-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-bar-tracks {
  display: grid;
  gap: 4px;
}

.reader-track-volume,
.reader-track-acc {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.reader-track-volume > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.reader-track-acc > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #257a54;
}

.reader-bar-nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.reader-bar-nums span {
  color: var(--text-muted);
}

/* AI 改判正负柱状条 */
.ai-shift-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
  padding-top: 8px;
  overflow-x: auto;
}

.ai-shift-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 34px;
  height: 100%;
}

.ai-shift-track {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  width: 100%;
  justify-content: center;
}

.shift-bar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 13px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.shift-bar.is-good { background: #257a54; }
.shift-bar.is-bad { background: #ad3f3a; }

.ai-shift-label {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* 按人聚合卡片 */
.person-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.person-attempts-list {
  display: grid;
  gap: 12px;
}

.person-attempt-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  overflow: hidden;
}

.person-attempt-card.is-open {
  border-color: var(--primary);
}

.person-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(280px, 2fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.person-identity {
  min-width: 0;
}

.person-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.person-name-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.person-submeta {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.person-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.person-progress-row .progress-bar {
  flex: 1;
  max-width: 180px;
  height: 6px;
}

.person-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.person-metric {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.person-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.person-metric strong {
  display: block;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.person-metric small.delta-tag {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.delta-tag.is-up,
.sparkline-delta.is-up { color: #257a54; }
.delta-tag.is-down,
.sparkline-delta.is-down { color: #ad3f3a; }

.person-spark-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.spark-label {
  color: var(--text-muted);
  font-size: 11px;
}

.sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sparkline-svg {
  width: 112px;
  height: 30px;
  overflow: visible;
}

.sparkline-ref {
  stroke: var(--line);
  stroke-dasharray: 2 3;
}

.sparkline-pre {
  fill: none;
  stroke: #8a9490;
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
}

.sparkline-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-dot {
  fill: var(--surface-strong);
  stroke: var(--primary);
  stroke-width: 1.5;
}

.sparkline-delta,
.sparkline-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.person-card-body {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 16px;
}

.person-batches-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.person-batches-head h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.shift-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shift-pill.is-good {
  background: #e6f4ec;
  color: #1f6a47;
}

.shift-pill.is-bad {
  background: #fbeaea;
  color: #9e322e;
}

.auc-curve-secondary {
  color: #257a54;
}

.auc-time-line {
  fill: none;
  stroke: #b7791f;
  stroke-width: 1.5;
  opacity: 0.72;
}

@media (max-width: 600px) {
  .chart-grid text,
  .chart-x-label,
  .chart-ref text {
    font-size: 14px;
  }
}

@media (max-width: 1080px) {
  .person-card-head {
    grid-template-columns: 1fr;
  }

  .person-spark-col {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 860px) {
  .cohort-charts-grid,
  .user-charts-grid,
  .detail-curves-grid {
    grid-template-columns: 1fr;
  }

  .person-metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .reader-bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reader-bar-tracks {
    grid-column: 1 / -1;
    order: 3;
  }
}

/* ----- 人机决策四象限矩阵 & 管理端缩略图点击放大 ----- */
.decision-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.decision-quad {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.decision-quad.quad-good {
  border-color: #b7d8c5;
  background: #f2f9f5;
}

.decision-quad.quad-steady {
  border-color: #b8d3d0;
  background: #f2f8f7;
}

.decision-quad.quad-bad {
  border-color: #e2b8b6;
  background: #fdf4f4;
}

.decision-quad.quad-missed {
  border-color: #e2cf9e;
  background: #fcf8ec;
}

.quad-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.quad-top span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

.quad-top strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.quad-bar {
  height: 7px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: rgba(20, 26, 24, 0.08);
  overflow: hidden;
}

.quad-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.quad-good .quad-bar > i { background: #1f6a47; }
.quad-steady .quad-bar > i { background: #1c6b63; }
.quad-bad .quad-bar > i { background: #b43934; }
.quad-missed .quad-bar > i { background: #b7791f; }

.quad-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.matrix-summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.matrix-summary-pill.is-good {
  background: #e6f4ec;
  color: #1f6a47;
}

.matrix-summary-pill.is-bad {
  background: #fbeaea;
  color: #9e322e;
}

.attempt-thumb-btn {
  display: inline-flex;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  cursor: zoom-in;
  overflow: hidden;
  transition: transform 120ms ease, border-color 120ms ease;
}

.attempt-thumb-btn:hover {
  border-color: var(--primary);
  transform: scale(1.04);
}

.attempt-thumb-btn .attempt-thumb {
  display: block;
}

.reason-cell {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  font-size: 12.5px;
  color: var(--text-soft);
}

@media (max-width: 680px) {
  .decision-matrix-grid {
    grid-template-columns: 1fr;
  }
}
