/* 首页：已确认的排版与窗口 */
.hero { position: relative; overflow-x: clip; padding-top: 44px; padding-bottom: 32px; }
.hero::before {
  content: "";
  position: absolute;
  inset: -64px 0 0;
  background-image: radial-gradient(circle, var(--dot) 1px, var(--clear) 1.3px);
  background-size: 18px 18px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, var(--mask-solid) 18%, var(--clear) 78%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, var(--mask-solid) 18%, var(--clear) 78%);
  pointer-events: none;
}
.hero > .shell { z-index: 1; }
.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.notice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 0 12px 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  box-shadow: var(--shadow-hair);
  font-size: 13px;
  transition: border-color var(--quick), color var(--quick);
}
.notice:hover { border-color: var(--text-faint); color: var(--text); }
.notice-dot, .status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--success);
  color: var(--text);
  flex-shrink: 0;
}
.notice-dot { position: relative; }
.notice-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-pill);
  background: var(--success-ring);
  animation: notice-breathe 2.4s ease-in-out infinite;
}
@keyframes notice-breathe {
  0%, 100% { transform: scale(.55); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
}
.notice-text { white-space: nowrap; }
.notice-text b { font-weight: 500; color: var(--text); }
.notice-sep { color: var(--text-muted); margin: 0 2px; }
.notice svg { width: 13px; height: 13px; flex-shrink: 0; }
.hero-title {
  margin: 22px 0 0;
  font-size: clamp(28px, 2.6vw + 12px, 48px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-title > span { display: block; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.hero .btn { padding: 0 12px 0 18px; }
.hero .btn-solid { border: 0; }
.hero-lede {
  max-width: 720px;
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.hero-lede strong { font-weight: 500; color: var(--text); }
.os-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 30px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.os-row a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--quick);
}
.os-row a:hover { color: var(--text); }
.os-row svg { width: 14px; height: 14px; flex-shrink: 0; }

.editor {
  margin-top: 34px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-window);
  overflow: hidden;
}
.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.editor-file, .editor-doc { display: inline-flex; align-items: center; font-size: 13px; }
.editor-file { gap: 9px; }
.editor-file svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.editor-file code { font-size: 12.5px; }
.editor-doc { gap: 5px; transition: text-decoration-color var(--quick); }
.editor-doc svg { width: 12px; height: 12px; }
.editor-body { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); min-height: 340px; }
.canvas, .feature-canvas {
  background-color: var(--bg-panel-2);
  color: var(--text);
  background-image: radial-gradient(circle, var(--dot-soft) 1px, var(--clear) 1.3px);
  background-size: 16px 16px;
  background-position: 8px 8px;
}
.canvas {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 96px 28px 24px;
  border-right: 1px solid var(--border);
}
.flow { display: flex; flex-direction: column; align-items: center; width: 262px; min-width: 0; }
.node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-node);
}
.node-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-panel-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.node-icon svg { width: 13px; height: 13px; }
.node-icon--hit { background: var(--accent-wash); color: var(--accent-dark); border-color: var(--accent-line); }
.node-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.node-kicker { font-size: 11.5px; color: var(--text-muted); }
.node-main { font-size: 13.5px; }
.node-main.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.wire { position: relative; width: 1px; height: 28px; background: var(--border-strong); }
.wire::before, .wire::after, .branch-line::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
}
.wire::before, .wire::after { position: absolute; left: -3px; }
.wire::before { top: -4px; }
.wire::after { bottom: -4px; }
.branch { position: absolute; top: 50%; left: 100%; display: flex; align-items: center; transform: translateY(-50%); }
.branch-line { width: 52px; border-top: 1px dashed var(--text-faint); }
.branch-line::before { display: block; margin: -4px 0 0 -4px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hair);
  font: 400 12px/1.4 var(--font-mono);
  white-space: nowrap;
}
.pill--side { border-style: dashed; color: var(--text-muted); }
.rules { display: flex; flex-direction: column; min-width: 0; padding: 20px 22px 18px; background: var(--bg-panel); color: var(--text); }
.rules-lede { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-muted); }
.rules-lede code { font-size: 12.5px; color: var(--text); }
.yaml {
  margin: 14px 0 0;
  padding: 10px 0;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  line-height: 21px;
  counter-reset: yl;
  overflow-x: auto;
}
.yaml code { display: block; min-width: max-content; font: inherit; }
.yl { display: block; padding: 0 14px 0 0; white-space: pre; counter-increment: yl; }
.yl::before {
  content: counter(yl);
  display: inline-block;
  width: 34px;
  margin-right: 12px;
  padding-right: 10px;
  text-align: right;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}
