:root {
  color-scheme: light;
  --ink: #202422;
  --muted: #5c6761;
  --line: #e2e5e1;
  --accent: #0e5a99;
  --surface: #f8f9f7;
  --mint: #e8f0eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a, button { color: inherit; }
a { text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #4385b9; outline-offset: 3px; }
.skip { position: fixed; top: -100px; z-index: 5; padding: 12px; background: white; }
.skip:focus { top: 8px; left: 8px; }
.mobile-bar, .menu-close, .sidebar-backdrop { display: none; }
.site-header { position: fixed; inset: 0 auto 0 0; width: 226px; background: var(--surface); border-right: 1px solid var(--line); z-index: 2; }
.header-content { height: 100%; padding: 22px 15px 18px; display: flex; flex-direction: column; gap: 29px; overflow-y: auto; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; width: max-content; gap: 10px; align-items: center; line-height: 1.3; }
.brand img { object-fit: contain; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button, .header-account a, .header-account button { border: 0; border-radius: 6px; background: none; padding: 9px 13px; color: #4f5852; font-size: 14px; white-space: nowrap; }
nav button { text-align: left; }
nav button:hover, .header-account a:hover, .header-account button:hover { background: #ecefeb; color: var(--ink); }
nav button[aria-current="page"] { background: var(--mint); color: #214b37; font-weight: 680; }
.header-account { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.header-account a { display: inline-block; }
.header-account .account-signup { color: var(--accent); }
.header-account button { text-align: left; }
.header-account .account-name { display: block; font-weight: 700; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
main { flex: 1; display: flex; flex-direction: column; margin-left: 226px; }
.container, footer { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.container { padding: 36px 0 54px; flex: 1; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 20px 0 24px; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer a:hover, .link:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { line-height: 1.7; }
.hero { min-height: 334px; background: #eaf0eb url('/assets/signal.webp') center right / cover no-repeat; display: flex; align-items: center; border: 1px solid #e0e8e2; border-radius: 11px; overflow: hidden; }
.hero-content { padding: 38px 10% 40px 5%; width: 100%; background: linear-gradient(90deg, #edf3ef 1%, #edf3eff2 35%, #edf3ef00 94%); }
.hero h1 { font-size: clamp(32px, 5vw, 62px); font-weight: 760; }
.hero p { margin: 12px 0 25px; color: #435049; }
.course { color: #37594a; font-size: 13px; margin-bottom: 15px; font-weight: 650; }
.course i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: #639781; border-radius: 50%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dark, .outline { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; gap: 10px; padding: 8px 16px; border-radius: 6px; font-weight: 650; border: 1px solid var(--ink); }
.dark { background: var(--ink); color: #fff; }
.dark:hover { background: #343e37; }
.outline { background: #fff; border-color: #c9d1cb; }
.outline:hover { background: #f2f6f3; }
.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 620; }
.dashboard { margin-top: 39px; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.heading h2 { font-size: 25px; }
.heading h1 { font-size: clamp(29px, 4vw, 43px); }
.heading p { color: var(--muted); margin: 6px 0 0; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.card { position: relative; min-height: 167px; text-align: left; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff; display: flex; flex-direction: column; align-items: start; gap: 6px; }
.card:hover { background: var(--surface); border-color: #a1b5a8; }
.card strong { font-size: 18px; }
.card :is(span,small):not(.tile-icon) { color: var(--muted); font-size: 13px; }
.card b { position: absolute; bottom: 15px; right: 17px; }
.tile-icon { display: grid; place-items: center; width: 38px; height: 38px; background: var(--mint); border-radius: 7px; color: #315a49; font-size: 25px; margin-bottom: 3px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar select, .short { padding: 9px 11px; border: 1px solid #bac6bd; border-radius: 6px; background: white; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 216px), 1fr)); gap: 12px; }
.row { display: flex; width: 100%; gap: 14px; justify-content: space-between; align-items: center; text-align: left; background: white; padding: 16px; border-radius: 7px; border: 1px solid var(--line); margin-bottom: 8px; }
.row:hover { background: var(--surface); }
.row small { color: var(--muted); }
.group-access { max-width: 790px; margin-bottom: 24px; padding: 22px; border-radius: 10px; border: 1px solid #d3e3d6; background: #f3f8f4; }
.group-access h2 { font-size: 21px; }
.group-access > p { margin: 6px 0 14px; color: #435049; }
.group-access .feedback { margin-bottom: 0; background: #fff; }
.group-access code { font-size: 15px; color: #214b37; }
.group-access .review .actions { margin-bottom: 10px; }
#qq-copy-status { color: var(--muted); font-size: 13px; }
.access-confirmed { color: #225b3e; margin: 0 0 18px; font-weight: 650; }
.year-preview { color: var(--muted); background: var(--surface); }
.practice { width: min(100%, 820px); }
.practice header { margin: 16px 0 18px; }
.practice header h2 { font-size: clamp(19px, 3vw, 25px); }
.practice header .progress { margin-top: 10px; }
.question-nav { display: flex; gap: 10px; justify-content: space-between; margin: 15px 0 0; }
.set-result { max-width: 680px; }
.meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding-bottom: 13px; font-size: 13px; }
.meta span { background: var(--mint); border-radius: 4px; padding: 3px 8px; color: #2f5644; }
.question { border: 1px solid var(--line); border-radius: 10px; padding: clamp(16px, 4vw, 31px); }
.question h1 { font-size: clamp(19px, 3vw, 26px); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
fieldset { border: 0; padding: 0; margin: 19px 0 12px; min-width: 0; }
legend { font-weight: 650; margin-bottom: 6px; white-space: pre-line; }
.option { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; padding: 11px 12px; border: 1px solid #d9e0da; border-radius: 7px; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; white-space: pre-line; }
.option:has(input:checked) { border-color: #71a78c; background: #eef5ef; }
.option input { margin-top: 4px; accent-color: #286748; flex: none; }
.short { display: block; width: 100%; margin: 6px 0 12px; }
.feedback { margin: 10px 0; padding: 11px 13px; border-radius: 7px; background: var(--surface); line-height: 1.55; }
.right { color: #1b6042; }
.wrong { color: #9b3d29; }
.review { margin-top: 14px; background: #f4f7f4; border: 1px solid var(--line); border-radius: 7px; padding: 16px; }
.review p { margin: 5px 0 12px; white-space: pre-line; }
.progress { height: 5px; width: 100%; accent-color: #346e54; }
.math-block { display: block; overflow-x: auto; max-width: 100%; margin: 8px 0; }
.math-block math { margin: 0; }
.learner-panel { width: min(100%, 760px); padding: clamp(14px, 4vw, 24px); border: 1px solid var(--line); border-radius: 10px; }
.account-details { margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.account-details dt { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.account-details dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.account-details .link { margin-inline-start: 8px; }
#profile-form .short { width: min(100%, 380px); margin-bottom: 4px; }
#nickname-hint, .rank-empty { color: var(--muted); }
.rank-opt-in { display: flex; align-items: center; gap: 7px; margin: 15px 0; }
.rank-opt-in input { accent-color: #286748; }
.rank-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.rank-summary p { margin: 0; font-weight: 650; }
.rank-table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
.rank-table :is(th, td) { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.rank-table thead { color: var(--muted); background: var(--surface); }
.rank-table td, .rank-table thead th { white-space: nowrap; }
.rank-table tbody th { overflow-wrap: anywhere; }
.rank-table :is(td, th):last-child { text-align: right; }
.rank-table small { color: #225b3e; }
.my-rank { background: var(--mint); }
@media (max-width: 1000px) {
  .site-header { width: 178px; }
  main { margin-left: 178px; }
  .container, footer { width: calc(100% - 42px); }
}
@media (max-width: 720px) {
  .mobile-bar { display: flex; align-items: center; gap: 13px; padding: 7px 14px; background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 680; }
  .menu-button { border: 1px solid var(--line); border-radius: 6px; background: #fff; min-height: 40px; padding-inline: 10px; }
  .mobile-bar a { flex-shrink: 0; }
  .mobile-account { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
  .menu-close { display: block; min-width: 40px; font-size: 23px; line-height: 1; }
  .site-header { width: min(280px, 82vw); visibility: hidden; transform: translateX(-100%); transition: transform .18s ease, visibility 0s linear .18s; }
  .site-header[data-open] { visibility: visible; transform: translateX(0); transition-delay: 0s; }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1; background: #17291e72; }
  body:has(.site-header[data-open]) { overflow: hidden; }
  body:has(.site-header[data-open]) .skip { visibility: hidden; }
  main { margin-left: 0; }
  .header-content { gap: 22px; padding-block: 14px max(18px, env(safe-area-inset-bottom)); }
  .brand img { width: 34px; height: 34px; }
  nav button, .header-account a, .header-account button { min-height: 44px; }
  .container { padding-top: 18px; }
  .container, footer { width: calc(100% - 28px); }
  .hero { min-height: 240px; background-position: 62% center; }
  .hero-content { padding: 24px 14px; }
  .cards { grid-template-columns: 1fr; gap: 9px; }
  .card { min-height: 130px; }
}
@media (max-width: 345px) {
  .mobile-bar { gap: 7px; padding-inline: 8px; }
  .mobile-bar a { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
