/* 标签页：未加载脚本时，未带 hidden 的面板正常可读。 */
.tabs { min-width: 0; }
.tablist, [role="tablist"] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  color: var(--text-muted);
}
[role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--clear);
  border-radius: var(--radius-sm);
  background: var(--clear);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 24px;
}
[role="tab"]:hover { color: var(--text); }
[role="tab"][aria-selected="true"] { border-color: var(--border); background: var(--surface); color: var(--accent-dark); }
[role="tabpanel"] { min-width: 0; }
[role="tabpanel"]:focus-visible { outline-offset: 6px; }
.toc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.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); }
.toc--sticky { position: sticky; top: 16px; z-index: 10; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.faq-item + .faq-item { margin-top: 12px; }
.faq-item summary { position: relative; padding: 20px 52px 20px 22px; cursor: pointer; list-style: none; font-size: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 18px; color: var(--accent); font-size: 22px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item__body { padding: 20px 22px; color: var(--text-muted); }
.faq-item__body > :last-child { margin-bottom: 0; }
.term-card, .client-card, .post-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); min-width: 0; }
.term-card:hover, .client-card:hover, .post-card:hover { border-color: var(--border-strong); }
.term-card h3, .client-card h3, .post-card h3 { margin-bottom: 12px; font-size: 24px; }
.term-card__english { display: block; margin-bottom: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.term-card p, .client-card p, .post-card p { color: var(--text-muted); }
.client-card--lead { border-color: var(--accent); }
.client-card__head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.client-card__head > div { min-width: 0; }
.client-card__head h3 { margin-bottom: 6px; }
.client-card__icon { width: 56px; height: 56px; flex-shrink: 0; }
.client-card__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; color: var(--text-muted); font-size: 13px; }
.client-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-version]:empty { display: none; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge, .tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 20px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.badge--lead, .badge--recommended { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-soft); }
.badge--archive { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border-strong); }
.badge--success { background: var(--surface); color: var(--success); }
.badge--warn { background: var(--surface); color: var(--warn-ink); }
.badge--error { background: var(--surface); color: var(--error); }
.post-card { display: flex; flex-direction: column; align-items: flex-start; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 12px; color: var(--text-muted); }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card__link { margin-top: auto; padding-top: 8px; font-size: 14px; }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg-panel); color: var(--text-muted); }
.callout strong { color: var(--text); }
.callout > :last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--warn); }
.callout--error { border-left-color: var(--error); }
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; background: var(--surface); 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-panel); color: var(--text); font-weight: var(--weight-medium); }
.data-table td { color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: 0; }
/* 包括隔着 div 的裸表格；不允许表格的固有宽度撑破正文。 */
.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;
  background: var(--surface);
  color: var(--text);
}
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.feature-panel { padding: 32px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); }
.feature-panel:hover { border-color: var(--border-strong); }
.feature-panel__mark { display: block; width: 10px; height: 10px; margin-bottom: 24px; background: var(--accent); color: var(--surface); }
.feature-panel h3 { font-size: 32px; }
.feature-panel > p { min-height: 52px; color: var(--text-muted); }
.feature-field { margin-top: 28px; padding: 32px 22px; min-height: 220px; display: grid; align-content: center; overflow-x: clip; background: linear-gradient(118deg, var(--field-a), var(--field-b)); color: var(--text); border-radius: var(--radius-sm); }
.ui-slice { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.ui-slice pre { margin: 0; border: 0; background: var(--surface); color: var(--text); }
.ui-slice__label { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.ui-slice__options { list-style: none; margin: 0; padding: 8px; font-family: var(--font-mono); font-size: 13px; }
.ui-slice__options li { margin: 0; padding: 6px 10px; }
.ui-slice__options .is-current { background: var(--accent-soft); color: var(--accent-dark); border-radius: var(--radius-sm); }
.ui-slice--mode { padding: 24px; text-align: center; }
.article-download { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; margin-top: 48px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); }
.article-download > div { min-width: 0; }
.article-download h2 { margin: 0 0 8px; font-size: 24px; }
.article-download p { margin: 0; color: var(--text-muted); }
.article-download .btn { flex-shrink: 0; }
.dl-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--surface);
  box-shadow: var(--shadow-window);
  font-size: 14px;
  font-weight: var(--weight-medium);
}
.dl-fab:hover { background: var(--accent-dark); color: var(--surface); }
.dl-fab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
body.has-dl-fab .site-footer { padding-bottom: 100px; }

/* 仅预览页使用的令牌陈列。 */
.spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { margin: 0; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--text); }
.swatch__paint { height: 64px; border-bottom: 1px solid var(--border); }
.swatch figcaption { padding: 10px 12px; font-size: 12px; }
.swatch code { font-size: 12px; }
.swatch--bg .swatch__paint { background: var(--bg); color: var(--text); }
.swatch--panel .swatch__paint { background: var(--bg-panel); color: var(--text); }
.swatch--panel2 .swatch__paint { background: var(--bg-panel-2); color: var(--text); }
.swatch--surface .swatch__paint { background: var(--surface); color: var(--text); }
.swatch--border .swatch__paint { background: var(--border); color: var(--text); }
.swatch--strong .swatch__paint { background: var(--border-strong); color: var(--text); }
.swatch--accent .swatch__paint { background: var(--accent); color: var(--surface); }
.swatch--dark .swatch__paint { background: var(--accent-dark); color: var(--surface); }
.swatch--soft .swatch__paint { background: var(--accent-soft); color: var(--text); }
.swatch--text .swatch__paint { background: var(--text); color: var(--surface); }
.swatch--muted .swatch__paint { background: var(--text-muted); color: var(--surface); }
.swatch--faint .swatch__paint { background: var(--text-faint); color: var(--text); }
.swatch--success .swatch__paint { background: var(--success); color: var(--surface); }
.swatch--warn .swatch__paint { background: var(--warn); color: var(--text); }
.swatch--warn-ink .swatch__paint { background: var(--warn-ink); color: var(--surface); }
.swatch--error .swatch__paint { background: var(--error); color: var(--surface); }
.swatch--a .swatch__paint { background: var(--field-a); color: var(--text); }
.swatch--b .swatch__paint { background: var(--field-b); color: var(--text); }
.swatch--glow .swatch__paint { background: linear-gradient(var(--field-glow), var(--field-glow)), var(--field-a); color: var(--text); }
.swatch--wind .swatch__paint { background: var(--wind); color: var(--text); }
.swatch--clear .swatch__paint { background: var(--clear); color: var(--text); }
.swatch--veil .swatch__paint { background: var(--veil); color: var(--text); }
.preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.preview-type > * { margin-bottom: 20px; }
.preview-footer { margin-top: 40px; }
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-panel { padding: 24px; }
  .feature-panel h3 { font-size: 26px; }
  .feature-panel > p { min-height: 0; }
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-download { flex-direction: column; align-items: flex-start; padding: 24px; }
}
@media (max-width: 640px) {
  [role="tab"] { padding-inline: 12px; }
  .feature-field { padding: 24px 12px; }
  .term-card, .client-card, .post-card { padding: 20px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
}