:root {
  --bg: #f5f1e8;
  --surface: rgba(255, 253, 248, 0.96);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(93, 87, 73, 0.14);
  --line-strong: rgba(42, 37, 26, 0.22);
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --accent-strong: #115e59;
  --warm: #92400e;
  --warm-soft: rgba(146, 64, 14, 0.1);
  --shadow: 0 22px 54px rgba(44, 39, 30, 0.06);
  --shadow-soft: 0 14px 34px rgba(44, 39, 30, 0.05);
  --shadow-panel: 0 10px 26px rgba(36, 31, 24, 0.05);
  --glow-accent: 0 18px 34px rgba(15, 118, 110, 0.18);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 1540px;
  --sidebar: 336px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
  overflow-x: clip;
  overscroll-behavior-y: none;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.06), transparent 22%),
    radial-gradient(circle at bottom right, rgba(146, 64, 14, 0.07), transparent 24%),
    linear-gradient(180deg, #fbf8f1 0%, #f5f1e8 46%, #f8f4eb 100%);
  line-height: 1.88;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

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

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

code,
pre {
  font-family: "Cascadia Code", "Consolas", monospace;
}

.page-shell {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  background: rgba(255, 252, 246, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 30px;
  box-shadow: var(--shadow);
  transform: translateZ(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.top-actions {
  display: flex;
  gap: 12px;
}

.solid-button,
.ghost-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
  cursor: pointer;
}

.solid-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  color: var(--text);
}

.solid-button:hover,
.ghost-button:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, var(--sidebar)) minmax(0, 1fr);
  gap: 36px;
  margin-top: 30px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 22px;
  max-height: calc(100vh - 32px);
}

.sidebar-card,
.hero,
.doc-section,
.doc-card,
.chapter,
.summary-card,
.summary-logo-card,
.concept-card,
.callout-box {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.sidebar-card,
.doc-section,
.doc-card,
.callout-box {
  border-radius: var(--radius-xl);
  padding: 32px;
}

.note-card {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.94));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.toc-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  height: 100%;
  padding-right: 18px;
}

.toc-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.8;
}

.toc {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.28) transparent;
}

.toc-group {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.34);
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.toc-group.active-group {
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.toc-sublist {
  display: grid;
  gap: 6px;
  padding-left: 8px;
}

.toc-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--muted);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.toc-link:hover {
  background: rgba(15, 118, 110, 0.06);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.toc-link-root {
  font-weight: 700;
  font-size: 0.98rem;
}

.toc-link-chapter {
  align-items: flex-start;
  min-height: 64px;
  padding: 14px 16px;
  color: #334155;
}

.toc-link-sub {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.toc-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5e9, #ffffff);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 16px rgba(15, 118, 110, 0.08);
}

.toc-label {
  flex: 1;
  line-height: 1.55;
}

.toc-link.active,
.toc-link.active-trail {
  color: var(--accent-strong);
}

.toc-link.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.toc-link.active::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), #14b8a6);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.18);
}

.toc-link.active-trail {
  background: rgba(15, 118, 110, 0.06);
}

.note-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.7rem;
  line-height: 1.35;
}

.note-list {
  margin: 18px 0 0;
  padding-left: 1.2rem;
  color: #475569;
}

.note-list li + li {
  margin-top: 12px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 42px;
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 32px;
  padding: clamp(32px, 4vw, 56px);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.99), rgba(255, 248, 240, 0.97)),
    linear-gradient(180deg, rgba(15, 118, 110, 0.04), rgba(255, 255, 255, 0));
}

.hero-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.5rem, 4vw, 4.4rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 56ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

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

.hero-promo-card {
  margin-top: 26px;
  max-width: 32rem;
  padding: 24px 26px;
  border-radius: 26px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 246, 239, 0.96));
  box-shadow: var(--shadow-panel);
}

.hero-promo-card h2 {
  margin: 10px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.5rem;
  line-height: 1.28;
}

.hero-promo-card p {
  margin: 12px 0 0;
  color: #475569;
}

.promo-link {
  display: inline-flex;
  margin-top: 16px;
  font-weight: 800;
  color: var(--accent-strong);
  word-break: break-all;
}

.hero-summary {
  display: grid;
  gap: 20px;
}

.summary-logo-card,
.summary-card {
  padding: 28px;
  border-radius: 24px;
  box-shadow: var(--shadow-panel);
}

.summary-logo-card {
  display: grid;
  place-items: center;
  min-height: 220px;
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 239, 0.96));
}

.hero-logo {
  width: min(100%, 230px);
  height: auto;
  object-fit: contain;
}

.summary-card p {
  margin: 10px 0 0;
  color: #475569;
}

.summary-kicker {
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
  line-height: 1.2;
}

.doc-grid {
  display: grid;
  gap: 28px;
}

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

.doc-card {
  border-radius: 26px;
}

.doc-card h3,
.chapter-head h3,
.concept-card h3 {
  margin: 0 0 12px;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.96rem;
}

