/* 英语阅读用宽正文承载中英对照，目录和关联资料使用轻量页边栏。 */
:root { --top-height: 76px; --reading-height: 100px; --nav-font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; --side-width: 212px; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top-height) + var(--reading-height) + 16px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
:where(a, button, input, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { text-underline-offset: 3px; }
header.top { min-height: 76px; padding: 14px 24px; gap: 22px; align-items: center; flex-wrap: nowrap; }
header.top h1 { font-size: 18px; letter-spacing: 0; white-space: nowrap; }
header.top h1 a { text-decoration: none; color: var(--ink); }
header.top h1 span { color: var(--accent); font-family: Georgia, serif; margin-left: 7px; }
nav.years { margin: 0; gap: 4px; flex-wrap: nowrap; font-family: var(--nav-font); }
nav.years a { padding: 5px 12px; border-radius: 6px; font-size: 14px; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; }
nav.years a.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px var(--accent); font-weight: 650; }
nav.years a:hover { background: var(--accent-soft); }
.search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 410px; margin-left: auto; font-family: var(--nav-font); }
#searchInput { width: 100%; padding: 10px 84px 10px 12px; font: 13px var(--nav-font); border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
.search-shortcut { position: absolute; right: 10px; top: 12px; color: var(--muted); font-size: 10px; pointer-events: none; }
.search-results { position: absolute; right: 0; top: calc(100% + 8px); width: min(520px, calc(100vw - 32px)); max-height: min(65vh, 600px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 30px #2b2b2b18; }
.search-group { position: sticky; top: 0; padding: 6px 14px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 650; }
.search-results a { display: block; padding: 10px 14px; color: var(--ink); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line); }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--hl); }
.search-meta, .search-excerpt { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.search-excerpt { font-family: Georgia, "Songti SC", serif; font-size: 12px; line-height: 1.5; }
.search-empty { padding: 18px; color: var(--muted); font-size: 13px; }
.study-layout { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); max-width: 1800px; margin-inline: auto; align-items: start; }
.sidebar { position: sticky; top: var(--top-height); height: calc(100dvh - var(--top-height)); padding: 22px 14px 40px; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; font-family: var(--nav-font); }
.sidebar-heading { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; padding: 0 9px 18px; }
#sectionNav a { display: block; padding: 6px 10px; border-radius: 5px; text-decoration: none; color: var(--ink); font-size: 13px; }
#sectionNav a.active, #sectionNav a:hover { color: var(--accent); background: var(--accent-soft); }
#sectionNav .text-link { margin: 4px 0 6px 10px; padding: 4px 8px; font-size: 11px; border-left: 1px solid var(--line); border-radius: 0; }
.nav-group { padding: 20px 10px 7px; font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.wrap.reader-main { width: 100%; max-width: none; min-width: 0; padding: 0 24px 60px; container: reading / inline-size; }
.reading-bar { position: sticky; top: var(--top-height); z-index: 35; background: var(--bg); padding: 12px 0; margin-bottom: 22px; border-bottom: 1px solid var(--line); font-family: var(--nav-font); }
.reading-location { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 27px; margin-bottom: 8px; }
#breadcrumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
#breadcrumbs a { color: var(--muted); text-decoration: none; }
#breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
#breadcrumbs [aria-current] { color: var(--ink); }
.crumb-separator { color: #b6aa92; }
#returnLink { color: var(--accent); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; font: 11px var(--nav-font); cursor: pointer; max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.toolbar { border: 0; padding: 0; margin: 0; background: transparent; gap: 16px; border-radius: 0; }
.toolbar label { font-family: var(--nav-font); font-size: 12px; }
.toolbar input { accent-color: var(--accent); }
#questionPicker { position: relative; margin-left: auto; font-size: 12px; }
#questionPicker summary { color: var(--accent); cursor: pointer; padding: 2px 6px; }
#questionGrid { position: absolute; right: 0; top: calc(100% + 8px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; width: 292px; padding: 14px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; box-shadow: 0 8px 24px #2b2b2b18; max-height: 60vh; overflow: auto; }
#questionGrid a { text-align: center; padding: 5px 0; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; }
#questionGrid a:hover, #questionGrid a.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.navigation-notice { font: 13px/1.6 var(--nav-font); padding: 12px; background: var(--hl); border-radius: 6px; }
.nav-focus { scroll-margin-top: calc(var(--top-height) + var(--reading-height) + 16px); }
.section { padding: 25px 24px; }
.section > h2 { font-size: 19px; }
.reading-text + .reading-text { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.reading-text > .subhead { margin-top: 4px; }
.article-panel { padding: 18px 20px; }
.questions-wrap { width: 100%; max-width: 900px; }
.bilingual-passage.translation-hidden .original-panel, .en-cn.translation-hidden .col:not(.trans-col) { width: 100%; max-width: 80ch; margin-inline: auto; }
.source-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font: 11px/1.6 var(--nav-font); }
.source-links a { color: var(--accent); text-decoration: none; padding-block: 3px; }
.source-links a:hover { text-decoration: underline; }
.cloze-q > .source-links { flex-basis: 100%; margin-top: 0; }
.blank a { color: inherit; text-decoration: none; }
.blank a:hover { text-decoration: underline; }
.study-card-item { display: flex; flex-direction: column; min-width: 0; }
.study-card-item > button { flex: 1; }
.study-card-item .source-links { padding-inline: 4px; }
.partb-targets { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-block: 12px 20px; font: 12px/1.8 var(--nav-font); }
.partb-shared-label { color: var(--muted); margin-right: 5px; }
.partb-target { padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--accent); background: var(--accent-soft); }
.reading-rail, .menu-toggle, #menuClose, .drawer-backdrop { display: none; }
@container reading (max-width: 1000px) {
  .bilingual-passage, .en-cn { grid-template-columns: 1fr; }
  .partb-option { grid-template-columns: 1fr; gap: 4px; }
  .partb-option-cn { border-left: 0; padding-left: 0; }
}
@media (min-width: 1740px) {
  .study-layout { grid-template-columns: var(--side-width) minmax(0, 1fr) 232px; }
  .reading-rail { display: block; position: sticky; top: calc(var(--top-height) + 22px); margin-top: 22px; padding: 0 18px 20px; border-left: 1px solid var(--line); max-height: calc(100dvh - var(--top-height) - 44px); overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; font-family: var(--nav-font); }
  .rail-current { padding-bottom: 18px; }
  .rail-kicker { color: var(--muted); font-size: 10px; }
  .rail-current h2 { margin: 8px 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
  .rail-kind { color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 4px; font-size: 10px; }
  .rail-section { border-top: 1px solid var(--line); padding: 14px 0; }
  .rail-section h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 12px; }
  .rail-section h3 span { color: var(--muted); font-weight: normal; }
  .rail-link { display: block; padding: 7px 0; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
  .rail-link:hover { color: var(--accent); text-decoration: underline; }
  .rail-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
  .rail-question-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .rail-question-grid a { border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--paper); text-align: center; font-size: 12px; text-decoration: none; padding: 3px 0; }
  .rail-question-grid a:hover, .rail-question-grid a[aria-current] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
  .rail-section summary { cursor: pointer; font-size: 11px; color: var(--accent); padding-top: 8px; }
  .rail-neighbors { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
  .rail-neighbors a { font-size: 11px; color: var(--accent); text-decoration: none; }
  .rail-neighbors a:last-child { text-align: right; }
}
@media (max-width: 1200px) and (min-width: 861px) {
  :root { --side-width: 186px; }
  header.top { gap: 14px; padding-inline: 20px; }
  nav.years a { padding-inline: 8px; font-size: 13px; }
  .search-shortcut { display: none; }
  #searchInput { padding-right: 10px; }
  .wrap.reader-main { padding-inline: 20px; }
}
@media (max-width: 860px) {
  header.top { flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; }
  header.top h1 { font-size: 17px; }
  nav.years { margin-left: auto; }
  nav.years a { padding-inline: 8px; font-size: 12px; }
  .search-wrap { flex-basis: 100%; max-width: none; margin-left: 0; }
  .study-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(310px, 85vw); height: 100dvh; z-index: 120; background: var(--paper); visibility: hidden; transform: translateX(-100%); }
  .drawer-open { overflow: hidden; }
  .drawer-open .sidebar { visibility: visible; transform: none; }
  .menu-toggle, #menuClose { display: block; border: 1px solid var(--line); background: var(--paper); color: var(--accent); font: 12px var(--nav-font); padding: 6px 9px; border-radius: 5px; cursor: pointer; }
  .drawer-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 110; background: #2b2b2b44; border: 0; }
  .wrap.reader-main { padding: 0 14px 60px; }
  .section { padding: 22px 18px; }
  .toolbar { gap: 8px; }
  .toolbar label { font-size: 11px; }
  .reading-bar { padding-block: 10px; }
  #breadcrumbs { font-size: 10px; }
}
@media (max-width: 560px) {
  nav.years { order: 3; flex-basis: 100%; justify-content: space-between; margin: 0; }
  .search-wrap { order: 4; }
  .menu-toggle { margin-left: auto; }
  nav.years a { padding: 4px 10px; }
  .section > h2 { font-size: 17px; }
  .vocab-grid, .cards-grid { grid-template-columns: minmax(0, 1fr); }
  .article-panel { padding: 16px 14px; }
  .article-panel, .passage, .sentence-en, .sentence-cn, .vocab-eg { text-align: left; }
}
@media print {
  header.top, .sidebar, .reading-rail, .reading-bar, .source-links, .drawer-backdrop { display: none !important; }
  .study-layout { display: block; }
  .wrap.reader-main { max-width: none; padding: 0; }
  .section { box-shadow: none; border: 0; }
  .bilingual-passage, .en-cn { grid-template-columns: 1fr; }
}
