/* 首页书目：独立于章节排版，不改变教材页。 */
.home {
  --paper: #f8f7f3; --ink: #20352f; --muted: #65716b; --rule: #d9dfd8;
  --accent: #285b4d;
  background: var(--paper); color: var(--ink); padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.75;
}
.home a { color: inherit; text-decoration: none; }
.home a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.home a:focus-visible, .home button:focus-visible, .home summary:focus-visible, .home input:focus-visible { outline: 2px solid #2b6b98; outline-offset: 5px; }
.home button, .home input { font: inherit; }
.home [id] { scroll-margin-top: 28px; }
.home [hidden] { display: none !important; }
.home-shell { max-width: 1264px; margin: auto; padding: 0 52px; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 25px 0 20px; border-bottom: 1px solid var(--ink); }
.masthead > a { font-family: "Iowan Old Style", "Songti SC", serif; font-weight: 700; font-size: 28px; line-height: 1; }
.masthead > a span { font-family: "PingFang SC", sans-serif; font-size: 15px; vertical-align: middle; margin-left: 6px; }
.masthead-note { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.intro { padding: 56px 0 42px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--muted); margin: 0 0 15px; }
.intro h1 { font-family: "Songti SC", "Noto Serif SC", serif; font-size: clamp(30px, 3.7vw, 46px); font-weight: 700; letter-spacing: .025em; line-height: 1.4; }
.intro h1 > span { color: #6c7a70; }
.intro-text { max-width: 600px; margin: 20px 0 30px; color: var(--muted); font-size: 14px; }
.subject-gateways { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.subject-gateway { display: flex; flex-direction: column; border: 1px solid #bdc9bd; border-top: 3px solid var(--accent); padding: 21px 25px; background: #f0f3ec; transition: background .15s; }
.subject-gateway:nth-child(2) { background: #f2f0e9; border-color: #cec9b9; border-top-color: #847450; }
.home a.subject-gateway:hover { text-decoration: none; background: #e5ebe0; }
.home a.subject-gateway:nth-child(2):hover { background: #ebe7dc; }
.gateway-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.gateway-label > span { font-size: 11px; }
.subject-gateway strong { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 7px; font-size: 23px; font-weight: 600; }
.subject-gateway strong > span { font-size: 21px; color: var(--muted); }
.gateway-description { color: var(--muted); font-size: 12px; }
.gateway-action { margin-top: 18px; font-size: 12px; font-weight: 600; }
.directory-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 55px; border-top: 1px solid var(--rule); padding-top: 34px; }
.directory-sidebar nav { display: flex; flex-direction: column; align-items: flex-start; }
.directory-sidebar { align-self: start; position: sticky; top: 26px; font-size: 12px; }
.nav-label { font-size: 11px; color: var(--muted); letter-spacing: .15em; margin-bottom: 10px; }
.directory-sidebar nav > a { padding: 5px 0 5px 20px; }
.directory-sidebar nav > .nav-subject { font-weight: 600; padding: 12px 0 7px; font-size: 13px; }
.nav-secondary { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 16px; display: flex; gap: 18px; }
.sidebar-note { border-left: 2px solid #c2cdbf; padding-left: 12px; margin-top: 30px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.directory-main { min-width: 0; }
.directory-filter { margin: 0 0 38px; }
.directory-filter label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 9px; }
.search-field { display: flex; align-items: center; gap: 12px; border: 1px solid #bbc6bc; background: #fffefa; padding: 11px 14px; }
.search-field svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search-field input { min-width: 0; width: 100%; border: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.8; border-radius: 0; }
.search-field input::placeholder { color: #737b73; }
.home button { cursor: pointer; border: 0; color: var(--accent); background: transparent; font-size: 12px; white-space: nowrap; min-height: 30px; padding: 2px 5px; }
.home button:disabled { cursor: default; opacity: .5; }
#directory-status { color: var(--muted); font-size: 11px; margin-top: 7px; }
.subject-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.subject-heading .eyebrow { margin-bottom: 5px; }
.subject-heading h2 { font-family: "Songti SC", "Noto Serif SC", serif; font-size: 28px; line-height: 1.5; }
.subject-heading > a { white-space: nowrap; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.subject-description { margin: 15px 0 25px; color: var(--muted); font-size: 13px; }
.directory-group { margin-bottom: 32px; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ink); }
.group-heading h3 { font-size: 17px; font-weight: 600; line-height: 1.6; }
.group-heading > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.group-note { margin: 8px 0 3px; color: var(--muted); font-size: 11px; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.directory-entry { padding: 16px 0 13px; border-bottom: 1px solid var(--rule); }
.entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.entry-heading h4 { font-weight: 600; font-size: 15px; line-height: 1.65; min-width: 0; }
.entry-heading h4 a { display: block; }
.entry-number { color: var(--muted); font-size: .86em; font-weight: 400; margin-right: 5px; white-space: nowrap; }
.entry-arrow { color: #7b8d7c; font-size: .85em; margin-left: 9px; white-space: nowrap; }
.entry-status { flex-shrink: 0; color: #496451; font-size: 10px; }
.entry-status.is-pending { color: #87692e; }
.entry-summary { color: #5a685f; font-size: 12px; margin: 5px 0 3px; line-height: 1.85; }
.entry-count { font-size: 10px; color: var(--muted); }
.pending-entry .entry-heading h4 { color: #706c5c; }
.subject-section + .subject-section { margin-top: 55px; }
.review-note { font-size: 12px; color: #496451; padding: 10px 13px; background: #eef1e9; border-left: 2px solid #a1b19c; margin: -10px 0 20px; }
.support-section { border-top: 1px solid var(--ink); margin-top: 40px; padding-top: 21px; }
.support-section .eyebrow { margin-bottom: 5px; }
.support-section h2 { font-size: 20px; margin-bottom: 16px; }
.support-section ul { padding-left: 19px; font-size: 12px; color: #5a685f; }
.support-section li { margin-bottom: 10px; }
.support-section > p:last-child { color: var(--muted); font-size: 12px; margin-top: 14px; }
.extra-link { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.extra-link strong { font-size: 15px; }
.extra-link small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.about-section { margin: 40px 0; font-size: 12px; color: var(--muted); }
.about-section h2 { font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.about-section details { margin-top: 12px; }
.about-section summary { cursor: pointer; width: fit-content; }
.about-section details p { margin-top: 7px; }
.home-footer { border-top: 1px solid var(--ink); padding: 20px 0 25px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; font-size: 10px; color: var(--muted); }
.empty-state { border: 1px solid var(--rule); padding: 25px; margin-bottom: 30px; }
.empty-state p:first-child { font-weight: 600; }
.empty-state p + p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.empty-state button { margin-top: 14px; text-decoration: underline; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 10px 16px; background: white; z-index: 2; }
.skip-link:focus { top: 16px; }
@media (max-width: 1000px) {
  .home-shell { padding: 0 30px; }
  .directory-layout { grid-template-columns: 165px minmax(0, 1fr); gap: 30px; }
  .subject-gateway { padding: 18px; }
  .subject-gateway strong { font-size: 20px; }
}
@media (max-width: 700px) {
  .home-shell { padding: 0 20px; }
  .masthead { padding-top: 21px; }
  .masthead-note { font-size: 10px; letter-spacing: 0; }
  .masthead > a { font-size: 25px; }
  .masthead > a span { font-size: 12px; margin-left: 3px; }
  .intro { padding: 32px 0 28px; }
  .intro .eyebrow { font-size: 9px; }
  .intro h1 { font-size: 31px; }
  .intro-text { font-size: 12px; margin: 16px 0 22px; }
  .subject-gateways { grid-template-columns: 1fr; gap: 12px; }
  .subject-gateway { padding: 16px 18px; }
  .subject-gateway strong { margin: 7px 0; }
  .gateway-action { margin-top: 12px; }
  .directory-layout { display: block; padding-top: 20px; }
  .directory-sidebar { position: static; margin-bottom: 26px; }
  .directory-sidebar nav { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 7px 17px; }
  .nav-label { flex-basis: 100%; margin: 0 0 4px; }
  .directory-sidebar nav > a { padding: 2px 0; }
  .directory-sidebar nav > .nav-subject { flex-basis: 100%; padding: 8px 0 1px; }
  .nav-secondary { margin: 5px 0 0; padding-top: 10px; width: 100%; }
  .sidebar-note { display: none; }
  .directory-filter { margin-bottom: 28px; }
  .search-field { gap: 8px; padding: 10px; }
  .search-field input { font-size: 16px; }
  .subject-heading { gap: 10px; }
  .subject-heading h2 { font-size: 23px; }
  .subject-heading > a { font-size: 10px; }
  .subject-description { font-size: 12px; }
  .entry-heading { flex-wrap: wrap; gap: 3px 12px; }
  .entry-heading h4 { flex: 1 1 210px; font-size: 15px; }
  .entry-status { max-width: 100%; }
  .group-heading h3 { font-size: 16px; }
  .group-heading > span { font-size: 10px; }
  .subject-section + .subject-section { margin-top: 38px; }
}
@media (prefers-reduced-motion: reduce) { .subject-gateway { transition: none; } }
@media print {
  @page { size: A4; margin: 13mm 15mm 15mm; }
  .home { color: #111; background: #fff; padding: 0; font-size: 9pt; }
  .home-shell { max-width: none; padding: 0; }
  .home a, .home p, .home span, .home small { color: #111 !important; }
  .home .directory-filter, .home .directory-sidebar, .home .skip-link, .home .empty-state,
  .home .gateway-action, .home .entry-arrow, .home .subject-heading > a, .home .home-footer > a { display: none !important; }
  .home [data-entry][hidden], .home [data-directory-group][hidden], .home [data-subject][hidden] { display: block !important; }
  .masthead { padding: 0 0 6px; }
  .masthead > a { font-size: 18pt; }
  .intro { padding: 12px 0; }
  .intro .eyebrow { margin-bottom: 5px; font-size: 7pt; }
  .intro h1 { font-size: 21pt; }
  .intro h1 br { display: none; }
  .intro-text { max-width: none; margin: 7px 0 10px; font-size: 9pt; }
  .subject-gateways { gap: 12px; }
  .subject-gateway, .subject-gateway:nth-child(2) { padding: 8px 10px; background: #fff; border: 1px solid #999; }
  .subject-gateway strong { font-size: 13pt; margin: 4px 0; }
  .gateway-label, .gateway-label > span, .gateway-description { font-size: 8pt; }
  .directory-layout { display: block; border-top: 0; padding: 0; }
  .subject-heading { border-bottom: 1px solid #333; padding-bottom: 5px; break-after: avoid; }
  .subject-heading .eyebrow { font-size: 7pt; margin: 0; }
  .subject-heading h2 { font-size: 16pt; }
  .subject-description { margin: 6px 0 10px; font-size: 9pt; }
  .directory-group { margin-bottom: 12px; }
  .group-heading { padding: 4px 0; border-color: #666; break-after: avoid; }
  .group-heading h3 { font-size: 11pt; }
  .group-heading > span, .group-note { font-size: 8pt; }
  .group-note { margin: 4px 0 0; break-after: avoid; }
  .directory-entry { padding: 6px 0; border-color: #ccc; break-inside: avoid; }
  .entry-heading h4 { font-size: 10pt; }
  .entry-status, .entry-count { font-size: 8pt; }
  .entry-summary { font-size: 9pt; line-height: 1.6; margin: 2px 0; }
  .subject-section + .subject-section { margin-top: 20px; }
  .review-note { background: #fff; border-color: #999; font-size: 9pt; margin: 0 0 10px; padding: 5px 8px; }
  .support-section { margin-top: 15px; padding-top: 10px; break-inside: avoid; }
  .support-section .eyebrow { font-size: 7pt; margin-bottom: 2px; }
  .support-section h2 { font-size: 12pt; margin-bottom: 8px; }
  .support-section ul, .support-section > p:last-child { font-size: 9pt; }
  .support-section li { margin-bottom: 4px; }
  .extra-link { padding: 6px 0; }
  .extra-link strong { font-size: 10pt; }
  .extra-link small { font-size: 8pt; }
  .about-section { margin: 15px 0; font-size: 8pt; break-inside: avoid; }
  .about-section h2 { font-size: 10pt; }
  .home-footer { padding: 8px 0; font-size: 8pt; }
}
