:root {
  color-scheme: light;
  --paper: #F9F6F0;
  --silk: #F2ECE2;
  --surface: #FCFBF8;
  --white: #FFFFFF;
  --ink: #1F1C18;
  --ink-2: #575047;
  --ink-3: #8A8174;
  --seal: #B32E18;
  --seal-deep: #922311;
  --gold: #9A7438;
  --rule: #DDD4C6;
  --rule-strong: #C6B9A4;
  --green: #2E6642;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font: 400 100%/1.7 var(--sans);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; overflow-x: clip; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg stroke='%238c7654' stroke-opacity='0.042' stroke-width='0.7'%3E%3Cpath d='M0 24h120M0 48h120M0 72h120M0 96h120M0 120h120'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink);
  overflow-x: clip;
}
body.is-fs-open { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: 0; }
button, a, summary {
  -webkit-tap-highlight-color: transparent;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), opacity .2s var(--ease);
}
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; pointer-events: none; }
.icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
code { font: .84em ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

.wrap { width: min(1320px, calc(100% - 80px)); margin-inline: auto; }

/* ================= 极简顶栏 ================= */
.mast {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--rule);
  background: rgba(249, 246, 240, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mast-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { display: block; flex: none; }
.brand strong { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }
.brand-sep { width: 1px; height: 13px; background: var(--rule-strong); display: inline-block; }
.brand span { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }

.mast nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.mast nav a {
  position: relative;
  font-size: 14px;
  color: var(--ink-2);
  padding-block: 6px;
}
.mast nav a:hover { color: var(--ink); }
.mast nav a.is-active { color: var(--ink); font-weight: 500; }
.mast nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--seal);
}

.live-link {
  padding: 6px 15px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
}
.live-link:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ================= 板块一：非对称东方书案首屏 ================= */
.hero-workbench {
  position: relative;
  padding: clamp(32px, 4vw, 54px) 0 36px;
  overflow: clip;
}
.astrolabe-bg {
  position: absolute;
  top: -120px;
  right: max(-120px, calc(50% - 760px));
  width: 600px;
  height: 600px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.14;
  animation: astrolabeSpin 160s linear infinite;
}
.astrolabe-bg svg { width: 100%; height: 100%; display: block; }
@keyframes astrolabeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-workbench .wrap { position: relative; z-index: 1; }

.spread {
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(36px, 4.8vw, 80px);
  align-items: center;
}
.desk-pane { min-width: 0; }

/* 左栏：宋体排版 + 细线目录 */
.prompt { display: flex; flex-direction: column; }
.hero-kicker {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(32px, 3.2vw, 48px);
  line-height: 1.18;
  letter-spacing: .01em;
  color: var(--ink);
  text-wrap: balance;
}
.hero-lead {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink-2);
  max-width: 40ch;
}

.scene-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 26px;
  border-bottom: 1px solid var(--rule);
}
.scenario {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 0 11px;
  font-size: 14.5px;
  color: var(--ink-3);
}
.sc-num {
  font: 500 11.5px ui-monospace, Consolas, monospace;
  color: var(--ink-3);
}
.scenario:hover { color: var(--ink); }
.scenario[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 500;
}
.scenario[aria-pressed="true"] .sc-num { color: var(--seal); }
.scenario[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--seal);
}

.ask-reading {
  margin-top: 24px;
  padding-left: 16px;
  border-left: 2px solid var(--seal);
}
.scene-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.scene-tag { color: var(--seal); font-weight: 500; }

.ask-reading blockquote {
  font-family: var(--serif);
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.38;
  font-weight: 500;
  color: var(--ink);
}
.intro {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

.guided-answer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule-strong);
}
.answer-label {
  display: block;
  font-size: 12px;
  color: var(--seal);
  margin-bottom: 4px;
}
.guided-answer p {
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink);
}

.player {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.primary {
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--seal);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .03em;
}
.primary:hover {
  background: var(--seal-deep);
  transform: translateY(-1px);
}
.text-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-strong);
}
.text-cta:hover {
  color: var(--seal);
  border-color: var(--seal);
}
.text-cta:hover .icon { transform: translateX(3px); }

