/* Learning hub. Dark workspace theme by default, a light theme shared with the reading pages
   (data-theme on <html>), system fonts only. Colours are tokens on :root. */

:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #12151c;
  --panel-2: #181c25;
  --panel-3: #222733;
  --line: #20242e;
  --line-2: #303644;
  --text: #eceef2;
  --text-2: #b9bfca;
  --muted: #8d95a3;
  --faint: #7d8594;
  --bar: rgb(11 13 18 / 90%);
  --bar-solid: rgb(11 13 18);
  --float: rgb(14 14 14 / 82%);
  --grid-line: rgb(255 255 255 / 4%);
  --invert-bg: #fff;
  --invert-text: #000;
  --brand: #4c9bff;
  --brand-strong: #1e6bff;
  --brand-soft: rgb(30 107 255 / 14%);
  --t-start: #2dd4bf;
  --t-core: #4c9bff;
  --t-systems: #f5b83d;
  --t-ai: #a78bfa;
  --accent: var(--brand);
  --radius: 12px;
  --topbar: 60px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --num: "DIN Alternate", "Bahnschrift", "D-DIN", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-break: strict; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-track="start"] { --accent: var(--t-start); }
[data-track="core"] { --accent: var(--t-core); }
[data-track="systems"] { --accent: var(--t-systems); }
[data-track="ai"] { --accent: var(--t-ai); }

/* ---------------------------------------------------------------- shared controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn.primary { background: var(--brand-strong); color: #fff; }
.btn.primary:hover { background: #3a7fff; }
.btn.light { background: var(--invert-bg); color: var(--invert-text); }
.btn.light:hover { opacity: .88; }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--faint); background: var(--panel-3); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); background: var(--panel-3); white-space: nowrap; }
.tag.accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.code { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--accent); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.segmented button { height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-text); }
.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang > svg.i { color: var(--muted); width: 15px; height: 15px; }
.icon-tile { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.icon-tile svg.i { width: 19px; height: 19px; }
.icon-tile.lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-tile.lg svg.i { width: 26px; height: 26px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 16px 18px; }
.muted { color: var(--muted); }
.empty { padding: 26px 18px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- intro (landing) */
.intro-page { position: relative; min-height: 100vh; overflow: hidden; }
.intro-page::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 45% 40% at 80% 14%, rgb(30 107 255 / 20%), transparent 70%),
    radial-gradient(ellipse 35% 35% at 96% 60%, rgb(192 132 252 / 14%), transparent 70%),
    radial-gradient(ellipse 30% 30% at 12% 10%, rgb(45 212 191 / 9%), transparent 70%),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: linear-gradient(#000 0, #000 640px, transparent 1000px); mask-image: linear-gradient(#000 0, #000 640px, transparent 1000px); }
.intro-page > * { position: relative; z-index: 1; }
.intro-bar { position: fixed; z-index: 60; top: 12px; left: 16px; right: 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 54px; padding: 0 10px 0 16px; border-radius: 16px; background: var(--float); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.brand .mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-strong); color: #fff; font: 700 12px/1 var(--mono); letter-spacing: .5px; }
.brand small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pill-nav { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.pill-nav .slider { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--brand-strong); transition: transform .32s cubic-bezier(.3,.7,.2,1), width .32s cubic-bezier(.3,.7,.2,1); }
.pill-nav button { position: relative; z-index: 1; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--text-2); transition: color .2s; }
.pill-nav button[aria-current="true"] { color: #fff; }
.intro-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.hero { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 48px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 150px 40px 72px; }
.hero h1 { font-size: clamp(42px, 5.6vw, 76px); line-height: 1.12; font-weight: 800; letter-spacing: -1.5px; }
:lang(zh-Hans) .hero h1 { letter-spacing: 1px; }
.hero h1 .hl { display: inline-block; color: #fff; white-space: nowrap; margin-top: 10px; padding: 2px 18px 8px; border-radius: 16px; background: linear-gradient(100deg, #1e6bff, #6d5dfc 55%, #c084fc); box-shadow: 0 18px 50px -18px rgb(109 93 252 / 60%); }
.hero .lead { margin-top: 26px; max-width: 560px; font-size: 16.5px; line-height: 1.85; color: var(--text-2); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.skip-intro { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.skip-intro input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; font-size: 12.5px; color: var(--text-2); }
.chips span { display: inline-flex; align-items: center; gap: 7px; }
.chips svg.i { width: 15px; height: 15px; color: var(--brand); }

.live { padding: 0; overflow: hidden; background: linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 40%), var(--panel); box-shadow: 0 30px 80px -30px rgb(30 107 255 / 35%); }
.live .panel-head small { font-size: 12px; color: var(--muted); }
.live-row { display: grid; grid-template-columns: 26px 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background .15s; }
.live-row:last-of-type { border-bottom: 0; }
.live-row:hover { background: var(--panel-2); }
.live-row .step { font: 600 12px/1 var(--num); color: var(--faint); }
.live-row b { display: block; font-size: 14px; font-weight: 600; }
.live-row span.sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row .go { color: var(--faint); }
.live-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--muted); }
.resume { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; max-width: 460px; margin-top: 20px; padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.resume small { font-size: 12px; color: var(--accent); font-weight: 600; }
.resume b { grid-column: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume svg.i { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); }
.resume:hover { border-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1160px; margin: 0 auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 26px 28px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font: 700 34px/1.15 var(--num); letter-spacing: -.5px; }
.stats span { font-size: 13px; color: var(--muted); }

.intro-section { max-width: 1160px; margin: 0 auto; padding: 88px 40px 0; }
.intro-section > header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.intro-section h2 { font-size: 32px; font-weight: 700; letter-spacing: -.4px; }
.intro-section header p { max-width: 520px; color: var(--muted); font-size: 14.5px; }
.eyebrow { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--brand); }

