:root {
  --app-viewport-height: 100dvh;
  color-scheme: light;
  --paper: #f6f7fb;
  --paper-deep: #e8e9f2;
  --ink: #2e3856;
  --muted: #646579;
  --forest: #4255ff;
  --green: #4255ff;
  --green-soft: #eef0ff;
  --amber: #825100;
  --amber-soft: #fff6d9;
  --red: #be3f4c;
  --success: #167452;
  --line: #dedfea;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 10px 28px rgba(46, 56, 86, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
body.onboarding-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(66,85,255,.45); outline-offset: 3px; }

.boot-screen {
  min-height: 100svh;
  display: grid;
  place-content: center;
  padding: 32px;
  text-align: center;
  animation: page-in 420ms ease both;
}
.boot-screen h1 { margin: 10px 0 28px; font-size: clamp(2.2rem, 8vw, 4rem); font-weight: 800; letter-spacing: -.05em; }
.boot-line { width: min(280px, 70vw); height: 2px; overflow: hidden; background: var(--paper-deep); }
.boot-line span { display: block; width: 42%; height: 100%; background: var(--green); animation: load 1.2s ease-in-out infinite; }

.app-shell { min-height: 100svh; }
body:has(.focus-shell), body:has(.mock-exam-page) { height: var(--app-viewport-height); min-height: 0; overflow: hidden; overscroll-behavior: none; }
.focus-shell { height: var(--app-viewport-height); min-height: 0; overflow: hidden; background: var(--paper); }
.focus-page { height: var(--app-viewport-height); min-height: 0; overflow: hidden; padding: 0 24px; }
.focus-inner { width: min(100%, 780px); height: 100%; min-height: 0; display: flex; flex-direction: column; margin: 0 auto; }
.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 216px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { text-decoration: none; display: block; margin: 2px 10px 42px; }
.brand-mark { color: var(--green); font-size: 1.7rem; font-weight: 850; letter-spacing: -0.05em; }
.brand-sub { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.nav-list { display: grid; gap: 6px; }
.nav-link { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 680; transition: background 160ms ease, color 160ms ease, transform 160ms ease; }
.nav-link:hover { color: var(--ink); background: var(--paper); transform: translateX(2px); }
.nav-link.active { color: var(--forest); background: var(--green-soft); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-note { margin: auto 10px 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; line-height: 1.65; }
.side-note-link { color: var(--muted); text-underline-offset: 3px; }
.side-note-link:hover { color: var(--forest); }
.mobile-topbar { display: none; }

.page {
  margin-left: 216px;
  min-height: 100svh;
  padding: 42px clamp(28px, 5vw, 72px) 88px;
  animation: page-in 260ms ease both;
}
.page-inner { width: min(100%, 960px); margin: 0 auto; }
.app-footer { margin-left: 216px; padding: 20px clamp(28px, 5vw, 72px) 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; text-align: center; }
.app-footer a { text-underline-offset: 3px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 6px 0 0; font-size: clamp(2rem, 4.5vw, 3.15rem); line-height: 1.08; font-weight: 780; letter-spacing: -.045em; }
.eyebrow { margin: 0; color: var(--green); font-size: .69rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.fine-print { color: var(--muted); font-size: .78rem; line-height: 1.65; }

.primary-btn, .secondary-btn, .quiet-btn, .danger-btn {
  min-height: 48px;
  border-radius: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.primary-btn { background: var(--forest); color: white; box-shadow: 0 3px 0 #3043d6; }
.primary-btn:hover { background: #3648e8; transform: translateY(-1px); }
.primary-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3043d6; }
.secondary-btn { background: var(--white); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.secondary-btn:hover, .quiet-btn:hover { background: var(--green-soft); }
.quiet-btn { min-height: 44px; padding: 7px 11px; background: transparent; border-color: transparent; color: var(--muted); }
.danger-btn { background: transparent; border-color: rgba(170,62,53,.3); color: var(--red); }
.primary-btn:disabled, .secondary-btn:disabled, .danger-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.home-dashboard { width: min(100%, 680px); margin: 0 auto; padding: 42px 0 20px; }
.home-welcome { margin-bottom: 24px; }
.home-kicker { margin: 0 0 10px; color: var(--muted); font-size: .82rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.home-welcome h1 { margin: 0 0 10px; font-size: 2.15rem; line-height: 1.2; font-weight: 780; letter-spacing: -.035em; }
.home-welcome > p:last-child { max-width: 540px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.guided-continue { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 15px 18px; font-size: 1rem; }
.guided-continue span { font-weight: 720; }
.guided-continue b { font-size: 1.1rem; font-weight: 500; transition: transform 160ms ease; }
.guided-continue:hover b { transform: translateX(3px); }
.home-progress-panel { margin-top: 24px; padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.home-progress-heading { display: flex; align-items: baseline; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.home-progress-heading strong { color: var(--ink); font-size: .82rem; font-variant-numeric: tabular-nums; }
.home-progress-value { display: inline; }
.home-progress-panel .progress-track { height: 6px; margin: 10px 0; }
.home-progress-panel p { margin: 0; color: var(--muted); font-size: .78rem; }
.home-actions { display: grid; margin-top: 12px; }
.home-actions a { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 14px 2px; border-bottom: 1px solid var(--line); text-decoration: none; transition: color 160ms ease, transform 160ms ease; }
.home-actions a:hover { transform: translateX(3px); }
.home-actions a:hover { color: var(--green); }
.home-actions strong, .home-actions small { display: block; }
.home-actions strong { font-size: .96rem; }
.home-actions small { margin-top: 5px; color: var(--muted); font-size: .78rem; font-weight: 450; }
.home-actions b { color: #9aa1a7; font-size: 1.05rem; font-weight: 500; }

.home-lead { display: grid; grid-template-columns: 1.45fr .75fr; gap: clamp(28px, 6vw, 80px); padding: 48px 0; border-bottom: 1px solid var(--line); }
.home-lead h2 { margin: 0 0 18px; max-width: 720px; font-size: clamp(2.15rem, 5.5vw, 4.4rem); line-height: 1; font-weight: 790; letter-spacing: -.055em; }
.home-lead p { max-width: 590px; font-size: 1.03rem; line-height: 1.75; }
.home-progress { align-self: end; }
.progress-number { font-size: clamp(3.2rem, 8vw, 6rem); line-height: .85; font-weight: 780; letter-spacing: -.065em; }
.progress-number small { font-size: .26em; color: var(--muted); letter-spacing: 0; }
.progress-track { height: 8px; margin: 20px 0 10px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width 420ms cubic-bezier(.2,.8,.2,1); }

.guided-workspace { padding: clamp(44px, 8vw, 88px) 0 50px; border-bottom: 1px solid var(--line); }
.guided-kicker { margin: 0 0 14px; color: var(--green); font-size: .8rem; font-weight: 800; letter-spacing: .04em; }
.guided-workspace h2 { max-width: 760px; margin: 0; font-size: clamp(3rem, 8vw, 6rem); line-height: .94; font-weight: 800; letter-spacing: -.06em; }
.guided-copy { max-width: 560px; margin: 24px 0 30px; color: var(--muted); line-height: 1.7; }
.simple-progress { max-width: 720px; padding: 34px 0 16px; }
.simple-progress > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.simple-progress span, .simple-progress p { color: var(--muted); font-size: .82rem; }
.simple-progress strong { font-size: 1.5rem; font-weight: 760; }
.simple-progress .progress-track { margin: 10px 0 12px; }
.simple-progress p { margin: 0; }
.home-secondary { margin: 22px 0 0; font-size: .82rem; }
.home-secondary a { color: var(--green); text-underline-offset: 4px; }
.guided-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.guided-strip div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.guided-strip span, .guided-strip small { color: var(--muted); }
.guided-strip strong { font-size: 1.55rem; font-weight: 760; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.metric { padding: 26px 20px 26px 0; }
.metric + .metric { padding-left: 28px; border-left: 1px solid var(--line); }
.metric strong { display: block; font-size: 2rem; font-weight: 760; }
.metric span { color: var(--muted); font-size: .82rem; }

.section-list { margin-top: 42px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.chapter-row { width: 100%; display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 20px; padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.chapter-row:hover .chapter-name { color: var(--green); }
.chapter-code { font-size: 1.25rem; color: var(--green); font-weight: 760; }
.chapter-name { font-weight: 750; transition: color 160ms ease; }
.chapter-meta { color: var(--muted); font-size: .8rem; }

.setup-section { padding: 34px 0; border-bottom: 1px solid var(--line); }
.setup-section h2 { margin: 0 0 8px; font-size: 1.15rem; }
.setup-section p { margin: 0 0 20px; line-height: 1.7; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; background: transparent; border: 0; }
.choice-tile { min-height: 138px; padding: 20px; border: 2px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: 0 3px 0 var(--line); text-align: left; cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.choice-link { color: inherit; text-decoration: none; }
.choice-tile:hover { border-color: var(--green); background: var(--green-soft); z-index: 1; transform: translateY(-2px); box-shadow: 0 3px 0 var(--green); }
.choice-tile strong { display: block; margin-bottom: 8px; font-size: 1rem; }
.choice-tile span { color: var(--muted); font-size: .82rem; line-height: 1.5; }

.study-top { position: relative; z-index: 12; width: min(100%, 780px); min-height: 46px; display: flex; flex: 0 0 auto; align-items: center; gap: 10px; margin: 0 auto; padding: 1px 0 0; border-bottom: 1px solid var(--line); background: rgba(246,247,251,.96); backdrop-filter: blur(16px); }
.study-top .progress-track { height: 6px; flex: 1; margin: 0; }
.study-exit { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: .82rem; text-decoration: none; }
.study-exit:hover { color: var(--ink); }
.study-count { min-width: 60px; text-align: right; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.question-shell { width: min(100%, 780px); min-height: 0; flex: 1 1 auto; margin: 12px auto 0; padding: 0 2px 12px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.prompt-card { padding: clamp(22px, 5vw, 38px); border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 2px 7px rgba(46,56,86,.045); }
.question-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; margin-bottom: 16px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.question-meta span:nth-child(2) { margin-left: auto; }
.question-favorite { width: 44px; height: 44px; display: grid; place-items: center; margin: -14px -15px -10px 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--green); font-size: 1.2rem; cursor: pointer; }
.question-favorite:hover { background: var(--green-soft); }
.question-stem { margin: 0 0 12px; font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.45; font-weight: 740; letter-spacing: -.015em; }
.stem-zh { margin: 12px 0 0; padding: 0; border-radius: 0; background: transparent; color: #56596f; font-size: .94rem; line-height: 1.65; font-weight: 500; }
.language-ribbon { margin: 20px 0 0; padding: 0; border-radius: 0; background: transparent; }
.language-ribbon > span { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; }
.language-ribbon .phrase-list { margin-top: 9px; }
.media-stage { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 24px 0 0; }
.media-stage img { max-height: 270px; width: auto; padding: 6px; border: 0; background: white; border-radius: 10px; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; border-top: 0; }
.option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 108px;
  padding: 17px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  box-shadow: 0 3px 0 var(--line);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.option:hover { border-color: #9da7ff; background: #fbfbff; transform: translateY(-1px); }
.option:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.option.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 3px 0 var(--green); }
.option.correct { border-color: var(--success); background: #effaf6; box-shadow: 0 3px 0 var(--success); }
.option.wrong { border-color: var(--red); background: #fff1f2; box-shadow: 0 3px 0 var(--red); }
.option:disabled { cursor: default; transform: none; color: inherit; }
.option-index { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #a8a9bb; border-radius: 4px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.option.selected .option-index { border-color: var(--green); background: var(--green); color: white; }
.option.correct .option-index { border-color: var(--success); background: var(--success); color: white; }
.option.wrong .option-index { border-color: var(--red); background: var(--red); color: white; }
.option-en { font-size: 1rem; line-height: 1.5; }
.option-zh { display: block; margin-top: 6px; color: #5d6074; font-size: .88rem; line-height: 1.55; }
.option-images { grid-column: 1 / -1; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 0 0; }
.option-images img { max-height: 145px; width: auto; border-radius: 8px; background: white; border: 1px solid var(--line); }
.image-fallback { width: 100%; min-height: 72px; display: grid; place-items: center; padding: 14px; border: 1px dashed #a8a9bb; border-radius: 8px; background: var(--paper); color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }
.support-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; }
.question-actions { position: relative; z-index: 30; width: min(100%, 780px); display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 auto; padding: 5px 0 calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.question-actions .primary-btn, .question-actions .secondary-btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
.answer-submit-group { display: flex; gap: 8px; margin-left: auto; }
.answer-submit-group .secondary-btn { color: var(--muted); }

.answer-panel { margin-top: 24px; padding: 0; overflow: hidden; scroll-margin-top: 72px; border: 1px solid #cfe8df; border-radius: 11px; background: var(--white); }
.feedback-mode .answer-panel { margin-top: 0; }
.answer-panel.is-wrong { border-color: #efc8cc; background: var(--white); }
.answer-state { display: flex; gap: 12px; align-items: center; padding: 16px 18px; background: #effaf6; }
.answer-state > div { min-width: 0; flex: 1; }
.answer-favorite { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; margin-left: auto; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--green); font-size: 1.28rem; cursor: pointer; }
.answer-favorite:hover { background: rgba(66,85,255,.08); }
.is-wrong .answer-state { background: #fff1f2; }
.answer-mark { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--success); color: white; font-size: 1rem; font-weight: 800; }
.is-wrong .answer-mark { background: var(--red); }
.answer-state strong { display: block; font-size: 1.08rem; font-weight: 760; }
.answer-state p { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.post-answer-meaning { margin: 0; padding: 15px 18px; border-top: 0; border-bottom: 1px solid var(--line); }
.post-answer-meaning span { color: var(--muted); font-size: .7rem; font-weight: 650; }
.post-answer-meaning p { margin-top: 5px; font-size: .92rem; }
.answer-panel h3 { margin: 18px 18px 8px; font-size: .82rem; }
.answer-panel p { margin: 0; line-height: 1.75; }
.phrase-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.phrase { display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 10px; background: var(--green-soft); border-radius: 6px; font-size: .82rem; }
.phrase + .phrase::before { content: none; }
.phrase small { color: var(--muted); font-size: .76rem; }
.support-state { margin: 18px 0 0; color: var(--muted); font-size: .8rem; }
.source-answer { margin-top: 12px !important; color: var(--muted); font-size: .78rem; }
.memory-line { margin-top: 16px; padding: 17px 18px; border-top: 1px solid var(--line); }
.is-wrong .memory-line { border-top-color: var(--line); }
.memory-line > span, .memory-heading { color: var(--green); font-size: .7rem; font-weight: 750; }
.memory-line p { margin-top: 5px; font-size: .98rem; font-weight: 650; line-height: 1.6; }
.memory-heading { margin: 0; padding: 15px 18px 0; }
.memory-anchor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 8px; padding: 0 18px 16px; }
.memory-anchor { min-width: 0; padding: 0 14px 0 0; background: transparent; }
.memory-anchor + .memory-anchor { padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.memory-anchor span, .wrong-contrast span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: 0; }
.memory-anchor b, .wrong-contrast b { display: block; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.4; font-weight: 700; }
.memory-anchor small, .wrong-contrast small { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.wrong-contrast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 8px 18px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.wrong-contrast > div { padding: 13px; border: 0; background: #fff7f7; }
.wrong-contrast > div + div { border-left: 1px solid var(--line); }
.wrong-contrast .correct-choice { background: #f1faf7; }
.wrong-reason { margin: 12px 18px 0 !important; color: var(--muted); font-size: .86rem; }
.source-english-note { margin: 16px 18px 0 !important; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #75400d; font-size: .8rem; }
.answer-more { margin-top: 0; border-top: 1px solid var(--line); }
.answer-more summary { padding: 14px 18px; color: var(--muted); font-size: .82rem; font-weight: 650; cursor: pointer; list-style-position: inside; }
.answer-more-body { padding: 0 18px 16px; }
.answer-more-body h3 { margin-left: 0; }
.answer-more-body .quiet-btn { margin-top: 10px; padding-left: 0; }
.attention-note { margin-top: 22px; padding: 18px; border-left: 4px solid var(--amber); background: var(--amber-soft); }
.attention-note strong { color: #75400d; }
.attention-note ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.65; }

.empty-state { padding: 80px 0; text-align: center; }
.empty-state h2 { font-size: 2rem; font-weight: 780; margin-bottom: 10px; }
.mock-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.mock-exam-page { height: var(--app-viewport-height); min-height: 0; overflow: hidden; padding: 12px clamp(18px, 5vw, 72px) 0; background: var(--paper); }
.mock-exam-page .page-inner { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.mock-exam-page .mock-banner, .mock-exam-page .mock-progress { flex: 0 0 auto; }
.mock-exam-page .question-shell { margin-top: 12px; }
.mock-progress { margin: 12px 0 0; }
.timer { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.mock-result { padding: 54px 0; text-align: center; }
.mock-result-actions { justify-content: center; margin-top: 24px; }
.mock-setup { width: min(100%, 680px); margin: 0 auto; padding: 38px 0; border-bottom: 1px solid var(--line); }
.mock-setup h2 { margin: 0; font-size: 1.65rem; line-height: 1.25; font-weight: 780; letter-spacing: -.025em; }
.mock-rule-summary { margin: 12px 0 0; color: var(--ink); font-size: 1rem; font-weight: 720; }
.mock-setup > .muted { margin: 10px 0 0; font-size: .92rem; line-height: 1.65; }
.mock-start-button { width: 100%; min-height: 56px; margin-top: 24px; }
.mock-vision-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.65; }
.score { margin: 8px 0 20px; font-size: clamp(5rem, 15vw, 10rem); line-height: .8; font-weight: 800; letter-spacing: -.09em; }
.score small { font-size: .22em; color: var(--muted); letter-spacing: 0; }

.vision-setup { width: min(100%, 680px); margin: 0 auto; padding: 38px 0; border-bottom: 1px solid var(--line); }
.vision-scope { margin: 0; color: var(--ink); font-size: 1.06rem; font-weight: 650; line-height: 1.65; }
.vision-latest { margin: 12px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.vision-start-button { width: 100%; min-height: 56px; margin-top: 24px; }
.vision-question { width: min(100%, 680px); min-height: 0; flex: 1 1 auto; margin: 20px auto 0; padding: 26px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 11px; background: var(--white); text-align: center; }
.vision-question h1 { margin: 10px 0 8px; font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 760; }
.vision-question .stem-zh { display: inline-block; margin: 0 0 24px; }
.vision-plate { width: min(100%, 390px); margin: 0 auto 24px; border-radius: 10px; background: white; }
.vision-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vision-option { min-height: 68px; border: 2px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 3px 0 var(--line); font-size: 1.65rem; font-weight: 720; cursor: pointer; }
.vision-option small { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.vision-option.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 3px 0 var(--green); }
.vision-option.correct { border-color: var(--success); background: #effaf6; box-shadow: 0 3px 0 var(--success); }
.vision-result { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 16px; border: 1px solid #cfe8df; border-radius: 8px; background: #effaf6; text-align: left; }
.vision-result strong { font-size: 1.2rem; }
.vision-result span { color: var(--muted); font-size: .78rem; }

.progress-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 34px; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.stat-line strong { font-size: 1.7rem; font-weight: 760; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.sync-header { width: min(100%, 680px); padding: 18px 0 26px; }
.sync-header h1 { margin: 6px 0 10px; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; font-weight: 790; letter-spacing: -.055em; }
.sync-header > p:last-child { margin: 0; color: var(--muted); line-height: 1.65; }
.sync-card { width: min(100%, 680px); padding: clamp(22px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 4px 16px rgba(46,56,86,.06); }
.sync-lead { margin: 0 0 18px; font-size: 1.08rem; line-height: 1.65; }
.sync-assurance, .sync-meta { margin: 14px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.sync-connected { display: flex; align-items: center; gap: 14px; }
.sync-connected > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 1.2rem; font-weight: 800; }
.sync-connected strong { display: block; }
.sync-connected p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.account-actions { margin-top: 20px; }
.danger-text { color: var(--red); }
.settings-more { width: min(100%, 680px); margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-more > summary { padding: 18px 2px; color: var(--muted); cursor: pointer; font-size: .86rem; font-weight: 700; }
.settings-more-body { padding: 0 0 10px; }
.settings-subsection { padding: 20px 0; border-top: 1px solid var(--line); }
.settings-subsection h2 { margin: 0 0 7px; font-size: .95rem; }
.settings-subsection p { max-width: 620px; margin: 0 0 14px; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.sync-form { display: grid; grid-template-columns: minmax(220px, 360px) auto; gap: 8px 10px; align-items: end; max-width: 620px; margin: 18px 0; }
.sync-form label { grid-column: 1 / -1; font-size: .8rem; font-weight: 750; }
.sync-form .button-row { grid-column: 1 / -1; }
.text-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(12,28,23,.55); backdrop-filter: blur(6px); animation: reveal 160ms ease both; }
.modal { width: min(100%, 560px); max-height: min(90svh, 700px); overflow: auto; padding: 24px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); animation: answer-rise 200ms ease both; }
.onboarding-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(28,34,56,.64); backdrop-filter: blur(10px); animation: reveal 180ms ease both; }
.onboarding { width: min(100%, 540px); height: min(720px, calc(100svh - 36px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--white); box-shadow: 0 24px 70px rgba(19,25,48,.28); animation: answer-rise 220ms ease both; }
.onboarding-top { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.onboarding-top strong { color: var(--green); font-size: .95rem; letter-spacing: -.02em; }
.onboarding-top strong span { margin-left: 5px; color: var(--muted); font-size: .72rem; font-weight: 650; }
.onboarding-close { min-width: 48px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .78rem; cursor: pointer; }
.onboarding-body { min-height: 0; flex: 1 1 auto; padding: clamp(26px, 5vh, 44px) 34px 24px; overflow-y: auto; }
.onboarding-kicker { margin: 0 0 16px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.onboarding h1 { margin: 0; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.08; font-weight: 790; letter-spacing: -.05em; }
.onboarding-copy { margin: 24px 0 0; color: var(--muted); font-size: .98rem; line-height: 1.75; }
.onboarding-route { display: flex; align-items: center; gap: 11px; margin: 6px 0 28px; color: var(--muted); }
.onboarding-route span, .onboarding-route strong { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: .8rem; }
.onboarding-route strong { border-color: var(--green); background: var(--green); color: white; font-size: 1rem; }
.onboarding-route i { height: 2px; flex: 1; background: var(--line); }
.onboarding-system, .onboarding-steps { margin: 28px 0 0; padding: 0; list-style: none; }
.onboarding-system li { display: grid; grid-template-columns: 94px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.onboarding-system li:first-child { border-top: 1px solid var(--line); }
.onboarding-system b { font-size: .87rem; }
.onboarding-system span { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.onboarding-flow { margin: 20px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.6; text-align: center; }
.onboarding-flow span { padding: 0 3px; color: var(--green); }
.onboarding-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.onboarding-steps li > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .76rem; font-weight: 800; }
.onboarding-steps p { margin: 1px 0 0; }
.onboarding-steps b, .onboarding-steps small { display: block; }
.onboarding-steps b { font-size: .9rem; }
.onboarding-steps small { margin-top: 4px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.onboarding-sync-note { margin-top: 16px; padding: 15px 0 0; border-top: 1px solid var(--line); }
.onboarding-sync-note b, .onboarding-sync-note span { display: block; }
.onboarding-sync-note b { color: var(--green); font-size: .87rem; }
.onboarding-sync-note span { margin-top: 5px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.onboarding-footer { flex: 0 0 auto; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.onboarding-progress { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; }
.onboarding-progress i { width: 18px; height: 3px; border-radius: 99px; background: var(--paper-deep); }
.onboarding-progress i.active { background: var(--green); }
.onboarding-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.onboarding-actions .quiet-btn { margin-right: auto; }
.onboarding-sync-primary { width: 100%; }
.onboarding-skip-login { width: 100%; margin: 0; }
.onboarding[data-onboarding-step="3"] .onboarding-actions { display: grid; grid-template-columns: 1fr; }
.field-label { display: block; margin: 18px 0 7px; font-size: .8rem; font-weight: 750; }
.field-control { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
textarea.field-control { resize: vertical; line-height: 1.55; }
.admin-token { min-height: 46px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }

.mobile-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); animation: answer-rise 220ms ease both; }
.error-screen { min-height: 100svh; display: grid; place-content: center; padding: 30px; text-align: center; }

.legal-body { background: var(--paper); color: var(--ink); }
.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244,240,231,.95);
  backdrop-filter: blur(16px);
}
.legal-brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.legal-brand .brand-mark { color: var(--forest); }
.legal-brand .brand-sub { margin: 0; color: var(--muted); }
.language-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.language-nav a { padding: 8px 10px; border-radius: 999px; color: var(--muted); font-size: .76rem; font-weight: 700; text-decoration: none; }
.language-nav a:hover { background: var(--green-soft); color: var(--forest); }
.legal-page { width: min(calc(100% - 40px), 920px); margin: 0 auto; }
.privacy-hero { padding: 76px 0 42px; border-bottom: 1px solid var(--line); }
.privacy-hero h1 { margin: 10px 0 6px; font-family: Georgia, "Songti SC", serif; font-size: clamp(2.7rem, 8vw, 5.8rem); line-height: .95; letter-spacing: -.05em; }
.privacy-deck { margin: 0 0 24px; color: var(--green); font-family: Georgia, serif; font-size: clamp(1.1rem, 2.6vw, 1.55rem); }
.privacy-status { margin-top: 26px; padding: 14px 16px; border-left: 4px solid var(--amber); background: var(--amber-soft); color: #75400d; font-size: .84rem; line-height: 1.65; }
.privacy-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1px solid var(--line); }
.privacy-summary div { min-width: 0; padding: 24px 20px 24px 0; }
.privacy-summary div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.privacy-summary span { display: block; min-height: 32px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.privacy-summary strong { display: block; margin-top: 6px; overflow-wrap: anywhere; font-size: .9rem; }
.privacy-summary a, .privacy-language a, .legal-footer a { color: var(--green); text-underline-offset: 3px; }
.privacy-language { padding: 72px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 86px; }
.privacy-language > header { display: flex; align-items: baseline; gap: 18px; margin-bottom: 42px; }
.privacy-language h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.035em; }
.privacy-language section { width: min(100%, 760px); margin-top: 36px; }
.privacy-language h3 { margin: 0 0 10px; font-size: 1rem; }
.privacy-language p, .privacy-language li { line-height: 1.82; }
.privacy-language p { margin: 10px 0; }
.privacy-language ul { margin: 12px 0 0; padding-left: 22px; }
.privacy-language li + li { margin-top: 8px; }
.legal-footer { padding: 34px 0 72px; text-align: center; font-size: .82rem; }

@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes load { 0% { transform: translateX(-120%); } 50% { transform: translateX(110%); } 100% { transform: translateX(250%); } }

@media (max-width: 820px) {
  .focus-page { padding: 0 14px; }
  .side-nav { display: none; }
  .mobile-topbar { position: sticky; top: 0; z-index: 24; min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 9px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); }
  .mobile-brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none; }
  .mobile-brand strong { color: var(--green); font-size: 1.18rem; font-weight: 850; letter-spacing: -.045em; }
  .mobile-brand span { color: var(--muted); font-size: .75rem; font-weight: 650; }
  .mobile-sync { padding: 8px 10px; border-radius: 10px; color: var(--green); font-size: .78rem; font-weight: 730; text-decoration: none; }
  .mobile-sync:hover { background: var(--green-soft); }
  .page { margin-left: 0; padding: 22px 20px calc(94px + env(safe-area-inset-bottom)); }
  .app-footer { margin-left: 0; padding: 20px 20px calc(94px + env(safe-area-inset-bottom)); }
  .page-header { align-items: flex-start; }
  .page-header .button-row { justify-content: flex-end; }
  .home-lead { grid-template-columns: 1fr; padding: 34px 0; gap: 34px; }
  .home-lead h2 { max-width: 520px; }
  .metric-row { grid-template-columns: 1fr 1fr 1fr; }
  .metric { padding: 20px 10px 20px 0; }
  .metric + .metric { padding-left: 12px; }
  .metric strong { font-size: 1.55rem; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-tile { min-height: 105px; }
  .progress-layout { grid-template-columns: 1fr; gap: 18px; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 26px rgba(23,32,29,.05);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a { min-height: 54px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 4px; border-radius: 10px; text-decoration: none; color: #4f5960; font-size: .78rem; font-weight: 650; }
  .mobile-nav a:hover { transform: none; background: transparent; }
  .mobile-nav .nav-icon, .mobile-nav .nav-icon svg { width: 20px; height: 20px; }
  .mobile-nav a.active { color: var(--forest); background: var(--green-soft); }
  .home-dashboard { padding-top: 20px; }
  .home-welcome { margin-bottom: 22px; }
  .home-welcome h1 { font-size: 1.9rem; }
  .question-shell { margin-top: 8px; padding-bottom: 10px; }
  .prompt-card { padding: 22px 18px; }
  .question-stem { font-size: 1.32rem; }
  .option-list { grid-template-columns: 1fr; gap: 10px; }
  .option { min-height: 78px; padding: 14px; }
  .memory-anchor-grid { grid-template-columns: 1fr; }
  .memory-anchor + .memory-anchor { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .question-actions { position: relative; margin: 0 auto; padding: 5px 0 calc(5px + env(safe-area-inset-bottom)); background: var(--paper); }
  .answer-submit-group { flex: 1; justify-content: flex-end; }
  .answer-submit-group .primary-btn, .answer-submit-group .secondary-btn { min-width: 0; min-height: 44px; padding-left: 12px; padding-right: 12px; }
  .mock-exam-page .question-actions { position: relative; margin: 0 auto; padding: 5px 0 calc(5px + env(safe-area-inset-bottom)); background: var(--paper); }
  .mock-banner { align-items: flex-start; flex-wrap: wrap; }
  .mock-banner > span:last-child { margin-left: auto; }
  .vision-question { margin-top: 12px; padding: 20px 16px 16px; }
  .toast { left: 18px; right: 18px; bottom: calc(82px + env(safe-area-inset-bottom)); text-align: center; }
  .guided-strip { align-items: stretch; flex-direction: column; gap: 18px; }
  .guided-strip .primary-btn, .guided-continue { width: 100%; }
}

@media (max-width: 520px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .mobile-topbar { padding-left: 16px; padding-right: 16px; }
  .page-header h1 { font-size: 2.05rem; }
  .page-header { display: block; }
  .page-header .button-row { margin-top: 18px; }
  .home-lead h2 { font-size: 2.45rem; }
  .mock-setup { padding: 28px 0; }
  .mock-setup h2 { font-size: 1.45rem; }
  .vision-setup { padding: 28px 0; }
  .home-actions a { min-height: 72px; }
  .metric span { font-size: .72rem; }
  .chapter-row { grid-template-columns: 54px 1fr auto; gap: 10px; }
  .question-shell { margin-left: 0; margin-right: 0; padding: 0 1px 10px; }
  .option { padding: 14px 13px; }
  .option-images { padding-left: 0; }
  .wrong-contrast { grid-template-columns: 1fr; }
  .wrong-contrast > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .sync-form { grid-template-columns: 1fr; }
  .sync-form > .primary-btn { width: 100%; }
  .onboarding-backdrop { inset: 0 0 auto; display: block; height: var(--app-viewport-height); padding: 0; overflow: hidden; }
  .onboarding { position: absolute; inset: 0; width: 100%; height: auto; max-height: none; border-radius: 0; }
  .onboarding-top { min-height: 54px; padding: 0 20px; }
  .onboarding-body { padding: 26px 22px 18px; }
  .onboarding h1 { font-size: clamp(2rem, 10vw, 2.7rem); }
  .onboarding-copy { margin-top: 20px; }
  .onboarding-system { margin-top: 22px; }
  .onboarding-system li { grid-template-columns: 88px 1fr; gap: 12px; padding: 12px 0; }
  .onboarding-steps { margin-top: 20px; }
  .onboarding-steps li { padding: 10px 0; }
  .onboarding-footer { padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); }
  .onboarding-actions .primary-btn, .onboarding-actions .secondary-btn { min-height: 46px; padding: 10px 13px; }
  .legal-topbar { position: static; display: block; min-height: 0; padding: 18px 16px; }
  .language-nav { margin-top: 14px; gap: 4px; }
  .language-nav a { padding-left: 8px; padding-right: 8px; }
  .legal-page { width: min(calc(100% - 32px), 920px); }
  .privacy-hero { padding-top: 48px; }
  .privacy-summary { grid-template-columns: 1fr; }
  .privacy-summary div { padding: 18px 0; }
  .privacy-summary div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .privacy-summary span { min-height: 0; }
  .privacy-language { padding: 54px 0; scroll-margin-top: 12px; }
  .privacy-language > header { display: block; margin-bottom: 34px; }
  .privacy-language h2 { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