/* 多意图 / 上下文细线附块 */
.desk-note-block {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.note-head code { color: var(--seal); }
.step-queue { list-style: none; padding: 0; display: grid; gap: 8px; }
.step-queue li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink-2);
}
.step-queue li:last-child { border-bottom: 0; }
.step-queue li > span { font: 500 11.5px ui-monospace, Consolas, monospace; color: var(--ink-3); }
.step-queue li strong { display: block; font-size: 13px; color: var(--ink); font-weight: 500; }
.step-queue li small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.step-queue li.active > span,
.step-queue li.active strong code { color: var(--seal); }
.step-queue li.done > span { color: var(--green); }

.context-state { font-size: 12px; color: var(--seal); font-weight: 500; }
.context-state.filled { color: var(--green); }
.context-kv {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 13px;
}
.context-kv dt { color: var(--ink-3); }
.context-kv dd { color: var(--ink); overflow-wrap: anywhere; }

/* 右栏：无外框宣纸器物舞台 */
.coin-stage { padding: 8px 0; }
.cast-art {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr);
  gap: clamp(20px, 2.8vw, 36px);
  align-items: center;
}
.coins { text-align: center; }
.coin-mat {
  position: relative;
  padding: 20px 10px;
  background: radial-gradient(circle at 50% 50%, rgba(154, 116, 56, 0.08), transparent 66%);
}
.coin-stack {
  aspect-ratio: 1.38;
  position: relative;
  max-width: 280px;
  margin: auto;
  perspective: 600px;
}
.coin-stack img {
  position: absolute;
  width: 44%;
  height: auto;
  filter: drop-shadow(0 4px 2px rgba(55, 42, 24, 0.18)) drop-shadow(0 12px 12px rgba(85, 65, 32, 0.12));
  transition: transform .35s var(--spring);
}
.coin-stack img:nth-child(1) { top: 4%; left: 3%; transform: rotate(-16deg); }
.coin-stack img:nth-child(2) { top: 0; right: 4%; transform: rotate(14deg); }
.coin-stack img:nth-child(3) { top: 34%; left: 28%; transform: rotate(-5deg); }
.coin-stack img.is-tossing { animation: coinToss 0.42s var(--spring); }
@keyframes coinToss {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  45% { transform: translateY(-22px) rotateY(180deg) scale(1.08); }
  100% { transform: translateY(0) rotateY(360deg) scale(1); }
}

.coins figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: .04em;
}

.line-book {
  padding-left: clamp(16px, 2vw, 26px);
  border-left: 1px solid var(--rule);
}
.result-head-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.result-name {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 25px);
  color: var(--ink);
  line-height: 1.25;
}
.result-name em {
  font-style: normal;
  font-size: 14px;
  color: var(--seal);
  margin: 0 7px;
}
.code-mark {
  font: 400 12px ui-monospace, Consolas, monospace;
  color: var(--ink-3);
}

.line-legend, #cast-lines button {
  display: grid;
  grid-template-columns: 32px repeat(2, minmax(24px, 1fr)) 16px;
  gap: 8px;
  align-items: center;
}
.line-legend {
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
}
.line-legend span:not(:first-child) { text-align: center; }
#cast-lines button {
  position: relative;
  width: 100%;
  justify-items: start;
  min-height: 31px;
  padding: 2px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}
#cast-lines button:hover:not(:disabled) { color: var(--ink); }
#cast-lines button[aria-pressed="true"] {
  color: var(--seal);
  font-weight: 500;
}
#cast-lines button[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  left: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--seal);
}
.yao {
  width: 100%;
  max-width: 82px;
  height: 4.5px;
  background: currentColor;
  display: inline-block;
  border-radius: 1px;
  justify-self: center;
}
.yao.split {
  background: linear-gradient(to right, currentColor 41%, transparent 41% 59%, currentColor 59%);
}
.yao.changed { color: var(--seal); }
.yao-empty { width: 100%; text-align: center; color: var(--ink-3); font-size: 12px; }
#cast-lines button:disabled { color: var(--ink-3); cursor: default; }
.moving { color: var(--seal); font-size: 11.5px; font-weight: 600; text-align: center; }

