:root {
  --bg: #f4f1e9;
  --paper: #fbfaf4;
  --paper-soft: #eee8dc;
  --ink: #161b17;
  --ink-soft: #3f4841;
  --muted: #69736c;
  --line: rgba(22, 27, 23, 0.16);
  --line-strong: rgba(22, 27, 23, 0.36);
  --red: #b23b2e;
  --red-soft: #f0d7d0;
  --green: #22685c;
  --green-soft: #d8e8df;
  --gold: #b77a1d;
  --shadow: 0 18px 50px rgba(22, 27, 23, 0.1);
  --font: "Noto Serif SC", "Source Han Serif SC", "SimSun", "Microsoft YaHei UI", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 27, 23, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(22, 27, 23, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  font-family: var(--font);
  line-height: 1.82;
}

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

.progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 4px;
  background: rgba(22, 27, 23, 0.08);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 120ms linear;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 233, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  font-family: var(--sans);
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background: var(--red);
  color: #fff8ed;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  font-family: var(--sans);
  white-space: nowrap;
}

.quick-nav a {
  padding: 7px 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.quick-nav a:hover {
  background: rgba(22, 27, 23, 0.07);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 920px) minmax(180px, 250px);
  gap: clamp(22px, 3.5vw, 42px);
  width: min(1540px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0 96px;
}

.toc-panel,
.reading-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100svh - 120px);
  overflow: auto;
  font-family: var(--sans);
}

.toc-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.84rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  color: var(--red);
}

.toc-toggle {
  display: none;
}

#toc {
  display: grid;
  gap: 2px;
}

#toc a {
  display: block;
  padding: 7px 9px;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

#toc a.level-3 {
  padding-left: 20px;
  font-size: 0.8rem;
}

#toc a.is-active {
  border-left-color: var(--red);
  background: rgba(178, 59, 46, 0.09);
  color: var(--ink);
  font-weight: 850;
}

.report-shell {
  min-width: 0;
}

.cover,
.executive-brief,
.report-section,
.closing-note {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.cover {
  padding: clamp(28px, 6vw, 68px);
  border-top: 8px solid var(--ink);
}

.kicker {
  margin: 0 0 14px;
  color: var(--red);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13ch;
  margin-bottom: 24px;
  font-size: clamp(2.7rem, 7vw, 6.1rem);
  font-weight: 950;
}

.subtitle {
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: clamp(1.06rem, 1.5vw, 1.28rem);
  font-weight: 700;
}

.cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  font-family: var(--sans);
}

.cover-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.cover-meta a:hover,
.cover-meta a:focus-visible {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.executive-brief {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 24px;
  margin-top: 22px;
  padding: clamp(24px, 4vw, 42px);
}

.executive-brief h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.brief-grid {
  display: grid;
  gap: 10px;
}

.brief-grid article,
.panel-card {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  padding: 16px;
}

.brief-grid span,
.panel-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.brief-grid p,
.panel-card p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.7;
}

.reading-panel {
  display: grid;
  gap: 12px;
}

.report-content {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.report-section {
  padding: clamp(24px, 4.5vw, 52px);
  scroll-margin-top: 92px;
}

.report-section h2 {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  font-weight: 950;
}

.report-section h3 {
  margin: 34px 0 12px;
  color: var(--ink);
  font-size: clamp(1.22rem, 2vw, 1.62rem);
  font-weight: 900;
}

.report-section h3:first-child {
  margin-top: 0;
}

.report-section p {
  margin-bottom: 1.05em;
  color: var(--ink-soft);
  font-size: clamp(1.03rem, 1.08vw, 1.12rem);
  line-height: 1.92;
}

.report-section p:last-child {
  margin-bottom: 0;
}

.report-section strong {
  color: var(--ink);
}

.report-section[data-theme="business"] {
  border-top: 8px solid var(--green);
}

.report-section[data-theme="method"] {
  border-top: 8px solid var(--gold);
}

.report-section[data-theme="risk"] {
  border-top: 8px solid var(--red);
}

.report-section[data-theme="roadmap"] {
  border-top: 8px solid var(--ink);
}

.report-section[data-theme="business"] h3,
.report-section[data-theme="roadmap"] h3 {
  padding: 14px 16px;
  border-left: 5px solid var(--green);
  background: var(--green-soft);
}

.report-section[data-theme="risk"] h3 {
  padding: 14px 16px;
  border-left: 5px solid var(--red);
  background: var(--red-soft);
}

.report-section[data-theme="method"] p {
  padding-left: 18px;
  border-left: 3px solid var(--line);
}

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1220px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  }

  .reading-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: static;
    max-height: none;
    padding: 12px;
    border: 1px solid var(--line-strong);
    background: rgba(251, 250, 244, 0.88);
    overflow: visible;
  }

  .toc-title {
    display: none;
  }

  .toc-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    text-align: left;
    cursor: pointer;
  }

  .toc-label {
    flex: 0 0 auto;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: 0.1em;
  }

  .toc-separator {
    flex: 0 0 auto;
    margin: 0 8px;
    color: var(--muted);
    font-weight: 850;
  }

  .toc-current {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toc-action {
    flex: 0 0 auto;
    margin-left: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
  }

  #toc {
    display: grid;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    transition: max-height 0.22s ease, padding-top 0.22s ease;
  }

  .toc-panel.is-open #toc {
    max-height: 52svh;
    overflow: auto;
    padding-top: 10px;
  }

  .toc-panel.is-open .toc-action {
    color: var(--red);
  }

  #toc a,
  #toc a.level-3 {
    max-width: none;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: var(--paper);
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .executive-brief {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    background-size: 24px 24px;
  }

  .layout {
    width: min(100% - 24px, 1540px);
    padding-top: 18px;
  }

  .brand span:last-child {
    font-size: 0.95rem;
  }

  .quick-nav a {
    padding: 6px 8px;
    font-size: 0.84rem;
  }

  .cover,
  .executive-brief,
  .report-section {
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 3.6rem);
  }

  .report-section h2 {
    font-size: clamp(1.65rem, 8vw, 2.45rem);
  }

  .report-section p {
    font-size: 1rem;
    line-height: 1.86;
  }
}
