@charset "UTF-8";

:root {
  --header-height: 68px;
  --paper: #f8f7f4;
  --white: #fff;
  --ink: #242424;
  --muted: #77736e;
  --line: #dedbd5;
  --accent: #a94e36;
  --soft: #f0e5df;
  --green: #3f6b56;
  --hover: #f8f4f0;
  --badge-bg: #ebeee9;
  --on-ink: #fff;
  --floating-shadow: 0 10px 30px rgb(35 30 25 / 12%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191d1c;
  --white: #222826;
  --ink: #f2efe8;
  --muted: #b6b3aa;
  --line: #3d4642;
  --accent: #e6a186;
  --soft: #3a302c;
  --green: #b4d1b9;
  --hover: #2c3330;
  --badge-bg: #304238;
  --on-ink: #191d1c;
  --floating-shadow: 0 10px 30px rgb(0 0 0 / 28%);
}

html { scroll-padding-top: calc(var(--header-height) + 24px); }
[hidden] { display: none !important; }

.site-header,
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-inner { height: var(--header-height); }
.site-inner,
.topbar-inner { gap: 18px; }
.header-actions,
.site-nav { display: flex; align-items: center; }
.header-actions { gap: 24px; }
.site-nav { gap: 25px; }
.site-nav a,
.top-actions a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color .18s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"],
.top-actions a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; }
.top-actions { gap: 18px; }
.local-badge { background: var(--badge-bg); color: var(--green); }
.theme-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 75px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: 12px/1.2 var(--ui);
  white-space: nowrap;
  transition: border-color .18s ease, background-color .18s ease;
}
.theme-switch:hover { border-color: var(--accent); background: var(--hover); }
.theme-symbol { font: 19px/1 Georgia, serif; width: 18px; text-align: center; }
.brand { display: inline-flex; align-items: center; }
.brand-mark { display: block; width: 22px; height: 22px; margin-right: 9px; border-radius: 3px; }
.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}
.header-icon svg { display: block; width: 17px; height: 17px; }
.header-icon:hover { border-color: var(--accent); background: var(--hover); color: var(--accent); }
.header-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 60;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.back-to-top {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--floating-shadow);
  font: 25px/1 Georgia, serif;
  transition: transform .18s ease, border-color .18s ease;
}
.back-to-top:hover { transform: translateY(-3px); border-color: var(--accent); }
.back-to-top:active { transform: translateY(0); }

.site-footer {
  max-width: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  max-width: 1120px;
  margin: auto;
  padding: 27px 24px 35px;
}
.admin-footer .footer-inner { max-width: 1680px; padding-left: 30px; padding-right: 30px; }
.footer-inner p { margin: 0; font: 12px/1.8 var(--ui); }
.footer-inner p strong { display: block; color: var(--ink); font-size: 13px; font-weight: 650; }
.footer-inner p span { display: block; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 12px 25px; padding-top: 3px; }
.footer-inner a { color: var(--muted); text-decoration: none; font-size: 12px; white-space: nowrap; }
.footer-inner a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* Reading pages keep a narrow text measure and a visible contents rail. */
@media (min-width: 971px) {
  .reader-main { max-width: 1180px; }
  .reader-grid { grid-template-columns: minmax(0, 740px) minmax(190px, 240px); column-gap: clamp(36px, 5vw, 64px); }
}
.intro { padding-top: 82px; }
.article-row { transition: background-color .18s ease; }
.article-row:hover { background: var(--hover); }
.article-body { line-height: 1.88; letter-spacing: .005em; }
.article-body p { margin: 1.25em 0; }
#panel-en,
#previewEn { font-family: Georgia, "Iowan Old Style", serif; font-size: 17px; line-height: 1.85; letter-spacing: 0; }
.toc-inner { top: calc(var(--header-height) + 22px); max-height: calc(100dvh - var(--header-height) - 42px); }
.reader-panels h2,
.reader-panels h3,
#articles,
#sources { scroll-margin-top: calc(var(--header-height) + 24px); }

