:root {
  --bg: #f4efe5;
  --bg-deep: #e8decf;
  --paper: rgba(255, 252, 246, 0.88);
  --paper-strong: #fffaf1;
  --ink: #1e2a2c;
  --muted: #5f6b67;
  --line: rgba(34, 50, 47, 0.12);
  --brand: #8f4c2f;
  --brand-soft: rgba(143, 76, 47, 0.12);
  --emerald: #2c6a57;
  --emerald-soft: rgba(44, 106, 87, 0.12);
  --navy: #24465d;
  --navy-soft: rgba(36, 70, 93, 0.12);
  --amber: #bc8b27;
  --danger: #a33b2b;
  --danger-soft: rgba(163, 59, 43, 0.12);
  --shadow: 0 24px 60px rgba(42, 38, 31, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(188, 139, 39, 0.15), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(44, 106, 87, 0.18), transparent 20%),
    linear-gradient(180deg, #f7f2ea 0%, #efe5d5 100%);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.35;
  content: "";
}

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

.page-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.hero,
.section-shell,
.content-section {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background: var(--paper);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 52px 56px;
  background:
    linear-gradient(135deg, rgba(36, 70, 93, 0.08), rgba(255, 252, 246, 0.92)),
    var(--paper);
}

.hero::after,
.section-shell::after,
.content-section::after {
  position: absolute;
  inset: auto -100px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 139, 39, 0.18), transparent 72%);
  content: "";
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.part-badge,
.panel-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.eyebrow,
.section-kicker,
.part-badge {
  color: var(--brand);
}

.hero h1,
.section-heading h2,
.part-header h2,
.card-title,
.toolkit-card h3 {
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
}

.hero h1 {
  margin: 10px 0 18px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.08;
}

.hero-lead {
  max-width: 880px;
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

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

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(36, 70, 93, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button-primary {
  background: linear-gradient(135deg, #234d63, #183645);
  color: #fffdf8;
  box-shadow: 0 18px 34px rgba(24, 54, 69, 0.22);
}

.button-secondary {
  border: 1px solid rgba(36, 70, 93, 0.24);
  background: rgba(255, 255, 255, 0.55);
  color: var(--navy);
}

.button-primary:hover,
.button-secondary:hover,
.site-mark:hover {
  transform: translateY(-2px);
}

.nav-link:hover {
  background-color: rgba(36, 70, 93, 0.1);
  transform: translateY(-2px);
}

.panel-label {
  margin: 0 0 16px;
  color: var(--emerald);
  font-weight: 700;
}

.sticky-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 24px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(248, 241, 229, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 36px rgba(40, 35, 28, 0.1);
}

.site-mark {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--navy);
  font-weight: 700;
}

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

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-link.active {
  background: var(--navy);
  color: #fffdf7;
}

.section-shell,
.content-section {
  margin-top: 24px;
  padding: 36px;
  scroll-margin-top: 108px;
}

.section-heading h2,
.part-header h2 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.16;
}

.section-heading p:last-child,
.part-header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.stat-value {
  display: block;
  margin-bottom: 10px;
  font-family: "STZhongsong", "Songti SC", serif;
  font-size: 38px;
  color: var(--navy);
}

.stat-label {
  display: block;
  font-weight: 700;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-grid,
.overview-cards,
.content-grid,
.toolkit-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-top: 18px;
}

.notice-panel,
.search-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.54);
}

.signal-list {
  display: grid;
  gap: 12px;
}

.signal-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(163, 59, 43, 0.08), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(163, 59, 43, 0.16);
}

.signal-item strong {
  display: block;
  color: var(--danger);
}

.signal-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.search-field {
  display: block;
}

.search-field span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(36, 70, 93, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  outline: none;
}

.search-field input:focus {
  border-color: rgba(36, 70, 93, 0.48);
  box-shadow: 0 0 0 4px rgba(36, 70, 93, 0.08);
}

.search-tip {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.overview-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.overview-card {
  position: relative;
  padding: 24px;
  min-height: 240px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(249, 242, 231, 0.9));
  border: 1px solid var(--line);
}

