/* 定位标记与页首。 */
.pin { position: absolute; width: var(--mark); height: var(--mark); background: var(--accent); color: var(--on-ink); pointer-events: none; }
.pin--tl { top: var(--edge); left: var(--edge); }
.pin--tr { top: var(--edge); right: var(--edge); }
.pin--bl { bottom: var(--edge); left: var(--edge); }
.pin--br { bottom: var(--edge); right: var(--edge); }
.page-head { position: relative; overflow-x: clip; padding-top: 100px; padding-bottom: 100px; background: var(--panel); color: var(--text); }
.page-head h1 { max-width: 900px; margin-top: 0; }
.page-head .lead { max-width: 680px; }

/* 拍板首屏：常规字重三行标题与静态配置切片。 */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-h) - var(--peek-h));
  min-height: 700px;
  max-height: 960px;
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  padding-inline: 24px;
  overflow: hidden;
}
.hero__visual { position: absolute; inset: 0; pointer-events: none; }
.hero__core { position: relative; z-index: 2; width: 100%; max-width: 760px; text-align: center; }
.proto-chips { list-style: none; margin: 0 0 28px; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.proto-chips li { margin: 0; font-family: var(--font-mono); font-size: 11.5px; line-height: 1; color: var(--muted); padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel); }
.hero__title { margin: 0; font-family: var(--font-display); font-weight: var(--weight-normal); font-size: clamp(28px, 3.4vw, 48px); line-height: 1.14; letter-spacing: -.035em; color: var(--faint); }
.hero__line { display: block; animation: line-rise .62s var(--ease-out) both; }
.hero__line--ink { color: var(--text); animation-delay: .16s; }
.hero__line--last { animation-delay: .32s; }
@keyframes line-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.hero__lead { margin: 26px auto 0; max-width: 620px; font-family: var(--font-serif); font-size: var(--text-lead); line-height: 1.72; color: var(--text-2); }
.hero__lead strong { font-weight: var(--weight-bold); color: var(--text); }
.hero__cta { margin-top: 34px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.os-row { list-style: none; margin: 30px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 30px; }
.os-row li { margin: 0; }
.os-row a { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; line-height: 1; color: var(--muted); text-decoration: none; transition: color var(--duration) ease; }
.os-row a:hover { color: var(--text); }
.os-row svg { width: 15px; height: 15px; flex-shrink: 0; }

.cut { position: absolute; z-index: 1; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-slice); overflow: hidden; }
.cut--tone { background: var(--panel-2); color: var(--text); }
.cut--bleed-l { border-left: 0; border-radius: 0 var(--r-card) var(--r-card) 0; }
.cut--bleed-r { border-right: 0; border-radius: var(--r-card) 0 0 var(--r-card); }
.cut__bar { display: flex; align-items: center; gap: 10px; height: 28px; padding-inline: 12px; border-bottom: 1px solid var(--border); background: var(--panel); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .01em; color: var(--muted); white-space: nowrap; }
.cut--tone .cut__bar { background: var(--panel-2); color: var(--muted); }
.cut--bleed-l .cut__bar { padding-left: 22px; }
.cut__dots { display: inline-flex; gap: 4px; flex-shrink: 0; }
.cut__dots i { display: block; width: 6px; height: 6px; border-radius: var(--r-circle); border: 1px solid var(--border-strong); flex-shrink: 0; }
.jsn { padding-top: 9px; font-family: var(--font-mono); font-size: 11.5px; line-height: 19px; color: var(--code-punc); }
.jsn__ln { display: block; white-space: pre; padding-right: 14px; }
.jsn__ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 36px; padding-right: 14px; text-align: right; color: var(--code-gutter); }
.jsn__ln--mark { background: var(--panel-2); color: var(--code-punc); }
.cut--tone .jsn__ln--mark { background: var(--panel); color: var(--code-punc); }
.jk, .jn { color: var(--text); }
.js { color: var(--code-str); }
.jsn--inbounds { counter-reset: ln 21; }
.jsn--routing { counter-reset: ln 63; }
.jsn--dns { counter-reset: ln 7; }
.opt-list { list-style: none; margin: 0; padding-block: 6px; }
.opt-list li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 14px; font-size: 13px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.opt-list li.is-on { color: var(--text); }
.opt-radio { position: relative; width: 13px; height: 13px; flex-shrink: 0; border-radius: var(--r-circle); border: 1.5px solid var(--faint); }
.is-on .opt-radio { border-color: var(--text); }
.is-on .opt-radio::after { content: ""; position: absolute; inset: 2px; border-radius: var(--r-circle); background: var(--text); color: var(--on-ink); }
.ng-top { display: flex; align-items: center; justify-content: space-between; height: 40px; padding-inline: 12px; font-size: 13.5px; font-weight: var(--weight-medium); color: var(--text); }
.ng-top__lead { display: flex; align-items: center; gap: 10px; }
.ng-top__lead svg { width: 15px; height: 15px; color: var(--muted); }
.ng-plus { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-circle); background: var(--border); color: var(--text); }
.ng-plus svg { width: 14px; height: 14px; }
.ng-menu { position: absolute; right: 10px; top: 62px; width: 172px; margin: 0; padding-block: 5px; list-style: none; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-pop); box-shadow: var(--shadow-pop); }
.ng-menu li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.35; color: var(--text); white-space: nowrap; }
.ng-menu svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); }
.core-pick { padding: 12px 14px 14px; }
.core-pick__label { display: block; margin-bottom: 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.core-select { display: flex; align-items: center; justify-content: space-between; height: 32px; padding-inline: 10px; border: 1px solid var(--border-strong); border-radius: var(--r-ctrl); background: var(--panel); color: var(--text); font-family: var(--font-mono); font-size: 12.5px; }
.core-select svg { width: 12px; height: 12px; color: var(--muted); }
.core-list { list-style: none; margin: 6px 0 0; padding: 4px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.core-list li { display: flex; align-items: center; justify-content: space-between; height: 28px; margin: 0; padding-inline: 8px; border-radius: var(--r-focus); font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.core-list li.is-sel { background: var(--panel-2); color: var(--text); }
.core-list svg { width: 12px; height: 12px; }
.cut--sys { left: 64px; top: 7%; width: 232px; }
.cut--routing { left: -28px; top: 36%; width: 300px; height: 196px; }
.cut--dns { left: 92px; top: 66%; width: 256px; height: 150px; }
.cut--inbounds { right: -28px; top: 12%; width: 304px; height: 244px; }
.cut--ng { right: 84px; top: 49%; width: 236px; height: 150px; }
.cut--core { right: 44px; top: 71%; width: 232px; }
.next-band { position: relative; overflow-x: clip; background: var(--bg); color: var(--text); border-top: 1px solid var(--border); padding: 120px var(--edge) 140px; }
.next-band__in { max-width: 1120px; margin-inline: auto; }

/* 分栏标签条和工作台。 */
.tabs { min-width: 0; }
.tablist, [role="tablist"].tablist {
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.tab {
  position: relative;
  flex: 1 0 0;
  min-width: 7em;
  min-height: 74px;
  padding: 20px 18px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.5;
}
.tab:last-child { border-right: 0; }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; width: var(--mark); height: var(--mark); background: var(--accent); color: var(--on-ink); }
.tab:hover { background: var(--bg); color: var(--text); }
.tabpanel { min-width: 0; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); align-items: center; gap: 48px; padding: 64px 48px; background: var(--panel-2); color: var(--text); }
.client-window { overflow: hidden; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-pop); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.client-window__bar { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: var(--text-xs); color: var(--muted); }
.client-window__body { display: grid; grid-template-columns: 130px minmax(0, 1fr); min-height: 260px; }
.client-window__menu { margin: 0; padding: 20px 12px; list-style: none; border-right: 1px solid var(--border); font-size: var(--text-xs); }
.client-window__menu li { padding: 9px 10px; margin: 0; border-radius: var(--r-ctrl); }
.client-window__menu .is-current { background: var(--panel-2); color: var(--text); }
.client-window__content { padding: 24px; font-size: var(--text-sm); }
.client-window__content pre { padding: 14px; margin: 16px 0 0; border: 0; background: var(--bg); color: var(--text); font-size: var(--text-xs); }
.workbench__note p { color: var(--text-2); font-size: var(--text-sm); line-height: 1.9; }
.workbench__note h3 { margin-top: 0; }
.setting-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--border); }

