/* 经确认的首屏：居中标题与四扇配置浮窗，不改为卡片墙。 */
.stage {
  position: relative;
  min-height: calc(100svh - var(--nav-h) - 64px);
  display: grid;
  align-content: center;
  padding-top: 28px;
  padding-bottom: 32px;
  overflow: hidden;
  isolation: isolate;
}
.stage-floor { position: absolute; inset: auto 0 0; height: 54%; z-index: -1; pointer-events: none; overflow: hidden; mask-image: linear-gradient(to top,var(--text) 35%,var(--clear) 100%); }
.stage-floor-plane {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -6%;
  height: 170%;
  background-image: linear-gradient(var(--bg-panel-2) 1px,var(--clear) 1px),linear-gradient(90deg,var(--bg-panel-2) 1px,var(--clear) 1px);
  background-size: 48px 48px;
  background-position: center bottom;
  transform: perspective(520px) rotateX(58deg);
  transform-origin: 50% 100%;
}
.stage-head { position: relative; max-width: 880px; margin-inline: auto; padding-inline: 24px; text-align: center; min-width: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 13px 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: var(--weight-medium);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.badge-dot { position: relative; width: 8px; height: 8px; border-radius: var(--radius-round); background: var(--accent); }
.badge-sep { color: var(--text-muted); }
.stage-title { margin: 18px 0 0; font-size: clamp(30px,2.2vw + 16px,48px); }
.stage-title-row { display: block; }
.stage-title-em { color: var(--accent); }
.stage-lede { margin: 16px auto 0; max-width: 720px; font-size: 17px; line-height: 1.6; color: var(--text-muted); }
.stage-lede strong { color: var(--text); font-weight: var(--weight-semibold); background: linear-gradient(var(--clear) 60%,var(--accent-soft) 60%); padding-inline: 2px; }
.stage-actions { margin-top: 26px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.platforms { margin: 22px 0 0; padding: 0; list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.platforms li + li { margin: 0; }
.platforms a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: var(--weight-medium);
  transition: color var(--speed) var(--ease),border-color var(--speed) var(--ease);
}
.platforms svg { width: 15px; height: 15px; color: var(--text); }
.platforms a:hover { color: var(--accent-dark); border-color: var(--accent); }
.platforms a:hover svg { color: var(--accent-dark); }
.bench {
  position: relative;
  margin-top: 36px;
  margin-bottom: -36px;
  padding: 10px max(24px,calc((100vw - 1200px) / 2 - 64px)) 36px;
  display: flex;
  gap: var(--bay-gap);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.bench::-webkit-scrollbar { display: none; }
.bench > li { flex: 0 0 var(--bay-w); min-width: 0; margin-top: 0; }
.bay { display: block; height: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; transition: transform var(--speed-card) var(--ease),box-shadow var(--speed-card) var(--ease); }
.bay:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); color: var(--text); }
.bay-field { position: relative; aspect-ratio: 3 / 2; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.bay-field::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--veil-light); }
.bay-field::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid-light) 1px,var(--clear) 1px),linear-gradient(90deg,var(--grid-light) 1px,var(--clear) 1px); background-size: 24px 24px; pointer-events: none; }
.bay-ghost { position: absolute; top: 18px; left: 42%; right: 20px; display: grid; gap: 8px; z-index: 1; }
.bay-ghost i { display: block; height: 8px; border-radius: var(--radius-line); background: var(--ghost-light); }
.bay-ghost i:last-child { width: 62%; }
.bay--jade .bay-field { background: linear-gradient(150deg,var(--accent),var(--accent-dark)); color: var(--on-accent); }
.bay--jade .bay-field::before { background: var(--veil-dark); }
.bay--jade .bay-field::after { background-image: linear-gradient(var(--grid-dark) 1px,var(--clear) 1px),linear-gradient(90deg,var(--grid-dark) 1px,var(--clear) 1px); }
.bay--jade .bay-ghost i { background: var(--ghost-dark); }
.bay--iris .bay-field { background: linear-gradient(160deg,color-mix(in srgb,var(--tint-iris) 58%,var(--bg)),var(--tint-iris)); color: var(--text); }
.bay--lime .bay-field { background: linear-gradient(160deg,color-mix(in srgb,var(--tint-lime) 55%,var(--bg)),var(--tint-lime)); color: var(--text); }
.bay--rose .bay-field { background: linear-gradient(160deg,color-mix(in srgb,var(--tint-rose) 55%,var(--bg)),var(--tint-rose)); color: var(--text); }
.float-win { position: relative; z-index: 2; width: 284px; margin-top: 18px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-float); overflow: hidden; text-align: left; min-width: 0; }
.float-win-bar { display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 5px 12px; background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: var(--weight-semibold); }
.float-win-dots { display: flex; gap: 4px; flex-shrink: 0; }
.float-win-dots i { width: 7px; height: 7px; border-radius: var(--radius-round); background: var(--border-strong); }
.float-win-tag { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: var(--weight-medium); color: var(--text-muted); }
.float-win-body { padding: 14px; }
.fw-label { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: var(--weight-semibold); color: var(--text-muted); }
.fw-row { display: flex; gap: 6px; }
.fw-input { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 32px; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.fw-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: var(--weight-bold); flex-shrink: 0; }
.fw-hint { margin: 9px 0 0; font-size: 11px; line-height: 1.4; color: var(--text-muted); }
.seg { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 3px; background: var(--bg-panel); color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-segment); }
.seg span { min-height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-segment-item); font-size: 12.5px; font-weight: var(--weight-semibold); }
.seg .is-on { background: var(--bg); color: var(--accent-dark); font-weight: var(--weight-bold); box-shadow: var(--shadow-xs); }
.mode-note { margin: 10px 0 0; font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.mode-note code { font-size: 11px; color: var(--text); }
.mode-note b { color: var(--accent-dark); font-weight: var(--weight-semibold); }
.rules { padding-block: 8px; overflow-x: auto; }
.rule-line { display: block; padding: 5px 14px 5px 12px; border-left: 2px solid var(--clear); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--text-muted); white-space: nowrap; }
.rule-line.is-hit { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); }
.rule-type { color: var(--text); font-weight: var(--weight-semibold); }
.rule-pol { color: var(--accent-dark); font-weight: var(--weight-semibold); }
.opts { padding-block: 2px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 12.5px; font-weight: var(--weight-semibold); color: var(--text); }
.opt + .opt { border-top: 1px solid var(--border); }
.switch { position: relative; width: 30px; height: 18px; flex-shrink: 0; border-radius: var(--radius-pill); background: var(--bg-panel-2); border: 1px solid var(--border-strong); }
.switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: var(--radius-round); background: var(--bg); box-shadow: var(--shadow-xs); }
.switch.is-on { background: var(--accent); border-color: var(--accent); }
.switch.is-on::after { transform: translateX(12px); }
.bay-text { padding: 18px 22px 22px; }
.bay-name { margin: 0; font-size: 18px; font-weight: var(--weight-heavy); letter-spacing: -.01em; line-height: 1.3; }
.bay-name::after { content: "→"; float: right; color: var(--text-muted); font-size: 16px; }
.bay-desc { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.next { padding: 24px 24px 120px; text-align: center; }
.next-eyebrow { margin: 0; font-size: 13px; font-weight: var(--weight-bold); letter-spacing: .04em; color: var(--accent-dark); }
.next-title { margin: 10px 0 0; font-size: 28px; line-height: 1.3; }

/* 交错浮窗长横段 */
.feature-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); align-items: center; gap: 80px; padding-top: 64px; padding-bottom: 64px; }
.feature-row + .feature-row { margin-top: 64px; }
.feature-row > * { min-width: 0; }
.feature-row:nth-child(even) .feature-copy { order: 2; }
.feature-copy h2 { font-weight: var(--weight-heavy); }
.feature-copy p { color: var(--text-muted); line-height: 1.85; }
.feature-link { font-weight: var(--weight-semibold); }
.feature-scene { position: relative; padding: 40px 30px 100px; border-radius: var(--radius); background: color-mix(in srgb,var(--accent) 12%,var(--bg)); color: var(--text); }
.feature-scene--iris { background: color-mix(in srgb,var(--tint-iris) 12%,var(--bg)); color: var(--text); }
.feature-scene--lime { background: color-mix(in srgb,var(--tint-lime) 12%,var(--bg)); color: var(--text); }
.feature-scene--rose { background: color-mix(in srgb,var(--tint-rose) 12%,var(--bg)); color: var(--text); }
.config-window { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); min-width: 0; overflow: hidden; }
.config-window pre { margin: 0; border: 0; border-radius: 0; background: var(--bg); color: var(--text); font-size: 12px; }
.config-line { display: block; }
.config-line.is-hit { background: var(--accent-soft); color: var(--accent-dark); }
.field-note { position: absolute; right: 12px; bottom: 20px; width: min(310px,calc(100% - 40px)); padding: 20px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-float); }
.field-note::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: var(--accent); }
.field-note p { margin: 8px 0 12px; font-size: 13px; color: var(--text-muted); }

