:root {
  color-scheme: light;
  --paper: #f7f6f0;
  --white: #fffefa;
  --ink: #202e29;
  --muted: #526159;
  --line: #dde2d9;
  --brand: #244039;
  --accent: #244039;
  --soft: #e8eee4;
  --track: #e4e8e1;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #428370; outline-offset: 3px;
}
svg { flex: none; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 10px 16px; border-radius: 8px; background: var(--white); }
.theme-math { --accent: #414793; --soft: #ebebfa; --track: #e5e6f5; }
.theme-physics { --accent: #20634f; --soft: #e3f1e8; --track: #dfede4; }
.theme-chinese { --accent: #82483e; --soft: #f6e8e3; --track: #f0e2df; }
.theme-classics { --accent: #795318; --soft: #f5ecd9; --track: #ede4d2; }
.theme-chemistry { --accent: #34528b; --soft: #e7edf9; --track: #dfe7f7; }
.theme-biology { --accent: #486736; --soft: #edf2e1; --track: #e7eddf; }
.theme-english { --accent: #644a82; --soft: #f1e9f7; --track: #eae2f4; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header-inner {
  max-width: 1088px; padding: 0 28px; min-height: 68px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 800; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  color: #f9fbef; background: var(--brand); border-radius: 11px;
}
.site-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.page { max-width: 1088px; margin: auto; padding: 42px 28px 64px; }
.welcome {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 33px; padding: 29px 32px 30px; border-radius: 23px;
  background: linear-gradient(112deg, #e8eddf 5%, #eff1e7 68%, #edf1e4);
  border: 1px solid #e2e8d9; overflow: hidden;
}
.welcome::after {
  position: absolute; top: -138px; right: -100px; width: 340px; height: 340px; border-radius: 50%;
  border: 34px solid rgba(129, 155, 124, .12); content: ""; pointer-events: none;
}
.welcome > * { position: relative; z-index: 1; }
.eyebrow, .lesson-kicker { color: var(--accent); font-size: 13px; font-weight: 780; letter-spacing: .055em; }
.eyebrow { display: flex; gap: 8px; align-items: center; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: #597d59; }
.welcome h1 { font-size: clamp(32px, 5vw, 49px); line-height: 1.19; letter-spacing: -.055em; margin: 9px 0 10px; }
.welcome-copy { color: var(--muted); font-size: 16px; }
.today {
  display: flex; align-items: center; gap: 10px; min-width: 165px; border-radius: 14px;
  padding: 11px 13px; border: 1px solid #dbe4d7; background: #fcfdf7; color: var(--brand);
}
.today span, .today time { display: block; }
.today span { color: var(--muted); font-size: 11px; }
.today time { font-size: 13px; font-weight: 750; white-space: nowrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.section-heading > span, .module-heading > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.course-card, .path-summary, .source-card, .lesson-heading, .phase-card, .hint-card, .lesson-row {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
}
.course-card {
  display: flex; flex-direction: column; gap: 19px; min-width: 0; padding: 22px;
  border-top: 4px solid var(--accent); box-shadow: 0 5px 18px #263a2b08;
}
.course-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.course-icon {
  display: grid; place-items: center; flex: none; width: 51px; height: 51px;
  border-radius: 15px; color: var(--accent); background: var(--soft);
}
.course-name { flex: 1; min-width: 0; }
.course-name h2, .course-name h1 { font-size: clamp(21px, 3vw, 26px); letter-spacing: -.025em; line-height: 1.26; }
.course-name > span { display: flex; gap: 5px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.status-chip {
  display: inline-flex; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--muted); background: #eef0eb;
}
.status-chip.active, .status-chip.finished { color: var(--accent); background: var(--soft); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.progress-box { min-width: 0; }
.progress-label, .progress-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.progress-label { font-size: 14px; font-variant-numeric: tabular-nums; }
.progress-label b:first-child { font-size: 23px; line-height: 1; }
.progress-total, .progress-foot { color: var(--muted); }
.progress-label .percent { color: var(--accent); }
progress { display: block; width: 100%; height: 8px; margin: 9px 0 6px; appearance: none; border: 0; border-radius: 99px; background: var(--track); }
progress::-webkit-progress-bar { border-radius: 99px; background: var(--track); }
progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }
.progress-foot { font-size: 12px; flex-wrap: wrap; }
.forecast { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--soft); color: var(--accent); }
.forecast-label { display: block; font-size: 11px; font-weight: 700; }
.forecast strong { display: block; font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.forecast-detail, .progress-extra { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; }
.progress-extra { color: var(--muted); }
.next-preview { min-height: 53px; }
.next-preview strong, .path-next strong { display: block; font-size: 15px; margin-top: 3px; }
.next-preview strong svg { vertical-align: -3px; color: var(--accent); }
.next-kicker { color: var(--accent); font-size: 12px; font-weight: 750; }
.course-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: stretch; margin-top: auto; }
.button {
  min-height: 46px; border: 1px solid transparent; border-radius: 11px; padding: 9px 14px; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center;
  font-size: 14px; font-weight: 760; white-space: nowrap; transition: filter .15s ease, background .15s ease;
}
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { filter: brightness(.9); }
.primary-action > .button { width: 100%; }
.button.secondary { color: var(--ink); border-color: var(--line); background: var(--white); }
.button.secondary:hover { background: var(--soft); }
.button.unavailable { color: var(--muted); background: #ebeee8; cursor: default; }
.small-link { display: inline-flex; gap: 5px; align-items: center; margin-top: 5px; color: var(--accent); font-weight: 740; font-size: 13px; }
.small-link:hover, .gate-links a:hover { text-decoration: underline; }
.notice { margin-top: 12px; padding: 10px 13px; background: #fff3d9; border: 1px solid #edd6a3; border-radius: 12px; font-size: 14px; }
.preserve-lines { white-space: pre-line; }
.button.text { min-height: 44px; color: var(--muted); background: transparent; padding: 4px 8px; text-decoration: underline; text-underline-offset: 3px; }
.forecast-help { margin-top: 22px; color: var(--muted); font-size: 13px; }
.forecast-help summary { min-height: 44px; align-content: center; font-weight: 700; }
.forecast-help p { max-width: 59em; padding: 1px 0 7px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -12px 0 10px; color: var(--accent); font-size: 14px; font-weight: 760; }
.path-summary, .lesson-heading { padding: 23px; border-top: 4px solid var(--accent); }
.path-metrics, .lesson-metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, .6fr); align-items: center; gap: 17px; margin-top: 20px; }
.path-next { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-top: 15px; border-top: 1px solid var(--line); margin-top: 18px; }
.module-section { margin-top: 28px; }
.module-toolbar, .module-heading { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.module-toolbar h2, .steps-heading h2 { font-size: 22px; }
.module-toolbar p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.module-form { display: flex; align-items: stretch; gap: 7px; min-width: 0; }
.module-form select {
  border: 1px solid var(--line); border-radius: 11px; padding: 0 8px 0 11px; background: var(--white); color: var(--ink);
  font-size: 14px; min-width: 0; min-height: 46px; width: min(42vw, 275px); text-overflow: ellipsis;
}
.module-heading { margin: 19px 0 9px; }
.module-heading h3 { font-size: 16px; }
.lesson-list, .steps { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
.lesson-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 58px; padding: 9px 13px; border-radius: 12px; }
.lesson-row:hover { border-color: var(--accent); }
.lesson-row.row-next { background: var(--soft); border-color: var(--accent); }
.lesson-index { display: inline-flex; gap: 5px; align-items: center; min-width: 50px; color: var(--muted); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.row-done .lesson-index, .row-next .lesson-index, .lesson-row-state { color: var(--accent); }
.lesson-row-title { font-size: 14px; font-weight: 730; overflow-wrap: anywhere; }
.lesson-row-title small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.lesson-row-state { font-size: 12px; font-weight: 700; white-space: nowrap; }
.optional-list { margin-top: 14px; }
.optional-list summary { min-height: 44px; align-content: center; color: var(--accent); font-weight: 750; }
.optional-list p, .path-next small { margin: 3px 0 8px; font-size: 13px; color: var(--muted); }
.row-arrow { color: var(--muted); }
.lesson-view { max-width: 842px; padding-bottom: 115px; }
.lesson-heading h1 { font-size: clamp(27px, 5vw, 39px); line-height: 1.23; letter-spacing: -.04em; margin: 7px 0 10px; overflow-wrap: anywhere; }
.lesson-kicker span { padding: 0 3px; }
.lesson-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-tags > span { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 4px 9px; background: var(--soft); color: var(--accent); font-size: 12px; font-weight: 710; }
.source-card { margin-top: 13px; padding: 16px 18px 9px; }
.source-card h2 { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 17px; }
.source-card ul { padding: 0 0 0 19px; margin: 8px 0; font-size: 14px; }
.source-card li + li { margin-top: 4px; }
.source-card p, .hint-card p { font-size: 13px; color: var(--muted); }
.source-details { border-top: 1px solid var(--line); margin-top: 11px; }
.timed-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; margin-top: 13px; padding: 13px 16px; }
.timed-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.timed-title h2 { display: flex; align-items: center; gap: 7px; font-size: 17px; color: var(--accent); }
.timed-title > span { font-size: 12px; color: var(--accent); font-weight: 720; }
.timed-card p { margin-top: 5px; font-size: 14px; color: var(--muted); }
.gate-links { font-size: 13px; padding-left: 19px; margin: 8px 0 1px; }
.gate-links a { color: var(--accent); }
.gate-actions { margin-top: 9px; width: max-content; max-width: 100%; }
.review-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.review-list a, .round-grid a { border: 1px solid var(--line); border-radius: 9px; min-height: 44px; padding: 6px 9px; }
.review-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.review-list a:hover, .round-grid a:hover { border-color: var(--accent); }
.review-list b, .round-grid b { display: block; font-size: 14px; }
.review-list small, .round-grid small { font-size: 12px; color: var(--muted); }
.round-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.round-grid .round-done, .round-grid .round-ready { background: var(--soft); color: var(--accent); }
.review-dates { display: grid; gap: 4px; margin-top: 12px; font-size: 14px; color: var(--accent); }
.review-dates > div { display: flex; align-items: center; gap: 6px; }
.source-details summary, .hint-card summary, .phase-card summary { list-style: none; display: flex; align-items: center; gap: 7px; min-height: 43px; }
summary::-webkit-details-marker { display: none; }
.source-details summary, .hint-card summary { font-size: 13px; font-weight: 750; color: var(--muted); }
.chevron { margin-left: auto; }
details[open] > summary .chevron { transform: rotate(180deg); }
.hint-card { margin-top: 8px; padding: 0 16px; }
.hint-card[open] { padding-bottom: 12px; }
.hint-card p + p { margin-top: 4px; }
.steps-section { margin-top: 22px; }
.steps-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; gap: 8px; }
.steps-heading > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.phase-card { padding: 13px 15px; border-radius: 13px; }
.phase-heading { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.phase-no { display: grid; place-items: center; height: 25px; width: 25px; border-radius: 8px; color: var(--accent); background: var(--soft); font-size: 13px; font-weight: 800; }
.phase-heading strong { font-size: 15px; }
.phase-time { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.phase-card p { margin: 8px 0 0 33px; font-size: 15px; line-height: 1.78; white-space: pre-line; overflow-wrap: anywhere; }
.check-phase { padding-block: 6px; }
.check-phase[open] { padding-bottom: 13px; }
.check-phase > p { margin-top: 3px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; }
.lesson-nav a { min-height: 44px; display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 14px; font-weight: 740; }
.study-dock {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--line);
  padding: 9px 18px max(10px, env(safe-area-inset-bottom)); background: #fffefaf5;
  box-shadow: 0 -5px 20px #243b2611; backdrop-filter: blur(8px);
}
.dock-inner { max-width: 786px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.dock-status { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; color: var(--accent); font-size: 13px; }
.dock-status strong { display: inline-flex; align-items: center; gap: 4px; }
.dock-inner > .primary-action, .dock-inner > .button { min-width: 155px; }
.dock-inner .button { min-height: 49px; }

@media (max-width: 650px) {
  .site-header-inner { padding: 0 16px; min-height: 59px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .page { padding: 19px 14px 45px; }
  .welcome { padding: 17px 16px 15px; border-radius: 17px; margin-bottom: 19px; display: block; }
  .welcome h1 { font-size: 32px; margin: 7px 0 5px; }
  .welcome-copy { font-size: 14px; }
  .today { display: inline-flex; min-width: 0; margin-top: 12px; padding: 5px 8px; gap: 6px; border-radius: 8px; }
  .today svg { width: 14px; height: 14px; }
  .today > div { display: flex; align-items: baseline; gap: 6px; }
  .today time { font-size: 12px; }
  .course-grid { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .course-card { padding: 15px; gap: 12px; border-radius: 15px; }
  .course-icon { width: 44px; height: 44px; border-radius: 13px; }
  .course-name h2 { font-size: 22px; }
  .forecast { padding: 8px 11px; }
  .next-preview { min-height: 45px; }
  .back-link { margin: -7px 0 6px; }
  .path-summary, .lesson-heading { padding: 15px; }
  .path-metrics, .lesson-metrics { grid-template-columns: minmax(0,1fr); gap: 11px; margin-top: 14px; }
  .path-next { align-items: end; gap: 8px; }
  .path-next .button { padding-inline: 10px; }
  .module-section { margin-top: 19px; }
  .module-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .module-form select { width: 100%; }
  .lesson-row { gap: 7px; padding: 8px 9px; }
  .lesson-row-title { font-size: 13px; }
  .lesson-row-state { font-size: 11px; }
  .lesson-view { padding-bottom: 105px; }
  .lesson-heading h1 { font-size: 27px; }
  .source-card { padding: 12px 13px 6px; }
  .phase-card p { margin-left: 0; }
  .study-dock { padding-inline: 14px; }
  .dock-inner > .primary-action, .dock-inner > .button { min-width: min(45vw, 160px); }
  .round-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }

.account-nav { display: flex; align-items: center; gap: 6px; }
.account-nav .button { padding-inline: 5px; }
.login-page { max-width: 520px; }
.login-card { display: grid; gap: 12px; padding: clamp(18px, 5vw, 30px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.login-card h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.2; }
.login-card p { color: var(--muted); }
.login-choices, .login-form { display: grid; gap: 12px; margin-top: 8px; }
.login-form label { display: grid; gap: 4px; font-weight: 650; }
.login-form input { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid #aeb9ad; border-radius: 9px; font: inherit; color: var(--ink); background: var(--white); }
.login-form input:focus-visible { outline: 3px solid #428370; outline-offset: 2px; }
.login-card .login-error { color: #942e21; }