.check-list,
.substep-copy ul,
.substep-copy ol {
  margin: 0;
  padding-left: 1.2rem;
}

.check-list li,
.substep-copy li {
  margin-bottom: 12px;
}

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

.concept-card {
  padding: 28px;
  border-radius: 24px;
}

.callout-box {
  border-left: 5px solid var(--accent);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0.96));
}

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

.guide-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.guide-item strong {
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.chapter {
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(251, 248, 242, 0.97));
  overflow: hidden;
}

.chapter-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 38px 42px 28px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  position: relative;
}

.chapter-head p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: none;
}

.chapter-index {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 28px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(145deg, #fff5e8, #ffffff 70%);
  color: var(--accent-strong);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 20px 30px rgba(15, 118, 110, 0.12);
  isolation: isolate;
}

.chapter-index::before,
.chapter-index::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.chapter-index::before {
  inset: -8px;
  background: radial-gradient(circle at 30% 20%, rgba(15, 118, 110, 0.18), transparent 55%);
  filter: blur(10px);
  opacity: 0.9;
  z-index: -2;
}

.chapter-index::after {
  inset: 10px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.28)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.8);
  z-index: -1;
}

.chapter-head h3 {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.24;
}

.substep {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px 42px;
  border-top: 1px solid var(--line);
}

.substep.has-media {
  display: flex;
}

.substep:first-of-type {
  border-top: 0;
}

.substep-copy h4 {
  margin: 0 0 18px;
  font-size: 1.24rem;
  line-height: 1.4;
}

.substep-copy {
  max-width: 72ch;
}

.substep.has-media .substep-copy {
  max-width: 72ch;
}

.substep-copy p {
  margin: 0 0 18px;
}

.substep-copy > *:last-child {
  margin-bottom: 0;
}

.inline-note {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.08);
  color: #115e59;
}

.mini-table {
  display: grid;
  gap: 14px;
  margin: 18px 0 24px;
}

.mini-table > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.mini-table span {
  color: var(--muted);
  font-weight: 700;
}

.mini-table.stack > div {
  flex-direction: column;
}

.media-frame {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 247, 241, 0.98));
  box-shadow: var(--shadow-soft);
  content-visibility: auto;
  contain-intrinsic-size: 1px 860px;
}

.media-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 26px 26px 0;
}

.media-frame > img + .media-placeholder {
  display: none;
}

.media-frame.loaded .media-placeholder {
  display: none;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.88));
}

.media-placeholder span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.media-placeholder strong {
  margin-top: 12px;
  font-size: 1.06rem;
}

.media-placeholder small {
  margin-top: 6px;
  color: var(--muted);
}

.media-stack {
  display: grid;
  gap: 34px;
  width: 100%;
  max-width: 1040px;
}

.substep > .media-frame {
  width: 100%;
  max-width: 1040px;
}

.media-caption {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(15, 118, 110, 0.1);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.03), rgba(255, 255, 255, 0.72));
}

.media-caption::before {
  content: "图示";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.media-caption p {
  margin: 0;
  color: #334155;
  line-height: 1.84;
}

.command-box {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: #0f172a;
  color: #e2e8f0;
}

.command-box code {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}

.command-box.single-line code {
  white-space: nowrap;
}

.copy-button {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.faq-list {
  display: grid;
  gap: 18px;
}

.faq-list details {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  padding: 24px 24px 0;
  content-visibility: auto;
  contain-intrinsic-size: 1px 160px;
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding-bottom: 20px;
  font-weight: 800;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin: 0 0 22px;
  color: var(--muted);
}

section[id],
article[id] {
  scroll-margin-top: 32px;
}

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

.asset-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.asset-item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  flex: 0 0 auto;
}

.search-hit {
  animation: search-flash 1.6s ease;
}

@keyframes search-flash {
  0%,
  100% {
    box-shadow: var(--shadow);
  }

  30% {
    box-shadow:
      0 0 0 4px rgba(15, 118, 110, 0.12),
      0 18px 36px rgba(15, 118, 110, 0.16);
  }
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.34);
  outline-offset: 3px;
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .sidebar {
    position: static;
    top: auto;
    order: 1;
    max-height: none;
    grid-template-rows: auto;
  }

  .content {
    order: 2;
  }
}

@media (max-width: 980px) {
  .hero,
  .two-up,
  .reading-guide {
    grid-template-columns: 1fr;
  }

  .concept-grid,
  .asset-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions a {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--container));
    padding-top: 12px;
    padding-bottom: 64px;
  }

  .hero,
  .doc-section,
  .sidebar-card,
  .doc-card {
    padding: 22px;
  }

  .chapter-head,
  .substep {
    padding: 22px;
  }

  .chapter-head {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .chapter-index {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 1.2rem;
  }

  .mini-table > div,
  .command-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .media-frame img {
    padding: 16px 16px 0;
  }

  .media-caption {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }

  .toc {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .toc-card {
    padding-right: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
