@charset "UTF-8";

/* A quiet blue study desk. Local fonts and original CSS/SVG only. */
:root {
  --blue: #315fd3;
  --deep: #244ea5;
  --blue-soft: #edf3ff;
  --bg: #f3f6fb;
  --surface: #fff;
  --ink: #24334b;
  --muted: #63738b;
  --line: #e3e9f2;
  --green: #316e5b;
  --amber: #80581e;
  --danger: #a53347;
  --radius: 18px;
  --shadow: 0 4px 20px #223e7010;
  --heading-font: "DengXian", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  font-size: 14px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

/* Foundations */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #668cf0;
  outline-offset: 4px;
}
a { color: var(--blue); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--heading-font); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.5; letter-spacing: -.6px; }
h2 { font-size: 20px; line-height: 1.55; }
h3 { font-size: 16px; line-height: 1.7; }
p { line-height: 1.85; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 16px; background: #fff; padding: 14px; z-index: 50; }
.skip-link:focus { top: 12px; }
.ui-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }

/* Persistent navigation */
.sidebar {
  width: 216px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 32px 16px;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 23px; font-weight: 700; text-decoration: none; padding: 0 12px; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px 14px 14px 4px;
  background: var(--blue); color: #fff; font-family: "KaiTi", "STKaiti", serif; font-size: 28px;
  box-shadow: 0 5px 12px #315fd320;
}
.brand small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 1px; margin-top: 3px; }
.nav-caption { margin: 48px 16px 16px; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }
#navigation { display: grid; gap: 8px; }
#navigation button {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 49px;
  text-align: left; padding: 13px 17px; border-radius: 11px; color: #607087;
  transition: background .18s, color .18s;
}
.nav-icon { width: 21px; height: 21px; display: inline-flex; flex: none; }
.nav-icon svg { width: 100%; height: 100%; }
#navigation button:hover { background: #f4f7fc; color: var(--blue); }
#navigation button.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
#navigation button.active::after { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; margin-left: auto; }
.sidebar-bottom { position: absolute; bottom: 28px; left: 28px; right: 20px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12px; color: #596e8c; }
.sidebar-bottom small { display: block; font-size: 10px; margin-top: 8px; line-height: 1.8; }
.local-dot { display: inline-block; width: 6px; height: 6px; background: #4b927a; border-radius: 50%; margin-right: 7px; }
.shell { margin-left: 216px; }
.topbar { min-height: 72px; background: #ffffffbf; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 15px 36px; gap: 14px; }
.topbar > div { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar-word { color: var(--muted); font-size: 12px; letter-spacing: .5px; }
.topbar-divider { color: #bdc9da; }
#breadcrumb { font-size: 13px; white-space: nowrap; }
.topbar-account { flex-wrap: wrap; justify-content: flex-end; }
.account-controls { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.account-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.topbar-account .text-button { white-space: nowrap; }
main { max-width: 1480px; min-height: calc(100vh - 140px); padding: 34px 36px 48px; margin: 0 auto; }
footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; padding: 22px 36px; color: var(--muted); font-size: 11px; line-height: 1.8; }

/* Shared controls and content */
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 28px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { margin: 6px 0 10px; overflow-wrap: anywhere; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.page-heading > .button { flex: none; }
.eyebrow { color: #526e96; font-size: 11px; font-weight: 500; letter-spacing: 1.7px; margin: 0 0 8px; line-height: 1.7; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
  padding: 11px 18px; border: 1px solid transparent; border-radius: 10px; background: var(--blue);
  color: #fff; font-size: 13px; font-weight: 600; line-height: 1.6; text-decoration: none;
  transition: background .18s, box-shadow .18s, border-color .18s;
}
.button:hover:not(:disabled) { background: #244fbf; box-shadow: 0 4px 10px #315fd322; }
.button.secondary { color: #4e6384; background: #fff; border-color: #dce4ef; }
.button.secondary:hover:not(:disabled) { border-color: #adc1e9; background: #f7faff; box-shadow: none; }
.button.quiet { background: var(--blue-soft); color: var(--blue); }
.button.quiet:hover:not(:disabled) { background: #e0eaff; box-shadow: none; }
.button.danger { background: #fff3f5; color: var(--danger); border-color: #edd4dc; }
.button.danger:hover:not(:disabled) { background: #fce6eb; box-shadow: none; }
.text-button { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 12px; text-align: left; padding: 7px 0; line-height: 1.7; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.actions.end { justify-content: flex-end; }
.badge, .status-pill { display: inline-block; padding: 4px 9px; border-radius: 7px; background: var(--blue-soft); color: #41649e; font-size: 11px; line-height: 1.7; }
.status-pill { background: #edf5f1; color: var(--green); }
.count-pill { display: inline-block; min-width: 24px; margin-left: 6px; padding: 2px 7px; border-radius: 7px; background: #eaf0fc; color: #4b6caa; font-size: 12px; font-weight: 500; text-align: center; vertical-align: middle; }
.card { min-width: 0; padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-title h2 { font-size: 18px; margin: 0; }
.section-title small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > div:first-child { min-width: 0; }
.row strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.row small { display: block; font-size: 12px; line-height: 1.9; margin-top: 5px; }
.row .actions { margin: 0; flex-shrink: 0; }
.fine { font-size: 12px; color: var(--muted); line-height: 1.85; }
.pretext { white-space: pre-wrap; overflow-wrap: anywhere; }
.list-clean { color: #586c89; padding-left: 20px; font-size: 13px; line-height: 2; }
.note { background: #f0f5fd; border: 1px solid #e3ebfa; border-radius: 10px; margin: 16px 0; padding: 14px 16px; color: #4f678c; font-size: 12px; line-height: 1.95; overflow-wrap: anywhere; }
.note.warning { background: #fff8eb; border-color: #f2e4c4; color: var(--amber); }
.note.error { background: #fff2f5; border-color: #f1d9e0; color: var(--danger); }
.note p:last-child { margin-bottom: 0; }
.empty { padding: 34px 24px; text-align: center; border: 1px dashed #cbd8ec; border-radius: 15px; background: #fafdff; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 16px; color: #7294cc; background: #edf3fc; }
.empty-icon .ui-icon { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; margin-bottom: 8px; }
.empty p { max-width: 480px; font-size: 13px; color: var(--muted); margin: 0 auto; }
.empty .actions { justify-content: center; margin-top: 20px; }
.loading { padding: 64px 20px; text-align: center; color: var(--muted); line-height: 1.9; }
.toolbar { display: flex; gap: 12px; margin-bottom: 22px; align-items: center; }
.toolbar input { max-width: 480px; margin-top: 0; background: #fff; }
.field { display: block; font-size: 13px; font-weight: 600; color: #4e6080; margin: 20px 0; }
.field small { display: block; font-size: 12px; font-weight: 400; line-height: 1.8; margin: 7px 0; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; min-width: 0; border: 1px solid #d8e1ef; border-radius: 10px; background: #fafcff; padding: 12px 14px; color: var(--ink); margin-top: 9px; font-weight: 400; line-height: 1.6; transition: border-color .18s, background .18s; }
input::placeholder, textarea::placeholder { color: #76859a; }
input:hover, textarea:hover, select:hover { border-color: #b0c1de; }
textarea { resize: vertical; min-height: 110px; line-height: 1.95; }
input[type=checkbox] { accent-color: var(--blue); width: 17px; height: 17px; flex-shrink: 0; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.9; color: #566c8c; margin: 18px 0; }
.check input { display: inline-block; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tag-list, .terms { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 24px; }
.stat-row > div { flex: 1; min-width: 90px; }
.stat-row strong { display: block; font-size: 28px; font-weight: 600; margin: 8px 0; }
.stat-row span { color: var(--muted); font-size: 12px; }

/* Dashboard: one prominent book, calm supporting surfaces. */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 24px; align-items: start; }
.dashboard-main, .dashboard-side, .dashboard-grid section { min-width: 0; }
.dashboard-main.stack { gap: 28px; }
.dashboard-side.stack { gap: 20px; }
.continue-card {
  isolation: isolate; position: relative; display: flex; align-items: center; gap: 22px; overflow: hidden;
  min-height: 288px; padding: 32px; border-radius: 20px; background: #2c56b5; color: #fff;
  box-shadow: 0 12px 28px #244ea51c;
}
.continue-card::before { content: ""; position: absolute; z-index: -1; width: 390px; height: 390px; right: -170px; top: -190px; border: 1px solid #ffffff19; border-radius: 50%; box-shadow: 0 0 0 48px #ffffff07, 0 0 0 96px #ffffff05; pointer-events: none; }
.hero-copy { flex: 1; min-width: 0; }
.hero-copy h2 { font-size: 30px; font-weight: 700; line-height: 1.5; letter-spacing: -.3px; margin: 13px 0 12px; overflow-wrap: anywhere; }
.hero-copy p { font-size: 13px; line-height: 1.95; color: #e2eaff; max-width: 420px; overflow-wrap: anywhere; margin-bottom: 0; }
.hero-kicker { font-size: 12px; color: #e4edff; letter-spacing: .6px; }
.hero-kicker::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: #b2e6d8; vertical-align: 2px; }
.hero-copy .hero-subject { font-size: 11px; color: #d1dfff; margin: 20px 0 -4px; }
.button.hero-button { background: #fff; color: #254fae; box-shadow: 0 3px 8px #183d8c20; }
.button.hero-button:hover:not(:disabled) { background: #edf3ff; }
.button.hero-outline { background: #ffffff08; color: #fff; border-color: #a0b9ef; }
.button.hero-outline:hover:not(:disabled) { background: #ffffff18; }
.hero-caption { color: #e0eaff; font-size: 12px; }
.study-paper { position: relative; flex: none; width: 168px; padding: 23px 20px; margin: 4px 5px 4px 0; background: #fcfdff; color: #47628c; border: 1px solid #fff; border-radius: 6px 14px 14px 6px; transform: rotate(8deg); box-shadow: -5px 5px 0 #d5e1fb, -9px 9px 0 #ffffff29, 0 18px 28px #122f752e; }
.study-paper::before { content: ""; position: absolute; top: -1px; right: 24px; height: 37px; width: 15px; background: #b3d9d2; clip-path: polygon(0 0,100% 0,100% 100%,50% 79%,0 100%); }
.paper-label { font-size: 11px; font-weight: 600; margin: 20px 0 24px; }
.paper-line { height: 4px; background: #dfe8f7; border-radius: 3px; margin-bottom: 11px; }
.paper-line.short { width: 65%; margin-bottom: 25px; }
.study-paper > span { font-size: 10px; color: #657d9c; }
.paper-mark { font-family: "KaiTi", "STKaiti", serif; text-align: right; font-size: 25px; color: #4e76b5; margin-top: 25px; }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.course-card:hover, .course-card:focus-within { border-color: #bdcdeb; box-shadow: 0 7px 24px #223e7014; }
.course-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-symbol { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: #edf3ff; color: #5074bb; }
.course-symbol .ui-icon { width: 23px; height: 23px; }
.course-card h3 { font-size: 17px; margin: 3px 0 0; overflow-wrap: anywhere; }
.course-card p { margin: 0; color: var(--muted); font-size: 13px; }
.course-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.course-bottom small { font-size: 11px; }
.material-shortcut { display: flex; align-items: center; gap: 13px; width: 100%; padding: 16px 0; text-align: left; border-bottom: 1px solid var(--line); }
.material-shortcut:last-child { border: 0; padding-bottom: 4px; }
.material-shortcut:hover strong { color: var(--blue); }
.material-shortcut > span:nth-child(2) { flex: 1; min-width: 0; }
.material-shortcut > span:last-child { color: #607fae; }
.material-shortcut strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.material-shortcut small { display: block; font-size: 11px; margin-top: 6px; }
.file-symbol { display: grid; place-items: center; flex: none; width: 40px; height: 47px; background: #edf3fc; border: 1px solid #dde6f5; border-radius: 5px 12px 5px 5px; color: #4c71ad; font-size: 10px; font-weight: 600; }
.today-panel .section-title { margin-bottom: 12px; }
.today-panel h2, .dashboard-side h2 { font-size: 17px; }
.today-panel .dialog-copy { margin-bottom: 5px; }
.today-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 18px 0; text-align: left; border-bottom: 1px solid var(--line); }
.today-item:hover strong { color: var(--blue); }
.today-item > span:nth-child(2) { flex: 1; min-width: 0; }
.today-item strong { display: block; font-size: 13px; font-weight: 600; }
.today-item small { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 5px; overflow-wrap: anywhere; }
.today-item > span:last-child { color: #6480b0; }
.today-dot { width: 8px; height: 8px; border-radius: 3px; background: #6486cf; flex: none; }
.today-dot.pale { background: #d3def1; }
.today-items + p { margin: 16px 0 0; font-size: 11px; }
.advisor-panel { background: #eaf1fd; border-color: #dce6f7; box-shadow: none; }
.advisor-panel .eyebrow { margin-bottom: 10px; }
.advisor-panel h2 { margin: 0 0 12px; }
.advisor-panel .fine { font-size: 11px; }
.review-shortcut { display: block; width: 100%; padding: 16px 0; text-align: left; border-bottom: 1px solid var(--line); }
.review-shortcut:first-of-type { padding-top: 0; }
.review-shortcut:last-child { border: 0; padding-bottom: 0; }
.review-shortcut:hover strong { color: var(--blue); }
.review-shortcut strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.8; }
.review-shortcut small { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 6px; }
.quiet-note { padding: 0 12px; margin: 0; font-size: 11px; line-height: 2; }
.hero { background: var(--deep); color: #fff; padding: 36px; }
.hero .eyebrow, .hero p { color: #d2e1ff; }
.hero h2 { font-size: 28px; }
.hero .button { background: #fff; color: var(--deep); }
.hero-rule { width: 70px; height: 3px; background: #a7c4ff; margin-top: 24px; }

/* Study diary: quiet blue activity tiles, one column per week. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.calendar-card .section-title { align-items: flex-start; }
.calendar-card .section-title .fine { margin: 8px 0 0; }
.calendar-frame { background: #f6f8fd; border-radius: 12px; padding: 18px 14px 12px; }
.calendar-layout { display: flex; gap: 9px; }
.calendar-labels { display: grid; grid-template-rows: repeat(7, 10px); gap: 4px; align-items: center; flex: none; width: 26px; margin-top: 25px; color: var(--muted); font-size: 10px; }
.calendar-scroll { min-width: 0; flex: 1; overflow-x: auto; padding: 3px 2px 5px; scrollbar-width: thin; }
.calendar-matrix { min-width: calc(var(--calendar-weeks) * 13.5px - 4px); }
.calendar-months { display: grid; grid-template-columns: repeat(var(--calendar-weeks), minmax(0, 1fr)); height: 22px; font-size: 10px; line-height: 15px; color: var(--muted); }
.calendar-months span { white-space: nowrap; }
.activity-calendar { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); grid-template-columns: repeat(var(--calendar-weeks), minmax(0, 1fr)); gap: 4px; }
.activity-day { min-width: 0; height: 10px; border: 1px solid #315fd30c; border-radius: 3px; padding: 0; }
.activity-day:hover:not(:disabled) { outline: 1px solid var(--blue); outline-offset: 1px; }
.calendar-card .level-0 { background: #e5ebf4; }
.calendar-card .level-1 { background: #cbdafa; }
.calendar-card .level-2 { background: #9cbaf2; }
.calendar-card .level-3 { background: #638edf; }
.calendar-card .level-4 { background: #315fd3; }
.activity-day.outside { visibility: hidden; }
.activity-day[aria-pressed="true"] { outline: 1px solid var(--blue); outline-offset: 1px; }
.activity-day:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.calendar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.calendar-bottom .fine { margin-bottom: 0; font-size: 11px; }
#calendar-detail { color: var(--deep); }
.calendar-legend { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.calendar-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.calendar-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 10px 0 0; font-size: 10px; }
.calendar-caption span { display: none; }
.activity-item { font-size: 13px; line-height: 1.9; padding: 18px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item time { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }

/* Reading desk: stable text, adjacent tools, restrained chrome. */
.reading-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 24px; }
.reading-head > div { min-width: 0; }
.reading-head h1 { font-size: 27px; margin: 8px 0 10px; overflow-wrap: anywhere; }
.reading-head p { color: var(--muted); font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.reading-head .badge { margin-left: 5px; }
.reading-head .actions { justify-content: flex-end; gap: 8px; margin-top: 5px; max-width: 415px; }
.reading-head .button { padding: 9px 13px; font-size: 12px; min-height: 40px; }
.lesson-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.lesson-tabs button { padding: 10px 15px; border: 1px solid #dce4f0; border-radius: 9px; background: #fff; font-size: 13px; line-height: 1.7; text-align: left; }
.lesson-tabs button.active { border-color: #c2d1ee; background: #e7efff; color: #2d58ae; font-weight: 600; }
.reading-layout { display: grid; grid-template-columns: 166px minmax(0, 1fr); gap: 24px; }
.outline { position: sticky; top: 24px; align-self: start; min-width: 0; }
.outline h2 { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 1px; margin: 2px 0 18px; }
.outline button { display: block; width: 100%; border-left: 2px solid #dce4f1; padding: 12px 14px; color: #5c708f; font-size: 13px; line-height: 1.8; text-align: left; overflow-wrap: anywhere; }
.outline button:hover { color: var(--blue); background: #edf3ff; }
.outline button.active { border-color: var(--blue); color: var(--blue); background: #e7effe; border-radius: 0 8px 8px 0; font-weight: 600; }
.outline small { display: block; font-size: 11px; line-height: 1.9; margin: 22px 14px; }
.reading-content { min-width: 0; }
.workspace-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.workspace-toolbar .button { gap: 7px; min-height: 40px; padding: 8px 12px; font-size: 12px; font-weight: 500; }
.workspace-toolbar .ui-icon { width: 16px; height: 16px; }
.workspace-toolbar [aria-expanded="true"] { color: #2854ad; background: #e4edff; border-color: #abc1eb; box-shadow: inset 0 0 0 1px #abc1eb20; }
.reading-desk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.reading-desk.with-panel { grid-template-columns: minmax(0, 1fr) minmax(280px, .74fr); }
.article { min-width: 0; padding: 34px; }
/* Tool changes resize this column; keep the app's saved scroll position. */
.reading-desk .article { max-height: 72vh; min-height: 420px; overflow: auto; overflow-anchor: none; overscroll-behavior: contain; scrollbar-gutter: stable; }
.article > .eyebrow { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.article h2 { font-size: 25px; line-height: 1.65; margin: 22px 0 24px; letter-spacing: -.3px; }
.article h3 { font-size: 14px; color: #536e96; margin-top: 28px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: #354761; font-size: 16px; line-height: 2.15; }
.example { padding: 18px 21px; margin: 26px 0; border-left: 3px solid #9db9e6; border-radius: 0 10px 10px 0; background: #f2f6fc; }
.example p { font-size: 14px; margin: 0; }
.reading-pagination { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.reading-pagination .button { font-size: 12px; padding: 10px 15px; }
.workspace-panel { min-width: 0; max-height: 72vh; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 13px; font-size: 14px; }
.workspace-panel h2 { font-size: 20px; margin: 14px 0; }
.workspace-panel h3 { color: #4c668c; font-size: 13px; margin-top: 20px; }
.workspace-panel p { overflow-wrap: anywhere; }
.workspace-panel .field { font-size: 12px; }
.workspace-panel textarea { font-size: 13px; line-height: 1.95; }
.workspace-panel .button { padding: 10px 13px; font-size: 12px; }
.workspace-panel .example { padding: 15px; }
.workspace-panel .eyebrow { margin-top: 22px; }
.inline-term { display: inline; padding: 0 2px; border-radius: 3px; border-bottom: 1px dotted #6688bf; background: #eaf1ff; color: #285398; font: inherit; line-height: inherit; text-align: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.inline-term:hover { background: #dce8ff; }
.term { color: #3e63a1; background: #edf3fc; border-bottom: 1px dotted #7f9cc9; padding: 6px 10px; font-size: 12px; border-radius: 5px; }
.term-more { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 11px; }
.term-more > summary { color: #44699f; font-size: 13px; cursor: pointer; }
.selection-note { margin: 14px 0; }
.selection-note p { max-height: 100px; overflow: auto; font-size: 13px; }
.selection-note small { font-size: 11px; }
.teacher { margin-top: 20px; }
.teacher summary { cursor: pointer; font-size: 13px; color: #526f9f; padding: 2px 0; }
.teacher p { font-size: 13px; color: var(--muted); margin: 15px 0 0; }
.exercise { padding: 24px 0; border-top: 1px solid var(--line); }
.exercise:first-child { border-top: 0; padding-top: 0; }
.exercise .prose { font-size: 14px; }
.prompt { font-size: 15px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.reference { padding: 18px; background: #edf6f1; border: 1px solid #dcebe3; border-radius: 11px; margin-top: 18px; font-size: 13px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Learning preparation is a document page, never an overlay. */
.learning-flow { max-width: 1080px; min-height: calc(100dvh - 150px); margin: 0 auto; padding: 32px 36px 64px; }
.flow-navigation { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 44px; color: var(--muted); font-size: 12px; }
.flow-heading { margin: 0 0 26px; }
.flow-heading h1 { margin: 8px 0 0; font-size: 30px; }
.flow-heading h1:focus { outline: none; }
.flow-content { min-width: 0; }
.flow-content > .dialog-copy { max-width: 760px; font-size: 15px; }
.flow-content .field { max-width: 800px; }
.flow-content .field input, .flow-content .field textarea, .flow-content .field select { background: #fff; }
.flow-content .entry-choice { min-height: 250px; background: var(--surface); }
.flow-content > .actions { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.flow-content .quiz-progress { margin-bottom: 30px; }
.learning-flow-open footer { display: none; }

/* A focused course workspace with room for reading and doing side by side. */
@media (min-width: 761px) {
  .learning-screen .sidebar { width: 88px; padding: 24px 10px; }
  .learning-screen .brand { justify-content: center; padding: 0; }
  .learning-screen .brand > span:last-child, .learning-screen .nav-caption, .learning-screen .sidebar-bottom { display: none; }
  .learning-screen #navigation { margin-top: 30px; gap: 8px; }
  .learning-screen #navigation button { flex-direction: column; justify-content: center; padding: 10px 2px; gap: 5px; font-size: 11px; }
  .learning-screen #navigation button.active::after { display: none; }
  .learning-screen .shell { margin-left: 88px; }
  .learning-screen main { max-width: 1680px; padding: 24px 28px 40px; }
  .learning-screen .toast { left: calc(50% + 44px); }
}
.learning-screen .reading-head { margin-bottom: 20px; }
.learning-screen .reading-layout { grid-template-columns: 144px minmax(0, 1fr); gap: 20px; }
.learning-screen .reading-desk { background: #fff; border: 1px solid var(--line); border-radius: 14px; gap: 0; }
.learning-screen .reading-desk .article { border: 0; box-shadow: none; border-radius: 14px; max-height: calc(100dvh - 245px); min-height: 460px; }
.learning-screen .workspace-panel { border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; max-height: calc(100dvh - 245px); }
.learning-screen .reading-desk.with-panel { grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); }
.learning-screen .workspace-toolbar { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; margin-top: -8px; }
.learning-screen footer { display: none; }

/* Dialogs are reserved for brief confirmations and term explanations. */
dialog { width: min(760px, calc(100vw - 40px)); max-height: 90vh; border: 1px solid #dde5f3; border-radius: 20px; padding: 30px; color: var(--ink); box-shadow: 0 24px 100px #182e5538; }
dialog::backdrop { background: #1c315769; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 23px; }
.dialog-heading h2 { font-size: 25px; margin: 0; }
.dialog-copy { color: #586c89; font-size: 13px; line-height: 1.95; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 9px; color: #647a9a; font-size: 25px; }
.icon-button:hover { background: var(--blue-soft); }
.entry-choice { display: block; width: 100%; text-align: left; border: 1px solid #dce5f4; border-radius: 15px; padding: 26px; background: #f6f9ff; transition: border-color .18s, background .18s; }
.entry-choice:hover { border-color: #91ace4; background: #eef4ff; }
.entry-choice strong { display: block; font-family: var(--heading-font); font-size: 19px; margin: 17px 0 10px; }
.entry-choice p { font-size: 13px; color: var(--muted); margin: 0; }
.entry-arrow { display: block; color: var(--blue); font-size: 12px; margin-top: 20px; }
.entry-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #e5edfc; color: #5b7fbd; }
.entry-icon .ui-icon { width: 24px; height: 24px; }
.preview { max-height: 280px; overflow: auto; background: #f7faff; border: 1px solid var(--line); padding: 18px; border-radius: 10px; font-size: 13px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.preview { font-family: "Cascadia Code", "Consolas", "Microsoft YaHei", monospace; font-size: 12px; }
.page-preview { border-bottom: 1px solid var(--line); margin-bottom: 15px; padding-bottom: 15px; }
.page-preview:last-child { border: 0; margin: 0; padding: 0; }
.page-preview small { display: block; margin-bottom: 8px; }
.options { display: grid; gap: 10px; margin: 22px 0; }
.option { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid #dbe4f3; border-radius: 11px; background: #fff; font-size: 13px; line-height: 1.8; text-align: left; }
.option::before { content: ""; width: 18px; height: 18px; border: 1px solid #b9c9e1; border-radius: 50%; flex-shrink: 0; }
.option.selected { background: var(--blue-soft); border-color: #91ace4; color: #2e58a0; }
.option.selected::before { border: 5px solid var(--blue); background: #fff; }
.quiz-progress { height: 4px; background: #e8eef8; margin: 18px 0 26px; border-radius: 4px; overflow: hidden; }
.quiz-progress > span { display: block; height: 100%; background: #6e93de; }
.accounting { font-size: 11px; color: var(--muted); line-height: 1.9; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 24px; }
.toast { position: fixed; bottom: 24px; left: calc(50% + 108px); transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 40px); padding: 14px 22px; border: 1px solid #ffffff22; border-radius: 12px; background: #243c62; color: #fff; font-size: 13px; line-height: 1.9; box-shadow: 0 8px 30px #12224130; white-space: pre-wrap; }
.toast.error { background: #8e3042; }
.spinner { display: block; width: 30px; height: 30px; border: 3px solid #e0e8f9; border-top-color: var(--blue); border-radius: 50%; margin: 30px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Account entry uses the same paper-and-ink visual language. */
.account-settings { margin-bottom: 24px; }
.auth-screen { background: radial-gradient(ellipse at 15% 35%, #e5edff 0, transparent 56%), #f3f6fb; }
.auth-screen .sidebar, .auth-screen .topbar, .auth-screen footer { display: none; }
.auth-screen .shell { margin: 0; }
.auth-screen main { max-width: 1120px; min-height: 100vh; display: grid; align-items: center; padding: 56px 40px; }
.auth-layout { display: grid; grid-template-columns: 1fr 440px; align-items: center; gap: 80px; }
.auth-intro .brand { padding: 0; margin-bottom: 64px; }
.auth-intro h1 { font-size: 44px; font-weight: 700; line-height: 1.6; letter-spacing: 1px; margin: 18px 0; }
.auth-intro p { font-size: 14px; color: var(--muted); line-height: 2; }
.auth-rule { display: block; width: 48px; height: 4px; border-radius: 2px; background: #7d9cda; margin-top: 32px; }
.auth-card { padding: 34px; border-radius: 22px; box-shadow: 0 16px 60px #27477712; }
.auth-card h2 { font-size: 24px; margin-bottom: 13px; }
.auth-tabs { display: flex; gap: 6px; background: #f0f4fa; border-radius: 10px; padding: 4px; margin-bottom: 28px; }
.auth-tabs button { flex: 1; padding: 10px 14px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.auth-tabs button.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 2px 6px #1c3d7410; }
.auth-card .field { margin: 23px 0; }
.auth-primary { width: 100%; margin-top: 3px; min-height: 46px; }
.auth-card .actions { justify-content: space-between; margin-top: 15px; }
.auth-privacy { border-top: 1px solid var(--line); margin: 26px 0 0; padding-top: 20px; }
.auth-card #login-code { letter-spacing: 8px; font-family: "Consolas", monospace; font-size: 24px; }
.auth-logout { max-width: 520px; margin: auto; }

/* Responsive layouts: sidebar -> rail -> bottom navigation. */
@media (min-width: 1550px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; }
  .continue-card { padding: 38px; }
}
@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 266px; gap: 20px; }
  .continue-card { padding: 28px; }
  .study-paper { display: none; }
  .dashboard-side .card { padding: 22px; }
  .reading-desk.with-panel { grid-template-columns: minmax(0, 1fr); }
  .workspace-panel { max-height: 65vh; }
  .reading-head { flex-wrap: wrap; }
  .reading-head .actions { justify-content: flex-start; max-width: none; margin-top: 0; }
}
@media (max-width: 1080px) {
  .learning-screen #workspace-panel, .learning-screen #course-reading { scroll-margin-top: 120px; }
  .learning-screen .reading-desk.with-panel { grid-template-columns: minmax(0, 1fr); }
  .learning-screen .reading-desk.with-panel .workspace-panel { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .learning-screen .reading-desk.with-panel .article { grid-row: 2; }
  .sidebar { width: 192px; padding: 28px 12px; }
  .brand { padding: 0 8px; }
  #navigation button { padding: 12px 14px; }
  .sidebar-bottom { left: 24px; }
  .shell { margin-left: 192px; }
  .topbar { padding: 15px 26px; }
  main { padding: 28px 26px 40px; }
  .page-heading { align-items: flex-start; gap: 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading > .button { margin-top: 23px; padding: 10px 13px; }
  .dashboard-grid, .workspace-grid { grid-template-columns: 1fr; }
  .dashboard-side.stack { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .dashboard-side .quiet-note { align-self: center; }
  .study-paper { display: block; }
  .reading-layout { grid-template-columns: 146px minmax(0, 1fr); gap: 18px; }
  .article { padding: 28px; }
  footer { padding: 22px 26px; }
  .toast { left: calc(50% + 96px); }
}
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr 390px; gap: 35px; }
  .auth-intro h1 { font-size: 34px; }
  .auth-card { padding: 28px; }
  .account-email { max-width: 120px; }
  .topbar-account, .account-controls { gap: 8px; }
  .topbar-word, .topbar-divider { display: none; }
}
@media (max-width: 760px) {
  .learning-flow { padding: 26px 22px 96px; }
  .flow-navigation { margin-bottom: 30px; }
  .flow-heading h1 { font-size: 25px; }
  .flow-content .entry-choice { min-height: auto; }
  .learning-screen .reading-layout { grid-template-columns: 1fr; gap: 12px; }
  .learning-screen .reading-desk .article { max-height: 70dvh; min-height: 340px; }
  .sidebar { width: 76px; padding: 24px 10px; }
  .brand { padding: 0; justify-content: center; }
  .sidebar .brand > span:last-child, .nav-caption, .sidebar-bottom { display: none; }
  #navigation { margin-top: 32px; gap: 10px; }
  #navigation button { flex-direction: column; justify-content: center; gap: 7px; padding: 11px 3px; font-size: 10px; min-height: 60px; }
  #navigation button.active::after { display: none; }
  .shell { margin-left: 76px; }
  .topbar { min-height: 64px; padding: 13px 22px; }
  main { padding: 26px 22px 36px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 24px; gap: 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading > .button { margin: 0; }
  .course-grid { grid-template-columns: 1fr; }
  .dashboard-side.stack { grid-template-columns: 1fr; }
  .dashboard-side .card { padding: 24px; }
  .hero-copy h2 { font-size: 29px; }
  .study-paper { width: 140px; padding: 20px 16px; }
  .study-paper > span { font-size: 9px; }
  .reading-layout { grid-template-columns: 1fr; gap: 16px; }
  .outline { position: static; display: flex; gap: 8px; padding: 4px 2px 10px; overflow: auto; }
  .outline h2, .outline small { display: none; }
  .outline button { flex: none; width: auto; max-width: 230px; min-width: 110px; border: 1px solid #dce4f1; border-radius: 8px; padding: 9px 13px; font-size: 12px; }
  .outline button.active { border-color: #b9cbed; border-radius: 8px; }
  .reading-head h1 { font-size: 25px; }
  .reading-desk .article { max-height: 65vh; min-height: 340px; padding: 26px; }
  .workspace-panel { max-height: none; }
  .article h2 { font-size: 23px; }
  .prose { font-size: 15px; }
  .row { align-items: flex-start; }
  .row .actions { flex-direction: column; gap: 5px; }
  .pair { grid-template-columns: 1fr; gap: 14px; }
  footer { padding: 20px 22px; flex-direction: column; gap: 6px; }
  .toast { left: calc(50% + 38px); }
}
@media (max-width: 680px) {
  .auth-screen main { padding: 32px 22px; }
  .auth-layout { grid-template-columns: 1fr; gap: 26px; max-width: 440px; margin: auto; width: 100%; }
  .auth-intro .brand { justify-content: flex-start; margin-bottom: 22px; }
  .auth-intro h1 { font-size: 27px; letter-spacing: 0; margin: 12px 0 0; }
  .auth-intro h1 br { display: none; }
  .auth-intro p, .auth-intro .eyebrow, .auth-rule { display: none; }
  .auth-card { padding: 26px; }
  .topbar-account .status-pill { display: none; }
  .account-email { max-width: 110px; }
  .auth-screen .toast { left: 50%; bottom: 24px; }
}
@media (max-width: 480px) {
  .sidebar { width: 100%; height: calc(72px + env(safe-area-inset-bottom)); inset: auto 0 0; padding: 0 4px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid #dce5f3; background: #fffffffa; backdrop-filter: blur(12px); box-shadow: 0 -4px 20px #1b365906; }
  .sidebar > .brand { display: none; }
  #navigation { display: flex; align-items: center; justify-content: space-between; height: 72px; margin: 0; gap: 0; }
  #navigation button { flex: 1; width: auto; gap: 6px; padding: 8px 1px; min-height: 58px; border-radius: 10px; font-size: 10px; }
  .nav-icon { width: 20px; height: 20px; }
  .shell { margin: 0 0 calc(72px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 58px; padding: 12px 18px; }
  #breadcrumb { font-size: 12px; }
  main { padding: 25px 18px 32px; }
  .page-heading { gap: 16px; }
  .page-heading h1 { font-size: 24px; line-height: 1.6; letter-spacing: -.4px; }
  .page-heading p { font-size: 12px; }
  .page-heading > .button { font-size: 12px; min-height: 42px; padding: 10px 15px; }
  .eyebrow { font-size: 10px; letter-spacing: 1px; }
  .dashboard-grid { gap: 22px; }
  .dashboard-main.stack { gap: 26px; }
  .dashboard-side.stack { gap: 18px; }
  .continue-card { padding: 27px 25px; min-height: 284px; border-radius: 18px; }
  .hero-copy h2 { font-size: 28px; }
  .hero-copy p { font-size: 13px; }
  .study-paper { display: none; }
  .hero-caption { font-size: 11px; }
  .continue-card .actions { gap: 12px; }
  .continue-card .button { padding: 11px 14px; font-size: 12px; }
  .card, .dashboard-side .card { padding: 22px; }
  .course-card { padding: 23px; }
  .section-title { gap: 10px; }
  .section-title h2 { font-size: 17px; }
  .section-title .text-button { font-size: 11px; flex: none; }
  .course-bottom { gap: 8px; }
  .calendar-frame { padding: 12px 10px; }
  .calendar-layout { gap: 6px; }
  .calendar-bottom { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .calendar-bottom > span { flex: none; }
  .calendar-card .section-title h2 { font-size: 16px; }
  .calendar-card .section-title .fine { font-size: 11px; }
  .calendar-caption span { display: inline; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input { max-width: none; }
  .row { gap: 12px; }
  .row .button { font-size: 12px; padding: 9px 11px; }
  .reading-head { gap: 16px; }
  .reading-head h1 { font-size: 24px; }
  .reading-head .actions { gap: 7px; }
  .reading-head .button { font-size: 11px; padding: 8px 11px; min-height: 38px; }
  .lesson-tabs { gap: 7px; margin-bottom: 18px; padding-bottom: 15px; }
  .lesson-tabs button { font-size: 12px; padding: 9px 12px; }
  .workspace-toolbar { gap: 7px; }
  .workspace-toolbar .button { font-size: 11px; padding: 9px 11px; }
  .workspace-toolbar .ui-icon { width: 15px; height: 15px; }
  .reading-desk .article { padding: 23px 20px; min-height: 310px; }
  .article h2 { font-size: 22px; }
  .prose { font-size: 15px; line-height: 2.1; }
  .workspace-panel { padding: 21px; }
  .reading-pagination .button { font-size: 11px; padding: 9px 12px; }
  .entry-choice { padding: 23px; }
  .entry-choice strong { font-size: 18px; }
  dialog { padding: 23px; width: calc(100vw - 24px); max-height: 91vh; border-radius: 17px; }
  .dialog-heading h2 { font-size: 22px; }
  .dialog-heading { gap: 10px; }
  .toast { width: max-content; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); }
  .auth-screen .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 25px; }
  input:not([type=checkbox]), textarea, select { font-size: 16px; }
}
@media (hover: hover) {
  ::-webkit-scrollbar { width: 7px; height: 7px; }
  ::-webkit-scrollbar-thumb { background: #c8d3e3; border: 2px solid #f7f9fc; border-radius: 8px; }
  ::-webkit-scrollbar-track { background: #f7f9fc; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
