/* 胶囊切换：每组外层使用 data-tabs，面板通过 aria-controls 对应。 */
.tabs { min-width: 0; }
[role="tablist"] {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  width: fit-content; max-width: 100%; margin: 0 auto 24px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg-panel); color: var(--text);
}
[role="tab"] {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px; max-width: 100%;
  border: 1px solid var(--clear); border-radius: var(--r-pill);
  font: 600 14px/1.5 var(--font-body);
  background: var(--clear); color: var(--text-muted); overflow-wrap: anywhere;
}
[role="tab"]:hover { background: var(--bg); color: var(--text); }
[role="tab"][aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
[role="tabpanel"] { min-width: 0; scroll-margin-top: 24px; }
.tab-detail {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 48px;
  padding: 40px; border: 1px solid var(--border); border-radius: var(--r-xl);
  background: var(--bg); color: var(--text); box-shadow: var(--shadow-1);
}
.tab-detail h3 { margin-top: 0; }
.tab-detail p { color: var(--text-muted); }
.tab-detail pre { margin: 0; align-self: center; }

/* 目录直接放在覆盖全部章节的父容器内。 */
.toc {
  position: sticky; top: 12px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 8px; min-width: 0;
  padding: 12px; margin-block: 24px 36px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg); color: var(--text); box-shadow: var(--shadow-1);
}
.toc a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; color: var(--text-muted); }
.toc a:hover, .toc a[aria-current] { background: var(--bg-panel); color: var(--accent-dark); }
.toc--flow { position: static; }
.faq-item { border-bottom: 1px solid var(--border); padding-block: 8px; }
.faq-item summary { position: relative; list-style: none; padding: 18px 40px 18px 0; font-weight: 600; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 16px; font: 400 22px/1.4 var(--font-mono); color: var(--accent); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 32px 18px 0; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); min-width: 0; }
.term-card h3 { margin: 12px 0; }
.term-card p { color: var(--text-muted); }
.term-en { font: 500 12px/1.6 var(--font-mono); color: var(--text-muted); }
.status-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  max-width: 100%; min-height: 26px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere;
  background: var(--bg-panel); color: var(--text-muted);
}
.status-badge--first, .status-badge--recommended { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-line); }
.status-badge--archived { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border-strong); }
.client-card { position: relative; min-width: 0; padding: 30px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); }
.client-card--first { border-color: var(--accent-line); }
.client-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.client-head h3 { margin: 0; }
.client-card p { margin-top: 16px; color: var(--text-muted); }
.client-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-block: 16px; font: 400 12px/1.6 var(--font-mono); color: var(--text-muted); }
[data-ver]:empty { display: none; }
.client-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.article-card { display: flex; flex-direction: column; min-width: 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); transition: box-shadow .25s var(--ease),transform .25s var(--ease); }
.article-card:hover { box-shadow: var(--shadow-1-hover); transform: translateY(-2px); }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-muted); }
.article-card h3 { margin-block: 18px 12px; font-size: 20px; }
.article-card p { color: var(--text-muted); }
.article-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--error); }
.callout--success { border-left-color: var(--success); }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; margin-block: 24px; border: 1px solid var(--border); border-radius: var(--r-md); overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; background: var(--bg); color: var(--text); font-size: 13px; }
.data-table th, .data-table td, .prose table th, .prose table td, .article-body table th, .article-body table td {
  min-width: 7em; padding: 14px 18px; 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: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table caption { padding: 16px; text-align: left; color: var(--text-muted); }
.prose table, .article-body table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 100%; min-width: 0; border-collapse: collapse;
  overscroll-behavior-inline: contain;
}
.prose table code, .article-body table code { overflow-wrap: anywhere; }
.article-download {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  margin-top: 48px; padding: 28px; border: 1px solid var(--border);
  border-radius: var(--r-xl); background: var(--bg-panel); color: var(--text);
}
.article-download h3 { margin: 0 0 8px; }
.article-download p { margin: 0; color: var(--text-muted); }
.dl-fab {
  position: fixed; z-index: 30; right: max(20px,env(safe-area-inset-right)); bottom: max(20px,env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  max-width: calc(100vw - 32px); min-height: 60px; padding: 12px 20px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); color: var(--text); box-shadow: var(--shadow-float);
}
.dl-fab svg { width: 22px; height: 22px; color: var(--accent); }
.dl-fab span { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 14px; }
.dl-fab small { font-size: 11px; font-weight: 400; color: var(--text-muted); }