/* 长文目录的直接父级必须覆盖所有章节。 */
.doc-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 64px; align-items: start; }
.toc { position: sticky; top: 28px; border-left: 1px solid var(--border); font-size: var(--text-sm); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 9px 18px; color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current] { color: var(--text); background: var(--panel-2); }
.toc--inline { display: flex; gap: 12px; flex-wrap: wrap; position: static; border-left: 0; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.toc--inline a { padding: 8px 14px; }
.json-window { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-pop); box-shadow: var(--shadow-pop); }
.json-window pre { margin: 0; border: 0; box-shadow: none; }

/* 内容卡与原生折叠项。 */
.faq-item { border-bottom: 1px solid var(--border); padding-block: 4px; }
.faq-item summary { position: relative; min-height: 64px; padding: 18px 40px 18px 0; list-style: none; font-weight: var(--weight-medium); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 17px; font-family: var(--font-mono); font-size: var(--text-lead); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__answer { padding-bottom: 20px; color: var(--text-2); }
.faq-item__answer p:last-child { margin-bottom: 0; }
.term-card { border-top: 1px solid var(--text); box-shadow: none; }
.term-card__name { margin: 0 0 8px; font-family: var(--font-mono); font-size: var(--text-lead); }
.term-card__category { margin-bottom: 18px; color: var(--muted); font-size: var(--text-xs); }
.term-card p { font-size: var(--text-sm); }
.download-card { padding: 32px; }
.download-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.download-card__head h3 { margin: 0; }
.app-icon { width: 56px; height: 56px; flex-shrink: 0; }
.download-card__meta { color: var(--muted); font-family: var(--font-mono); font-size: var(--text-xs); margin-bottom: 20px; }
.download-card__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.badge, .tag {
  display: inline-block;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text);
  font-size: var(--text-xs);
  line-height: 1.5;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.badge--first { background: var(--text); color: var(--on-ink); border-color: var(--text); }
.badge--recommended { background: var(--panel-2); color: var(--text); }
.badge--retired { background: var(--panel-2); color: var(--muted); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.article-card { display: flex; flex-direction: column; }
.article-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--muted); font-size: var(--text-xs); }
.article-card h3 { font-size: var(--text-lead); line-height: 1.6; }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.article-card p { color: var(--muted); font-size: var(--text-sm); }
.article-card__link { margin-top: auto; padding-top: 12px; font-size: var(--text-sm); }
.callout { margin: 28px 0; padding: 24px 28px; border: 1px solid var(--border); border-left: 2px solid var(--text); border-radius: var(--r-ctrl); background: var(--panel-2); color: var(--text-2); }
.callout p:last-child { margin-bottom: 0; }
.callout--notice { border-left-color: var(--warn); }
.callout--success { border-left-color: var(--success); }
.callout--error { border-left-color: var(--error); }
.article-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 32px; margin-block: 48px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--panel); color: var(--text); }
.article-download__copy { flex: 1 1 240px; }
.article-download h2 { margin: 0 0 8px; font-size: var(--text-h3); }
.article-download p { margin: 0; color: var(--muted); font-size: var(--text-sm); }