.tracks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.track { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-top: 2px solid var(--accent); }
.track h3 { font-size: 16px; font-weight: 650; }
.track p { font-size: 13px; color: var(--muted); }
.track ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.track li a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; }
.track li a:hover { background: var(--panel-2); }
.track li .code { min-width: 66px; }

.how { overflow: hidden; }
.how-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 16px 18px 0; }
.how-tabs button { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; text-align: left; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--line-2); }
.how-tabs button .icon-tile { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); background: var(--panel-2); border-color: var(--line-2); }
.how-tabs button[aria-selected="true"] { color: var(--text); border-color: var(--brand-strong); }
.how-tabs button[aria-selected="true"] .icon-tile { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.how-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; margin: 16px 18px; padding: 18px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.how-card small { font-size: 12px; color: var(--brand); }
.how-card h3 { margin: 2px 0 6px; font-size: 17px; }
.how-card p { color: var(--text-2); font-size: 14px; }
.how-notes { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 18px; }
.how-notes span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); }
.how-notes svg.i { width: 14px; height: 14px; color: var(--t-start); }

.faq { display: grid; gap: 8px; }
.faq details { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg.i { color: var(--muted); transition: transform .2s; }
.faq details[open] summary svg.i { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--text-2); font-size: 14px; line-height: 1.8; max-width: 860px; }
.intro-end { display: flex; justify-content: space-between; align-items: center; gap: 24px; max-width: 1160px; margin: 88px auto 0; padding: 30px 40px; border-radius: 18px; background: radial-gradient(ellipse at 90% 0, rgb(30 107 255 / 30%), transparent 60%), var(--panel); border: 1px solid var(--line-2); }
.intro-end h2 { font-size: 24px; }
.intro-end p { margin-top: 6px; color: var(--muted); }