.overview-card p {
  color: var(--muted);
}

.overview-link {
  position: absolute;
  left: 24px;
  bottom: 22px;
  color: var(--navy);
  font-weight: 700;
}

.content-stack {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.highlight-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(163, 59, 43, 0.16);
  background: linear-gradient(180deg, rgba(255, 249, 246, 0.96), rgba(255, 255, 255, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.highlight-card h3 {
  margin: 12px 0 10px;
  font-size: 24px;
  line-height: 1.28;
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
}

.highlight-card p {
  margin: 0;
  color: var(--muted);
}

.highlight-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(163, 59, 43, 0.1);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.content-section {
  opacity: 0.72;
  transform: translateY(18px);
  transition: opacity 320ms ease, transform 320ms ease;
}

.content-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.part-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.part-summary {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.summary-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.content-grid {
  grid-template-columns: 1fr;
  margin-top: 24px;
}

.knowledge-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 241, 0.96));
}

.knowledge-card.search-hidden,
.content-section.search-hidden,
.toolkit-card.search-hidden {
  display: none;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.card-type {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.card-note {
  margin: -8px 0 0;
  color: var(--muted);
}

.flow-diagram,
.spotlight-list,
.stages-grid {
  display: grid;
  gap: 16px;
}

.flow-diagram {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.flow-card {
  position: relative;
  min-height: 180px;
  padding: 18px 18px 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(36, 70, 93, 0.12);
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.95), rgba(255, 250, 241, 0.9));
  overflow: hidden;
}

.flow-card::after {
  position: absolute;
  right: -14px;
  top: 50%;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(36, 70, 93, 0.35), transparent);
  transform: translateY(-50%);
  content: "";
}

.flow-card:last-child::after {
  display: none;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #234d63, #183645);
  color: #fffdf8;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.flow-card h4,
.decision-card h4,
.spotlight-card h4,
.stage-card h4 {
  margin: 14px 0 10px;
  font-size: 20px;
  line-height: 1.3;
}

.flow-card p,
.decision-card p,
.spotlight-card p,
.stage-card p {
  margin: 0;
  color: var(--muted);
}

.flow-card h4,
.flow-card p {
  word-break: break-word;
}

.decision-wrap {
  display: grid;
  gap: 16px;
}

.decision-root,
.decision-outcome {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.decision-root {
  border: 1px solid rgba(36, 70, 93, 0.14);
  background: linear-gradient(135deg, rgba(36, 70, 93, 0.08), rgba(255, 255, 255, 0.82));
  color: var(--navy);
}

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

.decision-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.decision-card.safe {
  background: rgba(44, 106, 87, 0.08);
  border-color: rgba(44, 106, 87, 0.2);
}

.decision-card.risk {
  background: rgba(163, 59, 43, 0.08);
  border-color: rgba(163, 59, 43, 0.18);
}

.decision-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.decision-outcome {
  border-left: 4px solid var(--amber);
  background: rgba(188, 139, 39, 0.08);
  color: var(--ink);
}

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

.spotlight-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(188, 139, 39, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(255, 248, 234, 0.86));
}

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

.stage-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(36, 70, 93, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.stage-footer {
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(36, 70, 93, 0.06);
  color: var(--muted);
}

.mini-grid {
  display: grid;
  gap: 12px;
}

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

.mini-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(36, 70, 93, 0.05);
  border: 1px solid rgba(36, 70, 93, 0.08);
}

.mini-card strong,
.timeline-item strong,
.compare-col strong,
.case-card strong,
.toolkit-card strong {
  color: var(--navy);
}

.timeline-list,
.steps-list,
.pill-list,
.bullet-list,
.case-focus,
.case-takeaway,
.toolkit-list {
  display: grid;
  gap: 12px;
}

.timeline-item,
.steps-list li,
.bullet-list li,
.toolkit-list li {
  position: relative;
  padding-left: 18px;
}

.timeline-item::before,
.steps-list li::before,
.bullet-list li::before,
.toolkit-list li::before {
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.timeline-item {
  padding: 14px 14px 14px 18px;
  border-left: 2px solid rgba(188, 139, 39, 0.35);
  background: rgba(188, 139, 39, 0.07);
  border-radius: 0 14px 14px 0;
}

.timeline-time {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--brand);
  font-weight: 700;
}

.pill-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.pill {
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(44, 106, 87, 0.08);
  border: 1px solid rgba(44, 106, 87, 0.18);
  color: var(--emerald);
  text-align: center;
  font-weight: 700;
}

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

.compare-col {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.compare-col.safe {
  background: var(--emerald-soft);
  border: 1px solid rgba(44, 106, 87, 0.2);
}

.compare-col.risk {
  background: var(--danger-soft);
  border: 1px solid rgba(163, 59, 43, 0.2);
}

.compare-col h4,
.template-card h4,
.case-card h4 {
  margin: 0 0 12px;
  font-size: 20px;
}

.steps-list,
.bullet-list,
.toolkit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

.data-table thead {
  background: rgba(36, 70, 93, 0.08);
}

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

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.template-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid rgba(143, 76, 47, 0.16);
}

.template-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.law-callout {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(36, 70, 93, 0.08), rgba(255, 255, 255, 0.76));
  border: 1px solid rgba(36, 70, 93, 0.12);
}

.formula-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(36, 70, 93, 0.06);
  border: 1px solid rgba(36, 70, 93, 0.12);
}

