:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --sidebar: #f4f3ed;
  --ink: #203e4d;
  --body: #354c52;
  --muted: #61716e;
  --rule: #dcded5;
  --orange: #ba4d29;
  --warm: #f4b47c;
  font: 15px/1.6 "Source Sans 3", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--paper);
  color: var(--body);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .6; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #e5824c; outline-offset: 3px; }
button { border: 0; }
button, a, input, select, dialog { border-radius: 6px; }
button:hover { filter: brightness(.95); }
.skip-link { position: absolute; left: .5rem; top: -10rem; z-index: 10; background: white; padding: .5rem; color: var(--ink); }
.skip-link:focus { top: .5rem; }
.masthead { height: 75px; display: flex; justify-content: space-between; align-items: center; padding: 0 clamp(20px, 3.15vw, 58px); border-bottom: 1px solid var(--rule); background: #fffefa; }
.brand, .account-tools, .account-button, .nav-link, .location, .hero-meta, .action-row, .player-tools, .section-heading, .row-caption, .course-kicker { display: flex; align-items: center; }
.brand { gap: 13px; color: var(--ink); white-space: nowrap; }
.brand b { font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; font-size: 24px; letter-spacing: .085em; line-height: 1; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; width: 34px; height: 34px; background: var(--ink); border-radius: 9px; padding: 8px 7px; }
.brand-mark i { display: block; background: #f7e8c9; height: 10px; width: 5px; transform: skewY(-15deg); }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 18px; background: var(--warm); }
.brand-divider { height: 19px; border-left: 1px solid #c6cbc2; }
.brand-detail { color: #61736e; font-size: 13px; letter-spacing: .14em; }
.account-tools { gap: 12px; }
#account-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.account-button { gap: 8px; border: 1px solid #cdd3c9; padding: 5px 14px; min-height: 35px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 600; }
.profile-icon, .books-icon, .clock-icon, .media-icon { position: relative; display: inline-block; flex-shrink: 0; }
.profile-icon { width: 14px; height: 15px; }
.profile-icon::before, .profile-icon::after { content: ""; position: absolute; border: 1.5px solid currentColor; left: 50%; transform: translateX(-50%); }
.profile-icon::before { top: 1px; width: 4px; height: 4px; border-radius: 50%; }
.profile-icon::after { bottom: 0; width: 10px; height: 5px; border-radius: 9px 9px 2px 2px; }
.shell { display: grid; grid-template-columns: clamp(170px, 16vw, 244px) minmax(0, 1fr); min-height: calc(100vh - 75px); }
.rail { background: var(--sidebar); border-right: 1px solid var(--rule); padding: 37px clamp(13px, 1.6vw, 28px); }
.nav-group { position: sticky; top: 24px; }
.rail-label, .location, .course-kicker { font-size: 12px; letter-spacing: .11em; font-weight: 650; }
.rail-label { color: #727b73; margin: 0 13px 14px; }
.nav-link { gap: 12px; width: 100%; min-height: 43px; text-align: left; background: transparent; padding: 8px 14px; margin-bottom: 5px; font-size: 14px; font-weight: 540; }
.nav-link:hover { background: #e9eae2; }
.nav-link.active { background: #dfe7df; color: #244337; font-weight: 700; }
.books-icon { width: 16px; height: 14px; background: linear-gradient(to right,currentColor 1.5px,transparent 1.5px 4px,currentColor 4px 5.5px,transparent 5.5px 8px,currentColor 8px 9.5px,transparent 9.5px); }
.books-icon::after { content: ""; position: absolute; left: 12px; top: 1px; height: 13px; border-left: 1.5px solid currentColor; transform: rotate(-14deg); }
.clock-icon { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; }
.clock-icon::after { content: ""; position: absolute; width: 4px; height: 4px; top: 3px; left: 6px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; }
main { padding: 32px clamp(22px, 4vw, 80px) 58px; width: 100%; max-width: 1512px; margin: 0 auto; }
.page-head { margin-bottom: 21px; }
.location { color: var(--muted); gap: 9px; }
.location-dash { width: 23px; height: 2px; background: #c96842; }
h1, h2, h3, p { margin: 0; }
h1, .hero-title, .section-heading h2, .history-course, #login-heading { font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; }
h1 { font-size: clamp(32px, 3.1vw, 49px); letter-spacing: .045em; line-height: 1.23; margin-top: 6px; color: var(--ink); }
#notice, .form-error { padding: 9px 14px; background: #fff0da; color: #76401d; border-radius: 4px; }
#notice { margin: 0 0 15px; }
.hero { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 10px; background: #233f4d; color: #fff9e9; isolation: isolate; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(25px, 3.15vw, 52px); min-width: 0; }
.course-kicker { color: #efb583; gap: 10px; }
.course-kicker::before { content: ""; width: 16px; height: 2px; background: currentColor; }
.hero-title { font-size: clamp(34px, 3.55vw, 62px); font-weight: 700; letter-spacing: .025em; line-height: 1.25; margin: 12px 0 10px; }
.hero-summary { color: #e2e7dd; font-size: 14px; line-height: 1.75; max-width: 37em; overflow-wrap: anywhere; }
.hero-meta { flex-wrap: wrap; gap: 9px; font-size: 12px; margin-top: 12px; color: #d0dacf; }
.hero-meta span + span::before { content: "·"; padding-right: 9px; }
.hero-art { min-height: 270px; background: #d2b898 url("/assets/study.webp") center/cover no-repeat; }
.primary-button, .secondary-button, .hero-action { font-weight: 650; min-height: 42px; padding: 9px 18px; }
.hero-action { margin-top: 22px; display: inline-flex; align-items: center; gap: 13px; background: #f5bd89; color: #273b3b; }
.play-triangle { width: 0; height: 0; border-left: 8px solid currentColor; border-block: 5px solid transparent; }
.primary-button { background: var(--ink); color: white; }
.secondary-button { border: 1px solid var(--rule); color: var(--ink); background: #fffefa; }
.course-chooser { margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.course-chooser label { color: var(--muted); font-size: 13px; }
select { border: 1px solid #c6cdbf; background: #fffefa; color: var(--ink); padding: 6px 8px; max-width: 100%; }
.syllabus, .history-block { margin-top: 30px; }
.section-heading { justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 13px; border-bottom: 2px solid var(--ink); }
.section-heading h2, .history-course { color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: .025em; }
.section-count, .row-meta, .row-time, .progress-label { font-size: 13px; color: var(--muted); }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-row { width: 100%; min-height: 77px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 30px; align-items: center; gap: 13px; text-align: left; border-radius: 0; padding: 11px 5px; background: transparent; border-bottom: 1px solid var(--rule); }
.lesson-row:hover { background: #f1f1e9; filter: none; }
.lesson-num { font: italic 24px/1 Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; color: #a85033; }
.lesson-title { display: block; font-size: 16px; font-weight: 650; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.row-caption { flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.row-meta, .progress-label { font-size: 12px; }
.progress-label { color: #795431; }
.row-time { font: 13px/1.2 "Courier New", monospace; font-variant-numeric: tabular-nums; }
.row-go { justify-self: end; width: 27px; height: 27px; display: grid; place-content: center; border: 1px solid #c8cfc5; border-radius: 50%; color: var(--ink); font-size: 16px; }
.row-go::after { content: "›"; transform: translateY(-1px); }
.empty-state { padding: 30px 0; color: var(--muted); }
.empty-state p + button { margin-top: 16px; }
.history-block:first-child { margin-top: 0; }
.text-button { padding: 7px 0; color: #8f432c; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.player-panel { background: #f2f0e7; border: 1px solid var(--rule); border-radius: 10px; padding: clamp(14px, 2.5vw, 35px); }
.now-course { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.now-title { color: var(--ink); font-size: clamp(21px, 2.5vw, 34px); }
.player-media { width: 100%; display: block; margin: 20px 0 12px; }
video.player-media { background: #152a34; max-height: 55vh; border-radius: 6px; }
.player-tools { flex-wrap: wrap; gap: 7px; }
.player-tools button { padding: 5px 11px; font-size: 14px; border: 1px solid #c6cdbf; background: #fffefa; min-height: 36px; }
.speed-label { margin-left: auto; font-size: 13px; }
.player-foot { margin-top: 12px; color: var(--muted); font-size: 12px; }
.lesson-row[aria-current="true"] { background: #eaf0e7; }
.lesson-row[aria-current="true"] .row-go { color: #fff; background: var(--ink); }
dialog { width: min(405px, 92vw); border: 1px solid var(--rule); padding: 27px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 60px #102c3333; }
dialog::backdrop { background: #18333b73; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dialog-close { width: 32px; height: 32px; line-height: 1; font-size: 24px; background: #e9ece3; }
#login-form label { display: block; font-size: 14px; font-weight: 650; margin: 12px 0 4px; }
#login-form input { width: 100%; padding: 8px 11px; border: 1px solid #aebbb0; background: #fff; }
#login-form .primary-button, #login-form .secondary-button { width: 100%; margin-top: 12px; }
.form-error { margin-top: 12px; font-size: 13px; }
@media (min-width: 1600px) { .hero-art { min-height: 345px; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 151px minmax(0, 1fr); }
  .rail { padding: 32px 9px; }
  main { padding-inline: 22px; }
  .hero { grid-template-columns: 1.1fr .9fr; }
  .hero-copy { padding: 24px; }
}
@media (max-width: 740px) {
  .masthead { height: 62px; padding-inline: 17px; }
  .brand { gap: 9px; }
  .brand b { font-size: 21px; }
  .brand-detail { font-size: 12px; }
  .shell { display: block; min-height: auto; }
  .rail { border-right: 0; border-bottom: 1px solid var(--rule); padding: 0 16px; background: var(--paper); }
  .nav-group { display: flex; gap: 20px; position: static; }
  .rail-label { display: none; }
  .nav-link, .nav-link.active { width: auto; border-radius: 0; margin: 0; padding: 9px 0; min-height: 42px; gap: 7px; font-size: 13px; background: transparent; }
  .nav-link.active { box-shadow: inset 0 -2px var(--ink); }
  main { padding: 21px 17px 40px; }
  .page-head { margin-bottom: 15px; }
  .location { font-size: 11px; }
  .hero-art { min-height: 205px; }
  .hero-copy { padding: 22px 18px; }
  .hero-title { font-size: clamp(27px, 5vw, 37px); }
  .hero-action { margin-top: 16px; }
  .syllabus { margin-top: 24px; }
  .lesson-row { grid-template-columns: 30px minmax(0, 1fr) auto 24px; gap: 8px; min-height: 72px; }
  .lesson-title { font-size: 15px; }
  .row-go { width: 23px; height: 23px; }
}
@media (max-width: 510px) {
  .hero { display: flex; flex-direction: column; }
  .hero-art { order: -1; min-height: 128px; height: clamp(125px, 33vw, 162px); background-position: 50% 52%; }
  .hero-copy { padding: 17px 20px 20px; }
  .hero-title { margin: 6px 0; font-size: 32px; }
  .hero-summary { font-size: 13px; }
  .hero-meta { margin-top: 6px; }
  .hero-action { min-height: 38px; padding: 6px 14px; margin-top: 12px; }
  #account-name { max-width: 7ch; font-size: 11px; }
  .account-tools { gap: 5px; }
  .account-button { padding: 5px 8px; }
  .player-tools { gap: 5px; }
  .player-tools button { padding: 5px 8px; }
}
@media (max-width: 375px) {
  .brand-divider, .brand-detail { display: none; }
  .player-tools .speed-label { margin-left: 0; }
}
.library {margin:28px 0 32px}
.library h2 {margin:0 0 12px;font-family:SimSun,serif}
.library-filters,.course-grid {display:flex;flex-wrap:wrap;gap:12px}
.library-filters label {display:flex;gap:8px;align-items:center;font-size:14px}
.library-filters select {max-width:160px;padding:6px;background:var(--paper);color:var(--ink)}
.course-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));margin-top:15px}
.course-card {display:grid;gap:7px;text-align:left;background:#f3f1e9;color:var(--ink);padding:15px;border:1px solid var(--rule);border-radius:7px;overflow-wrap:anywhere}
.course-card:hover,.course-card:focus-visible {border-color:#54736b}
.course-card small,.course-card span {font-size:13px;color:#516560}
.manage {max-width:780px;margin:2rem auto;padding:0 1.2rem}
.manage form {display:flex;flex-wrap:wrap;align-items:end;gap:1rem}
.manage label {display:grid;gap:.35rem}
.manage input {padding:.65rem;border:1px solid var(--rule);border-radius:.4rem;max-width:100%}
.grant-row {display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem 0;border-bottom:1px solid var(--rule)}
