:root {
  color-scheme: light;
  --blue: #174a8b;
  --blue-2: #2269c7;
  --blue-soft: #eaf2fc;
  --green: #17805c;
  --red: #c54232;
  --ink: #172238;
  --muted: #6d788a;
  --line: #dce2ea;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.boot { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; background: var(--surface); }
.auth-brand { padding: 9vw 7vw; color: white; background: #153f73; display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark { display: flex; align-items: center; gap: 14px; font-size: 22px; font-weight: 700; }
.flag { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 6px; background: white; color: var(--blue); font-size: 24px; }
.auth-quote { max-width: 520px; font-size: clamp(28px, 3vw, 46px); line-height: 1.35; font-weight: 700; }
.auth-panel { display: grid; place-items: center; padding: 36px; }
.auth-form { width: min(420px, 100%); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; margin-bottom: 10px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.subtle { color: var(--muted); line-height: 1.65; }
.field { display: grid; gap: 7px; margin: 18px 0; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(34, 105, 199, .12); }
.btn { min-height: 42px; border: 1px solid transparent; border-radius: 6px; padding: 9px 16px; font-weight: 650; color: white; background: var(--blue); }
.btn:hover { background: #103d76; }
.btn.secondary { color: var(--ink); background: white; border-color: var(--line); }
.btn.secondary:hover { background: #f6f8fb; }
.btn.danger { background: var(--red); }
.btn.full { width: 100%; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: white; display: flex; flex-direction: column; }
.sidebar .brand-mark { color: var(--ink); padding: 0 8px 25px; }
.nav { display: grid; gap: 6px; }
.nav button { border: 0; background: transparent; color: #455166; padding: 12px 14px; text-align: left; border-radius: 6px; font-weight: 650; }
.nav button.active { color: var(--blue); background: var(--blue-soft); }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: white; }
.quote { color: #52627a; font-weight: 650; }
.main { min-width: 0; }
.content { width: min(1180px, calc(100% - 48px)); margin: 30px auto 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.band { border: 1px solid var(--line); background: white; }
.band + .band { margin-top: 20px; }
.band-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.band-body { padding: 22px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: white; margin-bottom: 22px; }
.metric-row.four { grid-template-columns: repeat(4, 1fr); }
.metric { padding: 20px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; color: var(--blue); font-size: 28px; margin-top: 8px; }
.progress { height: 8px; border-radius: 4px; overflow: hidden; background: #e4e8ef; }
.progress > span { display: block; height: 100%; background: var(--blue-2); }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 14px; }
.progress-table-head, .progress-table-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(190px, 1.6fr) minmax(100px, .8fr) minmax(120px, .9fr) auto; gap: 20px; align-items: center; padding: 15px 20px; }
.progress-table-head { color: var(--muted); font-size: 13px; font-weight: 700; background: #f6f8fb; border-bottom: 1px solid var(--line); }
.progress-table-row { border-bottom: 1px solid var(--line); }
.progress-table-row:last-child { border-bottom: 0; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.detail-metrics > div { padding: 16px; border-right: 1px solid var(--line); }
.detail-metrics > div:last-child { border-right: 0; }
.detail-metrics span, .detail-metrics small { display: block; color: var(--muted); }
.detail-metrics strong { display: block; margin: 7px 0; color: var(--blue); font-size: 24px; }
.detail-metrics .date-value { font-size: 17px; }
.subject-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin-top: 22px; }
.list { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); background: white; }
.row-title { font-weight: 700; line-height: 1.45; }
.row-meta { color: var(--muted); margin-top: 5px; font-size: 14px; }
.check { width: 26px; height: 26px; border: 1px solid #bfc8d5; border-radius: 5px; background: white; color: transparent; }
.check.done { color: white; border-color: var(--green); background: var(--green); }
.lesson-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lesson-main.done .row-title { color: var(--muted); text-decoration: line-through; }
.subject-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.subject-tabs button { border: 1px solid var(--line); border-radius: 5px; background: white; padding: 8px 14px; color: #4c596d; }
.subject-tabs button.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.student-grid { display: grid; grid-template-columns: 320px 1fr; border: 1px solid var(--line); background: white; min-height: 480px; }
.student-list { border-right: 1px solid var(--line); }
.student-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: white; padding: 16px; text-align: left; }
.student-item.active { background: var(--blue-soft); color: var(--blue); }
.student-item .status { float: right; }
.student-editor { padding: 24px; }
.editor-section { padding: 18px 0 24px; border-top: 1px solid var(--line); }
.editor-section:first-of-type { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 4px; font-size: 13px; font-weight: 700; background: #eef1f5; color: #596579; }
.status.active { color: var(--green); background: #e9f6f1; }
.status.inactive { color: var(--red); background: #fff0ee; }
.access-notice { display: flex; align-items: center; gap: 16px; padding: 15px 18px; margin-bottom: 20px; border-left: 4px solid var(--blue-2); background: #eaf2fc; color: #29486f; }
.access-notice.warning { border-left-color: #b8760b; background: #fff7e8; color: #76500d; }
.access-notice.blocked { border-left-color: var(--red); background: #fff0ee; color: #7d2c25; }
.access-notice strong { white-space: nowrap; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.checks label { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.practice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.practice-card { padding: 18px; border: 1px solid var(--line); background: white; }
.practice-card.locked { opacity: .62; }
.practice-card .btn { margin-top: 14px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 25, 42, .56); display: grid; place-items: center; padding: 20px; }
.modal { width: min(900px, 100%); max-height: 92vh; overflow: auto; background: white; border-radius: 7px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 18px 22px; background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 22px; }
.question { padding: 20px 0; border-bottom: 1px solid var(--line); }
.question-stem { font-weight: 700; line-height: 1.75; margin-bottom: 14px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 11px; border: 1px solid var(--line); margin: 8px 0; border-radius: 5px; line-height: 1.5; }
.option.correct { border-color: #80bca8; background: #edf8f4; }
.option.wrong { border-color: #e8a69e; background: #fff2f0; }
.analysis { margin-top: 13px; padding: 14px; background: #f5f7fa; white-space: pre-wrap; line-height: 1.7; color: #475267; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; padding: 13px 16px; border-radius: 6px; color: white; background: #27364d; box-shadow: 0 12px 30px rgba(0,0,0,.18); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 800px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 250px; padding: 34px 26px; }
  .auth-quote { font-size: 28px; margin-top: 44px; }
  .auth-panel { padding: 34px 24px; }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand-mark { padding: 0 4px 12px; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-foot { display: none; }
  .topbar { min-height: 62px; padding: 10px 16px; }
  .quote { display: none; }
  .content { width: min(100% - 24px, 1180px); margin-top: 20px; }
  .metric-row, .metric-row.four, .practice-grid, .student-grid, .detail-metrics, .subject-progress { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .student-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-metrics > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-metrics > div:last-child { border-bottom: 0; }
  .progress-table-head { display: none; }
  .progress-table-row { grid-template-columns: 1fr; gap: 12px; }
  .row { padding: 14px; }
  .checks { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .access-notice { align-items: flex-start; flex-direction: column; gap: 5px; }
  .page-head { display: block; }
  .page-head .toolbar { margin-top: 14px; }
}