.specimen-bottom {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.source-label {
  font-size: 12px;
  color: var(--ink-3);
  flex: none;
}
.result-note { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }

/* 古籍刻本风四柱（右栏） */
.chart-stage { padding: 8px 0; }
.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chart-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding: 18px 0;
  margin-bottom: 14px;
  text-align: center;
}
.chart-columns > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px;
  border-right: 1px solid var(--rule);
}
.chart-columns > div:last-child { border-right: 0; }
.chart-columns small { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.chart-columns b {
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1.22;
  font-weight: 500;
  color: var(--ink);
}
.chart-columns em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 8px;
}
.chart-columns .day b { color: var(--seal); }
.chart-columns .day em { color: var(--seal); font-weight: 500; }

#chart-details { margin: 8px 0 12px; }
#chart-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--seal);
  font-size: 13px;
  padding: 4px 0;
}
.chart-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
}
.chart-meta > div { display: grid; gap: 2px; }
.chart-meta dt { color: var(--ink-3); font-size: 11.5px; }
.chart-meta dd { color: var(--ink); }

.custom-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid var(--seal);
  border-radius: 0 10px 10px 0;
  background: var(--silk);
}
.custom-notice p { font-size: 13.5px; color: var(--ink); }
.custom-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 9px; }
.inline-cta {
  color: var(--seal);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 1px solid var(--seal);
}
.inline-secondary {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
}
.inline-secondary:hover { color: var(--seal); }

.day-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.day-seal {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 8px;
  padding: 4px 10px;
  line-height: 1.2;
  flex: none;
}
.day-body p { font-size: 13px; color: var(--ink); }
.day-tags { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; }
.tag-yi { color: var(--green); }
.tag-ji { color: var(--seal); }

/* 底部通栏细线附注 */
.stage-footnotes {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.footnote-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  flex: 1 1 auto;
}
.footnote-item { display: inline-block; }
.footnote-item[open] { flex-basis: 100%; }
.footnote-item summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  padding: 4px 0;
}
.footnote-item summary::-webkit-details-marker { display: none; }
.footnote-item summary .chev { width: 13px; height: 13px; transition: transform .2s var(--ease); }
.footnote-item summary:hover,
.footnote-item[open] summary { color: var(--seal); }
.footnote-item[open] summary .chev { transform: rotate(90deg); }

.footnote-body {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.footnote-status {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.see-route { color: var(--ink-2); border-bottom: 1px solid transparent; }
.see-route:hover { color: var(--seal); border-color: var(--seal); }

.payload-text {
  font-size: 13px;
  line-height: 1.68;
  color: var(--ink);
  padding-left: 12px;
  border-left: 2px solid var(--seal);
  overflow-wrap: anywhere;
}
.payload-meta { margin-top: 8px; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.payload-disclaimer { margin-top: 5px; font-size: 12px; color: var(--ink-3); }

.running-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
#trace { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trace-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
}
.trace-step code { font-size: 12px; color: var(--ink); font-weight: 500; }
.trace-step small { font-size: 11px; color: var(--ink-3); padding-left: 6px; border-left: 1px solid var(--rule); }
.trace-step.current { border-color: var(--seal); }
.trace-step.current code, .trace-step.current small { color: var(--seal); }
#trace .icon { width: 12px; height: 12px; color: var(--ink-3); }
.see-route-inline { font-size: 12.5px; color: var(--seal); white-space: nowrap; }
.see-route-inline:hover { text-decoration: underline; text-underline-offset: 4px; }

.transcript { max-height: 240px; overflow-y: auto; scrollbar-width: thin; }
.turn { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: baseline; gap: 10px; margin: 0 0 10px; max-width: 960px; }
.turn:last-child { margin-bottom: 0; }
.turn small { font-size: 11.5px; font-weight: 500; color: var(--seal); }
.turn.user small { color: var(--ink-3); }
.turn p { white-space: pre-line; font-size: 14px; line-height: 1.72; }

.birth-reply {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.birth-preset-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px dashed var(--rule); }
.birth-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.preset-btn {
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-size: 13px;
  background: var(--white);
}
.preset-btn:hover { background: var(--seal); color: var(--paper); }
.birth-form { padding-top: 12px; }
.birth-form-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.birth-form-head small { font-size: 12px; color: var(--ink-3); }
.birth-fields { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.cal-toggle { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; background: var(--white); }
.cal-opt { padding: 5px 11px; font-size: 13px; color: var(--ink-2); }
.cal-opt + .cal-opt { border-left: 1px solid var(--rule-strong); }
.cal-opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.bf-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.bf-item input, .bf-item select {
  padding: 5px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
}
.bf-item input { width: 68px; text-align: center; }
#bf-month, #bf-day { width: 52px; }
.birth-submit {
  padding: 6px 15px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}
.birth-submit:hover { background: var(--seal); }
.form-error { margin-top: 8px; font-size: 13px; color: var(--seal); }

/* ================= 板块二：功能流转及原理 ================= */
.workflow-section {
  background-color: var(--silk);
  padding-block: clamp(50px, 5.5vw, 76px);
  border-block: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 36px;
}
.section-title-group { max-width: 64ch; }
.context { color: var(--ink-3); font-size: 12.5px; letter-spacing: .06em; }
.context span { padding-inline: 5px; color: var(--rule-strong); }
.section-title-group h2 {
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.24;
  margin: 6px 0 8px;
}
.section-lead { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }

.arch-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.arch-path-tabs {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule-strong);
}
.arch-tab {
  position: relative;
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 4px 0 8px;
}
.arch-tab:hover { color: var(--ink); }
.arch-tab[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 500;
}
.arch-tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--seal);
}
.path-pill { font-size: 12.5px; color: var(--ink-3); }

