/* Tab：面板由 tabs.js 切换 hidden，未加载脚本时正文仍可阅读。 */
.tabs { min-width: 0; }
.tabs [role="tablist"] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-frame);
  background: var(--bg-panel2);
  color: var(--text);
}
.tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--clear);
  border-radius: var(--r-pill);
  background: var(--clear);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}
.tabs [role="tab"] svg { width: 18px; height: 18px; flex-shrink: 0; }
.tabs [role="tab"]:hover { background: var(--bg); color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--bg); box-shadow: var(--shadow-soft); }
.tabs [role="tabpanel"] { min-width: 0; scroll-margin-top: 24px; }
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 16px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-frame);
  background: var(--bg);
  color: var(--text);
}
.toc a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--r-pill); text-decoration: none; font-size: 14px; }
.toc a:hover { background: var(--bg-panel2); color: var(--text); }
.toc a[aria-current] { border-color: var(--accent); color: var(--accent); }
.toc--sticky { position: sticky; top: 16px; z-index: 8; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 24px 40px 24px 0; cursor: pointer; list-style: none; font-weight: var(--weight-medium); color: var(--accent-dark); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 24px; font-size: 22px; line-height: 1.2; font-weight: var(--weight-normal); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { max-width: 76ch; padding-bottom: 24px; color: var(--text-muted); }
.faq-item__body p:last-child { margin-bottom: 0; }
.term-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--r-frame); background: var(--bg-panel2); color: var(--text); }
.term-card h3 { margin: 14px 0 8px; }
.term-card__english { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.term-card p { margin-bottom: 0; font-size: 15px; line-height: 1.8; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel2);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.chip--first, .chip--recommended { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.chip--archived { background: var(--bg-panel2); color: var(--text-muted); border-style: dashed; }
.chip--warning { color: var(--text); background: var(--bg); }
.chip--warning::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); color: var(--text); flex-shrink: 0; }
.chip--error { background: var(--bg); color: var(--error); }
.chip--success { background: var(--bg); color: var(--text); }
.chip--success::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); color: var(--text); flex-shrink: 0; }
.client-card { padding: 30px; border: 1px solid var(--border); border-radius: var(--r-frame); background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); }
.client-card--first { border-color: var(--accent); }
.client-card__head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.client-card__logo { width: 56px; height: 56px; flex-shrink: 0; }
.client-card__title { flex: 1; min-width: 0; }
.client-card h3 { margin: 0 0 5px; }
.client-card__version { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
[data-version]:empty { display: none; }
.client-card__body { margin-top: 20px; color: var(--text-muted); }
.client-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.post-card { display: flex; flex-direction: column; min-width: 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-frame); background: var(--bg); color: var(--text); box-shadow: var(--shadow-soft); }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12px; }
.post-card h3 { margin-block: 22px 14px; font-size: 25px; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.post-card p { flex: 1; font-size: 14px; color: var(--text-muted); line-height: 1.8; }
.post-card__link { color: var(--link); font-size: 14px; text-underline-offset: 3px; }
.callout { margin: 28px 0; padding: 24px 26px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-card); background: var(--bg-panel2); color: var(--text); }
.callout--warning { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--error); }
.callout p:last-child { margin-bottom: 0; }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: var(--r-card); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; 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: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel2); color: var(--text); font-weight: var(--weight-medium); }
.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;
  overscroll-behavior-inline: contain;
  background: var(--bg);
  color: var(--text);
}
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.article-body, .article-body > *, .prose div { min-width: 0; max-width: 100%; }
.dl-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  min-height: 54px;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-cta);
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--weight-medium);
}
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-fab:hover { background: var(--accent-dark); color: var(--bg); }
.article-download { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 30px; border: 1px solid var(--border); border-radius: var(--r-frame); background: var(--bg-panel2); color: var(--text); }
.article-download > * { min-width: 0; }
.article-download h2 { font-size: 26px; margin: 0 0 10px; }
.article-download p { margin: 0; color: var(--text-muted); font-size: 14px; }
.article-download .btn { flex-shrink: 0; }