/* 外包横滑与后代裸表格双重防御，不压缩单元格。 */
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: var(--panel); color: var(--text); font-size: var(--text-sm); }
.data-table th, .data-table td, .prose table th, .prose table td {
  min-width: 7em;
  padding: 16px 20px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: normal;
}
.data-table th, .prose table th { background: var(--panel-2); color: var(--text); font-weight: var(--weight-medium); }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  overscroll-behavior-inline: contain;
  background: var(--panel);
  color: var(--text);
}
.data-table code, .prose table code { overflow-wrap: anywhere; word-break: normal; }

.dl-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--layer-fab);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--text);
  color: var(--on-ink);
  border: 1px solid var(--text);
  border-radius: var(--r-pop);
  box-shadow: var(--shadow-fab);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  text-decoration: none;
  transition: background-color var(--duration) ease;
}
.dl-fab:hover { background: var(--ink-hover); color: var(--on-ink); }
.dl-fab svg { width: 15px; height: 15px; flex-shrink: 0; }

/* 预览色板只使用令牌，不引入第二套配色。 */
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.swatch { min-width: 0; margin: 0; }
.swatch__paint { height: 76px; border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text); }
.swatch figcaption { margin-top: 8px; font-size: var(--text-xs); font-family: var(--font-mono); overflow-wrap: anywhere; }
.swatch--bg { background: var(--bg); }
.swatch--panel { background: var(--panel); }
.swatch--panel-2 { background: var(--panel-2); }
.swatch--border { background: var(--border); }
.swatch--border-strong { background: var(--border-strong); }
.swatch--accent { background: var(--accent); color: var(--on-ink); }
.swatch--accent-dark { background: var(--accent-dark); color: var(--on-ink); }
.swatch--text { background: var(--text); color: var(--on-ink); }
.swatch--text-2 { background: var(--text-2); color: var(--on-ink); }
.swatch--muted { background: var(--muted); color: var(--on-ink); }
.swatch--faint { background: var(--faint); }
.swatch--code-gutter { background: var(--code-gutter); }
.swatch--code-str { background: var(--code-str); color: var(--on-ink); }
.swatch--code-punc { background: var(--code-punc); }
.swatch--ink-hover { background: var(--ink-hover); color: var(--on-ink); }
.swatch--on-ink { background: var(--on-ink); }
.swatch--success { background: var(--success); color: var(--text); }
.swatch--warn { background: var(--warn); color: var(--text); }
.swatch--error { background: var(--error); color: var(--on-ink); }
.swatch--veil { background: var(--veil); }
.swatch--clear { background: var(--clear); }
.preview-stack { display: grid; gap: 32px; }
.preview-subsection { margin-top: 56px; }
.preview-type-title { margin: 0; font-size: var(--text-h1); font-weight: var(--weight-normal); }