.yl--hit { background: var(--accent-wash); color: var(--text); }
.yaml .k { color: var(--accent); }
.yaml .yl--hit .k { color: var(--accent-dark); }
.yaml :is(.p, .s) { color: var(--text-muted); }
.rules-note {
  display: flex;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}
.rules-note .mark { font-family: var(--font-mono); flex-shrink: 0; }
.rules-note code { font-size: 11.5px; color: var(--text); }

.get-band {
  position: relative;
  background: var(--bg-panel-2);
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: var(--section-top);
  padding-bottom: var(--section-bottom);
}
.band-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.band-title { margin: 0; font-size: 28px; }
.band-lede { max-width: 520px; margin: 0; font-size: 14.5px; color: var(--text-muted); }
.os-grid, .feature-browser {
  display: grid;
  gap: 1px;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.os-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.os-cell { min-width: 0; }
.os-cell a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 20px 20px 18px;
  background: var(--bg-panel);
  color: var(--text);
  transition: background-color var(--quick);
}
.os-cell a:hover { background: var(--bg); color: var(--text); }
.os-cell svg { width: 18px; height: 18px; margin-bottom: 8px; }
.os-cell:first-child a { border-start-start-radius: var(--radius-sm); }
.os-cell:last-child a { border-end-end-radius: var(--radius-sm); }
.os-name { font-size: 15px; font-weight: 500; }
.os-client { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.os-go { margin-top: 10px; font-size: 13px; }

/* 分类导航与资料浏览器 */
.tabs, .toc-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
}
[role="tab"], .toc-tabs a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: start;
  font-size: 14px;
}
[role="tab"]:is([aria-selected="true"], :hover:not(:disabled)), .toc-tabs a:hover {
  background: var(--bg-panel-2);
  color: var(--text);
}
[role="tab"][aria-selected="true"] { font-weight: 600; box-shadow: inset 0 -2px var(--accent); }
:is([role="tab"], .toc-tabs a):focus-visible { outline-offset: -3px; }
[role="tabpanel"] { min-width: 0; }
.toc-content > .toc-tabs--sticky { position: sticky; top: 0; z-index: 5; }
.toc-content [id] { scroll-margin-top: 76px; }
.feature-head { margin-bottom: 24px; }
.feature-head p { margin: 8px 0 0; color: var(--text-muted); }
.feature-browser { grid-template-columns: minmax(205px, 1fr) minmax(0, 2.8fr); }
.feature-tabs { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text); }
.feature-tabs [role="tab"] { justify-content: flex-start; min-height: 55px; padding-inline: 16px; border-radius: 0; }
.feature-tabs [role="tab"][aria-selected="true"] { box-shadow: inset 2px 0 var(--accent); }
.feature-panel { border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text); }
.feature-canvas { display: grid; place-items: center; min-height: 152px; padding: 18px 12px; border-bottom: 1px solid var(--border); }
.feature-canvas svg { display: block; width: min(100%, 500px); height: auto; }
.feature-canvas rect { fill: var(--bg-panel); stroke: var(--border-strong); rx: var(--radius); }
.feature-canvas path { fill: none; stroke: var(--text-muted); stroke-dasharray: 4 4; }
.feature-canvas text { fill: var(--text); font: 400 15px var(--font-mono); text-anchor: middle; dominant-baseline: middle; }
.feature-copy { padding: clamp(16px, 3vw, 28px); }
.feature-copy p { max-width: 68ch; color: var(--text-muted); }