.formula {
  margin: 0 0 10px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.case-grid {
  display: grid;
  gap: 16px;
}

.case-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.case-meta {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(188, 139, 39, 0.12);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.case-card p {
  color: var(--muted);
}

.case-section,
.case-result {
  margin-top: 14px;
}

.case-section strong,
.case-result strong {
  display: block;
  margin-bottom: 8px;
}

.toolkit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.toolkit-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 242, 231, 0.95));
  border: 1px solid var(--line);
}

.toolkit-card h3 {
  margin: 10px 0 10px;
  font-size: 24px;
}

.toolkit-card p {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .part-header,
  .dashboard-grid,
  .toolkit-grid {
    grid-template-columns: 1fr;
  }

  .overview-cards,
  .stats-grid,
  .highlight-grid,
  .decision-grid,
  .spotlight-list,
  .stages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 12px, 100%);
    padding: 8px 0 30px;
  }

  .hero,
  .section-shell,
  .content-section {
    padding: 18px;
    border-radius: 20px;
    scroll-margin-top: 86px;
  }

  .hero h1,
  .section-heading h2,
  .part-header h2 {
    font-size: 28px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .sticky-nav {
    top: 6px;
    align-items: stretch;
    flex-direction: column;
    border-radius: 20px;
    padding: 12px;
    gap: 10px;
  }

  .site-mark {
    width: 100%;
    text-align: center;
  }

  .nav-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }

  .stats-grid,
  .overview-cards,
  .highlight-grid,
  .toolkit-grid,
  .mini-grid.two-cols,
  .compare-grid,
  .decision-grid,
  .spotlight-list,
  .stages-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .hero-tags {
    flex-direction: column;
  }

  .button-primary,
  .button-secondary,
  .hero-tags span {
    width: 100%;
    justify-content: center;
  }

  .card-title {
    font-size: 22px;
  }

  .knowledge-card,
  .stat-card,
  .overview-card,
  .highlight-card,
  .toolkit-card,
  .notice-panel,
  .search-panel,
  .part-summary {
    padding: 18px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .data-table th,
  .data-table td {
    min-width: 120px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .timeline-item,
  .pill,
  .compare-col,
  .template-card,
  .law-callout,
  .formula-card,
  .case-card,
  .decision-root,
  .decision-outcome,
  .flow-card,
  .spotlight-card,
  .stage-card {
    padding: 16px;
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-card {
    min-height: auto;
  }

  .flow-card::after {
    left: 50%;
    right: auto;
    top: auto;
    bottom: -10px;
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, rgba(36, 70, 93, 0.32), transparent);
    transform: translateX(-50%);
  }

  .flow-step {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    padding: 8px 12px;
    font-size: 13px;
  }
}