/* 协议管线，所有层共用一条几何路径。 */
.proto { position: relative; overflow-x: clip; padding-top: 58px; padding-bottom: 96px; }
.proto::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg,var(--clear),var(--border) 18%,var(--border) 82%,var(--clear)); }
.proto-head { max-width: 880px; margin-inline: auto; padding-inline: var(--gutter); text-align: center; }
.h2 { margin: 16px 0 0; font-size: clamp(26px,2.4vw,36px); }
.h2 span { display: block; color: var(--text-muted); }
.proto-lede { margin: 14px auto 0; max-width: 620px; font-size: 15.5px; color: var(--text-muted); }
.pipe { position: relative; width: 100%; height: clamp(180px,18.05vw,300px); margin-top: 26px; }
.pipe > svg { position: absolute; inset: 0; width: 100%; height: 100%; mask-image: linear-gradient(90deg,var(--mask-none),var(--mask-solid) 9%,var(--mask-solid) 91%,var(--mask-none)); }
.pipe-shade { stroke: var(--pipe-shade); stroke-width: 30; }
.pipe-edge { stroke: var(--pipe-edge); stroke-width: 28; }
.pipe-base { stroke: var(--pipe-base); stroke-width: 25; }
.pipe-mid { stroke: var(--pipe-mid); stroke-width: 13; }
.pipe-hi { stroke: var(--pipe-hi); stroke-width: 4; opacity: .95; }
.tile { position: absolute; width: 68px; height: 68px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--bg); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-float); translate: -50% -50%; transform: rotate(var(--tilt,0deg)); }
.tile b { font: 800 19px/1 var(--font-display); letter-spacing: -.02em; }
.tile span { position: absolute; top: calc(100% + 12px); left: 50%; translate: -50% 0; font: 500 11.5px/1.5 var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.tile--ss { left: 11.806%; top: 46.15%; --tilt: -5deg; }
.tile--vm { left: 28.472%; top: 57.69%; --tilt: 4deg; }
.tile--tj { left: 45.139%; top: 42.31%; --tilt: -3deg; }
.tile--vl { left: 61.806%; top: 56.92%; --tilt: 5deg; }
.tile--hy { left: 78.472%; top: 45.38%; --tilt: -4deg; }
.tile--tu { left: 90.972%; top: 53.85%; --tilt: 3deg; }
.scenes { max-width: var(--maxw); margin: 28px auto 0; padding-inline: var(--gutter); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.scene { padding: 6px 40px 4px; border-left: 1px solid var(--border); min-width: 0; }
.scene h3 { margin: 0 0 12px; }
.scene p { color: var(--text-muted); margin: 0; }

/* 功能格阵：12 个内容格，两个示意格横跨两列。 */
.feature-matrix {
  display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 1px;
  padding: 1px; margin-bottom: 40px; background: var(--border); color: var(--text);
  mask-image: linear-gradient(90deg,var(--mask-none),var(--mask-solid) 3%,var(--mask-solid) 97%,var(--mask-none));
}
.feature-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-width: 0; min-height: 160px; padding: 22px 14px; text-align: center; background: var(--bg); color: var(--text-muted); font-size: 13px; }
.feature-cell > svg { width: 26px; height: 26px; }
.feature-cell--wide { grid-column: span 2; align-items: flex-start; text-align: left; background: linear-gradient(140deg,var(--bg),var(--bg-panel-2)); color: var(--text); }
.feature-cell pre { width: 100%; margin: 0; padding: 10px; font-size: 10px; background: var(--bg); color: var(--text); box-shadow: var(--shadow-1); }
.swatch-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.swatch { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); color: var(--text); }
.swatch-color { height: 48px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 12px; font-size: 11px; }
.swatch--bg { background: var(--bg); }
.swatch--panel { background: var(--bg-panel); }
.swatch--panel2 { background: var(--bg-panel-2); }
.swatch--border { background: var(--border); }
.swatch--border-strong { background: var(--border-strong); }
.swatch--accent { background: var(--accent); }
.swatch--accent-dark { background: var(--accent-dark); }
.swatch--accent-soft { background: var(--accent-soft); }
.swatch--accent-line { background: var(--accent-line); }
.swatch--pink { background: var(--grad-pink); }
.swatch--sky { background: var(--grad-sky); }
.swatch--text { background: var(--text); }
.swatch--muted { background: var(--text-muted); }
.swatch--faint { background: var(--text-faint); }
.swatch--decoration { background: var(--decoration); }
.swatch--success { background: var(--success); }
.swatch--halo { background: var(--success-halo); }
.swatch--warn { background: var(--warn); }
.swatch--error { background: var(--error); }
.swatch--rail { background: var(--rail-bg); }
.swatch--rail-ink { background: var(--rail-ink); }
.swatch--rail-chip { background: var(--rail-chip); }
.swatch--edge { background: var(--pipe-edge); }
.swatch--base { background: var(--pipe-base); }
.swatch--mid { background: var(--pipe-mid); }
.swatch--hi { background: var(--pipe-hi); }
.swatch--shade { background: var(--pipe-shade); }
.swatch--clear { background: var(--clear); }
.swatch--solid { background: var(--mask-solid); }
.swatch--none { background: var(--mask-none); }
.swatch--veil { background: var(--veil); }
.preview-block { border-top: 1px solid var(--border); }
.preview-label { margin: 0 0 24px; font: 500 12px/1.6 var(--font-mono); color: var(--text-muted); }
.preview-title { margin: 0 0 28px; }
.preview-type-display { font: 800 clamp(34px,3.35vw,48px)/1.13 var(--font-display); letter-spacing: -.02em; }
.preview-type-subtitle { font-size: 20px; color: var(--text-muted); }
.preview-footer { margin-top: 40px; }
@media (max-width: 1100px) {
  .feature-matrix { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .scene { padding-inline: 24px; }
}
@media (max-width: 768px) {
  .tab-detail { grid-template-columns: minmax(0,1fr); gap: 24px; padding: 26px; }
  .swatch-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .scenes { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .scene { padding-inline: 20px; }
}
@media (max-width: 640px) {
  [role="tablist"] { border-radius: var(--r-lg); gap: 4px; justify-content: center; }
  [role="tab"] { font-size: 12px; padding-inline: 13px; }
  .toc { position: static; }
  .client-card, .article-card, .term-card, .tab-detail { padding: 22px; }
  .swatch-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .feature-matrix { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .feature-cell { min-height: 132px; }
  .feature-cell--wide { grid-column: span 2; }
  .pipe { height: 190px; }
  .tile { width: 43px; height: 48px; border-radius: var(--r-sm); transform: none; }
  .tile b { font-size: 13px; }
  .tile span { font-size: 8px; }
  .tile--ss { left: 9%; }
  .tile--vm { left: 25%; }
  .tile--tj { left: 41%; }
  .tile--vl { left: 57%; }
  .tile--hy { left: 73%; }
  .tile--tu { left: 89%; }
  .dl-fab { right: 16px; bottom: max(16px,env(safe-area-inset-bottom)); min-height: 54px; padding: 10px 15px; }
  .has-dl-fab .site-footer { padding-bottom: 110px; }
  .preview-type-display { font-size: 30px; }
}