:root {
  --bg: #f7f1e7;
  --paper: rgba(255, 251, 243, 0.82);
  --paper-strong: rgba(255, 251, 243, 0.95);
  --font-song: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --font-current: var(--font-song);
  --base-font-size: 18px;
  --ink: #231816;
  --ink-soft: rgba(35, 24, 22, 0.72);
  --accent: #871e2a;
  --accent-deep: #5a121c;
  --gold: #b98d35;
  --content-width: min(1180px, calc(100% - 40px));
  --shadow: 0 30px 80px rgba(70, 39, 16, 0.14);
}
* { box-sizing: border-box; }
html { font-size: var(--base-font-size); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-current);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(135, 30, 42, 0.18), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(185, 141, 53, 0.2), transparent 28%),
    linear-gradient(180deg, #f3ebdf 0%, #f7f1e7 36%, #efe2ca 100%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
.progress {
  position: fixed; inset: 0 auto auto 0; z-index: 50; width: 100%; height: 3px;
  transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), #d2a039, #54756c);
}
.page-shell { width: var(--content-width); margin: 0 auto; padding: 24px 0 72px; }
.hero {
  position: relative; overflow: hidden; min-height: calc(100svh - 48px);
  padding: 28px; border-radius: 40px; isolation: isolate; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.4);
  background: linear-gradient(130deg, rgba(82,19,30,.94), rgba(122,36,50,.84) 35%, rgba(178,127,44,.72));
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16,10,8,.12), rgba(16,10,8,.48));
}
.hero-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: rgba(255,243,228,.8); font-size: .9rem; letter-spacing: .28em;
}
.eyebrow::before { content: ""; width: 44px; height: 1px; background: rgba(255,243,228,.58); }
.hero-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.hero-nav a, .mobile-jumpbar a {
  padding: 8px 14px; border-radius: 999px; color: rgba(255,243,228,.9);
  border: 1px solid rgba(255,243,228,.22); background: rgba(255,251,243,.08);
  font-size: .88rem;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .74fr);
  gap: 36px; align-items: end; min-height: calc(100svh - 190px); padding-top: 68px;
}
.hero-copy { min-width: 0; }
.hero-copy h1 {
  margin: 0; font-size: clamp(3.35rem, 7.8vw, 6.75rem);
  line-height: .96; letter-spacing: -.04em; color: #fff8ef;
}
.hero-meta {
  display: grid; gap: 18px; width: 100%; min-width: 0; align-self: stretch;
  padding: 26px; border-radius: 28px; color: #fff7ea;
  border: 1px solid rgba(255,243,228,.18);
  background: linear-gradient(180deg, rgba(255,251,243,.16), rgba(255,251,243,.06));
  backdrop-filter: blur(14px);
}
.hero-meta-label { font-size: .9rem; letter-spacing: .24em; color: rgba(255,243,228,.68); }
.hero-meta ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.hero-meta li { padding-bottom: 12px; border-bottom: 1px solid rgba(255,243,228,.12); overflow-wrap: anywhere; }
.hero-meta li:last-child { border-bottom: 0; }
.mobile-jumpbar { display: none; }
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px; margin-top: 28px; align-items: start; }
.toc {
  position: sticky; top: 24px; padding: 22px 20px; border-radius: 28px;
  background: rgba(255,251,243,.68); border: 1px solid rgba(255,255,255,.54);
  box-shadow: 0 16px 36px rgba(88,54,29,.08); backdrop-filter: blur(16px);
}
.toc-title { margin: 0 0 14px; font-size: 1.3rem; letter-spacing: .08em; }
.toc-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.toc-list a { display: block; padding: 10px 12px; border-radius: 14px; color: var(--ink-soft); }
.toc-list a:hover, .toc-list a.is-active { color: var(--accent); background: rgba(135,30,42,.08); }
.article { display: grid; gap: 28px; }
.section {
  position: relative; overflow: hidden; padding: 28px; border-radius: 32px;
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  border: 1px solid rgba(255,255,255,.72); box-shadow: 0 24px 50px rgba(90,56,31,.08);
  opacity: 0; transform: translateY(24px); transition: opacity 720ms ease, transform 720ms ease;
  scroll-margin-top: 24px;
}
.section.is-visible { opacity: 1; transform: translateY(0); }
.section h2 { margin: 0; font-size: clamp(2.1rem, 3.2vw, 3.15rem); line-height: 1.08; }
.section h3 { margin: 0; font-size: clamp(1.45rem, 2.2vw, 1.95rem); line-height: 1.18; }
.section h4 { margin: 0; font-size: 1.22rem; }
.section-header { display: grid; gap: 10px; margin-bottom: 22px; }
.section p { margin: 0 0 1em; color: var(--ink-soft); }
.topic-marker {
  margin: 8px 0 18px;
  color: var(--ink);
  font-size: clamp(1.75rem, 2.6vw, 2.35rem);
}
.detail-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(246,238,224,.9));
  border: 1px solid rgba(111,74,43,.12);
  box-shadow: 0 16px 34px rgba(88,54,29,.06);
}
.detail-card:first-child { margin-top: 0; }
.topic-marker + .detail-card { margin-top: 18px; }
.detail-card h3,
.detail-card h4 { margin: 0 0 6px; color: var(--ink); }
.detail-card > p:last-child,
.detail-card > .detail-line:last-child,
.detail-card > .table-shell:last-child,
.detail-card > .image-block:last-child { margin-bottom: 0; }
.detail-card > .detail-line:first-of-type,
.detail-card > p:first-of-type,
.detail-card > .table-shell:first-of-type,
.detail-card > .image-block:first-of-type { margin-top: 8px; }
.detail-line {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px;
  align-items: start; margin: 0 0 12px;
}
.detail-line strong { color: var(--accent-deep); font-weight: 700; }
.detail-line span { color: var(--ink-soft); }
.stats-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
}
.stat-card {
  min-height: 148px; padding: 22px; border-radius: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,.7), rgba(246,238,224,.92));
  border: 1px solid rgba(185,141,53,.18);
  display: grid; align-content: space-between; gap: 14px;
}
.stat-card:nth-child(1) {
  background: linear-gradient(160deg, rgba(125,24,39,.95), rgba(96,17,29,.88));
  color: #fff6ea;
}
.stat-card:nth-child(2) {
  background: linear-gradient(160deg, rgba(191,148,57,.28), rgba(255,250,240,.92));
}
.stat-card:nth-child(3) {
  background: linear-gradient(160deg, rgba(79,114,104,.18), rgba(255,252,246,.92));
}
.stat-card:nth-child(4) {
  background: linear-gradient(160deg, rgba(255,245,228,.94), rgba(236,220,184,.8));
}
.stat-label { color: inherit; font-size: .85rem; letter-spacing: .12em; opacity: .8; }
.stat-value {
  margin: 0; color: inherit; font-size: clamp(1.35rem, 2.3vw, 2.35rem);
  line-height: 1.16; font-weight: 700;
}
.platform-card p { margin: 0; color: inherit; }
.story-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
}
.story-card {
  display: grid; align-content: start; gap: 12px;
  padding: 22px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(255,255,255,.86), rgba(245,236,221,.9));
  border: 1px solid rgba(111,74,43,.12);
}
.story-card p { margin: 0; }
.story-card .image-block { margin: 4px 0 0; }
.story-card .image-block img { width: 100%; height: auto; object-fit: contain; }
.image-gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  align-items: start;
}
.image-gallery .image-block { margin: 0; }
.image-gallery img { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; }
.image-block { margin: 18px 0; }
.image-block img, td img {
  width: min(100%, 520px); height: auto; border-radius: 20px; object-fit: contain;
  box-shadow: 0 14px 30px rgba(72,44,22,.12);
}
.image-gallery .image-block img { width: 100%; }
.table-shell { overflow: hidden; border-radius: 24px; border: 1px solid rgba(111,74,43,.12); background: rgba(255,255,255,.76); margin: 18px 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(111,74,43,.12); }
th { background: rgba(135,30,42,.94); color: #fff7ea; font-weight: 600; }
td p { margin: 0; color: inherit; }
.platform-row td { background: rgba(239,226,201,.78); color: var(--accent-deep); font-weight: 600; }
.size-switcher { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.size-switcher-trigger {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px;
  border: 1px solid rgba(111,74,43,.16); background: rgba(255,251,243,.92);
  color: var(--accent-deep); font: inherit; font-size: 22px; cursor: pointer;
  box-shadow: 0 18px 42px rgba(79,47,21,.14); backdrop-filter: blur(18px);
}
.size-switcher-panel {
  position: absolute; right: 0; bottom: 68px; display: grid; gap: 10px;
  width: min(220px, calc(100vw - 32px)); padding: 14px; border-radius: 22px;
  background: rgba(255,251,243,.96); border: 1px solid rgba(111,74,43,.14);
  box-shadow: 0 18px 42px rgba(79,47,21,.14); backdrop-filter: blur(18px);
  opacity: 0; transform: translateY(10px) scale(.98); transform-origin: right bottom;
  pointer-events: none; transition: opacity 180ms ease, transform 180ms ease;
}
.size-switcher.is-open .size-switcher-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.size-switcher-title { margin: 0; color: var(--accent-deep); font-size: 14px; letter-spacing: .18em; }
.size-switcher-readout { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.size-switcher-value { color: var(--accent-deep); font-size: 24px; line-height: 1; }
.size-switcher-note, .size-switcher-scale { color: rgba(35,24,22,.58); font-size: 13px; }
.size-slider { width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.size-switcher-scale { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
@media (max-width: 1120px) {
  .hero { min-height: auto; }
  .hero-grid, .layout, .story-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
  .mobile-jumpbar {
    position: sticky; top: 12px; z-index: 30; display: flex; gap: 10px; overflow-x: auto;
    margin: 16px 0 4px; padding: 10px; border-radius: 999px;
    background: rgba(255,251,243,.82); border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 14px 30px rgba(80,47,23,.08); scrollbar-width: none;
  }
  .mobile-jumpbar a { flex: 0 0 auto; color: var(--accent-deep); background: rgba(135,30,42,.06); }
}
@media (max-width: 760px) {
  :root { --content-width: calc(100% - 20px); }
  .page-shell { padding: 10px 0 48px; }
  .hero { padding: 20px; border-radius: 28px; }
  .hero-nav { display: none; }
  .hero-grid { min-height: auto; gap: 22px; padding-top: 28px; }
  .hero-copy h1 { font-size: clamp(2.6rem, 13.2vw, 3.35rem); }
  .hero-meta { padding: 16px; border-radius: 22px; }
  .hero-meta-label { font-size: .84rem; }
  .hero-meta li { font-size: .95rem; }
  .section {
    overflow: visible; padding: 22px 18px; border-radius: 24px;
    opacity: 1; transform: none;
  }
  .stats-grid, .story-grid, .image-gallery { grid-template-columns: 1fr; }
  .detail-line { grid-template-columns: 1fr; gap: 4px; }
  .stat-card { min-height: 0; padding: 18px; border-radius: 22px; }
  .story-card { padding: 18px; border-radius: 22px; }
  .detail-card { gap: 12px; padding: 18px; border-radius: 22px; }
  .topic-marker { margin: 2px 0 20px; font-size: clamp(1.55rem, 8.5vw, 2.05rem); }
  .image-gallery { gap: 14px; }
  .image-gallery img { height: auto; max-height: none; }
  .table-shell { overflow: visible; background: transparent; border: 0; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; border-collapse: separate; border-spacing: 0; }
  thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  tbody, tr, td { display: block; width: 100%; }
  tbody { display: grid; gap: 14px; }
  tr { overflow: hidden; border-radius: 20px; background: rgba(255,255,255,.86); border: 1px solid rgba(111,74,43,.12); box-shadow: 0 14px 28px rgba(81,48,24,.06); }
  td { padding: 12px 14px; border-bottom: 1px solid rgba(111,74,43,.1); }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--accent); font-size: 12px; letter-spacing: .12em; }
  td[data-label=""]::before { content: none; display: none; }
  .platform-row td { border-bottom: 0; background: rgba(239,226,201,.88); }
  td img { width: min(100%, 260px); border-radius: 18px; }
  .catalogue-table tbody { gap: 16px; }
  .catalogue-table tr:not(.platform-row) {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 10px 14px; padding: 16px; border-radius: 24px;
    background: linear-gradient(160deg, rgba(255,255,255,.94), rgba(247,239,226,.88));
  }
  .catalogue-table tr:not(.platform-row) td {
    min-width: 0; padding: 0; border-bottom: 0;
  }
  .catalogue-table tr:not(.platform-row) td::before {
    margin-bottom: 4px; font-size: 12px; letter-spacing: .14em;
  }
  .catalogue-table tr:not(.platform-row) td:first-child {
    color: var(--ink); font-size: 1.12rem; font-weight: 700; line-height: 1.35;
  }
  .catalogue-table tr:not(.platform-row) td:nth-child(2) {
    color: var(--ink-soft); line-height: 1.45;
  }
  .size-switcher { right: 12px; bottom: 12px; }
  .size-switcher-trigger { width: 52px; height: 52px; font-size: 20px; }
  .size-switcher-panel { bottom: 62px; width: min(220px, calc(100vw - 24px)); padding: 12px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .section { opacity: 1; transform: none; }
}
