:root {
  color-scheme: dark;
  --bg: #08111f;
  --surface: #0d1929;
  --surface-2: #122238;
  --text: #eef5ff;
  --muted: #9aaac0;
  --line: rgba(154, 181, 211, .18);
  --cyan: #67e8f9;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --green: #34d399;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
  --max: 1240px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #edf3fa;
  --text: #112033;
  --muted: #5d6c80;
  --line: rgba(31, 57, 88, .15);
  --shadow: 0 24px 70px rgba(37, 63, 95, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--amber); color: #111827; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.topbar { position: sticky; top: 0; z-index: 50; height: 74px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; gap: 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--cyan) 55%, transparent); border-radius: 10px; color: var(--cyan); font: 700 13px/1 ui-monospace, monospace; box-shadow: inset 0 0 20px rgba(103,232,249,.08); }
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { font-size: 14px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
nav { display: flex; gap: 24px; }
nav a { color: var(--muted); text-decoration: none; font-size: 13px; transition: color .2s; }
nav a:hover { color: var(--text); }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }

.hero { position: relative; max-width: var(--max); min-height: calc(100vh - 74px); margin: 0 auto; padding: 100px 24px 90px; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 70px; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 550px; height: 550px; left: -340px; top: 5%; background: radial-gradient(circle, rgba(59,130,246,.16), transparent 68%); pointer-events: none; }
.eyebrow { margin: 0 0 18px; color: var(--cyan); font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(48px, 6vw, 82px); line-height: 1.04; letter-spacing: -.055em; }
.hero h1 span { color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--cyan) 68%, var(--text)); }
.lead { max-width: 660px; margin: 28px 0 0; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; gap: 12px; margin: 34px 0 42px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font: 650 13px/1 sans-serif; cursor: pointer; }
.button.primary { color: #06101c; background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 12px 30px rgba(96,165,250,.2); }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.hero-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.hero-metrics div { padding: 20px 12px 0 0; }
.hero-metrics dt { color: var(--text); font: 700 23px/1 ui-monospace, monospace; }
.hero-metrics dd { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.hero-visual { position: relative; min-height: 600px; }
.signal-line { position: absolute; left: 50%; top: 6%; bottom: 6%; width: 1px; background: linear-gradient(transparent, var(--cyan), var(--blue), transparent); opacity: .42; }
.chip-card { position: absolute; width: min(360px, 78%); padding: 22px 24px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.chip-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(103,232,249,.08), transparent 48%); pointer-events: none; }
.chip-card small { color: var(--cyan); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .16em; }
.chip-card h2 { margin: 16px 0 6px; font-size: 22px; }
.chip-card p { margin: 0; color: var(--muted); font-size: 13px; }
.chip-index { position: absolute; right: 20px; top: 17px; color: color-mix(in srgb, var(--text) 16%, transparent); font: 700 36px/1 ui-monospace, monospace; }
.phone-card { top: 5%; left: 0; transform: rotate(-1.8deg); }
.bes-card { top: 36%; right: 0; transform: rotate(1.5deg); }
.qc-card { bottom: 4%; left: 4%; transform: rotate(-.7deg); }
.protocol-tag { position: absolute; padding: 6px 10px; border-radius: 999px; font: 700 10px/1 ui-monospace, monospace; }
.tag-mt007 { left: 29%; top: 28%; color: var(--cyan); border: 1px solid rgba(103,232,249,.35); background: rgba(103,232,249,.07); }
.tag-bridge { right: 4%; top: 67%; color: var(--amber); border: 1px solid rgba(251,191,36,.35); background: rgba(251,191,36,.07); }

.section { max-width: var(--max); margin: 0 auto; padding: 110px 24px; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { max-width: 770px; margin-bottom: 48px; }
.section-heading.split { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4.3vw, 58px); line-height: 1.08; letter-spacing: -.04em; }
.section-heading > p:last-child { color: var(--muted); font-size: 17px; }
.text-link { color: var(--cyan); text-decoration: none; font-size: 13px; white-space: nowrap; }

.pattern-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pattern-grid article { min-height: 250px; padding: 28px; background: var(--surface); }
.pattern-grid article + article { border-left: 1px solid var(--line); }
.pattern-grid span { color: var(--cyan); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.pattern-grid h3 { margin: 54px 0 14px; font-size: 19px; }
.pattern-grid p { color: var(--muted); font-size: 13px; }
.decision-callout { margin-top: 22px; padding: 24px 28px; display: flex; align-items: center; gap: 34px; background: linear-gradient(90deg, rgba(103,232,249,.09), rgba(96,165,250,.03)); border: 1px solid rgba(103,232,249,.22); border-radius: 14px; }
.decision-callout strong { color: var(--cyan); white-space: nowrap; }
.decision-callout p { margin: 0; font-size: 17px; }

.diagram-section { max-width: 1440px; }
.diagram-summary { max-width: 960px; margin: -24px 0 20px; color: var(--muted); line-height: 1.8; }
.diagram-summary code { color: var(--cyan); }
.diagram-frame-wrap { background: #07101c; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.diagram-frame-wrap iframe { display: block; width: 100%; height: min(760px, 75vh); border: 0; background: #07101c; }
.sequence-section { padding-top: 54px; }
.sequence-frame iframe { height: min(820px, 80vh); }
.diagram-hint { color: var(--muted); font-size: 12px; text-align: center; }

.boundary-grid { display: grid; grid-template-columns: 1fr 180px 1fr; align-items: stretch; }
.boundary-card { padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.boundary-card.external { box-shadow: inset 3px 0 var(--cyan); }
.boundary-card.internal { box-shadow: inset -3px 0 var(--amber); }
.boundary-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.boundary-title code { color: inherit; font-size: 10px; }
.boundary-card h3 { font-size: 30px; margin: 36px 0 20px; }
.boundary-card ul { padding-left: 18px; color: var(--muted); }
.boundary-card li { margin: 9px 0; }
.no-cross { display: grid; place-content: center; justify-items: center; text-align: center; }
.no-cross span { display: grid; place-items: center; width: 52px; height: 52px; color: var(--danger); border: 1px solid rgba(251,113,133,.5); border-radius: 50%; font-size: 30px; }
.no-cross strong { margin-top: 10px; color: var(--danger); font: 700 10px/1 ui-monospace, monospace; }
.no-cross small { max-width: 130px; margin-top: 8px; color: var(--muted); font-size: 9px; }
.rules { margin-top: 28px; display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding: 32px; background: var(--surface-2); border-radius: 16px; }
.rules h3 { margin: 0; }
.rules ol { margin: 0; columns: 2; column-gap: 44px; color: var(--muted); }
.rules li { break-inside: avoid; margin: 0 0 12px; padding-left: 8px; }

.ownership-table { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.table-row { display: grid; grid-template-columns: 1.05fr 1fr 1.2fr 1.65fr; }
.table-row > * { padding: 17px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.table-row > * + * { border-left: 1px solid var(--line); }
.table-row strong { color: var(--text); }
.table-row.table-head > * { border-top: 0; color: var(--cyan); background: var(--surface-2); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .1em; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.timeline li { position: relative; padding: 0 22px 0 0; }
.timeline li::before { content: ""; position: absolute; left: 38px; right: 0; top: 19px; height: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline > li > span { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; color: var(--cyan); background: var(--bg); border: 1px solid rgba(103,232,249,.45); border-radius: 50%; font: 700 11px/1 ui-monospace, monospace; }
.timeline div { margin-top: 30px; }
.timeline small { color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .14em; }
.timeline h3 { margin: 10px 0; font-size: 17px; }
.timeline p { color: var(--muted); font-size: 12px; }
.acceptance-banner { margin-top: 56px; padding: 28px 30px; display: grid; grid-template-columns: 240px 1fr auto; align-items: center; gap: 30px; border: 1px solid rgba(251,191,36,.26); border-radius: 16px; background: rgba(251,191,36,.05); }
.acceptance-banner small, .acceptance-banner strong { display: block; }
.acceptance-banner small { color: var(--amber); }
.acceptance-banner p { color: var(--muted); }
.acceptance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.acceptance-grid article { min-height: 176px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, var(--surface), var(--surface-2)); }
.acceptance-grid article > span { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #06111d; background: var(--cyan); font: 800 11px/1 ui-monospace, monospace; }
.acceptance-grid h3 { margin: 18px 0 8px; font-size: 17px; }
.acceptance-grid p { min-height: 48px; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.acceptance-grid strong { color: var(--cyan); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .1em; }
.acceptance-note { margin-top: 18px; padding: 18px 20px; border-left: 3px solid var(--cyan); color: var(--muted); background: var(--surface); line-height: 1.7; }
.acceptance-note code { color: var(--cyan); }

.final-cta { text-align: center; max-width: 960px; }
.final-cta h2 { font-size: clamp(34px, 5vw, 60px); line-height: 1.08; letter-spacing: -.04em; }
.final-cta > p:not(.eyebrow) { max-width: 700px; margin: 22px auto 34px; color: var(--muted); }
.final-cta > div { display: flex; justify-content: center; gap: 12px; }
footer { max-width: var(--max); margin: 0 auto; padding: 30px 24px 46px; display: flex; justify-content: space-between; gap: 24px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

.plan-shell { display: grid; grid-template-columns: 280px minmax(0, 850px); justify-content: center; gap: 64px; max-width: 1280px; margin: 0 auto; padding: 70px 24px 120px; }
.plan-sidebar { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
.plan-sidebar h2 { font-size: 16px; }
.plan-sidebar ul { list-style: none; padding: 0; }
.plan-sidebar ul ul { padding-left: 14px; }
.plan-sidebar a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 12px; }
.plan-sidebar a:hover { color: var(--cyan); }
.plan-doc { min-width: 0; }
.plan-doc > h1 { margin-top: 0; font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -.045em; }
.plan-doc h2 { margin: 72px 0 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 30px; }
.plan-doc h3 { margin-top: 36px; font-size: 20px; }
.plan-doc h4 { margin-top: 28px; }
.plan-doc p, .plan-doc li { color: color-mix(in srgb, var(--text) 80%, var(--muted)); }
.plan-doc blockquote { margin: 24px 0; padding: 18px 22px; border-left: 3px solid var(--cyan); background: var(--surface); }
.plan-doc blockquote p { margin: 0; }
.plan-doc code { padding: .12em .35em; color: var(--cyan); background: var(--surface-2); border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.plan-doc pre { overflow: auto; padding: 20px; background: #050c16; border: 1px solid var(--line); border-radius: 12px; }
.plan-doc pre code { padding: 0; color: #d7e6f8; background: transparent; }
.plan-doc table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 24px 0; font-size: 13px; }
.plan-doc th, .plan-doc td { padding: 11px 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.plan-doc th { color: var(--cyan); background: var(--surface-2); white-space: nowrap; }
.plan-doc img, .plan-doc iframe { max-width: 100%; }
.plan-header { max-width: 1280px; margin: 0 auto; padding: 34px 24px 0; }
.plan-header a { color: var(--cyan); text-decoration: none; font-size: 13px; }

@media (max-width: 1000px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 70px; }
  .hero-visual { min-height: 560px; }
  .pattern-grid { grid-template-columns: repeat(2, 1fr); }
  .pattern-grid article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .pattern-grid article:nth-child(4) { border-top: 1px solid var(--line); }
  .boundary-grid { grid-template-columns: 1fr; gap: 20px; }
  .no-cross { min-height: 120px; }
  .rules { grid-template-columns: 1fr; }
  .table-row { grid-template-columns: 1fr 1fr; }
  .table-row > *:nth-child(3) { border-left: 0; }
  .timeline { grid-template-columns: 1fr; gap: 26px; }
  .timeline li { display: grid; grid-template-columns: 54px 1fr; padding: 0; }
  .timeline li::before { left: 19px; top: 40px; bottom: -26px; width: 1px; height: auto; }
  .timeline div { margin-top: 0; }
  .acceptance-banner { grid-template-columns: 1fr; }
  .acceptance-grid { grid-template-columns: 1fr 1fr; }
  .plan-shell { grid-template-columns: 1fr; }
  .plan-sidebar { position: static; max-height: 280px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
}

@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 16px; }
  .brand strong { font-size: 12px; }
  .hero { padding: 58px 18px 72px; }
  .hero h1 { font-size: 45px; }
  .lead { font-size: 16px; }
  .hero-actions { flex-direction: column; }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .hero-visual { min-height: 500px; }
  .chip-card { width: 88%; }
  .section { padding: 76px 18px; }
  .section-heading.split { align-items: start; flex-direction: column; }
  .pattern-grid { grid-template-columns: 1fr; }
  .pattern-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .decision-callout { align-items: start; flex-direction: column; gap: 8px; }
  .diagram-frame-wrap iframe { height: 620px; }
  .acceptance-grid { grid-template-columns: 1fr; }
  .rules ol { columns: 1; }
  .table-row { grid-template-columns: 1fr; padding: 14px 0; }
  .table-row > * { border-left: 0 !important; border-top: 0; padding: 7px 16px; }
  .table-row.table-head { display: none; }
  .final-cta > div, footer { flex-direction: column; }
  .button { width: 100%; }
  .plan-shell { padding: 40px 16px 90px; }
}

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