/* 卡片、文档及下载 */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
}
.faq-item + .faq-item { margin-top: 8px; }
.faq-item summary { padding: 12px 16px; min-height: var(--touch); list-style: none; font-weight: 500; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; display: inline-block; width: 1.6em; color: var(--text-muted); font-family: var(--font-mono); }
.faq-item[open] summary::before { content: "−"; }
.faq-answer { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card dt { margin-bottom: 8px; font-weight: 600; }
.term-card dd { margin: 0; color: var(--text-muted); }
.client-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.client-head > div { min-width: 0; }
.client-mark { display: block; width: 56px; height: 56px; flex-shrink: 0; }
.client-meta, .badge-row, .client-actions, .button-samples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.client-actions { margin-top: 16px; }
.badge, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  gap: 7px;
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.badge--first { background: var(--bg-panel-2); color: var(--text); border-color: var(--text-muted); font-weight: 600; }
.badge--recommended { background: var(--bg-panel); color: var(--text); }
.badge--retired { border-style: dashed; }
.copy-feedback { color: var(--success-ink); }
.post-card { display: flex; flex-direction: column; align-items: flex-start; }
.post-card h3 { margin-top: 10px; text-wrap: pretty; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 13px; }
.post-meta time { font-family: var(--font-mono); }
.post-card > .text-link { margin-top: auto; }
.callout {
  margin: 1.2em 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-inline-start: 2px solid var(--text-muted);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  color: var(--text);
}
.callout > :last-child { margin-bottom: 0; }
.download-endcap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-block: 28px;
}
.download-endcap p { margin: 0; color: var(--text-muted); }
.dl-fab {
  position: fixed;
  z-index: 6;
  inset-inline-end: max(var(--gutter), env(safe-area-inset-right));
  inset-block-end: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  max-width: calc(100% - var(--gutter) * 2);
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-btn);
  font-weight: 500;
}
.dl-fab:hover { background: var(--accent-dark); color: var(--on-accent); }
.dl-fab svg { width: 16px; height: 16px; flex-shrink: 0; }
.blog-article-page .site-footer { padding-bottom: 56px; }

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.data-table, .prose table, .article-body table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  color: var(--text);
  text-align: start;
  font-size: 14px;
}
:is(.data-table, .prose table, .article-body table) :is(th, td) {
  min-width: 7em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: normal;
}
:is(.data-table, .prose table, .article-body table) th { background: var(--bg-panel-2); color: var(--text); font-weight: 600; }
:is(.data-table, .prose table, .article-body table) caption { padding: 10px 14px; color: var(--text-muted); text-align: start; }
:is(.data-table, .prose table, .article-body table) :is(th, td) code { overflow-wrap: anywhere; }
.prose table, .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; }
:where(.prose, .article-body) .table-wrap table { display: table; overflow: visible; }

/* 仅设计预览使用的样张排版 */
.preview-symbols { position: absolute; width: 0; height: 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(125px, 100%), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.swatch { padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); font-size: 12px; }
.swatch::before { content: ""; display: block; height: 32px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--sample); }
.sw-bg { --sample: var(--bg); }
.sw-panel { --sample: var(--bg-panel); }
.sw-panel2 { --sample: var(--bg-panel-2); }
.sw-border { --sample: var(--border); }
.sw-strong { --sample: var(--border-strong); }
.sw-accent { --sample: var(--accent); }
.sw-dark { --sample: var(--accent-dark); }
.sw-wash { --sample: var(--accent-wash); }
.sw-line { --sample: var(--accent-line); }
.sw-ink { --sample: var(--text); }
.sw-muted { --sample: var(--text-muted); }
.sw-faint { --sample: var(--text-faint); }
.sw-success { --sample: var(--success); }
.sw-ring { --sample: var(--success-ring); }
.sw-success-ink { --sample: var(--success-ink); }
.sw-warn { --sample: var(--warn); }
.sw-error { --sample: var(--error); }
.sw-on { --sample: var(--on-accent); }
.sw-dot { --sample: var(--dot); }
.sw-soft { --sample: var(--dot-soft); }
.sw-mask { --sample: var(--mask-solid); }
.sw-clear { --sample: var(--clear); }
.sw-veil { --sample: var(--veil); }
.sw-key { --sample: var(--key-line); }

@media (max-width: 1080px) {
  .os-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .branch-line { width: 26px; }
}
@media (max-width: 900px) {
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .canvas { border-right: 0; border-bottom: 1px solid var(--border); padding: 28px 110px 28px 16px; }
  .band-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 768px) {
  .hero-title { font-size: var(--h1-mobile); }
  .feature-browser { grid-template-columns: minmax(0, 1fr); }
  .feature-tabs { flex-direction: row; overflow-x: auto; overscroll-behavior-inline: contain; }
  .feature-tabs [role="tab"] { min-height: var(--touch); white-space: nowrap; }
  .feature-tabs [role="tab"][aria-selected="true"] { box-shadow: inset 0 -2px var(--accent); }
}
@media (max-width: 640px) {
  .hero { padding-top: 32px; }
  .notice-text { white-space: normal; }
  .notice { padding: 6px 12px; text-align: left; }
  .editor-file .dim { display: none; }
  .canvas { padding: 24px 12px 72px; }
  .flow { width: 100%; max-width: 262px; }
  .branch { display: none; }
  .rules { padding-inline: 14px; }
  .os-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-cell a { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .notice-dot::after { animation: none; opacity: .6; transform: none; }
}