/* AnimatedBeam 动态光束拓扑 */
.topology-board {
  position: relative;
  margin-top: 24px;
  padding: 26px 24px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}
.topo-beams {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.beam-track { fill: none; stroke: #DFD5C4; stroke-width: 1.15; opacity: .78; }
.beam-active { fill: none; stroke: rgba(179, 46, 24, 0.22); stroke-width: 2; }
.beam-pulse {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 22 78;
  stroke-dashoffset: 100;
  animation: beamFlow 2.6s cubic-bezier(0.35, 0, 0.25, 1) infinite;
}
.beam-pulse.delay-1 { animation-delay: .42s; }
.beam-pulse.delay-2 { animation-delay: .84s; }
.beam-pulse.gold-pulse { stroke-width: 2.1; stroke-dasharray: 15 85; animation-duration: 3.1s; opacity: .9; }
.beam-port { fill: var(--surface); stroke: #C6B9A4; stroke-width: 1.3; }
.beam-port.active { fill: var(--seal); stroke: var(--surface); stroke-width: 1.6; }
@keyframes beamFlow {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: -100; }
}

.topology {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(38px, 4.8vw, 76px);
}
.stage { position: relative; min-width: 0; display: flex; flex-direction: column; }
.stage-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.stage-idx { font: 500 11.5px ui-monospace, Consolas, monospace; color: var(--gold); }
.stage h3 { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.stage-nodes { display: flex; flex-direction: column; justify-content: center; gap: 11px; flex: 1; }
.stage button {
  position: relative;
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px 12px 9px 24px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
}
.stage button::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--rule-strong);
}
.stage button span { display: block; font-size: 13.5px; font-weight: 500; }
.stage code { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.stage button:hover { background: var(--white); border-color: var(--rule-strong); color: var(--ink); }
.stage button.in-path {
  background: var(--white);
  border-color: rgba(179, 46, 24, 0.5);
  color: var(--ink);
}
.stage button.in-path::before { background: var(--seal); }
.stage button.in-path code { color: var(--ink-2); }
.stage button[aria-expanded="true"] {
  background: #FBF4F1;
  border-color: var(--seal);
  color: var(--seal);
}
.stage button[aria-expanded="true"] code { color: var(--seal); }

.contract { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--ease); margin-top: 12px; }
.contract.open { grid-template-rows: 1fr; }
.contract > div { overflow: hidden; }
.contract-inner {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-left: 2px solid var(--seal);
}
.contract-inner strong { color: var(--seal); margin-right: 8px; font-size: 14.5px; }
.contract-inner code { color: var(--ink); font-size: 12px; background: var(--silk); padding: 1px 6px; border-radius: 6px; }
.contract-inner p { color: var(--ink-2); margin-top: 6px; font-size: 14px; line-height: 1.72; }

/* 原理直证：开放细线排印，无嵌套大卡 */
.principle-panel {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--rule-strong);
}
.principle-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
}
.principle-head h3 {
  font-size: clamp(20px, 1.8vw, 25px);
  line-height: 1.35;
  margin-top: 5px;
  color: var(--ink);
}
.evidence-links { display: flex; gap: 16px; flex-wrap: wrap; }
.proof-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule-strong);
}
.proof-link .icon { width: 13px; height: 13px; color: var(--ink-3); }
.proof-link:hover { color: var(--seal); border-color: var(--seal); }
.proof-link:hover .icon { color: var(--seal); }