/* ---------------------------------------------------------------- workspace */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; height: var(--topbar); padding: 0 24px; background: var(--bar); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.main-nav { display: flex; align-self: stretch; gap: 4px; }
.nav-item { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 13.5px; color: var(--muted); white-space: nowrap; transition: color .15s; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 600; }
.nav-item.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-item svg.i { width: 16px; height: 16px; }
.nav-short { display: none; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top-link { font-size: 13px; color: var(--muted); white-space: nowrap; }
.top-link:hover { color: var(--text); }

.shell { max-width: 1240px; margin: 0 auto; padding: 26px 24px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { height: 30px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); }
.filters button[aria-pressed="true"] { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.search { display: flex; align-items: center; gap: 8px; width: min(280px, 100%); height: 32px; padding: 0 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.search svg.i { width: 15px; height: 15px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 13px; }
.search:focus-within { border-color: var(--brand); }

.course-table { width: 100%; border-collapse: collapse; }
.course-table th { padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.course-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.course-table tr:last-child td { border-bottom: 0; }
.course-table tbody tr { transition: background .15s; }
.course-table tbody tr:hover { background: var(--panel-2); }
.course-table .right { text-align: right; }
.course-table td.n { font: 600 15px/1 var(--num); white-space: nowrap; }
.course-table td.n small { display: block; margin-top: 4px; font-family: inherit; font-size: 11.5px; font-weight: 400; line-height: 1.2; color: var(--muted); }
.star { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--faint); }
.star:hover { color: var(--text); background: var(--panel-3); }
.star[aria-pressed="true"] { color: #f5b83d; }
.star[aria-pressed="true"] svg.i { fill: currentColor; }
.cell-course { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-course .t { min-width: 0; }
.cell-course b { display: block; font-size: 14.5px; font-weight: 600; }
.cell-course b a:hover { color: var(--brand); }
.cell-course .alt { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }
.cell-course .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.progress-line { display: block; width: 72px; height: 4px; margin-top: 7px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--accent); }

.detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 22px; }
.detail-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.detail-head .alt { margin-top: 2px; color: var(--muted); font-size: 14px; }
.detail-head .desc { margin-top: 12px; max-width: 760px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.detail-head .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts div { padding: 14px 22px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font: 700 22px/1.2 var(--num); }
.facts dd.text { font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.9; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-top: 16px; align-items: start; }
.side { position: sticky; top: calc(var(--topbar) + 16px); display: grid; gap: 16px; }
.side .panel-body { display: grid; gap: 10px; }
.side .btn { width: 100%; }
.side ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.75; }
.side li + li { margin-top: 4px; }
.side .resume-mini { padding: 12px; border-radius: 10px; background: var(--brand-soft); font-size: 13px; }
.side .resume-mini small { display: block; color: var(--brand); font-size: 12px; font-weight: 600; }
.stage { border-bottom: 1px solid var(--line); }
.stage:last-child { border-bottom: 0; }
.stage-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 8px; }
.stage-head h3 { font-size: 13px; font-weight: 600; color: var(--accent); }
.stage-head span { font-size: 12px; color: var(--muted); }
.chapter { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; transition: background .15s; }
.chapter:hover { background: var(--panel-2); }
.chapter .no { font: 600 13px/1 var(--num); color: var(--faint); }
.chapter .ttl { display: block; font-size: 14px; }
.chapter .ttl:hover { color: var(--brand); }
.chapter .alt { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }
.chapter .langs { display: flex; gap: 4px; }
.chapter .langs a { padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); }
.chapter .langs a:hover { color: var(--text); border-color: var(--brand); background: var(--brand-soft); }
.chapter.current { background: var(--brand-soft); }
.chapter.current .no { color: var(--brand); }

.route { display: grid; gap: 14px; }
.route-stage { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; }
.route-rail { position: relative; display: flex; justify-content: center; }
.route-rail::after { content: ""; position: absolute; top: 46px; bottom: -18px; width: 2px; background: linear-gradient(var(--accent), transparent); opacity: .5; }
.route-stage:last-child .route-rail::after { display: none; }
.route-rail b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font: 700 16px/1 var(--num); color: #000; background: var(--accent); }
.route-body h2 { font-size: 18px; font-weight: 650; }
.route-body > p { margin: 4px 0 12px; color: var(--muted); }
.route-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.route-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; transition: border-color .15s, background .15s; }
.route-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.route-card b { display: block; font-size: 14px; }
.route-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.sheet { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.sheet .top { display: flex; align-items: center; gap: 12px; }
.sheet b { display: block; font-size: 14px; }
.sheet small { display: block; font-size: 12px; color: var(--muted); }
.sheet .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.sheet.feature { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; background: radial-gradient(ellipse at 100% 0, rgb(30 107 255 / 22%), transparent 60%), var(--panel); }
.sheet.feature b { font-size: 16px; }

.mine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mini-list { list-style: none; margin: 0; padding: 6px 0; }
.mini-list li a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 18px; }
.mini-list li a:hover { background: var(--panel-2); }
.mini-list b { display: block; font-size: 13.5px; font-weight: 600; }
.mini-list small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 22px 24px 30px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.foot a:hover { color: var(--text); }
.intro-page .foot { margin-top: 70px; padding-left: 40px; padding-right: 40px; max-width: 1240px; }
.noscript { max-width: 720px; margin: 60px auto; padding: 0 24px; line-height: 1.9; }
.noscript a { color: var(--brand); }

