/* ==================================================================
   中国神话故事 · 样式
   ------------------------------------------------------------------
   定位：给家长看的文字型故事集。首屏用一张用户提供的《哪吒闹海》图，
   颜色从图里取：深青、海沫白、朱砂、赭金。正文仍是宣纸 + 墨 + 宋体，
   不做儿童卡片墙式的大色块；只有四类来源的卡片和分类圆点带颜色。
   ================================================================== */

/* ---------------------------------------------------------------- 令牌 */
:root {
  --paper: #eef1e9;
  --paper-2: #f6f8f2;
  --card: #fbfcf7;

  --ink: #1b2b2c;
  --ink-2: #4d5f5f;
  --ink-3: #7f918f;

  --line: #ccd8d0;
  --line-2: #dfe7df;

  --seal: #a83a2c;
  --gold: #b5873e;
  --gold-light: #e7c47d;
  --teal: #2f6b72;

  --topbar-bg: #102629;
  --topbar-ink: #f2eee1;
  --topbar-muted: rgba(242, 238, 225, 0.64);
  --topbar-line: rgba(242, 238, 225, 0.18);

  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    "Songti TC", "SimSun", "Georgia", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;

  --read-scale: 1;
  --maxw: 1040px;
  --article-w: 760px;
  --pad: 20px;
  --topbar-h: 56px;
}

html[data-font="sm"] { --read-scale: 0.94; }
html[data-font="md"] { --read-scale: 1; }
html[data-font="lg"] { --read-scale: 1.08; }
html[data-font="xl"] { --read-scale: 1.16; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.8;
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
}

::selection {
  background: #eadfc6;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
}

.loading {
  padding: 20px 0;
  font-size: 14px;
  color: var(--ink-3);
}

.noscript {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--pad) 20px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  color: var(--topbar-ink);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  color: var(--topbar-ink);
  text-decoration: none;
}

.brand__seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1;
  color: #fbf5e7;
  background: var(--seal);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand__text strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand__text small {
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--topbar-muted);
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--topbar-muted);
  text-decoration: none;
  white-space: nowrap;
}

.topnav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.topnav a:hover {
  color: var(--topbar-ink);
}

.topnav a:hover::after {
  transform: scaleX(1);
}

.topbar__spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.account-chip {
  display: inline-flex;
  align-items: center;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--topbar-ink);
  background: transparent;
  border: 1px solid var(--topbar-line);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.iconbtn:hover {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

/* ---------------------------------------------------------------- 首屏 */
.hero {
  position: relative;
  min-height: 440px;
  color: var(--topbar-ink);
  background-color: #102629;
  background-image:
    linear-gradient(90deg, rgba(7, 22, 25, 0.74) 0%, rgba(7, 22, 25, 0.46) 36%, rgba(7, 22, 25, 0.1) 66%, rgba(7, 22, 25, 0.18) 100%),
    url("../img/hero.webp");
  background-size: cover, cover;
  background-position: center, center 30%;
  background-repeat: no-repeat, no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light) 30%, var(--gold-light) 70%, transparent);
  opacity: 0.55;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px var(--pad) 56px;
}

.hero__eyebrow {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--gold-light);
}

.hero__title {
  margin: 14px 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(40px, 6.6vw, 62px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: var(--topbar-ink);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.38);
}

.hero__sub {
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.4vw, 21px);
  letter-spacing: 0.1em;
  color: rgba(242, 238, 225, 0.92);
}

