:root {
  --page: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --ink: #17211d;
  --ink-soft: #5d6964;
  --line: #dce3df;
  --line-strong: #c8d2cd;
  --primary: #1f5f4a;
  --primary-strong: #174a3a;
  --primary-soft: #e7f2ed;
  --accent: #93691d;
  --accent-soft: #fff5da;
  --danger: #a83d38;
  --danger-soft: #fcebea;
  --warning: #8a5d12;
  --warning-soft: #fff7df;
  --success: #256a50;
  --success-soft: #e8f4ee;
  --shadow: 0 12px 32px rgba(24, 48, 38, 0.07);
  --shadow-small: 0 4px 14px rgba(24, 48, 38, 0.06);
  --radius: 14px;
  --radius-small: 9px;
  --shell: 1180px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--page);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

a:hover {
  color: var(--primary-strong);
}

:focus-visible {
  outline: 3px solid rgba(31, 95, 74, 0.28);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 38px);
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(19px, 2.7vw, 24px);
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  overflow-wrap: anywhere;
  color: #31433b;
  background: #eef2f0;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
}

.shell {
  width: min(100% - 28px, var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  color: #fff;
  background: var(--primary-strong);
  border-radius: 7px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  position: relative;
  z-index: 20;
  color: #fff;
  background: #183e32;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-inner {
  min-height: 68px;
  padding-block: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #183e32;
  background: #fff;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.brand-mark-large {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  color: #fff;
  background: var(--primary);
  font-size: 25px;
}

.brand-copy {
  display: grid;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.header-actions,
.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user > span {
  color: rgba(255, 255, 255, 0.82);
}

.text-button {
  min-height: 40px;
  padding: 7px 3px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: #fff;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.admin-nav a {
  min-height: 40px;
  padding: 9px 11px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.page-main {
  flex: 1 0 auto;
  padding-block: 24px 44px;
}

.site-footer {
  padding: 18px 0 24px;
  color: #77817d;
  font-size: 12px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-heading p:last-child,
.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.teacher-heading {
  align-items: center;
}

.date-label {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.heading-actions,
.form-actions,
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.panel,
.form-card,
.login-card,
.message-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.panel,
.form-card {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading-wrap {
  align-items: flex-end;
  flex-wrap: wrap;
}

.panel-hint {
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.metric-grid {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-width: 0;
  padding: 15px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  column-gap: 5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 11px rgba(24, 48, 38, 0.04);
}

.metric-card span {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.metric-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(27px, 7vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: var(--ink-soft);
}

.metric-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.metric-primary span,
.metric-primary small {
  color: rgba(255, 255, 255, 0.72);
}

.metric-accent {
  background: var(--accent-soft);
  border-color: #ead9a7;
}

.metric-muted {
  background: var(--surface-soft);
}

.teacher-metrics .metric-primary {
  grid-column: 1 / -1;
}

.teacher-layout,
.correction-layout {
  display: grid;
  gap: 18px;
}

.register-panel {
  border-top: 4px solid var(--primary);
}

.stepper {
  margin-block: 6px 20px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: stretch;
}

.stepper-button {
  min-height: 62px;
  padding: 0;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #c4ddd2;
  border-radius: 11px;
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}

.stepper-button:hover {
  background: #dcece5;
}

.count-field {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.count-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 95, 74, 0.13);
}

.count-field input {
  width: min(150px, 72%);
  min-width: 0;
  padding: 8px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  text-align: right;
  appearance: textfield;
}

.count-field input::-webkit-inner-spin-button,
.count-field input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.count-field > span:last-child {
  color: var(--ink-soft);
}

.quick-select {
  padding: 0;
  margin: 0 0 20px;
  border: 0;
}

.quick-select legend {
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

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

.quick-button {
  min-height: 48px;
  padding: 9px 5px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-weight: 800;
}

.quick-button:hover,
.quick-button.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: #aebdb6;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

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

.button-primary:hover {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.button-secondary {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #c4ddd2;
}

.button-secondary:hover {
  color: var(--primary-strong);
  background: #dcece5;
  border-color: #accfc0;
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.button-ghost:hover {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

.button-block {
  width: 100%;
}

.button-large {
  min-height: 54px;
  font-size: 16px;
}

.button-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.form-help,
.login-note,
.message-help {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.record-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.record-item {
  min-height: 62px;
  padding: 12px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.record-item:first-child {
  padding-top: 2px;
}

.record-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.record-item strong {
  color: var(--primary);
  font-size: 22px;
}

.record-item.is-cancelled strong {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.record-remark {
  display: block;
  max-width: 260px;
  color: var(--ink-soft);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.status {
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  background: #eef1ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.status-normal,
.status-active {
  color: var(--success);
  background: var(--success-soft);
  border-color: #c9e3d7;
}

.status-cancelled,
.status-inactive {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0ccca;
}

.flash {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #c9e3d7;
  border-radius: 9px;
}

.flash-error,
.flash-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0ccca;
}

.flash-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #eedca6;
}

.flash ul {
  margin: 5px 0 0;
  padding-left: 20px;
}

.flash-close {
  flex: 0 0 auto;
  padding: 0 2px;
  color: currentColor;
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
}

.empty-state {
  min-height: 190px;
  padding: 36px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  margin: 5px 0 14px;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.field > span b {
  color: var(--danger);
}

.field small {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  font-weight: 400;
}

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

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #aabbb3;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 95, 74, 0.12);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 9px;
}

.field-inline > span {
  white-space: nowrap;
}

.field-inline input {
  min-height: 40px;
  padding-block: 7px;
}

.filter-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-panel {
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  gap: 14px;
}

.filter-actions {
  align-self: end;
}

.form-card {
  width: min(100%, 700px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 34px);
}

.form-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.breadcrumb {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.data-panel {
  padding: 0;
  overflow: hidden;
}

.data-panel > .panel-heading {
  padding: 20px 20px 0;
}

.data-panel > .empty-state {
  margin: 0 20px 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

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

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  padding-block: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody th {
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: #fbfcfb;
}

.data-table tfoot th,
.data-table tfoot td {
  color: var(--ink);
  background: #f0f5f2;
  font-weight: 800;
}

.data-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.number-emphasis {
  color: var(--primary);
  font-weight: 800;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.sort-link:hover,
.sort-link.is-sorted {
  color: var(--primary);
}

.rank-badge {
  min-width: 28px;
  height: 28px;
  padding-inline: 6px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.rank-top {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #e8d398;
}

.action-cell {
  text-align: right !important;
  white-space: nowrap;
}

.action-cell a + a {
  margin-left: 12px;
}

.remark-cell {
  max-width: 220px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

.row-cancelled {
  color: var(--ink-soft);
  background: #fafafa;
}

.row-cancelled .number-emphasis {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.muted {
  color: var(--ink-soft);
}

.pagination {
  padding: 16px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 0;
}

.detail-list > div {
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(95px, 0.7fr) 1.3fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--ink-soft);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.detail-list .detail-count {
  color: var(--primary);
  font-size: 22px;
}

.correction-form-card {
  width: 100%;
}

.notice {
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.notice-warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #eedca6;
}

.notice span {
  color: var(--ink-soft);
}

.login-page,
.message-page {
  background: #eef3f0;
}

.login-page .page-main,
.message-page .page-main {
  padding-block: 38px;
  display: grid;
  place-items: center;
}

.login-page .site-footer,
.message-page .site-footer {
  padding-top: 0;
}

.login-card,
.message-card {
  width: min(100%, 430px);
  padding: clamp(24px, 7vw, 40px);
}

.login-heading,
.message-card {
  text-align: center;
}

.login-heading {
  margin-bottom: 24px;
}

.login-heading h1,
.message-card h1 {
  font-size: 28px;
}

.login-heading > p:last-child,
.message-text,
.message-detail {
  color: var(--ink-soft);
}

.message-symbol {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid #ead89f;
  border-radius: 50%;
  font-size: 25px;
  font-weight: 800;
}

.message-text {
  margin: 14px 0 20px;
  font-size: 16px;
}

.message-detail {
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 13px;
}

.message-help {
  margin-top: 20px;
}

@media (max-width: 719px) {
  .header-inner {
    align-items: flex-start;
  }

  .admin-page .header-inner {
    width: 100%;
    padding-inline: 14px;
  }

  .admin-page .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-nav {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions > *,
  .heading-actions .button {
    width: 100%;
  }

  .teacher-heading {
    flex-direction: row;
    align-items: center;
  }

  .panel,
  .form-card {
    padding: 17px;
  }

  .data-panel {
    padding: 0;
  }

  .data-panel > .panel-heading {
    padding: 17px 17px 0;
  }

  .data-panel > .empty-state {
    margin: 0 17px 17px;
  }

  .panel-heading-wrap,
  .filter-form,
  .field-inline {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .filter-form .button,
  .field-inline input {
    width: 100%;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead,
  .data-table tfoot {
    display: none;
  }

  .data-table tbody {
    padding: 0 14px 14px;
  }

  .data-table tbody tr {
    margin-bottom: 12px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 2px 7px rgba(24, 48, 38, 0.03);
  }

  .data-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .data-table tbody tr:hover {
    background: #fff;
  }

  .data-table tbody th,
  .data-table tbody td {
    min-height: 38px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 0;
    border-bottom: 1px solid #edf0ee;
    text-align: right;
  }

  .data-table tbody tr > *:last-child {
    border-bottom: 0;
  }

  .data-table tbody td::before,
  .data-table tbody th::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
  }

  .data-table .number-cell,
  .data-table .action-cell {
    text-align: right !important;
  }

  .data-table .action-cell {
    justify-content: flex-end;
  }

  .data-table .action-cell::before {
    content: none;
  }

  .remark-cell {
    max-width: none;
  }

  .record-table tbody th,
  .teacher-table tbody th {
    font-size: 16px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }
}

@media (min-width: 600px) {
  .shell {
    width: min(100% - 40px, var(--shell));
  }

  .metric-grid {
    gap: 14px;
  }

  .teacher-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .teacher-metrics .metric-primary {
    grid-column: auto;
  }

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

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

@media (min-width: 800px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .page-main {
    padding-block: 34px 58px;
  }

  .admin-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .admin-metrics .metric-card {
    padding: 18px;
  }

  .admin-metrics .metric-card strong {
    font-size: clamp(28px, 3.2vw, 38px);
  }

  .filter-grid {
    grid-template-columns: 1.25fr 1fr 1fr auto;
    align-items: end;
  }
}

@media (min-width: 920px) {
  .teacher-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    align-items: start;
  }

  .correction-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(430px, 1.28fr);
    align-items: start;
  }

  .original-record {
    position: sticky;
    top: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