/* 编辑部分栏：sticky 的直接父元素就是完整特性区。 */
.features { display: grid; grid-template-columns: minmax(0,38fr) minmax(0,62fr); gap: 0; align-items: start; }
.features__intro { position: sticky; top: 40px; padding-right: 48px; }
.features__intro h2 { margin-top: 0; }
.features__intro p { color: var(--text-muted); }
.features__list { min-width: 0; padding-left: 40px; border-left: 1px solid var(--accent-soft); }
.feature-row { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: center; gap: 24px; padding-top: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.feature-row:first-child { padding-top: 0; }
.feature-row:last-child { border-bottom: 0; }
.feature-row > * { min-width: 0; }
.feature-tile { position: relative; aspect-ratio: 4/3; border-radius: var(--r-frame); background: var(--bg-panel2); color: var(--accent-dark); overflow: hidden; }
.feature-tile--cream { background: var(--bg-cream); color: var(--accent-dark); }
.feature-tile .art { position: absolute; inset: 0; }
.feature-tile__note { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-inner); background: var(--bg); color: var(--text); box-shadow: var(--shadow-soft); font-family: var(--font-mono); font-size: 10px; overflow-wrap: anywhere; }
.feature-row h3 { margin: 0 0 14px; }
.feature-row p { font-size: 14px; line-height: 1.85; color: var(--text-muted); }
.feature-row .btn { min-height: 40px; padding: 8px 18px; font-size: 13px; }

/* 预览页专用展示家具，仍使用同一套令牌。 */
.preview-heading { margin-top: 0; margin-bottom: 30px; }
.swatches { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.swatch { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); overflow: hidden; }
.swatch__paint { height: 64px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 10px 14px; font-size: 12px; }
.paint-bg { background: var(--bg); color: var(--text); }
.paint-cream { background: var(--bg-cream); color: var(--text); }
.paint-panel { background: var(--bg-panel2); color: var(--text); }
.paint-border { background: var(--border); color: var(--text); }
.paint-accent { background: var(--accent); color: var(--bg); }
.paint-dark { background: var(--accent-dark); color: var(--bg); }
.paint-text { background: var(--text); color: var(--bg); }
.paint-muted { background: var(--text-muted); color: var(--bg); }
.paint-link { background: var(--link); color: var(--bg); }
.paint-apricot { background: var(--apricot); color: var(--text); }
.paint-line { background: var(--apricot-line); color: var(--text); }
.paint-sage { background: var(--frame-sage); color: var(--text); }
.paint-mist { background: var(--frame-mist); color: var(--text); }
.paint-sand { background: var(--frame-sand); color: var(--text); }
.paint-success { background: var(--success); color: var(--text); }
.paint-warn { background: var(--warn); color: var(--text); }
.paint-error { background: var(--error); color: var(--bg); }
.paint-soft { background: var(--accent-soft); color: var(--text); }
.paint-cream-line { background: var(--line-cream); color: var(--text); }
.paint-band { background: var(--band-tint); color: var(--text); }
.paint-ghost { background: var(--ghost-hover); color: var(--text); }
.paint-veil { background: var(--veil); color: var(--text); }
.paint-clear { background: var(--clear); color: var(--text); }
.preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.preview-type h2 { margin-top: 0; }
.preview-type__display { font-family: var(--font-display); font-size: var(--size-h1); line-height: 1.18; color: var(--accent-dark); }
.preview-footer-note { font-size: 13px; color: var(--text-muted); }
.preview-language { font-size: 14px; }
.preview-mobile-links { display: none; }
@media (max-width:1023px) {
  .features { grid-template-columns: 1fr; gap: 40px; }
  .features__intro { position: static; padding-right: 0; }
  .features__list { padding-left: 0; border-left: 0; }
  .feature-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .swatches { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:640px) {
  .tabs [role="tablist"] { gap: 6px; padding: 6px; }
  .tabs [role="tab"] { padding-inline: 14px; font-size: 14px; }
  .toc { padding: 12px; gap: 6px; }
  .toc a { padding-inline: 12px; font-size: 13px; }
  .client-card, .term-card, .post-card { padding: 22px; }
  .client-card__actions .btn { width: 100%; }
  .article-download { flex-direction: column; align-items: stretch; padding: 24px; }
  .dl-fab { right: 16px; bottom: max(16px,env(safe-area-inset-bottom)); min-height: 48px; padding: 10px 18px; }
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .feature-tile { width: 100%; }
  .swatches { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .preview-language { font-size: 12px; }
  .preview-mobile-links { display: block; }
}