/* GNOME 配置窗：装饰窗口与可交互配置浏览器共享 chrome。 */
.stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 300px; margin-top: 18px; clip-path: inset(-600px -600px 0 -600px); }
.win-wrap { position: relative; width: min(var(--win-w), calc(100% - 48px)); height: 100%; margin-inline: auto; }
.win {
  position: absolute;
  inset: 0 0 auto;
  height: 800px;
  display: grid;
  grid-template-rows: 46px 1fr;
  overflow: hidden;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-window);
  text-align: left;
}
.headerbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 46px; padding: 0 16px; background: var(--chrome); color: var(--ink); border-bottom: 1px solid var(--line-light); }
.wbtns { display: flex; gap: 8px; }
.wbtns span { width: 13px; height: 13px; flex-shrink: 0; border-radius: var(--r-round); background: var(--chrome-dot); }
.wtitle { font-size: 13px; font-weight: var(--weight-medium); color: var(--ink); letter-spacing: .01em; }
.wtitle .mono { font-weight: var(--weight-title); }
.wactions { justify-self: end; display: flex; gap: 8px; padding-right: 128px; }
.wact { min-height: 28px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); font-size: 12.5px; border: 1px solid var(--line-light); background: var(--surface); color: var(--ink); }
.wact-primary { border-color: var(--clear); background: var(--accent); color: var(--on-accent); }
.wbody { display: grid; grid-template-columns: 56px minmax(0, 1fr) 300px; min-height: 0; }
.wside { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; background: var(--chrome); color: var(--ink-muted); border-right: 1px solid var(--line-light); }
.ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-muted); }
.ico svg { width: 18px; height: 18px; }
.ico.is-on { background: var(--tint-strong); color: var(--accent-dark); }
.weditor { display: flex; flex-direction: column; min-width: 0; }
.wtool { height: 38px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line-light); font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.wtool-path b { font-weight: var(--weight-title); color: var(--ink); }
.wtool-tags { display: flex; gap: 6px; }
.wtool-tags span { padding: 0 8px; line-height: 20px; border-radius: var(--r-xs); background: var(--chrome); color: var(--ink-muted); border: 1px solid var(--line-light); font-size: 11px; }
.wcode { padding: 10px 0; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 24px; }
.seg { position: relative; margin: 0 14px; border-radius: var(--r-sm); min-width: 300px; }
.seg-on { padding: 4px 0 8px; margin-bottom: 8px; background: var(--tint); color: var(--ink); }
.seg-on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: var(--r-xs); background: var(--accent-2); }
.seg-label { padding-left: 52px; font-size: 11.5px; line-height: 22px; color: var(--ink-faint); letter-spacing: .02em; }
.ln { display: grid; grid-template-columns: 40px 1fr; gap: 12px; white-space: nowrap; }
.ln .no { text-align: right; color: var(--ink-faint); }
.key, .fold-mark { color: var(--accent-dark); }
.pun { color: var(--ink-faint); }
.val { color: var(--ink); }
.fold-pill { display: inline-block; margin-left: 10px; padding: 0 8px; line-height: 20px; border-radius: var(--r-xs); background: var(--chrome); color: var(--ink-muted); border: 1px solid var(--line-light); font-size: 12px; }
.wnotes { display: flex; flex-direction: column; border-left: 1px solid var(--line-light); min-width: 0; }
.wnotes-head { height: 44px; flex: 0 0 auto; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line-light); font-size: 13.5px; font-weight: var(--weight-medium); }
.wsearch { margin: 14px 16px 6px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: var(--r-sm); background: var(--chrome); color: var(--ink-faint); border: 1px solid var(--line-light); font-size: 13px; }
.wsearch svg { width: 14px; height: 14px; }
.note { margin: 8px 16px 0; padding: 12px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; border-radius: var(--r); border: 1px solid var(--line-light); background: var(--surface); color: var(--ink); }
.note-on { border-color: var(--clear); background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; color: var(--ink); box-shadow: var(--shadow-focus); }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--tint-strong); color: var(--accent-dark); font-family: var(--font-mono); font-size: 12px; }
.note-name { font-family: var(--font-mono); font-size: 12.5px; line-height: 20px; color: var(--ink); }
.note-type { margin-left: 6px; font-size: 11px; color: var(--ink-faint); }
.note-desc { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--ink-muted); }
.float { position: absolute; z-index: 3; top: -80px; right: -96px; width: 208px; padding: 20px 16px 16px; display: grid; justify-items: center; gap: 14px; border-radius: var(--r); border: 1px solid var(--clear); background: linear-gradient(var(--bg-panel), var(--bg-panel)) padding-box, var(--grad) border-box; color: var(--text); box-shadow: var(--shadow-float); }
.orb { width: 92px; height: 92px; display: grid; place-items: center; border-radius: var(--r-round); background: radial-gradient(circle, var(--bg-deep) 0 42%, var(--clear) 66%), conic-gradient(from 210deg, var(--grad-a), var(--grad-c), var(--accent-2), var(--grad-a)); color: var(--text); box-shadow: 0 0 0 4px var(--orb-ring), 0 0 38px -4px var(--orb-glow); }
.orb img { width: 38px; height: 38px; }
.float-label { font-size: 13.5px; color: var(--text); text-align: center; line-height: 1.4; }