/* 页内切换与目录 */
.tabs { min-width: 0; }
[role="tablist"] { display: flex; align-items: center; gap: 6px; padding: 6px; margin-bottom: 28px; max-width: 100%; overflow-x: auto; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
[role="tab"] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: 10px 18px; background: var(--clear); color: var(--text-muted); border: 1px solid var(--clear); border-radius: var(--radius-sm); font-size: 14px; font-weight: var(--weight-semibold); }
[role="tab"]:hover { background: var(--bg); color: var(--text); }
[role="tab"][aria-selected="true"] { background: var(--bg); color: var(--accent-dark); border-color: var(--border); box-shadow: var(--shadow-xs); }
[role="tabpanel"] { min-width: 0; }
.toc { position: sticky; top: calc(var(--nav-h) + 12px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin-block: 28px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.toc a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--text-muted); font-size: 14px; }
.toc a:hover, .toc a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); }

/* 内容组件 */
.faq-item { border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.faq-item summary { position: relative; list-style: none; padding: 24px 40px 24px 0; cursor: pointer; font-weight: var(--weight-semibold); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 24px; color: var(--accent-dark); font-size: 20px; line-height: 1.2; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 24px; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card, .client-card, .post-card { padding: 28px; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.term-card dt { font-family: var(--font-display); font-size: 21px; font-weight: var(--weight-heavy); }
.term-card dd { margin: 12px 0 0; color: var(--text-muted); }
.term-alias { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 12px; font-weight: var(--weight-medium); color: var(--text-muted); }
.client-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.client-head > div { min-width: 0; }
.app-icon { width: 56px; height: 56px; }
.client-head h3 { margin-bottom: 6px; }
.client-card p { color: var(--text-muted); }
.client-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-block: 16px; margin-bottom: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-rev]:empty { display: none; }
.status, .tag {
  display: inline-block;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: var(--weight-semibold);
  white-space: normal;
  overflow-wrap: anywhere;
}
.status--first, .status--recommended { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft); }
.status--archived { background: var(--bg-panel-2); color: var(--text-muted); }
.status--warning { background: var(--bg); color: var(--text); border-color: var(--warn); }
.status--error { background: var(--bg); color: var(--error); border-color: var(--error); }
.status--success { background: var(--bg); color: var(--accent-dark); border-color: var(--success); }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; color: var(--text-muted); font-size: 13px; }
.post-card h3 { font-size: 21px; line-height: 1.5; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent-dark); }
.post-card p { color: var(--text-muted); font-size: 14px; }
.post-link { font-size: 14px; font-weight: var(--weight-semibold); }
.callout { margin: 28px 0; padding: 22px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout--warning { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--error); }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg); color: var(--text); font-size: 14px; }
.data-table th, .data-table td, .prose table th, .prose table td, .article-body table th, .article-body table td {
  min-width: 7em;
  padding: 16px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-semibold); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
}
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; white-space: normal; }
.prose div, .article-body div { min-width: 0; max-width: 100%; }
.article-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 28px; margin-top: 56px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.article-download > div { flex: 1 1 240px; min-width: 0; }
.article-download h2 { font-size: 24px; margin-bottom: 8px; }
.article-download p { margin: 0; color: var(--text-muted); font-size: 14px; }
.dl-fab {
  position: fixed;
  right: max(20px,env(safe-area-inset-right));
  bottom: max(20px,env(safe-area-inset-bottom));
  z-index: var(--layer-fab);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: calc(100vw - 40px);
  min-height: 56px;
  padding: 12px 18px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
}
.dl-fab svg { width: 22px; height: 22px; color: var(--accent); }
.dl-fab strong { display: block; font-size: 14px; }
.dl-fab small { display: block; color: var(--text-muted); font-size: 12px; }
.dl-fab:hover { border-color: var(--accent); color: var(--accent-dark); }
.has-dl-fab .site-footer { padding-bottom: 112px; }

