:root {
  --bg: #f7f0df;
  --bg-deep: #20170f;
  --ink: #251a12;
  --muted: #756858;
  --paper: #fff9ec;
  --accent: #be5b2b;
  --accent-dark: #7e351a;
  --line: rgba(75, 52, 34, 0.16);
  --shadow: 0 24px 70px rgba(61, 38, 18, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  background:
    radial-gradient(circle at top left, rgba(190, 91, 43, 0.18), transparent 32rem),
    linear-gradient(135deg, #fff7e6 0%, var(--bg) 45%, #ead7b8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.2rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 240, 223, 0.82);
  backdrop-filter: blur(16px);
}

.brand,
.nav-links,
.hero-actions,
.reader-controls,
.source-list {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  color: var(--paper);
  border-radius: 0.7rem;
  background: var(--bg-deep);
}

.nav-links {
  gap: clamp(1rem, 4vw, 2.4rem);
  color: var(--muted);
  font-size: 0.95rem;
}

.language-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 249, 236, 0.72);
  cursor: pointer;
}

.section-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(2rem, 6vw, 5rem);
  min-height: calc(100vh - 78px);
  align-items: center;
  padding: 5rem 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent-dark);
  font-family: "SF Pro Display", "PingFang SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(4.6rem, 13vw, 9rem);
  line-height: 0.88;
  letter-spacing: -0.12em;
}

.hero-subtitle {
  margin-bottom: 1.2rem;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 800;
}

.hero-text,
.source-panel p,
.download-section p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-family: "SF Pro Display", "PingFang SC", sans-serif;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.button-primary {
  color: var(--paper);
  background: var(--bg-deep);
  box-shadow: 0 16px 36px rgba(32, 23, 15, 0.22);
}

.button-secondary {
  color: var(--accent-dark);
  border: 1px solid rgba(126, 53, 26, 0.22);
  background: rgba(255, 249, 236, 0.64);
}

.reader-preview {
  justify-self: center;
}

.phone-frame {
  position: relative;
  width: min(82vw, 360px);
  min-height: 610px;
  padding: 1.2rem;
  border: 10px solid #21170f;
  border-radius: 2.4rem;
  background: linear-gradient(160deg, #2c1e14, #6f3b20);
  box-shadow: var(--shadow);
}

.phone-bar {
  width: 5.2rem;
  height: 0.45rem;
  margin: 0 auto 1.4rem;
  border-radius: 999px;
  background: rgba(255, 249, 236, 0.32);
}

.reader-card {
  min-height: 455px;
  padding: 2rem;
  border-radius: 1.5rem;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(75, 52, 34, 0.1);
}

.chapter {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-card h2 {
  margin: 1rem 0;
  font-size: 2.4rem;
}

.reader-card p {
  color: #6d5b4b;
  line-height: 1.9;
}

.page-lines {
  display: grid;
  gap: 0.8rem;
  margin-top: 2.5rem;
}

.page-lines span {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(126, 53, 26, 0.13);
}

.page-lines span:nth-child(2) {
  width: 86%;
}

.page-lines span:nth-child(3) {
  width: 72%;
}

.page-lines span:nth-child(4) {
  width: 56%;
}

.reader-controls {
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 1rem;
  color: rgba(255, 249, 236, 0.78);
  font-family: "SF Pro Display", "PingFang SC", sans-serif;
  font-size: 0.78rem;
}

.quick-start,
.feature-section,
.guide-section,
.source-panel,
.download-section {
  padding: 4rem 0;
}

.quick-start h2,
.section-heading h2,
.source-panel h2,
.download-section h2,
.doc-content h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
}

.steps,
.feature-grid,
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.steps article,
.feature-card,
.guide-card,
.source-panel,
.download-section,
.doc-content,
.doc-sidebar,
.doc-card-list a {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgba(255, 249, 236, 0.62);
  box-shadow: 0 18px 52px rgba(61, 38, 18, 0.08);
}

.steps article,
.feature-card,
.guide-card {
  padding: 1.4rem;
}

.steps span,
.feature-icon,
.guide-card span,
.doc-card-list span {
  color: var(--accent);
  font-family: "SF Pro Display", "PingFang SC", sans-serif;
  font-weight: 900;
}

.steps p,
.feature-card p,
.guide-card p,
.doc-card-list p,
.doc-content li,
.doc-content p {
  color: var(--muted);
  line-height: 1.7;
}

.feature-card,
.guide-card {
  min-height: 210px;
}

.guide-card {
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 58px rgba(61, 38, 18, 0.12);
}

.feature-icon {
  display: inline-grid;
  min-width: 2.8rem;
  height: 2.8rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 0.9rem;
  background: rgba(190, 91, 43, 0.1);
}

.source-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  padding: clamp(1.6rem, 5vw, 3rem);
}

.source-list {
  flex-wrap: wrap;
  align-content: center;
  gap: 0.75rem;
}

.source-list span {
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: var(--accent-dark);
  background: rgba(190, 91, 43, 0.1);
}

.download-section {
  margin-top: 4rem;
  margin-bottom: 4rem;
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.centered {
  justify-content: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1.2rem, 4vw, 4rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.doc-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.2rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.doc-sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.doc-sidebar a {
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  color: var(--muted);
}

.doc-sidebar a:hover,
.doc-sidebar a.active {
  color: var(--accent-dark);
  background: rgba(190, 91, 43, 0.1);
}

.doc-content {
  padding: clamp(1.4rem, 4vw, 3rem);
}

.doc-content h1 {
  margin-bottom: 1rem;
  letter-spacing: -0.06em;
}

.doc-content h2 {
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.doc-content code {
  border-radius: 0.35rem;
  padding: 0.1rem 0.32rem;
  color: var(--accent-dark);
  background: rgba(190, 91, 43, 0.1);
}

.doc-content pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(32, 23, 15, 0.9);
}

.doc-content pre code {
  padding: 0;
  color: var(--paper);
  background: transparent;
}

.doc-lead {
  max-width: 720px;
  font-size: 1.1rem;
}

.doc-note {
  margin: 1.4rem 0;
  border-left: 4px solid var(--accent);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  color: var(--accent-dark);
  background: rgba(190, 91, 43, 0.1);
}

.doc-card-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.doc-card-list a {
  display: block;
  padding: 1.2rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 700ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 120ms;
}

.feature-card:nth-child(2),
.steps article:nth-child(2) {
  animation-delay: 110ms;
}

.feature-card:nth-child(3),
.steps article:nth-child(3) {
  animation-delay: 220ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .source-panel,
  .doc-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }

  .steps,
  .feature-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
  }

  .phone-frame {
    min-height: 560px;
  }

  .site-footer {
    flex-direction: column;
  }
}

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

  .button,
  .reveal {
    transition: none;
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