/* ---------------------------------------------------------------- motion */
.reveal { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.reveal.d1 { animation-delay: .06s; } .reveal.d2 { animation-delay: .12s; } .reveal.d3 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .pill-nav .slider { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 120px; }
  .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  /* on narrow screens the reading actions come before the long chapter list, the rest after it */
  .side { display: contents; }
  .side > :first-child { order: -1; }
  .side > :not(:first-child) { order: 1; }
  .mine-grid { grid-template-columns: minmax(0, 1fr); }
  .how-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1160px) {
  /* between the phone tab bar and a wide window the top bar is tight: the homepage link stays in the footer */
  .top-link, .topbar .brand small { display: none; }
  .topbar { gap: 16px; }
  .nav-item { padding: 0 9px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  /* the short labels of the phone tab bar keep the top bar on one line */
  .nav-long { display: none; }
  .nav-short { display: inline; }
}
@media (max-width: 860px) {
  .intro-bar { grid-template-columns: auto 1fr; }
  .intro-bar .pill-nav { display: none; }
  .course-table thead, .course-table .hide-sm { display: none; }
  .course-table, .course-table tbody, .course-table tr, .course-table td { display: block; }
  .course-table tr { position: relative; padding: 14px 14px 14px 52px; border-bottom: 1px solid var(--line); }
  .course-table td { padding: 0; border: 0; }
  .course-table td.star-cell { position: absolute; left: 12px; top: 18px; }
  .course-table td.n { display: inline-block; margin: 10px 18px 0 0; }
  .row-actions { justify-content: flex-start; margin-top: 12px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  /* a backdrop filter would make the top bar the containing block of the fixed tab bar */
  .topbar { gap: 12px; padding: 0 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bar-solid); }
  .topbar .brand small, .top-link { display: none; }
  .main-nav { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: 60px; padding: 0 6px env(safe-area-inset-bottom); justify-content: space-around; gap: 0; background: var(--bar-solid); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 11px; }
  .nav-item.active::after { top: -1px; bottom: auto; left: 30%; right: 30%; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .shell { padding: 18px 16px 96px; }
  .foot { padding-bottom: 84px; }
  .hero { padding: 104px 16px 48px; }
  .hero h1 .hl { padding: 0 12px 6px; border-radius: 12px; }
  .intro-bar { left: 10px; right: 10px; top: 8px; padding: 0 8px 0 12px; }
  .intro-bar .brand small { display: none; }
  .intro-section { padding: 64px 16px 0; }
  .intro-section > header { flex-direction: column; align-items: start; }
  .intro-section h2 { font-size: 26px; }
  .tracks { grid-template-columns: minmax(0, 1fr); }
  .how-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-end { flex-direction: column; align-items: start; margin: 64px 16px 0; padding: 24px; }
  .intro-page .foot { padding-left: 16px; padding-right: 16px; padding-bottom: 30px; }
  .detail-head { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .detail-head .icon-tile { display: none; }
  .detail-head .head-actions { display: none; }
  .chapter { grid-template-columns: 28px minmax(0, 1fr); padding: 10px 14px; }
  .chapter .langs { grid-column: 2; }
  .sheet.feature { flex-direction: column; align-items: start; }
  .page-head { flex-direction: column; align-items: start; }
  .route-stage { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .route-rail b { width: 32px; height: 32px; font-size: 14px; }
  .route-rail::after { top: 38px; }
}
@media (max-width: 520px) {
  .intro-bar { grid-template-columns: auto minmax(0, 1fr); gap: 6px; padding: 0 6px 0 8px; }
  .intro-bar .brand { min-width: 0; font-size: 0; gap: 0; }
  .intro-bar .brand .mark { font-size: 12px; }
  .intro-actions { gap: 4px; min-width: 0; }
  .intro-actions .lang > svg.i { display: none; }
  .intro-actions .btn.primary { padding: 0 10px; white-space: nowrap; }
  .top-actions .lang > svg.i { display: none; }
  .segmented button { padding: 0 8px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .intro-actions .btn.primary { padding: 0 12px; }
  .stats div { padding: 18px 16px; }
  .stats b { font-size: 26px; }
}

/* ---------------------------------------------------------------- learning map */
.map-card { overflow: hidden; background: radial-gradient(ellipse at 70% 0, rgb(76 155 255 / 8%), transparent 60%), var(--panel); box-shadow: 0 40px 90px -40px rgb(30 107 255 / 45%); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--d); }
.map { display: block; width: 100%; height: auto; }
.map .district { fill: color-mix(in srgb, var(--d) 7%, transparent); stroke: color-mix(in srgb, var(--d) 30%, transparent); stroke-width: 1; stroke-dasharray: 4 5; }
.map .district-name { font: 700 10.5px/1 -apple-system, "PingFang SC", sans-serif; letter-spacing: 2px; fill: color-mix(in srgb, var(--d) 75%, #fff); opacity: .75; }
.map .river { fill: none; stroke: rgb(76 155 255 / 22%); stroke-width: 13; stroke-linecap: round; }
.map .river-glint { fill: none; stroke: rgb(140 190 255 / 35%); stroke-width: 1.5; stroke-dasharray: 10 22; animation: flow 6s linear infinite; }
.map .hills path { fill: #1a1f2a; stroke: color-mix(in srgb, var(--t-systems) 45%, transparent); stroke-width: 1; }
.map .hills .snow { fill: #e9edf5; stroke: none; opacity: .7; }
.map .tree circle { fill: #173a2c; stroke: rgb(52 211 153 / 35%); stroke-width: 1; }
.map .city rect { fill: #171b26; stroke: color-mix(in srgb, var(--t-ai) 40%, transparent); stroke-width: 1; }
.map .city .lit { fill: #ffd43b; stroke: none; opacity: .75; }
.map .road-casing { fill: none; stroke: #07080c; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.map .road { fill: none; stroke: #2a3040; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.map .road-line { fill: none; stroke: rgb(255 255 255 / 45%); stroke-width: 1.4; stroke-dasharray: 6 9; animation: flow 3s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -60; } }
.map .traveller { fill: #fff; filter: drop-shadow(0 0 6px #7ab0ff); }
.map .house { cursor: pointer; outline: none; }
.map .house .shadow { fill: #000; opacity: .45; }
.map .house .body { transition: transform .25s cubic-bezier(.3,.7,.2,1); }
.map .house .wall { fill: #141823; stroke: var(--c); stroke-width: 1.4; }
.map .house .roof { fill: var(--c); }
.map .house .win { fill: #ffe9a3; opacity: .85; }
.map .house .door { fill: color-mix(in srgb, var(--c) 55%, #000); }
.map .house .step { font: 700 8.5px/1 var(--num); fill: #0b0d12; text-anchor: middle; }
.map .house .tag rect { fill: rgb(13 15 21 / 92%); stroke: #2c3240; stroke-width: 1; transition: stroke .2s; }
.map .house .tn { font: 600 11.5px/1 -apple-system, "PingFang SC", sans-serif; fill: #eceef2; text-anchor: middle; }
.map .house .tc { font: 600 9px/1 var(--mono); fill: var(--c); text-anchor: middle; letter-spacing: .4px; }
.map .house:hover .body, .map .house:focus-visible .body { transform: translateY(-4px); }
.map .house:hover .tag rect, .map .house:focus-visible .tag rect { stroke: var(--c); }
.map .house.is-here .wall { stroke-width: 2; }
.map .here .pulse { fill: rgb(255 255 255 / 18%); transform-origin: 0 -7px; animation: ping 2.2s ease-out infinite; }
.map .here .pin { fill: #fff; }
.map .here rect { fill: #fff; }
.map .here text { font: 700 11px/1 -apple-system, "PingFang SC", sans-serif; fill: #0b0d12; }
@keyframes ping { 0% { transform: translateY(-7px) scale(.6); opacity: .9; } 100% { transform: translateY(-7px) scale(2.4); opacity: 0; } }
.map .compass circle { fill: rgb(13 15 21 / 80%); stroke: #2c3240; }
.map .compass path { fill: #4a5162; }
.map .compass .n { fill: #fb7185; }
.map .compass text { font: 700 9px/1 var(--mono); fill: var(--muted); text-anchor: middle; }
.map-caption { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 13px; color: var(--text-2); }
.map-caption > svg.i { color: var(--brand); }
.map-caption .dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.map-caption b { display: block; font-size: 13.5px; color: var(--text); }
.map-caption em { font-style: normal; font-size: 12px; color: var(--muted); }
.map-caption .btn { margin-left: auto; }

/* chapters per stage on the course page */
.stage-bar { display: flex; gap: 4px; padding: 0 22px 20px; }
.stage-bar span { position: relative; min-width: 0; padding-top: 14px; }
.stage-bar i { position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 6px; background: var(--accent); opacity: var(--o); transform-origin: left; animation: grow .7s cubic-bezier(.2,.7,.2,1) both; }
.stage-bar b { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-bar em { font-style: normal; font-size: 11.5px; color: var(--muted); }
@keyframes grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .map .road-line, .map .river-glint, .map .here .pulse, .stage-bar i { animation: none; }
}
@media (max-width: 760px) {
  .legend { display: none; }
  .map-caption .btn { display: none; }
  .stage-bar { flex-direction: column; gap: 10px; padding: 0 18px 18px; }
  .stage-bar span { flex: none !important; }
}

/* ---------------------------------------------------------------- search, route links, small controls */
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg.i { width: 16px; height: 16px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; height: 36px; padding: 0 14px; border-radius: 8px; background: var(--brand-strong); color: #fff; font-size: 13px; font-weight: 600; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
[tabindex="-1"]:focus { outline: none; }
.search kbd { padding: 2px 6px; border-radius: 5px; font: 600 11px/1.3 var(--mono); color: var(--muted); border: 1px solid var(--line-2); }
.search:focus-within kbd { display: none; }
mark { color: inherit; background: rgb(30 107 255 / 32%); border-radius: 3px; }
.hits { margin-top: 16px; }
.hit-list { list-style: none; margin: 0; padding: 6px 0; }
.hit-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; }
.hit-list a:hover { background: var(--panel-2); }
.hit-list small { display: block; font-size: 12px; color: var(--muted); }
.hit-list b { display: block; font-size: 14px; font-weight: 600; }
.hit-list em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.hit-list a > svg.i { color: var(--faint); }
.hits-more { padding: 4px 18px 16px; font-size: 12.5px; color: var(--muted); }
.progress-line.wide, .route-card .progress-line { width: 100%; margin-top: 10px; }
.route-link { display: block; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.route-link:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.route-link small { display: block; font-size: 12px; font-weight: 600; color: var(--accent); }
.route-link b { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 600; }
.peers { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.peers small { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.peers a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.peers a:hover { border-color: var(--accent); color: var(--text); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand); }
.text-link svg.i { width: 15px; height: 15px; }
.route-card .tag { margin-left: 4px; vertical-align: 1px; }
@media (max-width: 760px) {
  .search kbd { display: none; }
  .hit-list a { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- light theme */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #fff;
  --panel-2: #f3f5f9;
  --panel-3: #e7eaf0;
  --line: #e1e5ec;
  --line-2: #cbd2dc;
  --text: #11141b;
  --text-2: #394150;
  --muted: #586172;
  --faint: #677080;
  --brand: #1a5fe6;
  --brand-soft: rgb(30 107 255 / 9%);
  --bar: rgb(255 255 255 / 92%);
  --bar-solid: rgb(255 255 255);
  --float: rgb(255 255 255 / 88%);
  --grid-line: rgb(17 20 27 / 5%);
  --invert-bg: #11141b;
  --invert-text: #fff;
}
/* course colours are tuned for the dark theme; on white, text in a course colour is darkened to stay readable */
:root[data-theme="light"] :is(.code, .tag.accent, .stage-head h3, .resume small, .resume svg.i, .icon-tile[style], .route-link small, .chapter.current .no) { color: color-mix(in srgb, var(--accent) 45%, #0d1017); }
:root[data-theme="light"] .progress-line i { background: color-mix(in srgb, var(--accent) 75%, #0d1017); }
:root[data-theme="light"] .star[aria-pressed="true"] { color: #b7791f; }
:root[data-theme="light"] mark { background: #d6e4ff; }
:root[data-theme="light"] .panel, :root[data-theme="light"] .faq details { box-shadow: 0 1px 2px rgb(17 20 27 / 4%); }
/* the learning map stays a night map in both themes */
:root[data-theme="light"] .map-card {
  --panel: #12151c; --panel-2: #181c25; --panel-3: #222733; --line: #20242e; --line-2: #303644;
  --text: #eceef2; --text-2: #b9bfca; --muted: #8d95a3; --faint: #7d8594; --brand: #4c9bff; --invert-bg: #fff; --invert-text: #000;
  color: var(--text);
}
/* chapters read to the end on a reading page */
.chapter.read .no { color: var(--accent); }
.chapter.read .no::before { content: "✓ " / ""; }

/* Goals, practice, mock papers and the review queue (study.js) */
.nav-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 16px; text-align: center; color: #fff; background: var(--brand-strong); }
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.goal-card { display: flex; gap: 16px; align-items: start; padding: 20px; transition: border-color .15s; }
.goal-card:hover, .goal-card.current { border-color: var(--brand); }
.goal-card b { display: block; font-size: 17px; margin-bottom: 6px; }
.goal-card small { display: block; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.goal-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.goal-banner span { flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; }
.goal-banner .i { flex: none; }
.study-note { margin: 18px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.study-section { margin-bottom: 16px; }
.study-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.study-section .route-cards { margin-top: 10px; }
.study-section-panel { margin-top: 14px; }
.route-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.route-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.route-step.current { border-color: var(--brand); }
.route-step.done { opacity: .72; }
.step-no { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 700; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); }
.route-step.done .step-no { color: var(--brand); }
.route-step h3 { font-size: 15.5px; font-weight: 600; }
.route-step p { margin-top: 3px; color: var(--text-2); font-size: 13.5px; }
.step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; }
.fil { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); }
.fil.on { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.study-select { height: 30px; max-width: 240px; padding: 0 8px; border-radius: 8px; font: inherit; font-size: 12.5px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list a { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); }
.q-list a:hover { background: var(--panel-2); }
.q-title { min-width: 0; }
.q-title b { display: block; font-weight: 550; font-size: 14px; }
.q-title small { display: block; font-size: 12px; color: var(--muted); }
.q-score { flex: none; font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; color: var(--muted); background: var(--panel-2); }
.q-score.full { color: #3ecf8e; background: color-mix(in srgb, #3ecf8e 14%, transparent); }
.q-score.part { color: #e9b44c; background: color-mix(in srgb, #e9b44c 14%, transparent); }
.q-score.zero { color: #f07167; background: color-mix(in srgb, #f07167 14%, transparent); }
.weak-list { list-style: none; margin: 0; padding: 8px 16px 12px; display: grid; gap: 8px; }
.weak-list li { display: grid; grid-template-columns: 90px 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13px; }
.weak-bar { height: 7px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.weak-bar span { display: block; height: 100%; background: var(--accent); }
.q-panel { padding: 22px 24px; }
.q-panel header { margin-bottom: 12px; }
.q-panel h1 { font-size: 21px; font-weight: 650; margin: 8px 0 2px; line-height: 1.35; }
.q-panel h2 { font-size: 17px; margin: 6px 0; }
.q-panel h4 { margin: 16px 0 6px; font-size: 13.5px; font-weight: 650; color: var(--text); }
.q-panel p { margin: 6px 0; font-size: 15px; line-height: 1.7; color: var(--text-2); }
.q-chapter { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.q-prompt p { color: var(--text); }
.q-instruction { font-weight: 600; color: var(--text) !important; margin-top: 14px !important; }
.study-code { margin: 8px 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font: 13.5px / 1.6 var(--mono); color: var(--text); white-space: pre; tab-size: 4; }
.study-answer { display: block; width: 100%; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: 14px / 1.6 var(--mono); white-space: pre; overflow: auto; resize: vertical; tab-size: 4; }
.study-answer:focus, .numeric input:focus, .fill input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.q-label { display: block; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.q-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.q-result { margin: 12px 0; padding: 9px 12px; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--panel-2); font-size: 14px; }
.q-result.pass { border-left-color: #3ecf8e; }
.q-result.fail { border-left-color: #f07167; }
.q-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.q-foot .btn.primary { margin-left: auto; }
.study-list { padding-left: 22px; margin: 6px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.study-list.worked li p { margin: 0 0 4px; color: var(--text); }
.had { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.study-trace { margin: 10px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.study-trace table { width: 100%; border-collapse: collapse; font-size: 13px; }
.study-trace th { padding: 7px 10px; text-align: left; font-weight: 600; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.study-trace td { padding: 6px 10px; border-top: 1px solid var(--line); font-family: var(--mono); }
.study-trace tr.ok td:first-child { color: #3ecf8e; }
.study-trace tr.bad td:first-child { color: #f07167; }
.study-trace td.ok { color: #3ecf8e; }
.study-trace td.bad s { color: #f07167; }
.study-trace td.bad b { color: #3ecf8e; }
.fill input { width: 100%; min-width: 64px; height: 30px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--text); font: 13px var(--mono); }
.mcq { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.mcq li { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; }
.mcq label { display: flex; gap: 10px; align-items: start; font-size: 14.5px; line-height: 1.55; }
.mcq li.ok { border-color: #3ecf8e; }
.mcq li.bad { border-color: #f07167; }
.mcq small { display: block; margin: 4px 0 0 26px; font-size: 12.5px; color: var(--muted); }
.numeric { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.numeric input { width: 180px; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font: 15px var(--mono); }
.paper-note { margin: 14px 0; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 8px; }
.paper-note b { font-size: 13.5px; }
.paper-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.paper-timer b { font: 15px var(--mono); }
.rubric { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.rubric label { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.rubric-m { font: 12px var(--mono); color: var(--accent); }
.mem-diagram { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0; }
.mem-diagram h4 { margin: 0 0 6px; }
.mem-frame, .mem-block { padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); }
.mem-frame h5, .mem-block h5 { margin: 0 0 6px; font: 12px var(--mono); color: var(--muted); }
.mem-var { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font: 13px var(--mono); border-top: 1px solid var(--line); }
.mem-var b { font-weight: 500; }
.mem-var i { font-style: normal; color: var(--accent); }
.exam-bar { position: sticky; top: calc(var(--topbar) + 6px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; background: var(--bar-solid); border: 1px solid var(--line-2); border-radius: 10px; }
.exam-bar b { flex: 1; min-width: 120px; font-size: 13.5px; }
[data-exam-clock] { font: 15px var(--mono); }
[data-exam-clock].near { color: #e9b44c; }
[data-exam-clock].over { color: #f07167; }
.exam-paper { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.exam-q { padding: 18px 20px; }
.exam-q header { display: flex; align-items: center; gap: 10px; }
.exam-no { font: 700 14px var(--mono); color: var(--accent); }
.exam-q h3 { margin: 8px 0 4px; font-size: 15.5px; }
.exam-q p { font-size: 14.5px; line-height: 1.65; color: var(--text-2); margin: 6px 0; }
.exam-q h4 { margin: 12px 0 4px; font-size: 13px; }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 18px 20px; }
.review-stats { display: flex; gap: 26px; margin: 0; }
.review-stats div { display: flex; flex-direction: column-reverse; }
.review-stats dt { font-size: 12.5px; color: var(--muted); }
.review-stats dd { margin: 0; font-size: 26px; font-weight: 650; line-height: 1.2; }
.review-stats small { font-size: 13px; color: var(--muted); font-weight: 400; }
.review-limit { flex-basis: 100%; margin: 0; font-size: 12.5px; }
.deck-list { list-style: none; margin: 0; padding: 0; }
.deck-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.deck-list li:first-child { border-top: 0; }
.deck-name { flex: 1; min-width: 150px; }
.deck-name b { display: block; font-size: 13px; }
.deck-name small { display: block; font-size: 12px; color: var(--muted); }
.deck-count { font-size: 12px; }
.review-progress { position: relative; margin-bottom: 12px; padding-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.review-progress i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--brand); }
.review-front p { color: var(--text); font-size: 16px; }
.review-back { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.rate-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 12px; }
.rate { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 9px 4px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); }
.rate b { font-size: 13.5px; }
.rate small { font-size: 11px; color: var(--muted); }
.rate.again { border-color: #f07167; }
.rate.good { border-color: #3ecf8e; }
.file-btn { cursor: pointer; }
.lab-steps > li { padding-bottom: 8px; }
.lab-steps h4 { margin-top: 2px; }
.lab-steps h5 { margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
.study-code.output { background: var(--bg); }
:root[data-theme=light] .q-score.full, :root[data-theme=light] .study-trace td.ok, :root[data-theme=light] .study-trace td.bad b { color: #137a4c; }
:root[data-theme=light] .q-score.part { color: #8a6412; }
:root[data-theme=light] .q-score.zero, :root[data-theme=light] .study-trace td.bad s, :root[data-theme=light] .study-trace tr.bad td:first-child { color: #b4322a; }
@media (max-width: 760px) {
  .panel-head { flex-wrap: wrap; }
  .goal-grid { grid-template-columns: minmax(0, 1fr); }
  .goal-card { padding: 16px; }
  .q-panel { padding: 16px; }
  .q-panel h1 { font-size: 18.5px; }
  .weak-list { gap: 16px; }
  .weak-list li { display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .weak-name { order: 1; flex: 1 1 0; min-width: 0; }
  .weak-list b { order: 2; }
  .weak-bar { order: 3; flex: 0 0 100%; }
  .weak-list .btn { order: 4; }
  .exam-bar { top: calc(var(--topbar) + 4px); }
  .exam-q { padding: 14px; }
  .study-code { font-size: 13px; }
  .rate-row { gap: 6px; }
  .nav-badge { position: absolute; top: 4px; margin-left: 22px; }
  .main-nav .nav-item { position: relative; }
}
.q-panel code, .exam-q code, .mcq code, .rubric code { padding: 0 4px; border-radius: 4px; background: var(--panel-2); font: 13px var(--mono); }
.study-code del { color: #f07167; text-decoration: none; }
.study-code ins { color: #3ecf8e; text-decoration: none; }
:root[data-theme=light] .study-code del { color: #b4322a; }
:root[data-theme=light] .study-code ins { color: #137a4c; }