/* 预览页的令牌与状态陈列 */
.palette-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); color: var(--text); }
.swatch-sample { height: 72px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 12px; color: var(--text-muted); font-size: 12px; }
.swatch--bg .swatch-sample { background: var(--bg); color: var(--text); }
.swatch--panel .swatch-sample { background: var(--bg-panel); color: var(--text); }
.swatch--panel2 .swatch-sample { background: var(--bg-panel-2); color: var(--text); }
.swatch--border .swatch-sample { background: var(--border); color: var(--text); }
.swatch--strong .swatch-sample { background: var(--border-strong); color: var(--text); }
.swatch--accent .swatch-sample { background: var(--accent); color: var(--on-accent); }
.swatch--dark .swatch-sample { background: var(--accent-dark); color: var(--on-accent); }
.swatch--soft .swatch-sample { background: var(--accent-soft); color: var(--text); }
.swatch--text .swatch-sample { background: var(--text); color: var(--on-accent); }
.swatch--muted .swatch-sample { background: var(--text-muted); color: var(--on-accent); }
.swatch--faint .swatch-sample { background: var(--text-faint); color: var(--text); }
.swatch--success .swatch-sample { background: var(--success); color: var(--text); }
.swatch--warn .swatch-sample { background: var(--warn); color: var(--text); }
.swatch--error .swatch-sample { background: var(--error); color: var(--on-accent); }
.swatch--iris .swatch-sample { background: var(--tint-iris); color: var(--text); }
.swatch--lime .swatch-sample { background: var(--tint-lime); color: var(--text); }
.swatch--rose .swatch-sample { background: var(--tint-rose); color: var(--text); }
.type-display { font-family: var(--font-display); font-size: clamp(26px,3vw,40px); font-weight: var(--weight-display); line-height: 1.2; letter-spacing: -.02em; }
.type-mono { font-family: var(--font-mono); }
.preview-stack > * + * { margin-top: 24px; }
@media (max-width:900px) {
  .feature-row { gap: 36px; }
  .palette-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:768px) {
  .stage-title { font-size: clamp(24px,4vw,30px); }
  .feature-row { grid-template-columns: minmax(0,1fr); }
  .feature-row .feature-scene { order: -1; }
  .feature-row:nth-child(even) .feature-copy { order: 0; }
}
@media (max-width:640px) {
  .stage { padding-top: 22px; padding-bottom: 28px; }
  .badge { font-size: 12px; }
  .stage-title { margin-top: 14px; }
  .stage-lede { font-size: 15px; margin-top: 12px; }
  .stage-actions { margin-top: 20px; gap: 10px; }
  .platforms { margin-top: 18px; gap: 6px; }
  .platforms a { height: 30px; padding: 0 11px 0 9px; font-size: 13px; }
  .bench { margin-top: 26px; padding: 8px 20px 32px; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; }
  .bench > li { scroll-snap-align: start; }
  .float-win { width: calc(100% - 40px); max-width: 264px; margin-top: 14px; }
  .rule-line { font-size: 11px; padding-inline: 10px; }
  .bay-text { padding: 16px 18px 18px; }
  .bay-name { font-size: 17px; }
  .next-title { font-size: 22px; }
  .feature-row { padding-top: 32px; padding-bottom: 32px; }
  .feature-scene { padding: 24px 16px 120px; }
  .field-note { right: 50%; transform: translateX(50%); bottom: 16px; }
  .toc { position: static; }
  .term-card, .client-card, .post-card { padding: 22px; }
  .palette-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .article-download { padding: 22px; }
}
@media (prefers-reduced-motion:reduce) {
  .bay:hover { transform: none; }
}