:root {
  --ink: #172033;
  --muted: #5f6673;
  --rule: #d8dee6;
  --paper: #fffdf8;
  --page: #f4f7f8;
  --panel: #eef5f5;
  --accent: #2f6f7e;
  --accent-dark: #234958;
  --warm: #8b4f3f;
  --shadow: 0 18px 48px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef5f6 0, #f7f8f7 440px, #f3f5f6 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
  min-height: 60px;
  padding: 10px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(216, 222, 230, 0.85);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 720;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: 6px;
}

.top-nav a,
.site-footer a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  padding: 9px 10px;
  text-decoration: none;
}

.top-nav a:hover,
.site-footer a:hover {
  border-color: var(--rule);
  color: var(--ink);
  background: #fff;
}

.language-control {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.language-control select {
  height: 34px;
  min-width: 118px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 30px 0 10px;
}

.book-shell {
  width: min(1060px, calc(100% - 32px));
  margin: 34px auto 64px;
}

.cover-sheet,
.story,
.notes {
  background: var(--paper);
  box-shadow: var(--shadow);
}

.cover-sheet {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 76px);
}

.contact,
.cover-figure figcaption,
.figure-card figcaption {
  color: var(--muted);
  font-size: 13px;
}

.contact {
  margin: 0;
  text-align: center;
}

.cover-sheet h1 {
  max-width: 860px;
  margin: 14px auto 0;
  color: var(--ink);
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.02;
  text-align: center;
}

.subtitle {
  max-width: 760px;
  margin: 18px auto 0;
  color: #374151;
  font-size: clamp(17px, 2.6vw, 24px);
  line-height: 1.35;
  text-align: center;
}

.tagline {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--warm);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
  text-align: center;
}

.contact {
  margin-top: 8px;
}

.cover-figure {
  width: min(820px, 100%);
  margin: clamp(24px, 4vw, 42px) auto 0;
}

.cover-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #dde3e9;
  object-fit: cover;
}

.cover-figure figcaption,
.figure-card figcaption {
  margin-top: 10px;
  line-height: 1.45;
  text-align: center;
}

.cover-note {
  width: min(760px, 100%);
  margin: 22px auto 0;
  border-left: 4px solid var(--accent);
  background: var(--panel);
  color: #25313e;
  font-size: 15px;
  line-height: 1.65;
  padding: 15px 18px;
}

.story,
.notes {
  margin-top: 28px;
  padding: clamp(30px, 6vw, 72px);
  scroll-margin-top: 84px;
}

.epigraph {
  width: min(640px, 100%);
  margin: 0 auto 42px;
  border: 1px solid #d8e2e4;
  background: #f5fbfb;
  color: var(--accent-dark);
  font-size: 17px;
  line-height: 1.75;
  padding: 22px 26px;
}

.epigraph p {
  margin: 0;
}

.chapter {
  width: min(760px, 100%);
  margin: 0 auto;
  padding-top: 28px;
}

.chapter + .chapter {
  margin-top: 18px;
}

.chapter h2,
.notes h2,
.notes h3 {
  letter-spacing: 0;
}

.chapter h2 {
  margin: 0;
  color: #202833;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 720;
  line-height: 1.18;
  text-align: center;
}

.chapter .chapter-subtitle {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.chapter p {
  margin: 0 0 16px;
  color: #1e232b;
  font-family:
    "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Songti SC", "STSong", serif;
  font-size: 18px;
  line-height: 1.88;
  text-align: justify;
}

html[lang^="zh"] .chapter p {
  text-indent: 2em;
}

html[lang="en"] .chapter p {
  text-indent: 1.4em;
}

.notes > h2 {
  width: min(760px, 100%);
  margin: 0 auto 10px;
  color: var(--accent-dark);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  text-align: center;
}

.notes-intro {
  width: min(720px, 100%);
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.info-block {
  width: min(840px, 100%);
  margin: 30px auto 0;
}

.info-block h3,
.note-section h3 {
  margin: 0 0 14px;
  color: #263b5e;
  font-size: 24px;
  line-height: 1.25;
}

.data-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.data-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) 1fr;
}

.data-row + .data-row {
  border-top: 1px solid var(--rule);
}

.data-key,
.data-value {
  padding: 13px 15px;
}

.data-key {
  background: #e8eef3;
  color: #263b5e;
  font-weight: 720;
}

.data-value {
  background: #fff;
  color: #26313d;
}

.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: min(900px, 100%);
  margin: 40px auto 0;
}

.figure-card {
  margin: 0;
}

.figure-card img {
  width: 100%;
  border: 1px solid var(--rule);
  background: #f7f8fa;
}

.figure-card:nth-child(3),
.figure-card:nth-child(4) {
  grid-column: auto;
}

.note-section {
  width: min(800px, 100%);
  margin: 42px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.note-section p {
  margin: 0 0 14px;
  color: #26313d;
  font-size: 16px;
  line-height: 1.78;
  text-align: justify;
}

html[lang^="zh"] .note-section p {
  text-indent: 2em;
}

@media (max-width: 760px) {
  .site-bar {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 10px 14px;
  }

  .top-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .top-nav a {
    flex: 1;
    text-align: center;
  }

  .language-control span {
    display: none;
  }

  .language-control select {
    min-width: 100px;
  }

  .book-shell {
    width: min(100% - 18px, 1060px);
    margin-top: 14px;
  }

  .cover-sheet,
  .story,
  .notes {
    padding: 24px 18px;
  }

  .cover-sheet {
    min-height: auto;
  }

  .cover-sheet h1 {
    font-size: clamp(34px, 12vw, 52px);
  }

  .chapter p,
  .note-section p {
    font-size: 16px;
    line-height: 1.78;
  }

  .data-row {
    grid-template-columns: 1fr;
  }

  .data-value {
    border-top: 1px solid var(--rule);
  }

  .figures {
    grid-template-columns: 1fr;
  }

}