.reading-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) auto minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: 26px 0 22px;
}
.birth-plate figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.birth-plate figcaption strong { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.birth-plate figcaption small { font-size: 12.5px; color: var(--ink-3); }

.pillars-ink {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.pillar-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 14px;
  border-right: 1px solid var(--rule);
  text-align: center;
}
.pillar-tile:last-child { border-right: 0; }
.pillar-tile small { font-size: 12px; color: var(--ink-3); margin-bottom: 7px; }
.pillar-tile b {
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.2;
  font-weight: 500;
  color: var(--ink);
}
.pillar-role { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.pillar-tile.is-interactive { cursor: pointer; }
.pillar-tile.is-interactive:hover { background: var(--white); }
.pillar-tile.is-interactive[aria-pressed="true"] { background: #FBF4F1; }
.pillar-tile.is-interactive[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--seal);
}
.pillar-tile.is-interactive[aria-pressed="true"] .key-char,
.pillar-tile.is-interactive[aria-pressed="true"] .pillar-role { color: var(--seal); font-weight: 500; }

.flow-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
}
.bridge-line { width: 1px; height: 24px; background: var(--rule-strong); }

.reading-notes { display: grid; gap: 18px; }
.note-item {
  padding-left: 16px;
  border-left: 1.5px solid var(--rule-strong);
}
.note-item:last-child { border-left-color: var(--seal); }
.note-item code { font-size: 12px; color: var(--gold); }
.note-item h4 { font-size: 18px; color: var(--ink); margin: 4px 0 4px; }
.note-item p { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
#query-day { color: var(--seal); }

/* 展开工程契约 */
.engineering { border-top: 1px solid var(--rule); padding-top: 14px; }
.engineering summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--seal);
  padding: 4px 0;
}
.engineering summary::-webkit-details-marker { display: none; }
.engineering summary .chev { width: 13px; height: 13px; transition: transform .2s var(--ease); }
.engineering[open] summary .chev { transform: rotate(90deg); }

.contract-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}
.pipe-step {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  display: grid;
  gap: 4px;
  align-content: start;
}
.pipe-step:hover { border-color: var(--rule-strong); }
.pipe-step-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pipe-num { font: 500 11px ui-monospace, Consolas, monospace; color: var(--ink-3); }
.pipe-step-top code { font-size: 11.5px; color: var(--ink-2); }
.pipe-step strong { font-size: 13.5px; color: var(--ink); margin-top: 2px; font-weight: 500; }
.pipe-step small { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.pipe-step[aria-pressed="true"] { border-color: var(--seal); background: #FBF4F1; }
.pipe-step[aria-pressed="true"] .pipe-num,
.pipe-step[aria-pressed="true"] .pipe-step-top code,
.pipe-step[aria-pressed="true"] strong { color: var(--seal); }
.pipe-sep { display: grid; place-items: center; color: var(--ink-3); font-size: 14px; user-select: none; }

.contract-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 18px;
  margin-top: 16px;
  align-items: start;
}
.json-specimen {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.specimen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.specimen-title { display: flex; align-items: center; gap: 10px; }
.specimen-title strong { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.specimen-title code { font-size: 12px; color: var(--seal); }
.specimen-hint { font-size: 12px; color: var(--ink-3); }
.json-tree { display: grid; padding: 6px; gap: 2px; }
.json-row {
  text-align: left;
  width: 100%;
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  opacity: .56;
}
.json-row:hover { opacity: 1; background: var(--paper); }
.json-row.active-field { opacity: 1; background: var(--paper); border-left-color: var(--gold); }
.json-row[aria-pressed="true"] { opacity: 1; background: #FBF4F1; border-left-color: var(--seal); }
.json-key { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; align-self: start; }
.json-key code { font-size: 13px; font-weight: 500; color: var(--ink); }
.json-row[aria-pressed="true"] .json-key code { color: var(--seal); }
.type-badge { font: 400 10.5px ui-monospace, Consolas, monospace; color: var(--ink-3); }
.json-val { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.json-desc { grid-column: 2; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.specimen-foot { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--ink-3); background: var(--paper); border-top: 1px solid var(--rule); line-height: 1.6; }

.consumer-panel { display: grid; gap: 10px; }
.consumer-status {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--seal);
  border-radius: 10px;
  padding: 10px 14px;
}
.consumer-status code { color: var(--seal); }
.consumer-list { display: grid; gap: 10px; }
.consumer-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 13px 15px;
  opacity: .46;
}
.consumer-card.is-lit { opacity: 1; border-color: rgba(179, 46, 24, 0.45); }
.consumer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.consumer-tag { font-size: 11.5px; color: var(--seal); font-weight: 500; }
.consumer-head code { font-size: 12px; color: var(--ink); }
.binding-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 11.5px; color: var(--ink-2); }
.binding-expr { font-size: 12.5px; color: var(--ink-2); line-height: 1.68; }

/* ================= 板块三：真实的实时对话 ================= */
.live-section {
  padding-block: clamp(50px, 5.5vw, 76px);
}
.live-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  color: var(--ink-2);
  font-size: 13px;
}
.live-tool-btn:hover { border-color: var(--seal); color: var(--seal); }

.live-studio-shell {
  margin-top: 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
}
.live-fullscreen-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  background: var(--silk);
  border-bottom: 1px solid var(--rule);
}
.fs-brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-brand strong { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.fs-brand span { font-size: 12px; color: var(--ink-3); }

.live-frame-wrap {
  width: 100%;
  height: min(72vh, 660px);
  min-height: 540px;
}
.live-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}

