.rulewin {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-edge), var(--shadow-float);
  transform: translateY(-10px);
  overflow: hidden;
}
.rulewin__bar { min-height: 40px; padding: 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--panel); color: var(--text); border-bottom: 1px solid var(--border); }
.dots { display: flex; gap: 7px; }
.dots i { width: 10px; height: 10px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--border-strong); }
.wintitle { font-size: 13px; color: var(--muted); white-space: nowrap; }
.wintitle code { font-size: 12.5px; color: var(--text); }
.seg { justify-self: end; display: inline-flex; gap: 2px; padding: 2px; background: var(--panel-2); color: var(--muted); border-radius: var(--r); }
.seg span { padding: 2px 11px; border-radius: var(--r-sm); font-size: 12px; line-height: 20px; }
.seg .is-on { background: var(--bg); color: var(--text); box-shadow: var(--shadow-edge); }
.rulewin__body { display: grid; grid-template-columns: minmax(0, 1fr) 288px 64px; height: 344px; }
.lanes-wrap { min-width: 0; overflow-x: auto; }
.lanes { display: grid; grid-template-columns: 104px repeat(3, minmax(0, 1fr)); grid-template-rows: 42px repeat(5, 56px); padding-right: 6px; }
.lhead { display: flex; align-items: center; justify-content: center; gap: 7px; border-left: 1px solid var(--panel-2); border-bottom: 1px solid var(--border); }
.lhead--corner { border-left: 0; justify-content: flex-start; padding-left: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--muted); }
.lhead b { font-family: var(--font-mono); font-size: 12px; font-weight: var(--weight-medium); }
.sdot { width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--r-circle); }
.sdot--direct { background: var(--success); }
.sdot--proxy { background: var(--accent); }
.sdot--reject { background: var(--error); }
.tick { padding: 7px 0 0 14px; border-top: 1px solid var(--panel-2); font-family: var(--font-mono); font-size: 10px; line-height: 14px; letter-spacing: .02em; color: var(--muted); }
.lanes .tick:nth-child(5) { border-top: 0; }
.cell { padding: 6px 5px; border-left: 1px solid var(--panel-2); border-top: 1px solid var(--panel-2); min-width: 0; }
.lanes .cell:nth-child(-n+8) { border-top: 0; }
.blk { min-height: 100%; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 5px 8px; border-radius: var(--r-sm); }
.blk b { display: block; font-size: 12.5px; line-height: 17px; font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.blk code { display: block; font-size: 10px; line-height: 15px; color: var(--muted); }
.blk--solid { background: var(--panel-2); color: var(--text); }
.blk--leaf { background: var(--tint-leaf); color: var(--text); border: 1px dashed var(--tint-leaf-line); }
.blk--violet { background: var(--tint-violet); color: var(--text); border: 1px dashed var(--tint-violet-line); }
.side { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; background: var(--panel); color: var(--text); border-left: 1px solid var(--border); min-width: 0; }
.side__head { display: flex; align-items: center; gap: 9px; min-height: 22px; }
.side__head img { width: 22px; height: 22px; flex-shrink: 0; }
.side__head p { margin: 0; font-size: 14px; font-weight: var(--weight-medium); }
.side__x { margin-left: auto; font-size: 15px; color: var(--muted); }
.bubble { margin: 0; padding: 10px 12px; background: var(--tint-violet); color: var(--text); border: 1px solid var(--tint-violet-edge); border-radius: var(--r); font-size: 13px; line-height: 20px; }
.bubble code, .side__note code { font-size: 12px; color: var(--accent-dark); }
.side__note { margin: 0; font-size: 12.5px; line-height: 21px; color: var(--muted); }
.yaml { margin: 0; padding: 8px 11px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 11.5px; line-height: 18.4px; white-space: pre; overflow-x: auto; }
.yaml .y-k { color: var(--accent-dark); }
.yaml .y-v { color: var(--pine); }
.yaml .y-d { color: var(--muted); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-left: 1px solid var(--border); background: var(--bg); color: var(--muted); }
.rail__chev { width: 16px; height: 16px; margin-bottom: 10px; }
.rail span { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 50px; padding: 8px 0 6px; border-radius: var(--r); font-size: 11px; line-height: 14px; }
.rail span svg { width: 18px; height: 18px; }
.rail .is-on { background: var(--tint-violet); color: var(--accent-dark); }
/* 词条浏览器。嵌套 tab 由各自 data-tabs 容器管理。 */
.tabs { min-width: 0; }
.tab-list, [role="tablist"] { display: flex; align-items: center; gap: 8px; max-width: 100%; overflow-x: auto; padding: 4px; scrollbar-width: thin; }
[role="tab"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-body);
  line-height: 24px;
  text-align: left;
}
[role="tab"]:hover { background: var(--panel); color: var(--text); }
[role="tab"][aria-selected="true"] { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
[role="tabpanel"] { min-width: 0; }
.term-browser { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
.term-browser [role="tablist"] { display: flex; flex-direction: column; align-items: stretch; gap: 4px; overflow: visible; padding: 0; }
.term-browser [role="tab"] { justify-content: flex-start; border: 0; border-radius: var(--r); padding: 16px 20px; }
.term-browser [role="tab"][aria-selected="true"]::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 0; width: 3px; border-radius: var(--r-pill); background: var(--grad); }
.term-browser [role="tabpanel"] { padding: 28px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-edge); }
.tab-progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--border); color: var(--text); transform-origin: left; }
.tabs.is-playing [aria-selected="true"] .tab-progress { animation: tab-clock var(--tab-duration, 8s) linear forwards; }
@keyframes tab-clock { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.code-window { margin-block: 22px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg); color: var(--text); }
.code-window__bar { padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--panel); color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.code-window pre { border: 0; border-radius: 0; margin: 0; background: var(--bg); color: var(--text); }
.read-more { color: var(--accent-dark); font-size: var(--small-size); text-decoration: none; }
.read-more:hover { text-decoration: underline; }
.toc { position: sticky; top: var(--nav-h); z-index: 15; display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); color: var(--text); overscroll-behavior-inline: contain; }
.toc a { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: 8px 16px; border-radius: var(--r-pill); color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current] { background: var(--panel); color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.faq-item summary { position: relative; padding: 20px 42px 20px 0; list-style: none; cursor: pointer; font-weight: var(--weight-medium); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 12px; top: 20px; font-family: var(--font-mono); color: var(--muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { padding: 0 16px 20px 0; color: var(--muted); }
.faq-item__body > :last-child { margin-bottom: 0; }
.term-card, .client-card, .post-card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); color: var(--text); box-shadow: var(--shadow-edge); }
.term-card__name { margin-bottom: 6px; }
.term-card__alias { display: block; margin-bottom: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.term-card p, .client-card p, .post-card p { color: var(--muted); }
.client-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.client-card__head h3 { margin-bottom: 0; }
.client-card__icon { width: 56px; height: 56px; flex-shrink: 0; }
.client-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.client-card--first { border-color: var(--tint-violet-line); }
[data-version]:empty { display: none; }
.client-card [data-version] { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag, .status-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel); color: var(--muted); font-size: 12px; line-height: 18px; white-space: normal; overflow-wrap: anywhere; }
.status-badge--first { background: var(--tint-violet); color: var(--accent-dark); border-color: var(--tint-violet-edge); }
.status-badge--recommended { background: var(--tint-leaf); color: var(--pine); border-color: var(--tint-leaf-line); }
.status-badge--archived { background: var(--panel-2); color: var(--muted); }
.post-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.post-card h3 { margin: 0; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p { margin: 0; }
.post-card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.post-card .read-more { margin-top: auto; }
.callout { margin: 24px 0; padding: 18px 20px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r); background: var(--panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout--note { background: var(--panel); color: var(--text); }
.callout--warn { border-left-color: var(--warn); background: var(--tint-warn); color: var(--text); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg); color: var(--text); text-align: left; }
.data-table th, .data-table td, .prose table th, .prose 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 { background: var(--panel); color: var(--text); font-weight: var(--weight-medium); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; border-collapse: collapse; background: var(--bg); color: var(--text); }
.prose table code, .data-table code { overflow-wrap: anywhere; }
.article-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 28px; margin-top: 48px; border: 1px solid var(--border); border-radius: var(--r); background: var(--panel); color: var(--text); }
.article-download h2 { font-size: var(--h3-size); margin-bottom: 8px; }
.article-download p { margin-bottom: 0; color: var(--muted); }
.dl-fab { position: fixed; right: max(var(--gutter), env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; justify-content: center; gap: 10px; max-width: calc(100vw - var(--gutter) * 2); min-height: 48px; padding: 12px 20px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); box-shadow: var(--shadow-edge), var(--shadow-float); font-size: var(--small-size); font-weight: var(--weight-medium); text-decoration: none; }
.dl-fab svg { width: 18px; height: 18px; flex-shrink: 0; }
.dl-fab:hover { background: var(--panel); color: var(--text); }
body.has-dl-fab .site-footer { padding-bottom: 100px; }
/* 预览专用色板：背景值仍全部来自令牌。 */
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.swatch { margin: 0; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); color: var(--text); overflow: hidden; }
.swatch__paint { display: block; height: 70px; border-bottom: 1px solid var(--border); }
.swatch figcaption { padding: 10px; font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.paint-bg { background: var(--bg); color: var(--text); }
.paint-panel { background: var(--panel); color: var(--text); }
.paint-panel2 { background: var(--panel-2); color: var(--text); }
.paint-border { background: var(--border); color: var(--text); }
.paint-border-strong { background: var(--border-strong); color: var(--text); }
.paint-accent { background: var(--accent); color: var(--on-accent); }
.paint-accent-dark { background: var(--accent-dark); color: var(--on-accent); }
.paint-leaf { background: var(--leaf); color: var(--text); }
.paint-pine { background: var(--pine); color: var(--on-accent); }
.paint-text { background: var(--text); color: var(--on-accent); }
.paint-muted { background: var(--muted); color: var(--on-accent); }
.paint-success { background: var(--success); color: var(--text); }
.paint-warn { background: var(--warn); color: var(--text); }
.paint-error { background: var(--error); color: var(--on-accent); }
.paint-grad { background: var(--grad); color: var(--text); }
.paint-grad-btn { background: var(--grad-btn); color: var(--on-accent); }
.paint-violet { background: var(--tint-violet); color: var(--text); }
.paint-violet-edge { background: var(--tint-violet-edge); color: var(--text); }
.paint-violet-line { background: var(--tint-violet-line); color: var(--text); }
.paint-leaf-tint { background: var(--tint-leaf); color: var(--text); }
.paint-leaf-line { background: var(--tint-leaf-line); color: var(--text); }
.paint-warn-tint { background: var(--tint-warn); color: var(--text); }
.preview-stack { display: grid; gap: 24px; }
.preview-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.preview-section { border-top: 1px solid var(--border); }
@media (max-width: 1100px) {
  .rulewin__body { grid-template-columns: minmax(0, 1fr) 256px 60px; }
}
@media (max-width: 900px) {
  .rulewin__body { grid-template-columns: 1fr; height: auto; }
  .lanes { min-width: 680px; }
  .side { border-left: 0; border-top: 1px solid var(--border); }
  .rail { display: none; }
  .term-browser { grid-template-columns: 1fr; gap: 18px; }
  .term-browser [role="tablist"] { flex-direction: row; overflow-x: auto; padding: 4px; }
  .term-browser [role="tab"] { padding: 10px 18px; border-radius: var(--r-pill); }
  .term-browser [role="tab"][aria-selected="true"]::before { display: none; }
}
@media (max-width: 640px) {
  .wintitle { display: none; }
  .rulewin__bar { grid-template-columns: auto 1fr; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .term-browser [role="tabpanel"], .client-card, .term-card, .post-card { padding: 20px; }
  .article-download { padding: 20px; }
  .dl-fab { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tabs.is-playing [aria-selected="true"] .tab-progress { animation: none; }
}