/* Tab 组以 data-tabs 划分作用域，tab 和 panel 必须一一对应。 */
.tabs { min-width: 0; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
[role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line-light);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-muted);
  text-align: left;
  line-height: 1.6;
}
[role="tab"][aria-selected="true"] { border-color: var(--accent); background: var(--tint); color: var(--accent-dark); box-shadow: var(--shadow-focus); }
[role="tabpanel"] { min-width: 0; scroll-margin-top: 24px; }
.config-browser { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.config-browser [role="tablist"] { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.config-browser [role="tab"] { position: relative; display: block; width: 100%; padding: 16px 20px; border-color: var(--clear); background: var(--clear); color: var(--ink-muted); box-shadow: none; }
.config-browser [role="tab"] .mono { display: block; font-size: 13px; }
.config-browser [role="tab"] small { display: block; font-size: 13px; margin-top: 4px; }
.config-browser [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); }
.config-browser [role="tab"][aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: var(--r-xs); background: var(--grad); }
.config-window { overflow: hidden; padding: 0; }
.config-window .headerbar { grid-template-columns: 1fr auto 1fr; }
.config-window .panel-content { padding: 28px; }
.config-window pre { margin-top: 0; }
.config-window p { color: var(--ink-muted); }

/* 目录条的直接父容器应覆盖全部章节；不做 JS 布局修补。 */
.toc { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin-bottom: 32px; border: 1px solid var(--line-light); border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-panel); }
.toc a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: var(--r-sm); color: var(--ink-muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current] { background: var(--tint); color: var(--accent-dark); }
.anchor-section { scroll-margin-top: 96px; }
.faq-item { border-bottom: 1px solid var(--line-light); background: var(--surface); color: var(--ink); }
.faq-item:first-child { border-radius: var(--r) var(--r) 0 0; }
.faq-item summary { position: relative; padding: 22px 56px 22px 24px; cursor: pointer; list-style: none; font-weight: var(--weight-medium); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 24px; top: 22px; color: var(--accent-dark); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 24px 22px; color: var(--ink-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { border-top: 3px solid var(--accent); }
.term-card dt { font-size: var(--size-h3); font-weight: var(--weight-title); margin-bottom: 8px; }
.term-card dd { margin: 0; color: var(--ink-muted); }
.term-en { display: block; margin-bottom: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.client-card { display: flex; flex-direction: column; gap: 20px; }
.client-card.is-primary { border-color: var(--accent); box-shadow: var(--shadow-panel), var(--shadow-focus); }
.client-head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.client-head img { width: 56px; height: 56px; flex-shrink: 0; }
.client-head h3 { margin: 0; }
.client-copy { color: var(--ink-muted); margin: 0; }
.client-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.client-meta { margin: 0; color: var(--ink-muted); font-size: 13px; }
[data-version]:empty { display: none; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--r-pill);
  background: var(--chrome);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.tag-primary { background: var(--tint-strong); color: var(--accent-dark); border-color: var(--tint-strong); }
.tag-primary::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: var(--r-round); background: var(--accent-2); }
.tag-recommended { background: var(--tint); color: var(--accent-dark); }
.tag-archived { background: var(--chrome); color: var(--ink-muted); border-style: dashed; }
.post-card { display: flex; flex-direction: column; align-items: start; }
.post-card h3 { margin: 18px 0 14px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent-dark); }
.post-card p { color: var(--ink-muted); }
.post-date { font-size: 12px; font-family: var(--font-mono); color: var(--ink-muted); }
.post-card .text-link { margin-top: auto; }
.callout { margin: 28px 0; padding: 20px 24px; border: 1px solid var(--line-light); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--tint); color: var(--ink); }
.callout p:last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warn); }
.callout-success { border-left-color: var(--success); }
.callout-error { border-left-color: var(--error); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-light); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; font-size: 14px; }
.data-table th, .data-table td, .prose table th, .prose table td { min-width: 7em; padding: 16px 20px; border-bottom: 1px solid var(--line-light); vertical-align: top; overflow-wrap: normal; word-break: normal; }
.data-table th, .prose table th { background: var(--chrome); color: var(--ink); font-weight: var(--weight-medium); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table { display: block; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; background: var(--surface); color: var(--ink); }
.prose table code { overflow-wrap: anywhere; }
.article-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 28px; border: 1px solid var(--line-light); border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-panel); }
.article-download h2 { font-size: var(--size-h3); margin: 0 0 8px; }
.article-download p { margin: 0; color: var(--ink-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: 10px; max-width: calc(100% - 32px); min-height: 48px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-float); font-size: 14px; text-decoration: none; }
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-fab:hover { background: var(--bg); color: var(--text); }

