/* ============================================================
   English 轻松学 — 全站样式
   风格：明亮、友善、像一位耐心的老师。字大、行距宽、留白多、对比够。
   改配色只动下面 :root 与两个暗色块；程度颜色在 .lv1~.lv4。
   字号：<html data-size="1~4"> 控制 html 的 font-size，页面全部用 rem，所以整站一起缩放。
   ============================================================ */

:root {
  --bg: #F7FAFC;
  --surface: #FFFFFF;
  --surface-2: #EEF4F8;
  --line: #DCE5EE;
  --ink: #1B2540;
  --ink-2: #44526B;
  --ink-3: #66758C;
  --accent: #0B857A;
  --accent-soft: #DDF4F0;
  --accent-ink: #076A61;
  --sun: #FFC857;
  --sun-soft: #FFF3D1;
  --ok: #178A5C;
  --ok-soft: #E3F6EC;
  --bad: #C73A52;
  --bad-soft: #FDECEF;
  --info-soft: #E6EEFF;
  --shadow: 0 6px 24px rgba(27, 37, 64, .08);
  --radius: 16px;
  --font: 'Nunito', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #0F1724; --surface: #172133; --surface-2: #1D2A40; --line: #2B3A55;
    --ink: #EAF0FA; --ink-2: #B7C4D9; --ink-3: #8C9BB3;
    --accent: #12A596; --accent-soft: #123A3A; --accent-ink: #5FDCCB;
    --sun: #FFC857; --sun-soft: #3B3320;
    --ok: #3CC48C; --ok-soft: #14352A; --bad: #FF7B92; --bad-soft: #3A1B25; --info-soft: #1B2A4A;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --bg: #0F1724; --surface: #172133; --surface-2: #1D2A40; --line: #2B3A55;
  --ink: #EAF0FA; --ink-2: #B7C4D9; --ink-3: #8C9BB3;
  --accent: #12A596; --accent-soft: #123A3A; --accent-ink: #5FDCCB;
  --sun: #FFC857; --sun-soft: #3B3320;
  --ok: #3CC48C; --ok-soft: #14352A; --bad: #FF7B92; --bad-soft: #3A1B25; --info-soft: #1B2A4A;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* 程度颜色：任何带 .lv1~.lv4 的元素都会把自己的主色换成这一级的颜色 */
.lv1 { --lv: #178A5C; }
.lv2 { --lv: #2F6FE0; }
.lv3 { --lv: #B86A00; }
.lv4 { --lv: #7442E0; }
.lv1, .lv2, .lv3, .lv4 {
  --lv-soft: color-mix(in srgb, var(--lv) 12%, var(--surface));
  --lv-ink: color-mix(in srgb, var(--lv) 72%, var(--ink));
  --accent: var(--lv);
  --accent-soft: var(--lv-soft);
  --accent-ink: var(--lv-ink);
}

/* ---------- 基础 ---------- */

html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 130px; }
html[data-size="1"] { font-size: 15px; }
html[data-size="2"] { font-size: 17px; }
html[data-size="3"] { font-size: 19px; }
html[data-size="4"] { font-size: 21px; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font); line-height: 1.35; color: var(--ink); }
button { font-family: inherit; }
small { font-size: .78em; font-weight: 500; color: var(--ink-3); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 24px; padding-bottom: 72px; max-width: 920px; }
.page h1 { font-size: 2.1rem; font-weight: 800; margin: .3em 0 .3em; }
.page h2 { font-size: 1.45rem; font-weight: 800; margin: 0 0 .6em; }
.page-lead { font-size: 1.12rem; color: var(--ink-2); margin: 0 0 1.4em; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 999; }
.skip-link:focus { left: 8px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .4em; padding: .6em 1.3em; border-radius: 999px;
  font-weight: 800; font-size: 1rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.4;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--accent-ink); border-color: var(--accent); }
.btn-lg { font-size: 1.1rem; padding: .75em 1.6em; }

/* ---------- 顶部导航 + 程度条 ---------- */

.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  box-shadow: 3px 3px 0 var(--sun);
}
.brand-text { font-weight: 800; font-size: 1.15rem; }
.brand-accent { color: var(--accent-ink); }
.topnav { display: flex; gap: 2px; margin-left: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav-link { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .95rem; white-space: nowrap; }
.topnav-link:hover { background: var(--surface-2); color: var(--ink); }
.topnav-link.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.topbar-tools { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; font-weight: 800; font-size: 1rem; padding: 0;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.icon-btn-text { display: flex; align-items: baseline; justify-content: center; gap: 1px; }
.icon-btn-text small { font-size: .75em; color: inherit; }
.icon-sun { display: none; }
:root[data-mode="dark"] .icon-sun { display: block; }
:root[data-mode="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) .icon-sun { display: block; }
  :root:not([data-mode="light"]) .icon-moon { display: none; }
}

.levelbar { border-top: 1px solid var(--line); background: var(--surface-2); }
.levelbar-inner { max-width: 1280px; margin: 0 auto; padding: 6px 20px; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.levelbar-inner::-webkit-scrollbar { display: none; }
.levelbar-label { font-size: .82rem; color: var(--ink-3); font-weight: 700; margin-right: 4px; white-space: nowrap; }
.level-pill {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink); line-height: 1.6; font-size: .9rem;
}
.level-pill b { color: var(--lv-ink); font-weight: 800; }
.level-pill span { color: var(--ink-3); font-size: .85em; }
.level-pill:hover { border-color: var(--lv); color: var(--ink); }
.level-pill.is-active { background: var(--lv-soft); border-color: var(--lv); }

@media (max-width: 760px) {
  .topbar-inner { gap: 8px; padding: 8px 14px; flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; margin: 0; flex: none; }
  .brand-text { font-size: 1.05rem; }
  .icon-btn { width: 38px; height: 38px; }
  .topbar-tools { margin-left: auto; }
  .levelbar-label { display: none; }
  .levelbar-inner { padding: 6px 14px; }
}

/* ---------- 首页 ---------- */

.hero {
  background:
    radial-gradient(800px 380px at 88% -8%, color-mix(in srgb, var(--sun) 38%, transparent), transparent 70%),
    radial-gradient(700px 420px at 0% 0%, var(--accent-soft), transparent 70%);
  padding: 56px 0 48px;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-kicker { display: inline-block; background: var(--sun); color: #3a2a00; font-weight: 800; padding: 2px 14px; border-radius: 999px; font-size: .9rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 800; line-height: 1.25; margin: .35em 0 .4em; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 50%, transparent) 62%); padding: 0 .08em; }
.hero-lead { font-size: 1.2rem; color: var(--ink-2); margin: 0 0 1.4em; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.resume { margin-top: 18px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: inline-flex; gap: 8px; flex-wrap: wrap; font-size: .95rem; }
.resume[hidden] { display: none; }
.resume a { font-weight: 800; }
.hero-stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; line-height: 1.3; }
.hero-stats b { font-size: 1.9rem; font-weight: 800; color: var(--accent-ink); }
.hero-stats span { font-size: .88rem; color: var(--ink-3); }
.hero-card { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 28px; padding: 28px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.bubble { padding: 12px 18px; border-radius: 20px; font-weight: 700; font-size: 1.1rem; max-width: 88%; line-height: 1.5; }
.bubble-a { background: var(--accent-soft); color: var(--accent-ink); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble-b { background: var(--sun-soft); color: var(--ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble-c { background: var(--info-soft); color: var(--ink); border-bottom-left-radius: 6px; align-self: flex-start; }
.hero-tip { margin-top: 4px; font-size: .92rem; color: var(--ink-3); border-top: 2px dashed var(--line); padding-top: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .bubble-a { animation: float 5s ease-in-out infinite; }
  .bubble-b { animation: float 5s ease-in-out -1.6s infinite; }
  .bubble-c { animation: float 5s ease-in-out -3.2s infinite; }
  @keyframes float { 50% { transform: translateY(-5px); } }
}
@media (max-width: 860px) {
  .hero { padding: 36px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
}

.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 800; margin: 0 0 .3em; }
.section-lead { color: var(--ink-2); font-size: 1.1rem; margin: 0 0 1.6em; max-width: 40em; }

.level-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.level-card {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 2px solid var(--line); border-top: 8px solid var(--lv);
  border-radius: 20px; padding: 20px 22px 18px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.level-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--ink); border-color: var(--lv); }
.level-card-code { font-weight: 800; font-size: 1.7rem; color: var(--lv-ink); line-height: 1.2; }
.level-card-name { font-weight: 800; font-size: 1.2rem; }
.level-card-blurb { color: var(--ink-2); font-size: .98rem; line-height: 1.7; }
.level-card ul { margin: 6px 0 8px; padding-left: 1.2em; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
.level-card li::marker { color: var(--lv); }
.level-card-go { margin-top: auto; font-weight: 800; color: var(--lv-ink); font-size: .95rem; }

.skill-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.skill-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.skill-card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--ink); }
.skill-ico { font-size: 2rem; line-height: 1.2; }
.skill-name { font-weight: 800; font-size: 1.2rem; }
.skill-blurb { color: var(--ink-2); font-size: .98rem; line-height: 1.6; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 14px 18px 14px 64px; }
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center;
}

/* ---------- 程度页 ---------- */

.level-hero { background: var(--lv-soft); border-bottom: 1px solid var(--line); padding: 20px 0 26px; }
.level-hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; margin: 10px 0 18px; }
.level-code { display: inline-block; background: var(--lv); color: #fff; font-weight: 800; padding: 2px 16px; border-radius: 999px; font-size: 1.05rem; }
.level-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin: .25em 0 .2em; }
.level-hero .hero-lead { margin-bottom: .6em; }
.level-count { color: var(--ink-2); margin: 0 0 1em; }
.cando { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 16px 20px; }
.cando-title { font-weight: 800; margin-bottom: 4px; }
.cando ul { margin: 0; padding-left: 1.2em; line-height: 1.8; }
.cando li::marker { color: var(--lv); }
.skill-jump { display: flex; gap: 10px; flex-wrap: wrap; }
.skill-jump a { text-decoration: none; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 2px 16px; font-weight: 700; color: var(--ink); font-size: .95rem; }
.skill-jump a:hover { border-color: var(--lv); color: var(--ink); }
@media (max-width: 760px) { .level-hero-grid { grid-template-columns: 1fr; } }

.skill-section { padding: 36px 0 12px; }
.skill-head h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 .15em; }
.skill-head p { margin: 0 0 1em; color: var(--ink-2); }
.level-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--lv); margin-right: .45em; }
.more-link { margin: 1em 0 0; color: var(--ink-2); }

.lesson-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.lesson-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.lesson {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 14px; text-decoration: none; color: var(--ink); height: 100%; transition: border-color .15s, transform .15s;
}
.lesson:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.lesson-no { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.lesson-text { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.lesson-title { font-weight: 800; }
.lesson-sub { color: var(--ink-3); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-tick { margin-left: auto; display: none; color: var(--ok); font-weight: 800; }
.lesson.is-done { border-color: var(--ok); background: var(--ok-soft); }
.lesson.is-done .lesson-tick { display: block; }
.lesson.is-done .lesson-no { background: var(--ok); color: #fff; }

/* ---------- 技能页 / 起步页 / 术语页 ---------- */

.crumbs { font-size: .9rem; color: var(--ink-3); margin: 6px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; line-height: 1.6; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumb-sep { opacity: .6; }
.crumb-current { color: var(--ink-2); font-weight: 700; }

.skill-block { background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 20px 24px; margin: 0 0 18px; }
.skill-block-head { display: flex; gap: 14px; align-items: center; }
.skill-block-head .skill-ico { font-size: 2.4rem; }
.skill-block h2 { margin: 0; }
.skill-what { margin: 0; color: var(--ink-2); }
.skill-levels { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.mini-level { text-decoration: none; padding: 3px 14px; border-radius: 999px; background: var(--lv-soft); border: 2px solid transparent; color: var(--ink); font-size: .95rem; }
.mini-level b { color: var(--lv-ink); }
.mini-level:hover { border-color: var(--lv); color: var(--ink); }

.start-block { margin: 0 0 36px; }
.helper-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.helper { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.helper > span { font-size: 1.5rem; display: block; line-height: 1.4; font-weight: 800; color: var(--accent-ink); }
.helper b { font-size: 1.05rem; }
.helper p { margin: .2em 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }

.route { list-style: none; margin: 1em 0; padding: 0; display: grid; gap: 8px; }
.route-row {
  display: grid; grid-template-columns: 5.2em 5.6em 1fr 1.6em; gap: 10px; align-items: center; padding: 10px 16px; background: var(--surface);
  border: 2px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); line-height: 1.5;
}
.route-row:hover { border-color: var(--accent); color: var(--ink); }
.route-day { font-weight: 800; color: var(--accent-ink); }
.route-skill { color: var(--ink-3); font-size: .9rem; white-space: nowrap; }
.route-title { font-weight: 700; }
.route-tick { color: var(--ok); font-weight: 800; opacity: 0; }
.route-row.is-done { background: var(--ok-soft); border-color: var(--ok); }
.route-row.is-done .route-tick { opacity: 1; }
@media (max-width: 560px) { .route-row { grid-template-columns: 4.4em 1fr 1.4em; } .route-skill { display: none; } }

.glossary-filter {
  width: 100%; font: inherit; padding: 12px 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); margin-bottom: 1.4em;
}
.glossary-filter:focus { outline: none; border-color: var(--accent); }
.gloss-group h2 { margin-top: 1.4em; padding-bottom: .2em; border-bottom: 3px solid var(--accent-soft); }
.gloss-list { margin: 0; display: grid; gap: 10px; }
.gloss-item { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 10px 18px; }
.gloss-item dt { font-weight: 800; font-size: 1.1rem; }
.gloss-item dd { margin: 0; color: var(--ink-2); }
.gloss-eg { display: block; margin-top: 2px; font-size: .95rem; color: var(--ink-3); }

/* ---------- 笔记页版式 ---------- */

.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; }
.read-progress > span { display: block; height: 100%; width: 0; background: var(--accent); }

.note-layout { max-width: 1280px; margin: 0 auto; padding: 18px 20px 72px; display: grid; grid-template-columns: 250px minmax(0, 780px) 210px; gap: 36px; justify-content: center; align-items: start; }
.note-side, .note-toc { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; }
.side-details { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; }
.side-details > summary { padding: 12px 16px; font-weight: 800; cursor: pointer; font-size: .95rem; line-height: 1.5; list-style: none; }
.side-details > summary::-webkit-details-marker { display: none; }
.side-details > summary::after { content: '▾'; float: right; color: var(--ink-3); }
.side-details:not([open]) > summary::after { content: '▸'; }
.note-side-inner { padding: 0 8px 10px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-link { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.side-no { flex: none; width: 1.7em; text-align: right; color: var(--ink-3); font-size: .85em; font-weight: 800; }
.side-text { flex: 1; }
.side-tick { display: none; color: var(--ok); font-weight: 800; }
.side-link.is-done .side-tick { display: inline; }

.toc-title { font-weight: 800; font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .04em; }
.toc-link { display: block; padding: 3px 0 3px 12px; border-left: 3px solid var(--line); color: var(--ink-3); text-decoration: none; font-size: .88rem; line-height: 1.5; }
.toc-link.is-sub { padding-left: 24px; font-size: .84rem; }
.toc-link:hover { color: var(--ink); }
.toc-link.is-current { border-left-color: var(--accent); color: var(--accent-ink); font-weight: 800; }

@media (max-width: 1180px) {
  .note-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .note-toc { display: none; }
}
@media (max-width: 900px) {
  .note-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 12px 16px 64px; }
  .note-side { position: static; max-height: none; }
}

.note-badge { display: inline-block; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: .88rem; padding: 2px 14px; border-radius: 999px; margin: 2px 0 6px; }
.note-h1 { font-size: clamp(1.8rem, 4.2vw, 2.4rem); font-weight: 800; margin: .1em 0 .1em; line-height: 1.35; }
.note-subtitle { color: var(--ink-3); font-size: 1.15rem; font-weight: 600; margin-bottom: .6em; }
.note-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 10px 0 26px; padding-bottom: 18px; border-bottom: 2px dashed var(--line); }
.note-readtime { color: var(--ink-3); font-size: .9rem; }
.chip { background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 0 12px; font-size: .85rem; font-weight: 700; }
.tool-btn, .done-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; padding: 3px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.tool-btn:hover, .done-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.tool-btn.is-on { background: var(--sun-soft); border-color: var(--sun); color: var(--ink); }
.done-btn { margin-left: auto; }
.done-box { width: 1.05em; height: 1.05em; border: 2px solid currentColor; border-radius: 5px; display: inline-block; }
.done-btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.done-btn.is-done .done-box { background: #fff; border-color: #fff; }

/* ---------- 笔记正文（markdown.php 的输出） ---------- */

.note-body { font-size: 1.0625rem; }
.note-body > :first-child { margin-top: 0; }
.note-body p { margin: 1em 0; }
.note-body h2 { font-size: 1.55rem; font-weight: 800; margin: 2.2em 0 .7em; padding-left: 14px; border-left: 7px solid var(--accent); }
.note-body h3 { font-size: 1.25rem; font-weight: 800; margin: 1.8em 0 .5em; color: var(--accent-ink); }
.note-body ul, .note-body ol { padding-left: 1.5em; margin: .8em 0 1.2em; }
.note-body li { margin: .5em 0; padding-left: .2em; }
.note-body li::marker { color: var(--accent); font-weight: 800; }
.note-body strong { font-weight: 800; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 55%, transparent) 62%); padding: 0 .05em; }
.note-body td strong, .note-body th strong, .note-body .callout strong { background: none; }
.note-body em { font-style: normal; color: var(--accent-ink); font-weight: 700; }
.note-body hr { border: 0; border-top: 2px dashed var(--line); margin: 2em 0; }
.note-body hr.h3-rule { display: none; }
.note-body .sec-divider, .note-body .sub-divider { display: none; }
.note-body code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .92em; }
.note-body pre { background: var(--surface-2); padding: 14px 18px; border-radius: 14px; overflow-x: auto; }
.note-body pre code { background: none; padding: 0; }
.note-body img { border-radius: 12px; }

/* 概览：包成一张带标题的小卡片（render.php 的 en_wrap_overview） */
.overview-box { background: var(--accent-soft); border-radius: 18px; padding: 14px 22px 8px; margin: 0 0 1.6em; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.overview-label { font-weight: 800; color: var(--accent-ink); margin-bottom: 2px; }
.overview-box ul { margin: .4em 0 .6em; }

.table-scroll { overflow-x: auto; margin: 1.2em 0; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); -webkit-overflow-scrolling: touch; }
table.vocab { border-collapse: collapse; width: 100%; font-size: .98rem; line-height: 1.65; min-width: 460px; }
table.vocab th { background: var(--accent-soft); color: var(--accent-ink); text-align: left; padding: 10px 14px; font-weight: 800; white-space: nowrap; }
table.vocab td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.vocab tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.vocab td:first-child { font-weight: 800; }

.example-card { background: var(--surface); border: 2px solid var(--line); border-left: 7px solid var(--accent); border-radius: 14px; padding: 12px 18px; margin: 12px 0; }
.example-card .jp { font-weight: 800; font-size: 1.12rem; line-height: 1.6; }
.example-card .cn { color: var(--ink-2); margin-top: 2px; }

.callout { border-radius: 14px; padding: 4px 18px; margin: 1.2em 0; border: 2px solid; }
.callout p { margin: .7em 0; }
.callout-tip { background: var(--sun-soft); border-color: var(--sun); }
.callout-warn { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.callout-note { background: var(--info-soft); border-color: color-mix(in srgb, #3B82F6 45%, transparent); }
.note-body blockquote { margin: .6em 0; padding: 2px 16px; border-left: 5px solid var(--line); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.note-body blockquote p { margin: .5em 0; }

/* 听力对话稿：英文行（带 🔊）和下面的中文译文贴在一起 */
.note-body p.has-say { margin-bottom: .1em; }
.note-body p.has-say + blockquote { margin-top: 0; }

/* 🔊 朗读按钮 */
.say {
  display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; margin-left: .45em; border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: .82em; line-height: 1; padding: 0; vertical-align: middle; filter: grayscale(.3);
}
.say:hover { border-color: var(--accent); filter: none; }
.say.is-playing { background: var(--accent-soft); border-color: var(--accent); filter: none; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
td.has-say { position: relative; padding-right: 2.7em; }
td.has-say > .say { position: absolute; right: .55em; top: .6em; margin: 0; }
td.ipa { white-space: nowrap; color: var(--ink-2); }

/* 术语小提示 */
.gl { border-bottom: 2px dotted var(--accent); cursor: help; color: inherit; }
.gl:hover, .gl:focus { background: var(--accent-soft); outline: none; }
.gl-pop {
  position: absolute; z-index: 300; max-width: min(320px, calc(100vw - 20px)); background: var(--ink); color: var(--bg); padding: 10px 14px;
  border-radius: 12px; font-size: .92rem; line-height: 1.6; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.gl-pop[hidden] { display: none; }
.gl-pop b { color: var(--sun); }

/* 遮住中文 */
body.hide-zh .zh-mask:not(.is-revealed) { filter: blur(7px); cursor: pointer; user-select: none; transition: filter .2s; }
body.hide-zh .zh-mask { cursor: pointer; }

/* ---------- 测验 ---------- */

.quiz-section { margin-top: 3em; }
.quiz-heading { font-size: 1.6rem; font-weight: 800; margin: 0 0 .2em; padding-left: 14px; border-left: 7px solid var(--sun); }
.quiz-lead { color: var(--ink-2); margin: 0 0 1em; }
.quiz-box { background: var(--surface); border: 2px solid var(--accent); border-radius: 18px; margin: 14px 0; overflow: hidden; }
.quiz-box > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; background: var(--accent); color: #fff;
  font-weight: 800; cursor: pointer; list-style: none; font-size: 1.05rem;
}
.quiz-box > summary::-webkit-details-marker { display: none; }
.quiz-box[open] > summary { background: var(--accent-soft); color: var(--accent-ink); border-bottom: 2px solid var(--accent); }
.quiz-box-count { margin-left: 10px; font-weight: 600; font-size: .85em; opacity: .85; }
.quiz-box-score { background: var(--sun); color: #3a2a00; border-radius: 999px; padding: 0 14px; font-weight: 800; font-size: .95rem; }
.quiz-box-score[hidden] { display: none; }
.quiz-box-body { padding: 8px 20px 20px; }
.quiz-question { margin: 1.4em 0; }
.quiz-question-text { font-weight: 800; margin-bottom: .5em; line-height: 1.7; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  text-align: left; font-size: 1rem; line-height: 1.6; padding: 10px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); }
.quiz-option.is-selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.quiz-option.is-correct { border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }
.quiz-option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-option:disabled { cursor: default; color: var(--ink); }
.quiz-explanation { margin-top: 8px; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; color: var(--ink-2); font-size: .97rem; line-height: 1.7; }
.quiz-fill-input { width: 100%; font: inherit; padding: 10px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.quiz-fill-input:focus { outline: none; border-color: var(--accent); }
.quiz-fill-input.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.quiz-fill-input.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-correct-answer { margin-top: 6px; color: var(--ok); font-weight: 700; }
.quiz-reorder-picked { min-height: 3em; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 2px dashed var(--line); border-radius: 12px; margin-bottom: 8px; align-items: center; }
.quiz-reorder-picked.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.quiz-reorder-picked.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-reorder-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-reorder-chip { font-size: 1rem; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.quiz-reorder-chip.is-picked { background: var(--accent-soft); border-color: var(--accent); }
.quiz-reorder-hint { color: var(--ink-3); font-size: .92rem; }
.quiz-page-nav { display: flex; gap: 6px; justify-content: center; margin: 1em 0; flex-wrap: wrap; }
.quiz-page-btn { min-width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.quiz-page-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.quiz-page-btn:disabled { opacity: .4; cursor: default; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 1em; }
.quiz-submit, .quiz-retry { font-size: 1rem; font-weight: 800; padding: .55em 1.6em; border-radius: 999px; border: 2px solid var(--accent); cursor: pointer; }
.quiz-submit { background: var(--accent); color: #fff; }
.quiz-submit:disabled { opacity: .45; cursor: not-allowed; }
.quiz-retry { background: var(--surface); color: var(--accent-ink); }

/* ---------- 上一课 / 下一课 ---------- */

.note-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 3em; }
.note-nav-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); line-height: 1.5; }
.note-nav-link:hover:not(.is-disabled) { border-color: var(--accent); color: var(--ink); }
.note-nav-link.is-next { text-align: right; }
.note-nav-link.is-disabled { opacity: .5; }
.note-nav-dir { font-size: .85rem; font-weight: 800; color: var(--accent-ink); }
.note-nav-title { font-weight: 800; }
@media (max-width: 560px) { .note-nav { grid-template-columns: 1fr; } .note-nav-link.is-next { text-align: left; } }

/* ---------- 搜索浮层 ---------- */

.search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 36, .55); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 0; }
.search-overlay[hidden] { display: none; }
.search-panel { width: min(640px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; border: 2px solid var(--line); }
.search-input { width: 100%; font: inherit; font-size: 1.15rem; padding: 16px 22px; border: 0; border-bottom: 2px solid var(--line); background: transparent; color: var(--ink); }
.search-input:focus { outline: none; border-bottom-color: var(--accent); }
.search-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.search-group { padding: 8px 14px 2px; font-size: .8rem; font-weight: 800; color: var(--ink-3); letter-spacing: .05em; }
.search-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); line-height: 1.5; }
.search-row:hover { background: var(--accent-soft); color: var(--ink); }
.search-main b { color: var(--accent-ink); }
.search-sub { color: var(--ink-3); font-size: .85rem; white-space: nowrap; }
.search-empty { padding: 22px; text-align: center; color: var(--ink-3); }
.search-hint { padding: 8px 18px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }

/* ---------- 页尾 ---------- */

.site-foot { border-top: 1px solid var(--line); padding: 26px 0 34px; color: var(--ink-3); font-size: .92rem; line-height: 1.7; background: var(--surface); }
.site-foot p { margin: 0; }

@media print {
  .topbar, .note-side, .note-toc, .note-nav, .site-foot, .say, .read-progress { display: none !important; }
  .note-layout { display: block; }
}
