:root {
  color-scheme: dark;
  --bg: #111214;
  --surface: #1c1c1e;
  --surface-2: #242426;
  --surface-3: #2c2c2e;
  --line: #3a3a3c;
  --line-strong: #48484a;
  --ink: #f5f5f7;
  --muted: #98989d;
  --muted-2: #c7c7cc;
  --blue: #0a84ff;
  --blue-dark: #0b477a;
  --green: #63e681;
  --amber: #ffd60a;
  --red: #ff6961;
  --radius: 7px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .48;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.35;
}

h3 {
  font-size: 14px;
  line-height: 1.4;
}

.eyebrow {
  color: var(--muted);
  font: 700 9px/1.3 Consolas, "Microsoft YaHei", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #18191b;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

.login-view {
  display: grid;
  min-height: calc(100vh - 69px);
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.login-panel p,
.empty-detail p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted-2);
  font-size: 10px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  background: var(--surface-2);
}

input,
select {
  padding: 6px 9px;
}

textarea {
  min-height: 92px;
  padding: 8px 9px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

.button,
.icon-button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-3);
}

.button {
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 650;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
}

.button.danger {
  border-color: #8b3431;
  background: #321f20;
  color: #ffb4af;
}

.button.subtle {
  background: transparent;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: #636366;
  background: #3a3a3c;
}

.icon-button {
  width: 30px;
  padding: 0;
  font-size: 17px;
}

.inline-error {
  padding: 8px 10px;
  border-left: 3px solid var(--red);
  color: #ffb4af;
  background: #321f20;
  font-size: 11px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  min-height: calc(100vh - 69px);
}

.report-sidebar {
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  overflow: auto;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #17181a;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sidebar-head,
.section-head,
.batch-title-row,
.review-card-head,
.trajectory-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  margin-top: 14px;
}

.student-admin {
  margin-top: 8px;
}

.student-admin .button {
  width: 100%;
}

.list-more {
  width: 100%;
  margin-top: 8px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

.summary-strip > div {
  min-width: 0;
  padding: 7px 6px;
  background: var(--surface);
}

.summary-strip span,
.metric span,
.overview-metric span,
.radar-legend span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.summary-strip strong {
  display: block;
  margin-top: 2px;
  font: 700 13px/1.2 Consolas, monospace;
}

.report-list {
  display: grid;
  gap: 6px;
}

.report-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  background: var(--surface);
}

.report-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.report-row[aria-current="true"] {
  border-color: var(--blue);
  background: var(--blue-dark);
}

.report-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.report-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row code {
  color: #8dc5ff;
  font: 600 9px/1.2 Consolas, monospace;
}

.report-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted-2);
  background: var(--surface-3);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.pending {
  border-color: #6b5d1a;
  color: #ffe27a;
  background: #2c2712;
}

.badge.reviewed,
.badge.pass {
  border-color: #285f36;
  color: #a7f3b6;
  background: #17291c;
}

.badge.suspect {
  border-color: #8b3431;
  color: #ffb4af;
  background: #321f20;
}

.detail-column {
  min-width: 0;
  padding: 16px;
}