.hero__lead {
  max-width: 36em;
  margin-top: 18px;
  font-size: 15.5px;
  line-height: 2;
  color: rgba(242, 238, 225, 0.9);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.hero__meta {
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(242, 238, 225, 0.62);
}

.hero__seal {
  position: absolute;
  top: 50%;
  right: 3%;
  z-index: 2;
  padding: 10px 0;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  text-align: center;
  writing-mode: vertical-rl;
  border: 2px solid rgba(231, 196, 125, 0.75);
  border-radius: 2px;
  opacity: 0.9;
  transform: translateY(-50%);
  user-select: none;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-tag,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(242, 238, 225, 0.9);
  text-decoration: none;
  background: rgba(7, 22, 25, 0.34);
  border: 1px solid rgba(242, 238, 225, 0.32);
  border-radius: 999px;
}

.hero-tag:hover {
  color: var(--topbar-ink);
  border-color: var(--gold-light);
  background: rgba(7, 22, 25, 0.55);
}

.hero__actions {
  display: flex;
  gap: 16px;
  margin-top: 14px;
}

.hero__action {
  min-height: 36px;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: rgba(242, 238, 225, 0.86);
  text-decoration: underline;
  text-decoration-color: rgba(242, 238, 225, 0.4);
  text-underline-offset: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.hero__action:hover {
  color: var(--topbar-ink);
  text-decoration-color: var(--gold-light);
}

.hero__eyebrow--source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(242, 238, 225, 0.86);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.hero__eyebrow--source::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--cat, var(--gold-light));
  border-radius: 50%;
}

/* 注意：基础 .crumb 写在后面（约 1079 行），同优先级会盖掉这里。
   所以用 .hero 提升一级特异性，别把这段挪到基础规则前面。 */
.hero .crumb--light {
  color: rgba(242, 238, 225, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72), 0 1px 14px rgba(0, 0, 0, 0.5);
}

.hero .crumb--light a {
  color: rgba(242, 238, 225, 0.94);
  text-shadow: inherit;
  text-decoration-color: rgba(242, 238, 225, 0.4);
}

.hero .crumb--light a:hover {
  color: var(--topbar-ink);
}

.hero .crumb--light .crumb__sep {
  color: rgba(242, 238, 225, 0.6);
}

.hero--compact {
  min-height: 300px;
}

.hero--story {
  min-height: 380px;
}

.hero--compact .hero__inner {
  padding: 46px var(--pad) 40px;
}

.hero--story .hero__inner {
  padding: 34px var(--pad) 38px;
}

.hero__title--story {
  font-size: clamp(32px, 5.4vw, 46px);
  letter-spacing: 0.1em;
  margin-top: 10px;
}

.hero__title--page {
  font-size: clamp(34px, 6vw, 48px);
}

/* ---------------------------------------------------------------- 神话插图 */
.gallery {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 0 4px;
}

.gallery__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.gallery__head h2 {
  font-size: 22px;
  letter-spacing: 0.12em;
}

.gallery__head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.shot {
  display: block;
  margin: 0;
  padding: 5px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 1px;
}

.shot figcaption {
  padding: 7px 3px 2px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.gallery__credit {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 四类卡片 */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.themes {
  padding: 36px 0 6px;
}

.themes__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.themes__head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.themes__head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.rail-nav {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.rail-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.rail-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--gold);
}

.rail-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.theme-rail {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.theme-rail::-webkit-scrollbar {
  display: none;
}

/* 竖版 3:4，像一本小书——与毛主席诗词的精选卡一致 */
.theme-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  width: min(62vw, 224px);
  aspect-ratio: 3 / 4;
  padding: 16px 15px 13px;
  overflow: hidden;
  scroll-snap-align: start;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cat, var(--gold));
  border-radius: 3px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.theme-card:hover {
  background: #fff;
  border-color: var(--cat, var(--gold));
  transform: translateY(-2px);
}

.theme-card__no {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--cat, var(--gold));
}

