:root {
  --bg: #f7f3ea;
  --bg-soft: #fffdf8;
  --surface: rgba(255, 252, 245, 0.9);
  --surface-strong: #fffdf7;
  --text: #21313a;
  --muted: #5f6f77;
  --line: rgba(33, 49, 58, 0.12);
  --line-strong: rgba(33, 49, 58, 0.2);
  --brand: #136f63;
  --brand-soft: rgba(19, 111, 99, 0.1);
  --accent: #d77c4a;
  --accent-soft: rgba(215, 124, 74, 0.12);
  --gold: #c9a55a;
  --shadow: 0 24px 60px rgba(33, 49, 58, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar: 310px;
  --content: 1180px;
  --serif: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 88px;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at top left, rgba(215, 124, 74, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 111, 99, 0.18), transparent 25%),
    linear-gradient(180deg, #fcf9f1 0%, #f7f3ea 45%, #f1eee6 100%);
}

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

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

p,
li {
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.15;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 74px);
  letter-spacing: -0.04em;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 24px;
}

.site-shell {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
}

.global-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(252, 249, 241, 0.8);
  border-bottom: 1px solid rgba(33, 49, 58, 0.08);
  backdrop-filter: blur(16px);
}

.nav-inner {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(19, 111, 99, 0.08);
  border-color: rgba(19, 111, 99, 0.1);
}

.hero {
  padding: 36px 0 72px;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.pill,
.tag,
.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.pill {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 26px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: 40px;
}

.hero-copy p {
  max-width: 760px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-weight: 600;
}

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

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #136f63 0%, #0f594f 100%);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line);
}

.hero-side {
  padding: 30px;
  display: grid;
  gap: 18px;
}

.hero-figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(19, 111, 99, 0.08), rgba(215, 124, 74, 0.09));
  border: 1px solid rgba(19, 111, 99, 0.08);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

.section {
  padding: 24px 0 64px;
}

.section-tight {
  padding-top: 10px;
  padding-bottom: 42px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head p {
  max-width: 680px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.chip.active,
.chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.card-grid {
  display: grid;
  gap: 18px;
}

.card-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 12px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.tag {
  padding: 8px 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.mini-tag {
  padding: 6px 10px;
  background: rgba(33, 49, 58, 0.06);
  color: var(--muted);
}

.card-meta,
.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chapter-card {
  position: relative;
  overflow: hidden;
}

.chapter-card::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 124, 74, 0.14), transparent 70%);
}

.chapter-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.chapter-card .number {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.chapter-card.hidden {
  display: none;
}

.path-grid,
.use-case-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.path-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 246, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.flow-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
}

.feature-band {
  padding: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  align-items: center;
  background: linear-gradient(145deg, rgba(19, 111, 99, 0.08), rgba(255, 250, 242, 0.96));
  border-color: rgba(19, 111, 99, 0.14);
}

.shortcut-band {
  padding: 30px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(201, 165, 90, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(19, 111, 99, 0.12), rgba(255, 252, 245, 0.96));
  border-color: rgba(19, 111, 99, 0.18);
}

.shortcut-copy p {
  max-width: 520px;
}

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

.shortcut-pill {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 111, 99, 0.12);
  box-shadow: 0 12px 28px rgba(33, 49, 58, 0.06);
}

.shortcut-pill strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
}

.shortcut-pill span {
  display: block;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

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

.list-clean li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
}

.list-clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.note,
.prompt-box,
.checkpoint,
.warning-box {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-top: 18px;
}

.note {
  background: rgba(19, 111, 99, 0.06);
}

.prompt-box {
  background: rgba(33, 49, 58, 0.04);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: pre-wrap;
  color: var(--text);
}

.checkpoint {
  background: rgba(201, 165, 90, 0.14);
}

.warning-box {
  background: rgba(215, 124, 74, 0.12);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(280px, var(--sidebar)) minmax(0, 1fr);
  gap: 24px;
  width: min(calc(100% - 32px), 1380px);
  margin: 0 auto;
  padding: 22px 0 48px;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 22px;
}

.sidebar h2 {
  font-size: 28px;
}

.sidebar .chapter-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.sidebar .chapter-links a {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.sidebar .chapter-links a.active,
.sidebar .chapter-links a:hover {
  color: var(--text);
  background: rgba(19, 111, 99, 0.09);
  border-color: rgba(19, 111, 99, 0.1);
}

.sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-shortcuts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.sidebar-shortcuts h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.sidebar-shortcuts a {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-shortcuts a:hover {
  color: var(--text);
  background: rgba(19, 111, 99, 0.08);
}

.content {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  color: var(--muted);
}

.breadcrumb strong {
  color: var(--text);
}

.chapter-hero {
  padding: 34px;
  margin-bottom: 22px;
}

.chapter-hero p {
  max-width: 900px;
  font-size: 18px;
}

.chapter-layout {
  display: grid;
  gap: 18px;
}

.chapter-section {
  padding: 26px;
}

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

.chapter-section h3 {
  margin-bottom: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-deck {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(251, 248, 241, 0.94));
  border: 1px solid rgba(19, 111, 99, 0.14);
  box-shadow: var(--shadow);
}

.step-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
}

.step-hint {
  margin: 8px 0 0;
  font-size: 14px;
}

.step-nav-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.step-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(33, 49, 58, 0.14);
  cursor: pointer;
}

.step-dot.active {
  background: var(--brand);
  transform: scale(1.15);
}

.step-card {
  display: none;
  min-height: 280px;
  padding: 6px 0 0;
}

.step-card.active {
  display: block;
}

.step-card-index {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 12px;
}

.step-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.step-controls button {
  min-width: 90px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
}

.step-controls button[data-step-next] {
  background: linear-gradient(135deg, #136f63 0%, #0f594f 100%);
  color: #fff;
  border-color: transparent;
}

.step-counter {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
}

.step-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-counter {
  font-size: 14px;
  color: var(--muted);
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.example-table th,
.example-table td {
  text-align: left;
  padding: 14px 16px;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}

.example-table th {
  background: rgba(19, 111, 99, 0.08);
  color: var(--text);
}

.example-table tr:last-child td {
  border-bottom: none;
}

details {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.62);
}

details + details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.chapter-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
}

.nav-link-card {
  flex: 1;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.nav-link-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.inline-kbd {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(33, 49, 58, 0.08);
  font-size: 13px;
  color: var(--text);
}

.footer {
  padding: 24px 0 44px;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .hero-grid,
  .flow-panel,
  .feature-band,
  .shortcut-band,
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 840px) {
  .site-shell,
  .page-shell {
    width: min(calc(100% - 24px), 100%);
  }

  .nav-inner {
    min-height: auto;
    padding: 14px 0;
    align-items: start;
    flex-direction: column;
  }

  .stats,
  .card-grid.cols-2,
  .card-grid.cols-3,
  .shortcut-grid,
  .guide-grid,
  .path-grid,
  .use-case-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-side,
  .chapter-hero,
  .chapter-section {
    padding: 22px;
  }

  .step-deck-header {
    flex-direction: column;
  }

  .step-nav-meta {
    justify-items: start;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