/* 无脚本预览专用色板，色值全部来自令牌。 */
.preview-stack { display: grid; gap: 64px; }
.preview-block > h2 { margin-top: 0; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.swatch { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line-light); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: 11px; }
.swatch::before { content: ""; display: block; height: 64px; background: var(--sample); }
.swatch span { padding: 10px; overflow-wrap: anywhere; }
.s-bg { --sample: var(--bg); }
.s-bg-deep { --sample: var(--bg-deep); }
.s-bg-panel { --sample: var(--bg-panel); }
.s-bg-panel-2 { --sample: var(--bg-panel-2); }
.s-border { --sample: var(--border); }
.s-accent { --sample: var(--accent); }
.s-accent-dark { --sample: var(--accent-dark); }
.s-accent-2 { --sample: var(--accent-2); }
.s-grad-a { --sample: var(--grad-a); }
.s-grad-c { --sample: var(--grad-c); }
.s-text { --sample: var(--text); }
.s-text-muted { --sample: var(--text-muted); }
.s-text-faint { --sample: var(--text-faint); }
.s-success { --sample: var(--success); }
.s-warn { --sample: var(--warn); }
.s-error { --sample: var(--error); }
.s-surface { --sample: var(--surface); }
.s-ink { --sample: var(--ink); }
.s-ink-muted { --sample: var(--ink-muted); }
.s-ink-faint { --sample: var(--ink-faint); }
.s-line-light { --sample: var(--line-light); }
.s-chrome { --sample: var(--chrome); }
.s-chrome-dot { --sample: var(--chrome-dot); }
.s-tint { --sample: var(--tint); }
.s-tint-strong { --sample: var(--tint-strong); }
.s-star { --sample: var(--star); }
.s-star-dim { --sample: var(--star-dim); }
.s-veil { --sample: var(--veil); }
.s-hair { --sample: var(--hair); }
.s-hover-veil { --sample: var(--hover-veil); }
.s-glow-a { --sample: var(--glow-a); }
.s-glow-b { --sample: var(--glow-b); }
.s-dot-ring { --sample: var(--dot-ring); }
.s-orb-ring { --sample: var(--orb-ring); }
.s-orb-glow { --sample: var(--orb-glow); }
.s-scrim { --sample: var(--scrim); }
.s-clear { --sample: var(--clear); }
.s-grad { --sample: var(--grad); }
.s-grad-readable { --sample: var(--grad-readable); }
.preview-type-display { font-size: var(--size-h1); font-weight: var(--weight-title); line-height: 1.22; margin-bottom: 24px; }
.preview-footer-note { font-size: 13px; color: var(--text-muted); }
@media (max-width: 1360px) {
  .float { right: -56px; }
  .wactions { padding-right: 168px; }
}
@media (max-width: 1220px) {
  .float { display: none; }
  .wactions { padding-right: 0; }
}
@media (max-width: 980px) {
  .wbody { grid-template-columns: 56px minmax(0, 1fr); }
  .wnotes { display: none; }
}
@media (max-width: 768px) {
  .config-browser { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .config-browser [role="tablist"] { flex-direction: row; flex-wrap: wrap; margin-bottom: 0; }
  .config-browser [role="tab"] { width: auto; flex: 1 1 120px; }
  .preview-type-display { font-size: 30px; }
}
@media (max-width: 640px) {
  .stage { flex: 0 0 auto; height: 320px; }
  .win-wrap { width: calc(100% - var(--gutter) * 2); }
  .wside { display: none; }
  .wbody { grid-template-columns: minmax(0, 1fr); }
  .headerbar { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .wactions, .wtool-tags { display: none; }
  .wtitle { font-size: 11px; }
  .wbtns { gap: 5px; }
  .wbtns span { width: 9px; height: 9px; }
  .config-window .panel-content { padding: 20px; }
  .toc { position: static; }
  .article-download { padding: 22px; }
  .article-download .btn { width: 100%; }
  .dl-fab { right: 16px; bottom: 16px; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}