:root {
  --ink: #17201c;
  --muted: #5b6963;
  --line: #d9e3df;
  --bg: #f6f8f5;
  --panel: #ffffff;
  --teal: #0f766e;
  --blue: #2563eb;
  --amber: #a16207;
  --red: #b42318;
  --green: #4d7c0f;
  --soft-teal: #ecfdf5;
  --soft-blue: #eff6ff;
  --soft-amber: #fffbeb;
  --soft-red: #fff1f2;
  --shadow: 0 14px 32px rgba(23, 32, 28, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(246, 248, 245, 0) 320px),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.58;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
}

header {
  padding: 38px 0 24px;
  border-bottom: 1px solid rgba(23, 32, 28, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 1080px;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 980px;
  color: var(--muted);
  font-size: 17px;
  margin: 16px 0 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #33413b;
  font-size: 13px;
  white-space: nowrap;
}

nav.quick {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

nav.quick a,
.link-card {
  display: block;
  border: 1px solid #e3eae7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #33413b;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}

nav.quick a:hover,
.link-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--soft-teal);
  color: var(--teal);
  text-decoration: none;
}

.doc-toc {
  max-width: 760px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.doc-toc li {
  border-bottom: 1px solid rgba(23, 32, 28, 0.1);
}

.doc-toc a {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  color: #33413b;
  text-decoration: none;
  font-size: 15px;
}

.doc-toc a:hover {
  color: var(--teal);
  text-decoration: none;
}

.doc-toc span {
  color: var(--teal);
  font-weight: 800;
}

main { padding: 22px 0 72px; }
section { padding: 23px 0; }

h2 {
  margin: 0 0 14px;
  font-size: 25px;
  letter-spacing: 0;
}

h3 {
  margin: 18px 0 10px;
  font-size: 18px;
  letter-spacing: 0;
}

p {
  max-width: 980px;
  margin: 10px 0 14px;
}

.note,
.warn,
.decision {
  border-radius: 8px;
  padding: 14px 16px;
  max-width: 1080px;
}

.note {
  border-left: 4px solid var(--teal);
  background: var(--soft-teal);
  color: #24413a;
}

.warn {
  border-left: 4px solid var(--amber);
  background: var(--soft-amber);
  color: #60451e;
}

.decision {
  border-left: 4px solid var(--blue);
  background: var(--soft-blue);
  color: #1e3a5f;
  font-weight: 700;
}

.summary-grid,
.page-grid,
.evidence-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.summary-grid { grid-template-columns: repeat(4, 1fr); }
.page-grid { grid-template-columns: repeat(4, 1fr); }
.evidence-grid { grid-template-columns: repeat(3, 1fr); }

.card,
.evidence-card,
.table-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body { padding: 15px; }

.card b,
.link-card b {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.card p,
.link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tag.teal { color: #0f766e; background: var(--soft-teal); }
.tag.blue { color: #1d4ed8; background: var(--soft-blue); }
.tag.amber { color: #92400e; background: var(--soft-amber); }
.tag.green { color: #3f6212; background: #f0fdf4; }
.tag.red { color: var(--red); background: var(--soft-red); }

.table-block {
  margin: 14px 0 24px;
}

.table-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: #f8fbf9;
}

.table-caption strong { font-size: 15px; }
.table-caption span { color: var(--muted); font-size: 13px; }

.table-scroll {
  width: 100%;
  overflow: auto;
  max-height: 78vh;
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #edf2ef;
  vertical-align: top;
  text-align: left;
}

th:last-child,
td:last-child { border-right: 0; }

th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: #26352f;
  background: #eef7f4;
  font-weight: 800;
}

tr:last-child td { border-bottom: 0; }

.narrow table { min-width: 860px; }
.wide table { min-width: 1360px; }

.evidence-card img,
.thumb {
  display: block;
  width: 100%;
  height: auto;
}

.evidence-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eef4f1;
}

.evidence-card .meta {
  padding: 11px 12px 13px;
}

.evidence-card .meta b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.evidence-card .meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.thumb-link {
  display: block;
  width: 180px;
  max-width: 100%;
  color: inherit;
}

.thumb-link img {
  border: 1px solid var(--line);
  border-radius: 7px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #eef4f1;
}

.thumb-link span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pricing-table .thumb-link {
  width: 118px;
}

.pricing-table .thumb-link img {
  aspect-ratio: 4 / 3;
}

.price-lines,
.benefit-lines {
  display: grid;
  gap: 5px;
  min-width: 160px;
}

.price-lines span,
.benefit-lines span {
  display: block;
  line-height: 1.38;
}

.price-lines b,
.benefit-lines b {
  color: #26352f;
}

.evidence-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(16, 24, 20, 0.72);
}

.lightbox.open {
  display: grid;
}

.lightbox-panel {
  width: min(1120px, 94vw);
  max-height: 92vh;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #0f1714;
}

.lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  color: #26352f;
  font-size: 13px;
  line-height: 1.4;
}

.lightbox-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #26352f;
  cursor: pointer;
  font: inherit;
  padding: 4px 9px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}

.step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow);
}