@media (max-width: 1360px) {
  .cut--sys { left: 36px; width: 206px; }
  .cut--routing { width: 240px; }
  .cut--dns { left: 44px; width: 214px; }
  .cut--inbounds { width: 250px; }
  .cut--ng { right: 44px; width: 192px; }
  .cut--ng .ng-menu { width: 160px; }
  .cut--core { right: 32px; width: 206px; }
}
@media (max-width: 1200px) {
  .hero { height: auto; min-height: 0; max-height: none; display: flex; flex-direction: column; align-items: center; padding: 72px 24px 80px; }
  .hero__visual { display: contents; }
  .cut { position: relative; left: auto; right: auto; top: auto; }
  .cut--sys, .cut--dns, .cut--ng, .cut--core { display: none; }
  .cut--routing, .cut--inbounds { width: min(440px, 100%); border: 1px solid var(--border); border-radius: var(--r-card); }
  .cut--routing { order: 0; height: 176px; margin-bottom: 48px; }
  .cut--routing .cut__bar { padding-left: 12px; }
  .hero__core { order: 1; }
  .cut--inbounds { order: 2; height: 178px; margin-top: 52px; }
}
@media (max-width: 960px) {
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px; }
  .doc-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 760px) {
  .hero { padding: 56px 18px 64px; }
  .hero__title { font-size: clamp(24px, 7vw, 30px); line-height: 1.2; }
  .hero__lead { font-size: var(--text-base); margin-top: 20px; }
  .proto-chips { margin-bottom: 22px; }
  .hero__cta { margin-top: 26px; }
  .os-row { gap: 12px 22px; margin-top: 24px; }
  .cut--routing { margin-bottom: 36px; }
  .cut--inbounds { margin-top: 40px; }
  .next-band { padding: 80px 20px 96px; }
  .dl-fab { right: 16px; bottom: 16px; }
  .tablist { gap: 8px; border: 0; padding-block: 4px; background: var(--clear); color: var(--text); }
  .tab { flex: 0 0 auto; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--text-sm); }
  .tab:last-child { border-right: 1px solid var(--border); }
  .tab[aria-selected="true"]::before { top: 3px; left: 9px; }
  .workbench { margin-top: 12px; padding: 24px 18px; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .client-window__body { grid-template-columns: 92px minmax(0, 1fr); }
  .client-window__menu { padding: 12px 5px; }
  .client-window__menu li { padding: 10px 5px; }
  .client-window__content { padding: 16px 12px; }
  .download-card { padding: 22px; }
  .hero { padding-top: 32px; }
  .hero .cut--routing { height: 98px; margin-bottom: 28px; }
  .hero__title { letter-spacing: -.02em; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__line { animation: none; opacity: 1; transform: none; }
}