.empty-detail,
.loading-panel {
  max-width: 520px;
  margin: 48px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workflow-section {
  margin-bottom: 12px;
  scroll-margin-top: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

#detail-view {
  scroll-margin-top: 82px;
}

.section-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.section-index {
  color: #8dc5ff;
  font: 700 22px/1 Consolas, monospace;
}

.section-head-copy {
  flex: 1;
  min-width: 0;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.section-body {
  padding: 14px;
}

.batch-title-row {
  align-items: center;
}

.batch-title-row h2 {
  margin-top: 0;
  font-size: 19px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

.overview-metric {
  min-width: 0;
  padding: 9px;
  background: var(--surface-2);
}

.overview-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-strip {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.report-sections {
  display: grid;
  gap: 7px;
}

.report-entry {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.report-entry summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.report-entry summary::-webkit-details-marker {
  display: none;
}

.report-entry-number {
  color: #8dc5ff;
  font: 700 10px/1 Consolas, monospace;
}

.report-entry-title {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-entry-hint {
  color: var(--muted);
  font: 9px/1 Consolas, monospace;
}

.report-entry-body {
  padding: 0 12px 12px 54px;
  color: var(--muted-2);
  font-size: 11px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.data-table th,
.data-table td {
  padding: 6px 7px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--muted-2);
  background: var(--surface-3);
  font-weight: 650;
}

.definition-grid {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 5px 10px;
}

.definition-grid dt {
  color: var(--muted);
}

.definition-grid dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.markdown-block {
  color: var(--muted-2);
}

.markdown-block h3,
.markdown-block h4,
.markdown-block h5 {
  margin: 12px 0 5px;
  color: var(--ink);
}

.markdown-block p,
.markdown-block ul,
.markdown-block ol {
  margin: 5px 0;
}

.markdown-block ul,
.markdown-block ol {
  padding-left: 20px;
}

.markdown-block code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--surface-3);
  font-family: Consolas, monospace;
}

.ability-layout {
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(0, 1.08fr);
  gap: 14px;
}

.radar-panel,
.ability-table-panel,
.assistance-panel,
.trajectory-panel,
.review-card,
.comment-panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.radar-panel {
  padding: 8px;
}

.radar-svg {
  display: block;
  width: 100%;
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: #3f4146;
  stroke-width: 1;
}

.radar-axis {
  stroke: #34363a;
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(10, 132, 255, .22);
  stroke: var(--blue);
  stroke-width: 2;
}

.radar-dot {
  fill: var(--blue);
}

.radar-label {
  fill: var(--muted-2);
  font-size: 9px;
}

.radar-label-rate {
  fill: #8dc5ff;
  font: 700 9px/1 Consolas, monospace;
}

.ability-table-panel {
  overflow: hidden;
}

.ability-table-panel .data-table th:first-child,
.ability-table-panel .data-table td:first-child {
  width: 48%;
}

.ladder-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.section-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 7px;
}

.section-subhead:first-child {
  margin-top: 0;
}

.step-list {
  display: grid;
  gap: 6px;
}

.step-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 110px;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.step-card[data-assisted="true"] {
  border-left: 3px solid var(--amber);
}

.step-id {
  color: #8dc5ff;
  font: 700 11px/1.3 Consolas, monospace;
}

.step-main {
  min-width: 0;
}

.step-main h4 {
  font-size: 11px;
}

.step-main p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.failed-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.failed-items .badge {
  border-radius: 4px;
}

.step-score {
  text-align: right;
}

.step-score strong {
  font: 700 14px/1.2 Consolas, monospace;
}

.step-score span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.assistance-panel {
  margin-top: 10px;
  padding: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.metric strong {
  display: block;
  margin-top: 2px;
}

.trajectory-panel {
  padding: 11px;
}

.trajectory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-card {
  padding: 10px;
}

.review-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.answer-box {
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-2);
  background: var(--surface);
  font-size: 10px;
  white-space: pre-wrap;
}

.review-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  margin-top: 8px;
}

.comment-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.comment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-footer span {
  color: var(--muted);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 16px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-3);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  font-size: 11px;
}

.toast.error {
  border-color: #8b3431;
  color: #ffb4af;
}

html.quality-lowfx * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.quality-lowfx .app-header,
html.quality-lowfx .report-sidebar,
html.quality-lowfx .workflow-section,
html.quality-lowfx .report-entry,
html.quality-lowfx .radar-panel,
html.quality-lowfx .ability-table-panel,
html.quality-lowfx .assistance-panel,
html.quality-lowfx .trajectory-panel,
html.quality-lowfx .review-card,
html.quality-lowfx .comment-panel,
html.quality-lowfx .toast {
  box-shadow: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

html.quality-lowfx .radar-shape {
  fill: rgba(10, 132, 255, .14);
}

html.quality-lowfx .radar-dot {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 266px minmax(0, 1fr);
  }

  .overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ability-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-header {
    padding: 10px 12px;
  }

  .app-header h1 {
    font-size: 17px;
  }

  .workspace {
    display: block;
  }

  .report-sidebar {
    position: static;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .detail-column {
    padding: 10px;
  }

  .overview-grid,
  .metric-grid,
  .trajectory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ability-layout,
  .review-answer-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .step-score {
    grid-column: 2;
    text-align: left;
  }

  .review-actions {
    grid-template-columns: 1fr 1fr;
  }

  .review-actions textarea {
    grid-column: 1 / -1;
  }

  .section-head {
    padding: 10px;
  }

  .section-body {
    padding: 10px;
  }

  .report-entry summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .report-entry-hint {
    display: none;
  }

  .report-entry-body {
    padding-left: 48px;
  }

  .definition-grid {
    grid-template-columns: 1fr;
  }
}

html.quality-medium .toast,
html.quality-medium .report-row,
html.quality-medium .workflow-section {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition-duration: 120ms;
}

html.quality-lowfx *,
html.quality-lowfx *::before,
html.quality-lowfx *::after {
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
}

html.quality-lowfx .toast,
html.quality-lowfx .report-row,
html.quality-lowfx .workflow-section,
html.quality-lowfx .answer-box,
html.quality-lowfx .metric,
html.quality-lowfx .review-card {
  box-shadow: none !important;
  filter: none !important;
}

html.quality-lowfx .radar-dot {
  display: inline;
}