.theme-card__name {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.theme-card__desc {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

.theme-card__works {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.theme-card__works-label {
  margin-top: 12px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.theme-card__meta {
  margin-top: 14px;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
}

/* ---------------------------------------------------------------- 目录 */
.catalog {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 34px 0 16px;
  scroll-margin-top: calc(var(--topbar-h) + 8px);
}

.catalog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.catalog__title h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.catalog__title p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 300px;
  max-width: 400px;
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.15s ease;
}

.search:focus-within {
  border-color: var(--teal);
}

.search__label {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search__input::placeholder {
  color: var(--ink-3);
}

/* 只用我们自己的「清除」，不显示浏览器自带的 × */
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search__clear {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 2px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.search__clear:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.search-note {
  margin: 16px 0 0;
  padding-bottom: 8px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.search-note strong {
  color: var(--ink);
  font-weight: 600;
}

.search-empty {
  margin: 22px 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
}

.results {
  margin-top: 2px;
}

.result {
  padding: 16px 6px;
  border-bottom: 1px solid var(--line-2);
}

.result__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  text-decoration: none;
}

.result__title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.result__head:hover .result__title {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.result__meta {
  font-size: 12px;
  color: var(--ink-3);
}

.result__snippet {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
}

mark {
  padding: 0 1px;
  color: var(--ink);
  background: #eadfc6;
}

/* ---------------------------------------------------------------- 四类详情 */
.theme-section {
  scroll-margin-top: var(--topbar-h);
}

.theme-section__head {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  padding: 15px 0 12px;
  background: var(--paper);
  border-top: 2px solid var(--cat, var(--gold));
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.16s ease;
}

.theme-section__head.is-stuck {
  box-shadow: 0 12px 20px -22px rgba(16, 38, 41, 0.7);
}

.theme-section__row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.theme-section__no {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.theme-section__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.theme-section__count {
  font-size: 12px;
  color: var(--ink-3);
}

.theme-section__toggle {
  margin-left: auto;
  min-height: 44px;
  padding: 0 13px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-section__toggle:hover {
  color: var(--ink);
  border-color: var(--cat, var(--gold));
}

.theme-section__desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-3);
}

.theme-section.is-collapsed .entries {
  display: none;
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  display: flex;
  gap: 16px;
  padding: 15px 6px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line-2);
  transition: background 0.15s ease;
}

.entries li:first-child .entry {
  border-top: 0;
}

.entry:hover {
  background: rgba(47, 107, 114, 0.045);
}

.entry:hover .entry__title {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.entry:hover .entry__arrow {
  opacity: 1;
  transform: translateX(3px);
}

.entry__no {
  flex: 0 0 26px;
  padding-top: 5px;
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.entry__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.entry__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.45;
}

.entry__sum {
  font-size: calc(15px * var(--read-scale));
  line-height: 1.85;
  color: var(--ink-2);
}

.entry__meta {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.entry__arrow {
  flex: 0 0 auto;
  align-self: center;
  font-size: 15px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* 页尾说明 */
.site-note {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 0 48px;
  border-top: 1px solid var(--line);
}

.site-note h2 {
  font-size: 18px;
  letter-spacing: 0.1em;
}

.site-note p {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.site-note strong {
  color: var(--ink);
  font-weight: 600;
}

.site-note a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

/* ---------------------------------------------------------------- 详情页 */
.readbar {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  left: 0;
  z-index: 45;
  height: 2px;
  pointer-events: none;
}

.readbar__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.1s linear;
}

.article {
  width: 100%;
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 24px var(--pad) 64px;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.crumb a {
  color: var(--ink-2);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.crumb__sep {
  color: var(--line);
}

.article__head {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--line);
}

.article__source {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.article__source::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--cat, var(--gold));
  border-radius: 50%;
}

.article__title {
  margin: 10px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.article__lead {
  font-family: var(--font-serif);
  font-size: clamp(17px, 2.2vw, 18px);
  line-height: 1.9;
  color: var(--ink-2);
}

.article__actions {
  display: flex;
  gap: 18px;
  margin-top: 4px;
}

.textbtn {
  min-height: 44px;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: rgba(77, 95, 95, 0.32);
  text-underline-offset: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.textbtn:hover {
  color: var(--ink);
  text-decoration-color: rgba(27, 43, 44, 0.5);
}

/* 顶部翻页：参考毛主席诗词，两格窄条 */
.pager--top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
}

.pgbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.pgbtn:hover {
  color: var(--ink);
  border-color: var(--cat, var(--gold));
}

.pgbtn--next {
  justify-content: flex-end;
}

.pgbtn--none {
  opacity: 0.45;
}

.pgbtn--none:hover {
  color: var(--ink-2);
  border-color: var(--line);
}

.pgbtn__dir {
  color: var(--ink-3);
}

.pgbtn__title {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.prose {
  padding: 22px 0 8px;
  font-family: var(--font-serif);
}

.prose p {
  margin: 0 0 1.15em;
  font-size: calc(clamp(19px, 2.2vw, 20px) * var(--read-scale));
  line-height: 2.05;
  letter-spacing: 0.015em;
  text-indent: 2em;
  transition: background 0.2s ease;
}

.prose p.is-reading {
  background: rgba(47, 107, 114, 0.07);
}

/* 正文底下的四个区块统一成一套：细线分隔、标题同字号、
   金色竖道只挂在标题行里（不跟着整段走）。 */
.story-section {
  padding: 26px 0 24px;
  border-top: 1px solid var(--line);
}

.story-section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.story-section__title::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 1.05em;
  background: var(--gold);
  border-radius: 1px;
}

.story-section__text {
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-size: calc(17px * var(--read-scale));
  line-height: 1.95;
  color: var(--ink);
}

.qa {
  padding-top: 26px;
}

.qa__list {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.qa__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.qa__no {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  font-size: 11.5px;
  color: var(--gold);
  border: 1px solid rgba(168, 116, 51, 0.4);
  border-radius: 50%;
}

.qa__q {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(18px * var(--read-scale));
  font-weight: 400;
  line-height: 1.9;
  color: var(--ink);
}

.qa__note {
  margin: 15px 0 0 34px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.insight .story-section__text {
  color: var(--ink);
}

.facts {
  margin: 16px 0 0;
}

.facts__row {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px dashed var(--line);
}

.facts__row:first-child {
  padding-top: 0;
  border-top: 0;
}

.facts__row dt {
  padding-top: 3px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.facts__row dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-2);
}

.parentbox .story-section__text {
  color: var(--ink-2);
}

/* 底部翻页：三格并排，上一篇 / 返回目录 / 下一篇 */
.pager {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 30px 0 8px;
}

.pager__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 78px;
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.pager__link:hover {
  background: #fff;
  border-color: var(--cat, var(--gold));
}

.pager__link--next {
  text-align: right;
  align-items: flex-end;
}

.pager__link--index {
  grid-column: auto;
  order: 0;
  align-items: center;
  text-align: center;
}

.pager__link--none {
  opacity: 0.45;
}

.pager__link--none:hover {
  background: var(--paper-2);
  border-color: var(--line);
}

.pager__dir {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.pager__title {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- 凡例 */
.about {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--pad) 64px;
}

.about__head {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}

.about__eyebrow {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.about__title {
  margin: 12px 0 10px;
  font-size: clamp(34px, 6vw, 44px);
  letter-spacing: 0.14em;
}

.about__lead {
  margin: 0;
  font-size: 16px;
  line-height: 2;
  color: var(--ink-2);
}

.about__lead strong {
  color: var(--ink);
  font-weight: 600;
}

.about__section {
  padding: 26px 0 8px;
  border-bottom: 1px solid var(--line);
}

.about__section h2 {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: 0.08em;
}

.about__section p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
}

.about__section p strong {
  color: var(--ink);
  font-weight: 600;
}

.about__section .muted {
  font-size: 13.5px;
  color: var(--ink-3);
}

.rules,
.steps {
  margin: 0 0 10px;
  padding-left: 1.3em;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
}

.rules li,
.steps li {
  margin-bottom: 8px;
}

.rules strong,
.steps strong {
  color: var(--ink);
  font-weight: 600;
}

.catlist {
  margin-top: 4px;
}

.catline {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-2);
}

.catline__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 10px;
  background: var(--cat, var(--gold));
  border-radius: 50%;
}

.catline__body {
  min-width: 0;
}

.catline__name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.catline__count {
  margin-left: 8px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
}

.catline__desc {
  margin: 3px 0 0 !important;
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
}

.planlist {
  margin-top: 4px;
}

.planline {
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
}

.planline__name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.planline__list {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.about__back {
  margin-top: 28px;
  font-size: 14px;
}

.about__back a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 9vh 16px 16px;
  overflow-y: auto;
  background: rgba(7, 22, 25, 0.58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.search-panel {
  max-width: 640px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 40px 70px -36px rgba(0, 0, 0, 0.7);
}

.search-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 0;
}

.search-panel__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.search-panel__close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.search-panel__input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
}

.search-panel__input::-webkit-search-cancel-button,
.search-panel__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-panel__body {
  min-height: 210px;
  padding: 10px 16px 16px;
}

.search-panel__hint {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

.search-panel__suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.search-chip {
  min-height: 34px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.search-chip:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.search-results {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.search-result {
  display: block;
  padding: 12px 0;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line-2);
}

.search-result__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.search-result__meta {
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.search-result__snippet {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.search-panel__empty {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- 页脚 */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad) 30px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}

.footer__brand {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer__legal {
  color: var(--ink-3) !important;
  font-size: 11.5px;
}

/* 提示 */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 100;
  max-width: min(86vw, 380px);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--topbar-ink);
  text-align: center;
  background: rgba(16, 38, 41, 0.95);
  border-radius: 2px;
  transform: translateX(-50%);
}

/* ---------------------------------------------------------------- 响应式 */
@media (min-width: 860px) {
  .gallery__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

}

@media (max-width: 699px) {
  .hero {
    min-height: 400px;
    background-image:
      linear-gradient(180deg, rgba(7, 22, 25, 0.55) 0%, rgba(7, 22, 25, 0.72) 55%, rgba(7, 22, 25, 0.9) 100%),
      url("../img/hero.webp");
    background-position: center, 56% 26%;
  }

  .hero__inner {
    padding: 40px var(--pad) 34px;
  }

  .hero--compact {
    min-height: 260px;
  }

  .hero--story {
    min-height: 330px;
  }

  .hero--compact .hero__inner,
  .hero--story .hero__inner {
    padding: 28px var(--pad) 30px;
  }

  .gallery {
    padding-top: 24px;
  }

  .search-overlay {
    padding: 4vh 10px 10px;
  }

  .search-panel__input::-webkit-search-cancel-button,
.search-panel__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-panel__body {
    min-height: 180px;
  }

  .hero__seal {
    display: none;
  }

  .hero__lead {
    font-size: 14.5px;
  }

  .themes {
    padding-top: 28px;
  }

  .catalog {
    padding-top: 26px;
  }

  .catalog__head {
    align-items: stretch;
  }

  .theme-section__desc {
    display: none;
  }

  .theme-section__name {
    font-size: 20px;
  }

  .entry {
    gap: 12px;
    padding: 13px 4px;
  }

  .entry__no {
    flex-basis: 22px;
    font-size: 11.5px;
  }

  .entry__title {
    font-size: 21px;
  }

  .entry__arrow {
    display: none;
  }

  .article {
    padding-top: 18px;
  }

  .footer__inner {
    gap: 4px 14px;
  }
}

@media (max-width: 560px) {
  :root {
    --pad: 16px;
  }

  .topbar__inner {
    gap: 12px;
  }

  .brand__text small {
    display: none;
  }

  .brand__text strong {
    font-size: 16.5px;
  }

  .topnav {
    gap: 12px;
  }

  .topnav a {
    font-size: 13px;
  }

  .theme-card {
    padding: 14px 13px 12px;
  }

  .theme-rail {
    gap: 10px;
  }

  .theme-card__name {
    font-size: 18px;
  }

  .theme-card__desc {
    font-size: 12px;
  }

  .hero__title--story {
    font-size: 30px;
  }

  .hero__tags {
    gap: 6px;
  }

  .hero-tag,
  .tag {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .qa__q {
    font-size: calc(18px * var(--read-scale));
  }

  .insight p {
    font-size: calc(16px * var(--read-scale));
  }

  .theme-section__toggle {
    padding: 0 10px;
  }

  .qa h2,
  .sourcebox h2 {
    font-size: 14px;
  }

  .article__title {
    letter-spacing: 0.08em;
  }

  .pager--top {
    gap: 6px;
  }

  .pgbtn {
    padding: 7px 10px;
  }

  .footer__inner {
    gap: 4px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
