:root {
  color-scheme: light;
  --ink: #173538;
  --muted: #5d7272;
  --paper: #f4f4eb;
  --panel: #ffffff;
  --line: #cfddd7;
  --teal: #0c756d;
  --teal-dark: #183d40;
  --mint: #dff0e9;
  --orange: #c65f3f;
  --amber: #8a682b;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.65 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input { font: inherit; }
button, .teacher-file-button { cursor: pointer; }

.teacher-hero { padding: clamp(28px, 7vw, 86px) max(22px, calc((100vw - 1120px) / 2)); color: #e9f3ed; background: radial-gradient(circle at 78% 15%, #326c68 0, transparent 35%), linear-gradient(138deg, #132c31, #1c4e50); }
.teacher-back { display: inline-flex; color: #b9ded4; font-size: 14px; text-decoration: none; }
.teacher-back:hover { color: #fff; text-decoration: underline; }
.teacher-kicker, .section-kicker { margin: 28px 0 8px; color: #78d1bc; font: 800 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.teacher-hero h1 { margin: 0; color: #fffdf6; font-family: "STZhongsong", "Songti SC", serif; font-size: clamp(34px, 5vw, 58px); letter-spacing: .04em; }
.teacher-lead { max-width: 760px; margin: 16px 0 0; color: #d2e4df; font-size: clamp(15px, 2vw, 19px); }
.teacher-hero-meta { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 26px; color: #b8d9d1; font-size: 14px; }
.teacher-hero-meta a { color: #fff2c9; }

.teacher-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 64px; }
.teacher-main > section { margin-top: 22px; }
.teacher-guidance, .teacher-boundaries { display: grid; grid-template-columns: minmax(210px, .85fr) minmax(0, 1.6fr); gap: 28px; padding: 26px; background: #e2eee8; border: 1px solid #c7dcd3; }
.teacher-guidance .section-kicker, .teacher-boundaries .section-kicker { margin-top: 0; color: #328777; }
.teacher-guidance h2, .teacher-boundaries h2, .teacher-summary h2, .teacher-import h2 { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: clamp(22px, 3vw, 31px); line-height: 1.25; }
.teacher-guidance ol { margin: 0; padding-left: 22px; }
.teacher-guidance li + li { margin-top: 9px; }
.teacher-boundaries p { margin: 0; color: #426264; }

.teacher-import { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; padding: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 15px 40px rgba(33, 71, 65, .07); }
.teacher-import .section-kicker { margin-top: 0; color: var(--teal); }
.teacher-import-copy p:last-child { max-width: 650px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.teacher-import-copy code { color: #225f5d; font-size: .9em; }
.teacher-import-actions { display: flex; align-items: center; align-self: center; flex-wrap: wrap; gap: 10px; }
.teacher-file-button, .teacher-summary header button, .teacher-import-actions button { min-height: 44px; padding: 10px 14px; color: #fff; background: var(--teal); border: 1px solid var(--teal); border-radius: 2px; font-weight: 750; }
.teacher-import-actions button { color: #315556; background: #fff; border-color: #a6c1ba; }
.teacher-import-actions button:disabled { color: #8b9c9b; background: #eff2ef; border-color: #d5ddda; cursor: not-allowed; }
.teacher-import-status { grid-column: 1 / -1; margin: 0; padding-top: 14px; color: var(--muted); border-top: 1px solid #e3e9e5; font-size: 14px; }
.teacher-import-status[data-level="error"] { color: #9a432d; }
.teacher-import-status[data-level="success"] { color: #267367; }

.teacher-summary { padding: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 15px 40px rgba(33, 71, 65, .07); }
.teacher-summary header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.teacher-summary header .section-kicker { margin-top: 0; color: var(--teal); }
.teacher-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.teacher-stat { padding: 16px; color: #315658; background: #eaf2ed; border-top: 3px solid #8bbdaf; }
.teacher-stat b, .teacher-stat span { display: block; }
.teacher-stat b { color: var(--teal-dark); font: 850 30px/1 ui-monospace, Consolas, monospace; }
.teacher-stat span { margin-top: 9px; font-size: 13px; }
.teacher-table-wrap { overflow-x: auto; margin-top: 22px; border: 1px solid #d6e0db; }
.teacher-table-wrap table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.teacher-table-wrap th, .teacher-table-wrap td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #dce5e0; }
.teacher-table-wrap th { color: #416264; background: #edf3ef; font-size: 12px; }
.teacher-table-wrap tbody tr:last-child td { border-bottom: 0; }
.teacher-table-wrap code { color: #2d5557; font-size: 11px; }
.teacher-pill { display: inline-block; padding: 3px 7px; border-radius: 99px; color: #276c60; background: #def0e7; font-size: 12px; font-weight: 750; white-space: nowrap; }
.teacher-pill.is-warn { color: #745b25; background: #f5edd7; }
.teacher-pill.is-alert { color: #96452e; background: #f5e1da; }
.teacher-cell-note { min-width: 190px; color: #526c6c; line-height: 1.55; }
.teacher-summary-note { margin: 15px 0 0; color: #607676; font-size: 13px; line-height: 1.6; }

#offlineStatus[data-state="ready"] { color: #b8eadb; }
#offlineStatus[data-state="update"] { color: #fff0b7; }
#offlineStatus[data-state="unavailable"], #offlineStatus[data-state="unsupported"] { color: #f2c9b2; }

@media (max-width: 720px) {
  .teacher-hero { padding-top: 28px; }
  .teacher-main { width: min(100% - 24px, 1120px); padding-top: 16px; }
  .teacher-guidance, .teacher-boundaries, .teacher-import { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .teacher-import-actions { align-self: start; }
  .teacher-summary { padding: 20px; }
  .teacher-summary header { align-items: start; flex-direction: column; }
  .teacher-stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .teacher-stat-grid { grid-template-columns: 1fr; }
  .teacher-file-button, .teacher-import-actions button, .teacher-summary header button { width: 100%; text-align: center; }
}

/* ---------- Responsive hardening: teacher desk ---------- */
:root { --teacher-vw: 100vw; --teacher-vh: 100dvh; }
html, body { min-width: 0; max-width: 100%; overflow-x: hidden; }
.teacher-hero, .teacher-main, .teacher-main > section, .teacher-guidance, .teacher-boundaries,
.teacher-import, .teacher-summary, .teacher-summary header, .teacher-import-copy, .teacher-import-actions {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.teacher-hero { padding-inline: clamp(14px, 5vw, calc((var(--teacher-vw) - 1120px) / 2)); }
.teacher-main { width: min(1120px, calc(100% - clamp(24px, 6vw, 40px))); }
.teacher-hero h1, .teacher-lead, .teacher-guidance h2, .teacher-boundaries h2, .teacher-summary h2,
.teacher-import h2, .teacher-import-copy p, .teacher-summary-note, .teacher-import-status {
  overflow-wrap: anywhere;
}
.teacher-table-wrap { max-inline-size: 100%; overscroll-behavior-inline: contain; }
.teacher-table-wrap table { max-inline-size: none; }

@media (max-width: 560px) {
  .teacher-hero { padding-block: 22px 30px; }
  .teacher-main { width: calc(100% - 20px); padding-bottom: 34px; }
  .teacher-guidance, .teacher-boundaries, .teacher-import, .teacher-summary { padding: 16px; }
  .teacher-stat-grid { grid-template-columns: 1fr; }
  .teacher-import-actions { width: 100%; }
  .teacher-file-button, .teacher-import-actions button, .teacher-summary header button { width: 100%; }
}

@media (max-width: 340px) {
  body { font-size: 14px; }
  .teacher-main { width: calc(100% - 12px); }
  .teacher-guidance, .teacher-boundaries, .teacher-import, .teacher-summary { padding: 12px; }
  .teacher-summary h2, .teacher-import h2 { font-size: 22px; }
}