/* The editorial desk uses the same paper, ink, and reading rhythm. */
.queue-item:hover,
.queue-item.selected { background: var(--hover); }
.review-card,
.reject-field { background: var(--white); color: var(--ink); }
.primary { color: var(--on-ink); }
.notice { bottom: 82px; color: var(--on-ink); }
.notice.error { color: #fff; }
.preview { line-height: 1.88; }

.about-main { max-width: 940px; min-height: calc(100dvh - var(--header-height) - 135px); margin: auto; padding: 78px 24px 110px; }
.about-head { padding-bottom: 64px; border-bottom: 1px solid var(--line); }
.about-head h1 { margin: 0 0 17px; font: 600 clamp(42px, 6vw, 65px)/1.2 var(--body); letter-spacing: -.035em; }
.about-head > p:last-child { max-width: 580px; margin: 0; color: var(--muted); font: 17px/1.8 var(--body); }
.about-content section { display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 44px; padding: 33px 0 34px; border-bottom: 1px solid var(--line); }
.about-content h2 { grid-column: 1; grid-row: 1 / span 3; margin: 0; font: 600 19px/1.55 var(--body); }
.about-content p { grid-column: 2; margin: 0 0 15px; font: 16px/1.95 var(--body); }
.about-content p:last-child { margin-bottom: 0; }
.about-back { display: inline-block; margin-top: 35px; color: var(--accent); text-decoration: none; font-size: 13px; }
.about-back:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 800px) {
  .topbar { position: sticky; }
  .queue-panel { position: static; height: auto; }
  .toc-inner { position: static; max-height: 210px; }
}
@media (max-width: 640px) {
  .site-inner { padding: 0 18px; }
  .header-actions { gap: 15px; }
  .site-nav { gap: 14px; }
  .site-nav a,
  .top-actions a { font-size: 12px; }
  .topbar-inner { padding: 0 18px; }
  .top-actions { gap: 11px; }
  .local-badge { display: none; }
  .footer-inner,
  .admin-footer .footer-inner { padding: 25px 18px 32px; }
  .footer-inner { display: block; }
  .footer-inner nav { margin-top: 18px; padding: 0; }
  .about-main { padding: 55px 18px 80px; }
  .about-head { padding-bottom: 45px; }
  .about-content section { display: block; padding: 27px 0; }
  .about-content h2 { margin-bottom: 13px; }
  .about-content p { font-size: 15px; }
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  .notice { bottom: 74px; }
}

@media (max-width: 430px) {
  .site-header .site-inner:has(.site-nav) { gap: 8px; padding-inline: 12px; }
  .site-header .header-actions { gap: 8px; }
  .site-header .site-nav { gap: 9px; }
  .site-header .brand span { display: none; }
}