.step small {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--teal);
  font-weight: 800;
}

.step b { display: block; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; }

.canvas-lead {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 16px;
  margin-top: 16px;
}

.logic-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 16px;
}

.logic-card h3,
.logic-card p {
  margin-top: 0;
}

.logic-card p:last-child {
  margin-bottom: 0;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.signal {
  border: 1px solid #cfe0dc;
  border-radius: 8px;
  background: #f8fbf9;
  padding: 12px;
}

.signal b {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 14px;
}

.signal span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bmc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  grid-template-rows: auto auto auto;
  gap: 10px;
  margin-top: 16px;
}

.bmc-cell {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px 14px 13px;
  overflow: hidden;
}

.bmc-cell::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
  opacity: 0.82;
}

.bmc-cell.revenue::before,
.bmc-cell.value::before {
  background: var(--blue);
}

.bmc-cell.risk::before {
  background: var(--amber);
}

.bmc-cell h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.bmc-cell ul,
.layer-card ul {
  margin: 0;
  padding-left: 18px;
  color: #26352f;
  font-size: 13.5px;
  line-height: 1.55;
}

.bmc-cell li + li,
.layer-card li + li {
  margin-top: 5px;
}

.bmc-cell .mark {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.value { grid-column: 3; grid-row: 1 / 3; }
.partners { grid-column: 1; grid-row: 1 / 3; }
.activities { grid-column: 2; grid-row: 1; }
.resources { grid-column: 2; grid-row: 2; }
.relations { grid-column: 4; grid-row: 1; }
.channels { grid-column: 4; grid-row: 2; }
.segments { grid-column: 5; grid-row: 1 / 3; }
.cost { grid-column: 1 / 3; grid-row: 3; min-height: 140px; }
.revenue { grid-column: 3 / 6; grid-row: 3; min-height: 140px; }

.layer-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.layer-card {
  display: grid;
  grid-template-columns: 190px 1fr 240px;
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.layer-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  background: #eef7f4;
  border-right: 1px solid var(--line);
}

.layer-title strong {
  font-size: 17px;
  line-height: 1.25;
}

.layer-title span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.layer-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 14px 0;
}

.layer-chip {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid #dfe8e4;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 8px 10px;
  color: #273630;
  font-size: 13px;
  line-height: 1.35;
}

.layer-output {
  border-left: 1px solid var(--line);
  padding: 14px;
  background: #f8fbf9;
}

.layer-output b {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 13px;
}

.layer-output p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.flow-brief {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.flow-brief .logic-card {
  min-height: 142px;
}

.flow-brief strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 13px;
}

.closed-loop {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.loop-head {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f8fbf9;
  padding: 16px;
}

.loop-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.loop-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.loop-score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.loop-score div {
  border: 1px solid #dbe8e4;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.loop-score b {
  display: block;
  color: #173c35;
  font-size: 18px;
  line-height: 1;
}

.loop-score span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.loop-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  padding: 16px;
}

.loop-node {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 164px;
  border: 1px solid #dbe8e4;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.loop-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -11px;
  width: 11px;
  height: 1px;
  background: #8aa19a;
}

.loop-node.primary {
  border-color: rgba(37, 99, 235, 0.34);
  background: var(--soft-blue);
}

.loop-node small {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #eaf5f1;
  padding: 3px 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.loop-node.primary small {
  background: #dceafe;
  color: var(--blue);
}

.loop-node b {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.3;
}

.loop-node p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.loop-node .charge {
  align-self: end;
  margin-top: 12px;
  border-top: 1px solid #dfebe7;
  padding-top: 8px;
  color: #1f4f46;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.loop-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #f8fbf9;
  padding: 16px;
}

.lane-card {
  border: 1px solid #dbe8e4;
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.lane-card b {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.lane-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.loop-rule {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  color: #26352f;
  font-size: 14px;
  line-height: 1.55;
}

.loop-rule strong {
  color: var(--teal);
}

footer {
  border-top: 1px solid rgba(23, 32, 28, 0.08);
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .wrap { width: min(100vw - 28px, 1240px); }
  nav.quick,
  .summary-grid,
  .page-grid,
  .evidence-grid,
  .flow,
  .bmc-grid,
  .flow-brief,
  .loop-head,
  .loop-track,
  .loop-lanes,
  .canvas-lead { grid-template-columns: 1fr; }
  h2 { font-size: 22px; }
  .table-caption { display: block; }
  table { font-size: 13px; }

  .bmc-cell,
  .partners,
  .activities,
  .resources,
  .value,
  .relations,
  .channels,
  .segments,
  .cost,
  .revenue {
    grid-column: auto;
    grid-row: auto;
  }

  .layer-card {
    grid-template-columns: 1fr;
  }

  .layer-title,
  .layer-output {
    border: 0;
  }

  .layer-items {
    grid-template-columns: 1fr 1fr;
    padding: 0 14px 14px;
  }

  .loop-node:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 700px) {
  .layer-items,
  .signal-row,
  .loop-score {
    grid-template-columns: 1fr;
  }
}
