:root {
  --paper: #f4efe5;
  --paper-deep: #ebe2d3;
  --ink: #252525;
  --muted: #746f68;
  --line: #d8ccba;
  --coral: #e95835;
  --moss: #7f9b32;
  --slate: #26323a;
  --white: #fffaf0;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(127, 155, 50, 0.08), transparent 260px),
    var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 18px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px solid rgba(233, 88, 53, 0.32);
}

a:hover {
  border-bottom-color: currentColor;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(38, 50, 58, 0.08);
  font-size: 0.88em;
}

pre {
  overflow-x: auto;
  padding: 20px;
  border-radius: 8px;
  background: #20272d;
  color: #fffaf0;
  font-size: 14px;
  line-height: 1.7;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.top-rule {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 4px;
  background: linear-gradient(90deg, var(--coral), var(--moss), var(--slate));
}

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.landing-shell,
.page-section {
  width: min(100%, 760px);
  margin: 0 auto;
  padding-inline: 42px;
}

.landing-shell {
  padding-block: 92px 54px;
  text-align: center;
}

.eyebrow,
.chapter-kicker,
.site-footer,
.reader-nav,
.reader-footer,
.book-note,
.button,
.cover-author {
  font-family: "Noto Sans SC", system-ui, sans-serif;
}

.eyebrow,
.chapter-kicker {
  margin: 0 0 34px;
  color: var(--moss);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.landing-shell h1,
.book-cover h1 {
  margin: 0 0 18px;
  color: var(--slate);
  font-size: clamp(42px, 9vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-shell h1 span,
.book-cover h1 span {
  color: var(--coral);
}

.subtitle {
  margin: 0 auto 48px;
  width: 100%;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(18px, 3.2vw, 23px);
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.author-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.author-line span {
  width: 48px;
  height: 1px;
  background: var(--line);
}

.book-note {
  margin: 0 0 42px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.intro {
  max-width: 560px;
  margin: 0 auto 44px;
  color: var(--muted);
  font-size: 16px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.button {
  display: inline-flex;
  min-width: 150px;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--coral);
  color: white;
  border-bottom: none;
  box-shadow: 0 10px 30px rgba(233, 88, 53, 0.18);
}

.button-secondary {
  color: var(--slate);
  border-color: var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.42);
}

.site-footer,
.reader-footer {
  padding: 30px 24px 42px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.footer-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 10px 2px;
  border-radius: 999px;
  background: var(--coral);
}

.reader-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px max(18px, calc((100vw - 760px) / 2 + 42px));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 229, 0.9);
  backdrop-filter: blur(14px);
  font-size: 13px;
}

.reader-nav a {
  color: var(--muted);
  border-bottom: none;
}

.reader-nav span {
  color: var(--slate);
  font-weight: 700;
}

.reader-nav .download-link {
  justify-self: end;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.book-cover {
  min-height: calc(100vh - 51px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 90px 72px;
  border-bottom: 3px solid var(--coral);
}

.cover-author {
  margin: 0;
  color: var(--slate);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.frontmatter,
.prose,
.appendix,
.contact-section {
  padding-block: 64px;
}

.frontmatter {
  border-bottom: 2px solid var(--line);
}

.frontmatter h2,
.prose h3,
.appendix h2,
.contact-section h2 {
  color: var(--slate);
}

.frontmatter h2,
.appendix h2,
.contact-section h2 {
  margin: 2.4em 0 0.8em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.frontmatter h2:first-child,
.appendix h2:first-child,
.contact-section h2:first-child {
  margin-top: 0;
}

p {
  margin: 0 0 1.35em;
  text-align: justify;
}

blockquote {
  margin: 1.8em 0;
  padding: 18px 22px;
  border-left: 4px solid var(--coral);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 250, 240, 0.48);
  color: var(--muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

.toc {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
  font-family: "Noto Sans SC", system-ui, sans-serif;
}

.toc li {
  margin-bottom: 0.55em;
}

.chapter-break {
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: 84px 52px;
  border-top: 1px solid var(--line);
}

.chapter-break h2 {
  margin: 0 0 14px;
  color: var(--slate);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.25;
}

.chapter-break p:last-child {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  font-style: italic;
}

.prose h3 {
  margin: 2.3em 0 0.8em;
  padding-left: 14px;
  border-left: 4px solid var(--moss);
  font-size: 20px;
}

.prose ul {
  margin: 1em 0 1.6em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.55em;
}

.prompt-card,
.contact-grid {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.5);
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
}

@media (max-width: 900px) {
  body {
    font-size: 17px;
  }

  .landing-shell,
  .page-section {
    padding-inline: 24px;
  }

  .landing-shell {
    padding-block-start: 76px;
  }

  .reader-nav {
    display: flex;
    justify-content: space-between;
    padding-inline: 18px;
  }

  .reader-nav span {
    display: none;
  }

  .reader-nav .download-link {
    display: none;
  }

  .book-cover {
    min-height: 82vh;
  }

  .book-cover .subtitle {
    max-width: 300px;
    margin-inline: 0;
  }

  .author-line span {
    width: 32px;
  }

  .button {
    width: 100%;
  }
}

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .reader-nav,
  .site-footer,
  .reader-footer {
    display: none;
  }

  .book-cover {
    min-height: 90vh;
    page-break-after: always;
  }

  .chapter-break {
    page-break-before: always;
  }

  .page-section {
    width: auto;
    padding-inline: 0;
  }

  a {
    color: black;
    border-bottom: none;
  }

  @page {
    size: A4;
    margin: 20mm 18mm;
  }
}