/* Illustrated reading library */
.site-main { max-width: 1180px; }
.intro { display: flex; align-items: baseline; justify-content: space-between; gap: 24px 30px; padding: 24px 0 20px; border-bottom: 1px solid var(--line); }
.intro h1 { max-width: 640px; margin: 0; color: var(--ink); font: 400 clamp(16px, 1.35vw, 17px)/1.6 var(--body); letter-spacing: 0; }
.library { padding-top: 26px; }
.search-field { max-width: 390px; margin: 26px 0 34px; }
.search-field input { background: var(--white); }
.article-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 28px; border: 0; }
.article-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); background: var(--white); transition: transform .2s ease, box-shadow .2s ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgb(35 30 25 / 8%); }
.card-cover { display: block; overflow: hidden; aspect-ratio: 640/420; background: var(--soft); }
.card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article-card:hover .card-cover img { transform: scale(1.035); }
.card-copy { display: flex; flex-direction: column; flex: 1; padding: 25px 27px 26px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font: 11px/1.4 var(--ui); letter-spacing: .04em; }
.card-meta span { color: var(--accent); }
.card-copy h3 { margin: 16px 0 10px; font: 600 clamp(21px, 2.4vw, 28px)/1.35 var(--body); letter-spacing: -.025em; }
.card-copy h3 a { text-decoration: none; }
.card-copy h3 a:hover { color: var(--accent); }
.card-summary { margin: 0; font: 15px/1.85 var(--body); color: var(--muted); }
.card-original { margin: 15px 0 0; color: var(--muted); font: italic 13px/1.55 Georgia, serif; }
.card-read { align-self: flex-start; margin-top: auto; padding-top: 23px; color: var(--ink); text-decoration: none; font: 600 12px/1.4 var(--ui); border-bottom: 1px solid var(--accent); }
.card-read span { margin-left: 7px; color: var(--accent); }
.card-read:hover { color: var(--accent); }
.article-head { min-height: 230px; }
.article-head-cover { float: right; width: min(32%, 235px); height: auto; aspect-ratio: 640/420; object-fit: cover; margin: 0 0 18px 28px; }
.article-head .eyebrow { margin-bottom: 14px; }
.article-head h1 { font-size: clamp(34px, 4vw, 50px); }
.article-summary { max-width: 670px; margin: 22px 0 0; font: 17px/1.85 var(--body); color: var(--ink); }
.listen-link { display: inline-block; margin-top: 21px; font: 600 13px/1.5 var(--ui); text-decoration: none; border-bottom: 1px solid var(--accent); }
.listen-link:hover { color: var(--accent); }
.listen-link span { color: var(--accent); }
.reader-grid { grid-template-areas: "head toc" "media toc" "tabs toc" "body toc" "sources toc" "pager toc"; }
.reader-grid > .media-drawer { grid-area: media; min-width: 0; }
.media-drawer { max-width: 760px; width: 100%; margin: 0 auto 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-height) + 20px); }
.media-drawer > summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; list-style: none; padding: 17px 0; cursor: pointer; font: 600 14px/1.4 var(--ui); }
.media-drawer > summary::-webkit-details-marker { display: none; }
.media-drawer > summary span { font-size: 12px; color: var(--muted); font-weight: 400; }
.media-drawer[open] > summary span span { display: inline-block; transform: rotate(180deg); }
.reader-media { margin: 0 auto 16px; }
.reader-media .media-label:first-child { margin-top: 8px; }
.video-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; background-size: cover; background-position: center; cursor: pointer; }
.video-play-symbol { display: grid; place-items: center; width: 64px; height: 64px; padding-left: 4px; border: 2px solid white; border-radius: 50%; background: rgb(0 0 0 / 28%); font-size: 24px; }
.video-fallback { display: inline-block; margin: -8px 0 24px; font-size: 12px; color: var(--muted); text-underline-offset: 3px; }
.video-fallback:hover { color: var(--accent); }
@media (max-width: 970px) {
  .reader-grid { grid-template-areas: "head" "media" "tabs" "toc" "body" "sources" "pager"; }
}
@media (max-width: 700px) {
  .article-list { grid-template-columns: 1fr; gap: 22px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 0 16px; }
  .intro h1 { font-size: 15px; }
  .intro > p.intro-stats { white-space: normal; }
  .card-copy { padding: 22px 22px 24px; }
  .article-head-cover { width: 100%; float: none; display: block; margin: 0 0 26px; }
  .article-summary { font-size: 16px; }
}
@media (max-width: 480px) {
  .brand { font-size: 15px; letter-spacing: .06em; }
  .brand span { font-size: 12px; margin-left: 5px; }
  .theme-switch { min-width: 37px; width: 37px; padding: 5px; }
  .theme-text { display: none; }
}
@media (max-width: 360px) {
  .top-actions a[href="about.html"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .theme-switch,
  .article-row { transition: none; }
}

/* Compact archive: three articles per row on wider screens. */
.intro { padding: 22px 0 18px; }
.library { padding-top: 24px; }
.library-controls { display: flex; align-items: center; gap: 10px; margin: 22px 0 18px; }
.library-controls .search-field { flex: 1; max-width: 420px; margin: 0; }
.library-controls .search-field input, .filter-select select { height: 42px; border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 0 12px; font: 13px var(--ui); }
.filter-select select { min-width: 118px; cursor: pointer; }
.topic-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.topic-filters button { min-height: 32px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--muted); font: 12px/1.3 var(--ui); }
.topic-filters button:hover { color: var(--ink); border-color: var(--ink); }
.topic-filters button[aria-pressed="true"] { color: var(--white); background: var(--ink); border-color: var(--ink); }
.article-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 18px; }
.article-card { border-color: var(--line); }
.article-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(35 30 25 / 7%); }
.card-cover { aspect-ratio: 16/9; }
.card-copy { padding: 15px 17px 16px; }
.card-meta { font-size: 11px; }
.card-copy h3 { margin: 10px 0 7px; font: 600 19px/1.42 var(--body); letter-spacing: -.015em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card-summary { color: var(--muted); font: 13px/1.65 var(--body); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.card-topics { display: flex; flex-wrap: wrap; gap: 5px; }
.card-topics span { display: inline-block; padding: 3px 6px; background: var(--badge-bg); color: var(--green); font: 10px/1.35 var(--ui); }
.card-read { flex: none; margin: 0; padding: 0; white-space: nowrap; }
.article-head-cover { aspect-ratio: 16/9; }
@media (max-width: 900px) { .article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) {
  .library-controls { flex-wrap: wrap; }
  .library-controls .search-field { flex-basis: 100%; max-width: none; }
  .filter-select { flex: 1; }
  .filter-select select { width: 100%; }
  .article-list { grid-template-columns: 1fr; }
}

/* About page: extended sections */
.about-content .about-list,
.about-content .about-links,
.about-content .creator { grid-column: 2; min-width: 0; }
.about-content .about-list { list-style: none; margin: 0; padding: 0; }
.about-content .about-list li { position: relative; margin: 0 0 10px; padding-left: 19px; font: 16px/1.9 var(--body); }
.about-content .about-list li:last-child { margin-bottom: 0; }
.about-content .about-list li::before { content: ""; position: absolute; left: 2px; top: .88em; width: 7px; height: 1px; background: var(--accent); }
.about-content .about-list a,
.creator-bio a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
.about-content .about-list a:hover,
.creator-bio a:hover { text-decoration: underline; }
.about-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.about-links li { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: baseline; gap: 14px; font: 16px/1.7 var(--body); }
.about-links span { color: var(--muted); font: 12px/1.7 var(--ui); letter-spacing: .05em; }
.about-links a { color: var(--accent); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.about-links a:hover { border-bottom-color: var(--accent); }
.creator { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.creator-bio p:first-child { margin-top: 0; }
.contact-inline { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) {
  .about-content .about-list li { font-size: 15px; }
  .creator { grid-template-columns: 1fr; gap: 0; }
  .about-links li { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
}

.intro > p.intro-stats { flex: none; margin: 0; color: var(--accent); font: 12px/1.6 var(--ui); letter-spacing: .06em; white-space: nowrap; }
.intro > p.intro-stats:empty { display: none; }
.about-head > p.about-stats { margin: 16px 0 0; color: var(--muted); font: 12px/1.6 var(--ui); letter-spacing: .08em; }
.about-head > p.about-stats:empty { display: none; }

.update-note { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 2px; padding: 0; color: var(--muted); font: 12px/1.7 var(--ui); }
.update-note strong { flex: none; color: var(--ink); font-weight: 700; }
.featured-label { display: inline-block; color: var(--accent); font-weight: 700; white-space: nowrap; }
@media (max-width: 650px) { .update-note { align-items: flex-start; flex-direction: column; gap: 2px; } }

/* Quiet, compact recommendations leave room for the article list on the first screen. */
.featured-section { margin: 25px 0 24px; }
.featured-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.featured-heading h2 { margin: 0; font: 600 19px/1.4 var(--body); letter-spacing: -.015em; }
.featured-actions { display: flex; align-items: center; gap: 7px; }
.featured-actions span { min-width: 42px; margin: 0 3px; color: var(--muted); font: 11px/1 var(--ui); letter-spacing: .04em; }
.featured-actions button:not(.featured-filter-link) { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: 15px/1 var(--body); cursor: pointer; }
.featured-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.featured-actions button:disabled { opacity: .35; cursor: default; }
.featured-track { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.featured-track::-webkit-scrollbar { display: none; }
.featured-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); flex: 0 0 100%; min-width: 0; height: 155px; scroll-snap-align: start; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.featured-cover { display: block; overflow: hidden; min-width: 0; background: var(--soft); }
.featured-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.featured-copy { display: flex; flex-direction: column; align-items: start; min-width: 0; padding: 14px 22px; }
.featured-number { color: var(--muted); font: 11px/1.3 var(--ui); letter-spacing: .03em; }
.featured-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 5px 0 4px; font: 600 clamp(19px, 2vw, 23px)/1.3 var(--body); letter-spacing: -.01em; }
.featured-copy h3 a { text-decoration: none; }
.featured-copy h3 a:hover { color: var(--accent); }
.featured-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 5px; color: var(--muted); font: 12px/1.5 var(--body); }
.featured-read { display: inline-block; margin-top: auto; color: var(--accent); text-decoration: none; font: 600 11px/1.3 var(--ui); }
.featured-filter-link { padding: 0 5px; border: 0; background: none; color: var(--muted); cursor: pointer; font: 11px/1.4 var(--ui); }
.featured-filter-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Article guides are short, source-linked reading cards rather than a second article. */
.reader-grid { grid-template-areas: "head toc" "guide toc" "media toc" "tabs toc" "body toc" "sources toc" "pager toc"; }
.reader-grid > .reader-guide { grid-area: guide; min-width: 0; }
.reader-grid:has(.reader-guide) > .article-head { margin-bottom: 23px; }
.reader-guide { margin: 0 0 28px; }
.guide-heading, .guide-actions { display: flex; align-items: center; }
.guide-heading { justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.guide-heading h2 { margin: 0; font: 600 16px/1.5 var(--body); }
.guide-actions { gap: 7px; }
.guide-actions span { min-width: 42px; color: var(--muted); font: 11px/1 var(--ui); }
.guide-actions button { width: 27px; height: 27px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; font: 15px/1 var(--body); }
.guide-actions button:disabled { opacity: .35; cursor: default; }
.guide-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.guide-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; scrollbar-width: none; }
.guide-track::-webkit-scrollbar { display: none; }
.guide-card { flex: 0 0 100%; min-width: 0; min-height: 142px; padding: 13px 18px 14px; scroll-snap-align: start; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.guide-number { color: var(--muted); font: 10px/1.4 var(--ui); letter-spacing: .05em; }
.guide-card h3 { margin: 3px 0 4px; font: 600 19px/1.35 var(--body); }
.guide-card p { margin: 0 0 6px; color: var(--muted); font: 13px/1.55 var(--body); }
.guide-card a { color: var(--accent); font: 600 11px/1.4 var(--ui); text-decoration: none; }
.guide-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
.source-figure { margin: 32px 0 38px; padding: 15px; border: 1px solid var(--line); background: var(--white); }
.source-figure img { max-width: 100%; max-height: 660px; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.source-figure figcaption { margin-top: 12px; color: var(--muted); text-align: center; font: 12px/1.5 var(--ui); }
@media (max-width: 750px) {
  .featured-section { margin-top: 22px; }
  .featured-card { grid-template-columns: 124px minmax(0, 1fr); height: 150px; }
  .featured-copy { padding: 12px 14px; }
  .featured-copy h3 { font-size: 18px; }
  .featured-summary { -webkit-line-clamp: 2; }
}
@media (max-width: 480px) {
  .featured-heading { flex-wrap: wrap; }
  .featured-actions { width: 100%; justify-content: flex-end; }
  .featured-filter-link { margin-right: auto; }
  .featured-card { grid-template-columns: 88px minmax(0, 1fr); height: 144px; }
  .featured-copy { padding: 11px 12px; }
  .featured-copy h3 { font-size: 16px; }
  .featured-summary { font-size: 11px; }
  .featured-read { display: none; }
  .guide-card { min-height: 160px; padding: 12px 14px; }
  .guide-card h3 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .carousel-toggle { display: none; } }
@media (max-width: 970px) {
  .reader-grid { grid-template-areas: "head" "guide" "media" "tabs" "toc" "body" "sources" "pager"; }
}

.books-main { max-width: 1060px; min-height: calc(100dvh - var(--header-height) - 135px); margin: 0 auto; padding: 76px 24px 96px; }
.books-head { max-width: 710px; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.books-head .eyebrow { margin: 0 0 17px; }
.books-head h1 { margin: 0 0 16px; font: 600 clamp(40px, 5vw, 58px)/1.2 var(--body); }
.books-head > p:last-child { margin: 0; color: var(--muted); font: 16px/1.8 var(--body); }
.book-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 34px 0 0; }
.book-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; min-height: 300px; padding: 28px; border: 1px solid var(--line); background: var(--white); }
.book-number { margin: 6px 0 0; color: var(--accent); font: 12px/1.4 var(--ui); }
.book-card h2 { margin: 0 0 4px; font: 600 clamp(24px, 2.6vw, 30px)/1.3 Georgia, serif; }
.book-subtitle { margin: 0; color: var(--muted); font: italic 14px/1.5 Georgia, serif; }
.book-description { margin: 30px 0 26px; color: var(--ink); font: 15px/1.85 var(--body); }
.book-actions { display: flex; flex-wrap: wrap; gap: 12px 23px; }
.book-actions a { color: var(--accent); text-decoration: none; font: 600 13px/1.5 var(--ui); border-bottom: 1px solid currentColor; }
.book-actions a:hover { color: var(--ink); }
@media (max-width: 760px) { .books-main { padding: 55px 18px 80px; } .book-list { grid-template-columns: 1fr; } .book-card { min-height: 0; padding: 24px; grid-template-columns: 55px minmax(0, 1fr); } }

.private-book-main { max-width: 1180px; margin: 0 auto; padding: 34px 24px 100px; }
.private-book-main > .back-link { margin: 6px 0 0; }
.private-book-head { margin: 38px 0 36px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.private-book-head h1 { margin: 4px 0 10px; font: 600 clamp(32px, 4.2vw, 48px)/1.2 var(--body); }
.private-book-head > p:last-child { margin: 0; color: var(--muted); font: 13px/1.6 var(--ui); }
.private-book-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 5vw, 70px); align-items: start; }
.private-book-toc { position: sticky; top: calc(var(--header-height) + 18px); max-height: calc(100dvh - var(--header-height) - 36px); overflow: auto; padding-right: 8px; }
.private-book-toc h2 { margin: 0 0 14px; color: var(--muted); font: 600 12px/1.5 var(--ui); }
.private-book-toc button { display: flex; align-items: start; gap: 10px; width: 100%; padding: 10px 5px; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.private-book-toc button.selected { color: var(--ink); font-weight: 700; }
.private-book-toc button span { flex: none; color: var(--accent); font: 12px/1.6 var(--ui); }
.private-book-toc button strong { flex: 1; font: inherit; line-height: 1.5; }
.private-book-toc button em { color: var(--green); font: 10px/1.5 var(--ui); white-space: nowrap; }
.private-book-reader { min-width: 0; max-width: 760px; }
.private-book-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.private-book-tabs button { padding: 10px 0 13px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; font: 600 15px/1.4 var(--ui); }
.private-book-tabs button.selected { color: var(--ink); border-bottom-color: var(--accent); }
#bookMessage { color: var(--muted); font: 13px/1.7 var(--ui); }
#bookMessage:empty { display: none; }
#bookBody { padding: 8px 0 28px; font-size: 18px; }
#bookBody[lang="en"] { font-family: Georgia, serif; }
#bookBody h2, #bookBody h3 { scroll-margin-top: calc(var(--header-height) + 20px); }
.private-book-pager { display: flex; justify-content: space-between; gap: 15px; padding-top: 20px; border-top: 1px solid var(--line); }
.private-book-pager button { border: 0; background: transparent; color: var(--accent); cursor: pointer; font: 600 13px/1.5 var(--ui); }
.private-book-pager button:disabled { opacity: .3; cursor: default; }
@media (max-width: 760px) { .private-book-main { padding: 28px 18px 80px; } .private-book-grid { display: block; } .private-book-toc { position: static; max-height: 200px; margin-bottom: 30px; border-bottom: 1px solid var(--line); } }

/* Inline QR mention inside body copy */
.qr-mention {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
  cursor: help;
}
.qr-mention:hover { text-decoration-style: solid; }
.qr-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  width: 144px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .38);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  pointer-events: none;
  z-index: 6;
}
.qr-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 9px;
  height: 9px;
  margin-left: -5px;
  margin-top: -5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  transform: rotate(45deg);
}
.qr-pop img { display: block; width: 100%; height: auto; }
.qr-mention:hover .qr-pop,
.qr-mention:focus-visible .qr-pop,
.qr-mention.is-open .qr-pop {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Contact dock: hover the floating button to reveal the WeChat QR code */.contact-dock {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 55px);
  z-index: 34;
  transition: bottom .18s ease;
}
.contact-dock.is-flush { bottom: max(22px, env(safe-area-inset-bottom)); }
.contact-trigger {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--floating-shadow);
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
}
.contact-trigger:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }
.contact-trigger svg { display: block; width: 18px; height: 18px; }
.contact-card {
  position: absolute;
  right: 0;
  bottom: 55px;
  width: 214px;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.985);
  transform-origin: bottom right;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.contact-dock.is-open .contact-card { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.contact-card p { margin: 0; }
.contact-card-label { font: 11px/1.5 var(--ui); letter-spacing: .12em; color: var(--muted); }
.contact-qr { display: block; width: 126px; height: auto; margin: 10px auto 9px; border: 1px solid var(--line); background: #fff; }
.contact-card-note { font: 12px/1.65 var(--ui); color: var(--muted); text-align: center; }
.contact-links { display: grid; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 11px/1.5 var(--ui);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}
.contact-links a > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.contact-links a:hover { color: var(--accent); }
.contact-links a span[aria-hidden] { flex: none; color: var(--muted); font-size: 10px; letter-spacing: .02em; }
@media (max-width: 640px) {
  .contact-dock { right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px); }
  .contact-dock.is-flush { bottom: max(16px, env(safe-area-inset-bottom)); }
  .contact-trigger { width: 42px; height: 42px; }
  .contact-card { width: min(214px, calc(100vw - 32px)); }
}
