:root {
      --ink: #15263d;
      --muted: #637083;
      --paper: #ffffff;
      --canvas: #f4f7fb;
      --line: #dce4ee;
      --brand: #164d73;
      --brand-2: #0f7a72;
      --accent: #f2ad3f;
      --accent-soft: #fff4d8;
      --good: #177245;
      --bad: #b63434;
      --info: #eaf3fb;
      --shadow: 0 18px 50px rgba(24, 49, 78, .10);
      --radius: 20px;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      color: var(--ink);
      background: var(--canvas);
      font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
      line-height: 1.65;
    }
    button, input, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: var(--brand); }
    .skip-link {
      position: fixed; left: 12px; top: -50px; z-index: 999;
      background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
    }
    .skip-link:focus { top: 12px; }

    .hero {
      position: relative;
      overflow: hidden;
      color: var(--ink);
      padding: 34px clamp(18px, 4vw, 64px) 52px;
      background: #fff;
      border-bottom: 6px solid #2d6288;
    }
    .hero::after {
      content: none;
    }
    .hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; }
    .eyebrow {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 7px 12px; border: 1px solid #cbd9e5; border-radius: 8px;
      font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
      background: #f3f7fa; color: #285577;
    }
    .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2d6288; }
    h1 { margin: 18px 0 8px; font-size: clamp(32px, 5vw, 58px); line-height: 1.08; letter-spacing: -.035em; }
    .hero p.lead { max-width: 820px; color: #516174; font-size: 17px; margin: 0; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
    .btn {
      border: 1px solid transparent; border-radius: 12px; padding: 11px 16px;
      font-weight: 700; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
      background: #fff; color: var(--brand);
      box-shadow: 0 8px 20px rgba(0,0,0,.12);
    }
    .btn:hover { transform: translateY(-1px); }
    .btn.primary { background: #245f88; color: #fff; }
    .btn.ghost { background: #fff; color: #245f88; border-color: #a9c0d3; box-shadow: none; }
    .btn.small { padding: 7px 11px; border-radius: 9px; font-size: 13px; box-shadow: none; }
    .btn.soft { background: var(--info); color: var(--brand); border-color: #cfe1f0; }
    .btn.danger { background: #fff0f0; color: var(--bad); border-color: #f1cccc; }
    .btn:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
      outline: 3px solid #f7c25b; outline-offset: 2px;
    }

    .facts {
      max-width: 1180px; margin: -28px auto 0; padding: 0 clamp(14px, 3vw, 32px);
      display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; z-index: 2;
    }
    .fact {
      background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
      box-shadow: var(--shadow);
    }
    .fact strong { display: block; font-size: 24px; line-height: 1.1; color: #245f88; }
    .fact span { color: var(--muted); font-size: 13px; }

    .top-nav {
      position: sticky; top: 0; z-index: 50; margin-top: 22px;
      background: rgba(244,247,251,.92); backdrop-filter: blur(14px);
      border-bottom: 1px solid rgba(220,228,238,.9);
    }
    .top-nav-inner {
      max-width: 1180px; margin: 0 auto; padding: 9px 14px;
      display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
    }
    .top-nav-inner::-webkit-scrollbar { display: none; }
    .top-nav a {
      flex: 0 0 auto; text-decoration: none; color: #415269; padding: 7px 11px; border-radius: 9px;
      font-size: 13px; font-weight: 700; border: 1px solid transparent;
    }
    .top-nav a:hover { background: #fff; border-color: var(--line); color: var(--brand); }

    main { max-width: 1180px; margin: 0 auto; padding: 26px 16px 70px; }
    .layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
    .main-column { min-width: 0; }
    .side-column { position: sticky; top: 64px; display: grid; gap: 14px; }
    .card, section.panel {
      background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 42px rgba(24,49,78,.07);
    }
    .card { padding: 18px; }
    .side-card h3 { margin: 0 0 10px; font-size: 16px; }
    .side-card p, .side-card li { color: var(--muted); font-size: 13px; }
    .side-card ul { padding-left: 18px; margin: 8px 0 0; }
    .progress-wrap { height: 10px; background: #e9eef4; border-radius: 999px; overflow: hidden; margin: 9px 0 8px; }
    .progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), #3d9f87); transition: width .25s ease; }
    .score-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }

    section.panel { padding: clamp(18px, 3vw, 30px); margin-bottom: 22px; scroll-margin-top: 72px; }
    section.panel:target { box-shadow: 0 0 0 3px rgba(242,173,63,.32), 0 14px 42px rgba(24,49,78,.08); }
    .section-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
    .section-kicker { color: var(--brand-2); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
    h2 { margin: 3px 0 4px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.02em; }
    h3 { margin: 24px 0 8px; font-size: 20px; }
    .section-sub { color: var(--muted); margin: 0; }
    .badges { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
    .badge {
      display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px;
      background: var(--info); color: var(--brand); font-size: 12px; font-weight: 800; white-space: nowrap;
    }
    .badge.ai { background: var(--accent-soft); color: #80520c; }
    .badge.mark { background: #e8f6ef; color: var(--good); }
    .notice {
      border-left: 4px solid var(--brand-2); background: #f1fbf8; border-radius: 10px;
      padding: 12px 14px; color: #33534e; font-size: 14px; margin: 14px 0 18px;
    }
    .notice.warn { border-left-color: var(--accent); background: #fffaf0; color: #6b511f; }
    .format-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
    .format-card { border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: #fbfcfe; }
    .format-card strong { display: block; color: var(--brand); margin-bottom: 4px; }
    .format-card p { margin: 0; color: var(--muted); font-size: 14px; }
    .table-wrap { overflow-x: auto; margin-top: 14px; }
    table { width: 100%; border-collapse: collapse; min-width: 680px; }
    th, td { border-bottom: 1px solid var(--line); padding: 11px 9px; text-align: left; vertical-align: top; font-size: 14px; }
    th { background: #f7f9fc; color: #34465e; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
    tr:last-child td { border-bottom: 0; }
    .timeline { display: grid; gap: 10px; margin-top: 12px; }
    .timeline-item { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: start; }
    .timeline-item b { color: var(--brand-2); }
    .timeline-item p { margin: 0; color: var(--muted); }

    .article {
      border: 1px solid var(--line); border-radius: 16px; background: #fff;
      padding: clamp(16px, 3vw, 26px); margin: 18px 0 22px;
    }
    .article-title { font-size: 26px; font-weight: 800; line-height: 1.25; margin: 0 0 14px; color: #183a5b; }
    .article p { margin: 0 0 14px; }
    .article .small-caption { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
    .subarticle {
      border: 1px solid #e3e9f1; border-radius: 14px; padding: 14px 16px; margin: 11px 0; background: #fbfcfe;
    }
    .subarticle h4 { margin: 0 0 7px; color: var(--brand); font-size: 18px; }

    .question-card {
      border: 1px solid var(--line); border-radius: 15px; padding: 15px; margin: 11px 0; background: #fff;
    }
    .question-card.correct { border-color: #a9d9bf; background: #fbfefc; }
    .question-card.incorrect { border-color: #efb8b8; background: #fffafa; }
    .question-label { font-weight: 800; color: var(--brand); margin-right: 5px; }
    .answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 10px; }
    input[type="text"] {
      width: 100%; border: 1px solid #c9d4e1; border-radius: 10px; padding: 10px 11px; background: #fff;
    }
    .multi-answer { display: grid; gap: 8px; margin-top: 10px; }
    .choice-list { display: grid; gap: 8px; margin-top: 10px; }
    .choice {
      display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; border: 1px solid var(--line);
      border-radius: 11px; background: #fbfcfe; cursor: pointer;
    }
    .choice:hover { border-color: #9fb8cf; }
    .choice input { margin-top: 4px; accent-color: var(--brand-2); }
    .matching-grid { display: grid; gap: 8px; margin-top: 10px; }
    .matching-row { display: grid; grid-template-columns: minmax(0,1fr) 94px; gap: 10px; align-items: center; }
    select {
      width: 100%; border: 1px solid #c9d4e1; border-radius: 10px; padding: 9px; background: #fff;
    }
    .feedback { min-height: 0; margin-top: 9px; font-size: 13px; font-weight: 700; }
    .feedback:empty { display: none; }
    .feedback.good { color: var(--good); }
    .feedback.bad { color: var(--bad); }
    .answer-reveal { margin-top: 8px; color: #6b4b10; background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
    details { margin-top: 10px; }
    summary { cursor: pointer; color: var(--brand); font-weight: 700; }
    .question-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0 4px; }
    .mark-note { color: var(--muted); font-size: 13px; }
    .writing-box { width: 100%; min-height: 220px; border: 1px solid #c9d4e1; border-radius: 14px; padding: 14px; resize: vertical; background: #fff; line-height: 1.6; }
    .writing-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin: 10px 0; }
    .word-count { font-weight: 800; color: var(--muted); }
    .word-count.in-range { color: var(--good); }
    .word-count.over, .word-count.under { color: #a66a08; }
    .checklist { display: grid; gap: 7px; margin-top: 12px; }
    .checklist label { display: flex; gap: 9px; color: #4c5d72; font-size: 14px; }
    .checklist input { accent-color: var(--brand-2); margin-top: 4px; }
    .writer-feedback {
      margin-top: 13px; border-radius: 12px; padding: 12px 14px; background: #f7f9fc; border: 1px solid var(--line);
      display: grid; gap: 6px; font-size: 14px;
    }
    .writer-feedback .ok::before { content: "✓ "; color: var(--good); font-weight: 900; }
    .writer-feedback .tip::before { content: "→ "; color: #a66a08; font-weight: 900; }
    .model-answer { white-space: pre-wrap; line-height: 1.75; }
    .prompt {
      border: 1px solid #d8e2ed; border-radius: 14px; padding: 15px; background: linear-gradient(180deg, #f9fbfe, #fff);
    }
    .prompt strong { color: var(--brand); }
    .prompt ul { margin-top: 8px; }
    .comment-cloud { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 13px 0; }
    .comment { border-radius: 13px; padding: 10px 12px; background: #edf6f6; color: #315b59; font-size: 13px; }
    .comment:nth-child(even) { background: #fff5dc; color: #6e531c; }

    .word {
      display: inline; border-radius: 4px; cursor: pointer;
      transition: background .14s ease, box-shadow .14s ease, color .14s ease;
    }
    .word:hover { background: #fff1c9; }
    .word.active { background: #ffd979; box-shadow: 0 0 0 2px rgba(242,173,63,.28); color: #5c3d00; }
    .wordtip {
      position: fixed; z-index: 200; width: min(286px, calc(100vw - 24px));
      background: #132d44; color: #fff; border-radius: 13px; padding: 12px 13px;
      box-shadow: 0 18px 40px rgba(8,30,48,.28); transform: translateY(-8px);
    }
    .wordtip[hidden] { display: none; }
    .wordtip::after {
      content: ""; position: absolute; left: var(--arrow-left, 50%); bottom: -7px; transform: translateX(-50%) rotate(45deg);
      width: 14px; height: 14px; background: #132d44;
    }
    .wordtip.below::after { top: -7px; bottom: auto; }
    .wordtip-word { font-weight: 800; font-size: 17px; }
    .wordtip-zh { color: #ffe19a; font-size: 15px; margin-top: 2px; }
    .wordtip-note { color: rgba(255,255,255,.72); font-size: 12px; margin-top: 6px; }
    .translation-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
    .pulse { width: 7px; height: 7px; border-radius: 50%; background: #35a47b; box-shadow: 0 0 0 4px rgba(53,164,123,.12); }

    .sources a { word-break: break-word; }
    footer { color: var(--muted); text-align: center; font-size: 12px; padding: 0 16px 32px; }
    .toast {
      position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
      background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 300; font-size: 14px;
      transition: .2s ease;
    }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }
    .hidden { display: none !important; }
    .answer-reveal.hidden { display: none; }

    @media (max-width: 940px) {
      .layout { grid-template-columns: 1fr; }
      .side-column { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
      .facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .format-grid { grid-template-columns: 1fr 1fr; }
    }
    @media (max-width: 620px) {
      .hero { padding-bottom: 44px; }
      .facts { grid-template-columns: 1fr 1fr; }
      .side-column, .format-grid { grid-template-columns: 1fr; }
      .section-head { display: block; }
      .badges { justify-content: flex-start; margin-top: 10px; }
      .answer-row, .matching-row { grid-template-columns: 1fr; }
      .comment-cloud { grid-template-columns: 1fr; }
      .timeline-item { grid-template-columns: 58px 1fr; }
      .top-nav { margin-top: 16px; }
    }
    @media print {
      .top-nav, .side-column, .hero-actions, .question-actions, .btn, .wordtip { display: none !important; }
      body { background: #fff; }
      .hero { background: #163c5c !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
      .layout { display: block; }
      section.panel { break-inside: avoid; box-shadow: none; }
    }
/* Multi-page shell and compact exam-paper layout */
.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.site-header {
  background: #fff;
  border-bottom: 1px solid #d8e1ea;
}
.site-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 15px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
}
.site-brand {
  display: grid;
  gap: 1px;
  color: #16324f;
  text-decoration: none;
}
.site-brand strong { font-size: 16px; }
.brand-kicker {
  color: #2b6389;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.header-meta {
  color: #68788a;
  font-size: 13px;
  text-align: right;
}
.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #d8e1ea;
  backdrop-filter: blur(12px);
}
.site-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav-inner::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 8px;
  color: #44586e;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}
.site-nav a:hover { background: #f1f5f8; border-color: #d8e1ea; color: #174f75; }
.site-nav a.active { background: #1e5b84; color: #fff; }
.home-hero {
  margin: 0 0 18px;
  border: 1px solid #d8e1ea;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(24,49,78,.06);
}
.home-hero::after { content: none; }
.home-hero .hero-inner { max-width: none; }
.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
.home-facts .fact { box-shadow: 0 8px 24px rgba(24,49,78,.06); }
.dashboard { margin-bottom: 0; }
.page-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.page-card {
  position: relative;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 17px;
  border: 1px solid #dbe4ed;
  border-radius: 15px;
  background: #fff;
  color: #243b53;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.page-card:hover {
  transform: translateY(-2px);
  border-color: #9fb8cf;
  box-shadow: 0 14px 32px rgba(24,49,78,.10);
}
.page-card .card-number {
  color: #2b6389;
  font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.page-card strong { font-size: 17px; line-height: 1.25; }
.page-card p { margin: 0; color: #68788a; font-size: 13px; line-height: 1.5; }
.page-card .card-link { margin-top: auto; color: #1e5b84; font-size: 13px; font-weight: 800; }

.reading-exercise { padding: 22px; }
.reading-exercise .section-head { margin-bottom: 10px; }
.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, .92fr);
  gap: 22px;
  align-items: start;
}
.reading-column,
.question-column { min-width: 0; }
.exam-layout .article { margin-bottom: 0; }
.question-column .question-card { margin-top: 0; margin-bottom: 10px; }
.question-column .question-card:last-child { margin-bottom: 0; }
.writing-section .prompt { margin-bottom: 13px; }
.writing-section .writing-box { min-height: 260px; }
.page-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.pager-link {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid #d8e1ea;
  border-radius: 13px;
  background: #fff;
  color: #1e5b84;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 7px 22px rgba(24,49,78,.05);
}
.pager-link:hover { border-color: #9fb8cf; }
.pager-link span {
  color: #718096;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pager-link.next { text-align: right; }
.site-footer {
  padding: 0 20px 30px;
  color: #718096;
  text-align: center;
  font-size: 12px;
}
.wordtip-note { display: none !important; }
.wordtip { width: min(245px, calc(100vw - 24px)); }
.wordtip-zh { margin-top: 4px; }

@media (min-width: 1050px) {
  .reading-column .article {
    position: sticky;
    top: 66px;
    max-height: calc(100vh - 84px);
    overflow: auto;
    overscroll-behavior: contain;
  }
}
@media (max-width: 1049px) {
  .exam-layout { grid-template-columns: 1fr; }
  .page-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-meta { display: none; }
}
@media (max-width: 700px) {
  .page-shell { padding: 14px 10px 46px; }
  .site-header-inner { padding: 12px 14px; }
  .site-brand strong { font-size: 14px; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-card-grid { grid-template-columns: 1fr; }
  .page-card { min-height: 140px; }
  .reading-exercise { padding: 14px; }
  .page-pager { grid-template-columns: 1fr; }
  .pager-link.next { text-align: left; }
}