.live-studio-shell.is-fullscreen {
  position: fixed;
  inset: 14px;
  z-index: 200;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 100vmax rgba(28, 24, 19, 0.56);
}
.live-studio-shell.is-fullscreen .live-fullscreen-bar { display: flex; }
.live-studio-shell.is-fullscreen .live-frame-wrap { flex: 1; height: auto; min-height: 0; }

/* ================= 页脚 ================= */
.site-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--rule);
  min-height: 74px;
}
.site-foot .brand strong { font-size: 16px; }
.site-foot small { color: var(--ink-3); font-size: 13px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.text-link:hover { color: var(--seal); }
.site-foot .text-link { margin-left: auto; }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .contract-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-sep { display: none; }
  .topo-beams { display: none; }
  .topology-board { padding: 18px; }
  .topology { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .stage-nodes { justify-content: flex-start; }
  .arch-controls { align-items: flex-start; }
}

@media (max-width: 960px) {
  .wrap { width: calc(100% - 44px); }
  .spread { grid-template-columns: 1fr; gap: 28px; }
  .reading-desk { grid-template-columns: 1fr; gap: 16px; }
  .flow-bridge { flex-direction: row; justify-content: center; }
  .bridge-line { width: 32px; height: 1px; }
  .contract-canvas { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .mast-inner { min-height: 56px; gap: 10px; }
  .mast nav { display: none; }
  .live-link { margin-left: auto; padding: 5px 12px; font-size: 13px; }
  .hero-workbench { padding: 20px 0 28px; }
  .hero-title { font-size: 28px; }
  .scene-menu { gap: 18px; }
  .cast-art { grid-template-columns: 1fr; gap: 18px; }
  .coin-stack { max-width: 220px; }
  .line-book { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--rule); }
  .chart-columns b { font-size: 26px; }
  .chart-meta { grid-template-columns: 1fr; }
  .contract-pipeline { grid-template-columns: 1fr; }
  .json-row { grid-template-columns: 1fr; gap: 3px; }
  .json-desc { grid-column: 1; }
  .topology { grid-template-columns: 1fr; }
  .stage-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-frame-wrap { height: 600px; min-height: 520px; }
  .live-studio-shell.is-fullscreen { inset: 0; border-radius: 0; }
  .site-foot { flex-wrap: wrap; padding-block: 14px; gap: 10px; }
  .site-foot .brand span, .site-foot .brand-sep { display: none; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 24px); }
  .stage-nodes { grid-template-columns: 1fr; }
  .scene-menu { gap: 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .astrolabe-bg { animation: none !important; }
  .beam-pulse { animation: none !important; opacity: 0; }
  .beam-active { stroke: rgba(179, 46, 24, 0.55); }
}
