.canvas { position: relative; height: 456px; margin-top: 36px; }
.canvas-ground {
  position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--canvas-edge); color: var(--text);
  background:
    radial-gradient(60% 75% at 86% 12%, var(--topo-glow) 0%, transparent 70%),
    radial-gradient(52% 85% at 2% 100%, var(--topo-wash) 0%, transparent 72%),
    linear-gradient(168deg, var(--topo-base-hi) 0%, var(--topo-base) 58%, var(--topo-base-lo) 100%);
}
.canvas-ground::before, .canvas-ground::after { content: ""; position: absolute; inset: 0; }
.canvas-ground::before {
  background: repeating-radial-gradient(ellipse 120% 90% at 46% 150%, transparent 0, transparent 37px, var(--topo-line) 38px, transparent 39.5px, transparent 46px);
  mask-image: linear-gradient(to top, var(--mask-solid) 0%, var(--mask-solid) 30%, transparent 85%);
}
.canvas-ground::after {
  background: repeating-radial-gradient(ellipse 70% 110% at 104% 64%, transparent 0, transparent 29px, var(--topo-line-2) 30px, transparent 31.5px, transparent 36px);
  mask-image: radial-gradient(60% 90% at 100% 70%, var(--mask-solid) 20%, transparent 80%);
}
.topo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.topo path { fill: none; stroke: var(--topo-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.topo .ix { stroke: var(--topo-index); stroke-width: 1.4; }
.topo .s { stroke: var(--topo-line-2); }
.win { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-card); min-width: 0; }
.win-bar { flex: none; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center; height: 34px; padding: 0 14px; background: var(--chrome); color: var(--text-muted); border-bottom: 1px solid var(--border); }
.dots { display: inline-flex; gap: 7px; }
.dots i { width: 10px; height: 10px; border-radius: var(--r-round); background: var(--win-dot); }
.win-title { text-align: center; font-size: 12.5px; color: var(--text-muted); }
.win-main {
  position: absolute; z-index: 2; left: 10%; top: 46px; width: 78%; height: 380px;
  background: var(--surface); color: var(--text-soft); border: 1px solid var(--border);
  box-shadow: var(--shadow-near), var(--shadow-far); font-size: 12.5px;
}
.menu { flex: none; display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.menu li { padding: 3px 10px; border-radius: var(--r-ctl); color: var(--text-soft); white-space: nowrap; }
.menu li.is-hover { background: var(--menu-hover); color: var(--text); }
.win-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 172px minmax(0, 1fr); }
.side { padding: 12px 8px; background: var(--side-bg); color: var(--text-muted); border-right: 1px solid var(--border); }
.side-h { padding: 0 10px 8px; color: var(--text-muted); font-size: 11px; letter-spacing: 0.06em; }
.side li { position: relative; padding: 6px 10px 6px 14px; border-radius: var(--r-ctl); color: var(--text-muted); }
.side li.is-on { background: var(--bg-panel-2); color: var(--text); }
.side li.is-on::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: var(--r-ctl); background: var(--accent); }
.list { display: flex; flex-direction: column; min-width: 0; }
.list-head { flex: none; display: grid; grid-template-columns: 70px 1.3fr 1.6fr 70px 92px 64px; height: 32px; align-items: center; background: var(--chrome); color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 12px; }
.list-head span { padding: 0 12px; border-left: 1px solid var(--border); line-height: 14px; white-space: nowrap; }
.list-head span:first-child { border-left: 0; }
.list-body { position: relative; flex: 1; }
.list-body::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--row-line) 31px, var(--row-line) 32px);
  mask-image: linear-gradient(to bottom, var(--mask-solid), transparent 80%);
}
.empty {
  position: absolute; top: 34px; left: 50%; transform: translateX(-56%);
  display: flex; align-items: center; gap: 14px; padding: 14px 20px 14px 14px;
  background: var(--surface); color: var(--text-muted); border: 1px dashed var(--border-strong);
  border-radius: var(--r-card); white-space: nowrap;
}
.empty-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text-muted); flex-shrink: 0; }
.empty-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.empty p { font-size: 12.5px; }
.kbd { display: inline-block; padding: 1px 7px; margin: 0 2px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text); }
.arr { color: var(--text-muted); margin: 0 3px; }
.status { flex: none; display: flex; align-items: center; gap: 20px; height: 34px; padding: 0 14px; background: var(--chrome); color: var(--text-muted); border-top: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
.st { display: inline-flex; align-items: center; gap: 7px; }
.dot-on { width: 7px; height: 7px; border-radius: var(--r-round); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sel { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); }
.sel::after { content: "▾"; color: var(--text-muted); font-size: 10px; }
.st-mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.win-log { position: absolute; z-index: 3; right: 3.5%; bottom: -30px; width: 33%; background: var(--ink); color: var(--log-fg); border: 1px solid var(--ink-line); box-shadow: var(--shadow-float-near), var(--shadow-float-far); }
.win-log .win-bar { height: 32px; background: var(--ink-raise); color: var(--log-fg); border-color: var(--ink-line); }
.win-log .dots i { background: var(--ink-dot); }
.win-log .win-title { color: var(--log-fg); font-family: var(--font-mono); font-size: 11.5px; }
.log { padding: 13px 16px 15px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.85; color: var(--log-fg); overflow-x: auto; }
.log li { white-space: nowrap; }
.lv-i { color: var(--log-info); }
.lv-w { color: var(--log-warn); }
.mod { color: var(--log-path); }
.dl { padding-top: 28px; padding-bottom: 96px; }
.dl-tray { padding: 56px 48px 48px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); }
.dl-head { max-width: 620px; }
.dl-head h2 { font-size: 28px; line-height: 1.2; }
.dl-note { margin-top: 12px; color: var(--text-muted); }
.dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.dl-card { display: grid; gap: 4px; padding: 22px 20px 20px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); min-width: 0; }
.dl-card:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.dl-ic { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text-soft); }
.dl-ic svg { width: 18px; height: 18px; fill: currentColor; }
.dl-os { font-size: 16px; }
.dl-app { color: var(--text-muted); font-family: var(--font-mono); font-size: 12.5px; }
.dl-go { margin-top: 14px; color: var(--accent-dark); font-size: 14px; }
.tabs { min-width: 0; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
[role="tab"] {
  position: relative; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border);
  border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text-muted);
  text-align: left;
}
[role="tab"]:hover { background: var(--bg-panel-2); color: var(--text); }
[role="tab"][aria-selected="true"] { background: var(--surface); color: var(--accent-dark); border-color: var(--border-strong); }
[role="tabpanel"] { min-width: 0; }
.feature-tray { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 40px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); }
.feature-tray [role="tablist"] { display: flex; flex-direction: column; align-self: start; gap: 4px; margin: 0; }
.feature-tray [role="tab"] { border: 0; background: var(--bg-panel); color: var(--text-muted); border-radius: var(--r-ctl); }
.feature-tray [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); }
.feature-tray [role="tab"][aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }
.detail-window { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-near), var(--shadow-card); }
.detail-body { padding: 30px; }
.detail-body h3 { margin-bottom: 16px; }
.detail-body p { color: var(--text-muted); }
.setting-path { margin-top: 24px; font-size: 13px; }
.toc { position: sticky; top: 12px; z-index: 10; display: flex; gap: 8px; max-width: 100%; padding: 10px; margin-bottom: 32px; overflow-x: auto; overscroll-behavior-x: contain; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-card); }
.toc a { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 44px; padding: 8px 14px; color: var(--text-soft); border-radius: var(--r-ctl); white-space: nowrap; }
.toc a:hover, .toc a[aria-current="location"] { background: var(--surface); color: var(--accent-dark); text-decoration: none; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; min-height: 56px; padding: 18px 36px 18px 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: 8px; top: 17px; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 22px; max-width: 780px; color: var(--text-muted); }
.term-card { border-left: 2px solid var(--border-strong); }
.term-card dt { font-size: 20px; }
.term-card dd { margin: 12px 0 0; color: var(--text-muted); }
.term-category { display: block; margin-bottom: 12px; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.client-card { display: grid; gap: 20px; }
.client-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.client-meta { color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; }
.badge-label { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; padding: 3px 9px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text-soft); font-size: 12px; }
.badge-label::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: var(--r-round); background: var(--text-muted); }
.badge-first::before, .badge-recommended::before { background: var(--accent); }
.badge-retired { border-style: dashed; color: var(--text-muted); background: var(--bg-panel); }
.article-card { display: flex; flex-direction: column; align-items: start; gap: 16px; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { margin: 0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); }
.article-card .article-more { margin-top: auto; }
.callout { padding: 22px 24px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text-soft); }
.callout strong { color: var(--text); }
.callout p + p { margin-top: 10px; }
.callout-warning { border-left-color: var(--warn); }
.callout-success { border-left-color: var(--success); }
.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--r-ctl); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); color: var(--text); }
.data-table th, .data-table td, .prose table th, .prose table td { min-width: 7em; padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: normal; word-break: normal; }
.data-table th, .prose table th { background: var(--bg-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(--surface); color: var(--text); }
.prose table code, .data-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(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.article-download p { margin-top: 8px; color: var(--text-muted); }
.dl-fab {
  position: fixed; z-index: 25; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 12px; max-width: calc(100% - 40px);
  padding: 12px 18px; border: 1px solid var(--ink-line); border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-menu);
}
.dl-fab:hover { background: var(--ink-hover); color: var(--on-ink); text-decoration: none; }
.dl-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dl-fab small { display: block; font-size: 11px; color: var(--log-fg); }
.preview-block { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--border); }
.preview-block h2 { margin-bottom: 28px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.swatch { padding: 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); min-width: 0; }
.swatch i { display: block; height: 46px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--swatch-color); }
.swatch code { font-size: 11px; }
.sw-bg { --swatch-color: var(--bg); }
.sw-panel { --swatch-color: var(--bg-panel); }
.sw-panel2 { --swatch-color: var(--bg-panel-2); }
.sw-border { --swatch-color: var(--border); }
.sw-strong { --swatch-color: var(--border-strong); }
.sw-accent { --swatch-color: var(--accent); }
.sw-accent-dark { --swatch-color: var(--accent-dark); }
.sw-ring { --swatch-color: var(--accent-ring); }
.sw-text { --swatch-color: var(--text); }
.sw-soft { --swatch-color: var(--text-soft); }
.sw-muted { --swatch-color: var(--text-muted); }
.sw-faint { --swatch-color: var(--text-faint); }
.sw-success { --swatch-color: var(--success); }
.sw-warn { --swatch-color: var(--warn); }
.sw-error { --swatch-color: var(--error); }
.sw-surface { --swatch-color: var(--surface); }
.sw-chrome { --swatch-color: var(--chrome); }
.sw-dot { --swatch-color: var(--win-dot); }
.sw-row { --swatch-color: var(--row-line); }
.sw-side { --swatch-color: var(--side-bg); }
.sw-menu { --swatch-color: var(--menu-hover); }
.sw-ink { --swatch-color: var(--ink); }
.sw-raise { --swatch-color: var(--ink-raise); }
.sw-hover { --swatch-color: var(--ink-hover); }
.sw-line { --swatch-color: var(--ink-line); }
.sw-ink-dot { --swatch-color: var(--ink-dot); }
.sw-on { --swatch-color: var(--on-ink); }
.sw-log { --swatch-color: var(--log-fg); }
.sw-dim { --swatch-color: var(--log-dim); }
.sw-info { --swatch-color: var(--log-info); }
.sw-log-warn { --swatch-color: var(--log-warn); }
.sw-path { --swatch-color: var(--log-path); }
.sw-topo { --swatch-color: var(--topo-base); }
.sw-hi { --swatch-color: var(--topo-base-hi); }
.sw-lo { --swatch-color: var(--topo-base-lo); }
.sw-glow { --swatch-color: var(--topo-glow); }
.sw-wash { --swatch-color: var(--topo-wash); }
.sw-topo-line { --swatch-color: var(--topo-line); }
.sw-topo-line2 { --swatch-color: var(--topo-line-2); }
.sw-index { --swatch-color: var(--topo-index); }
.sw-edge { --swatch-color: var(--canvas-edge); }
.sw-mask { --swatch-color: var(--mask-solid); }
.sw-veil { --swatch-color: var(--veil); }
@media (max-width: 1180px) {
  .win-main { left: 6%; width: 84%; }
  .win-log { width: 38%; right: 3%; }
}
@media (max-width: 920px) {
  .canvas { height: 420px; }
  .win-main { left: 4%; width: 92%; height: 350px; top: 34px; }
  .win-log { width: 50%; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-tray { grid-template-columns: 180px minmax(0, 1fr); padding: 24px; gap: 24px; }
  .swatch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .canvas { height: auto; margin-top: 30px; padding: 20px 16px; border-radius: var(--r-card); }
  .win-main { position: relative; left: auto; top: auto; width: 100%; height: 360px; }
  .win-body { grid-template-columns: minmax(0, 1fr); }
  .win-main .side { display: none; }
  .win-main .menu, .win-main .list-head { overflow: hidden; }
  .win-main .empty { left: 12px; right: 12px; transform: none; white-space: normal; padding: 12px; }
  .win-main .empty p { min-width: 0; overflow-wrap: anywhere; }
  .win-main .status { flex-wrap: wrap; gap: 8px; height: auto; padding: 8px 12px; }
  .win-main .st { flex-wrap: wrap; white-space: normal; }
  .win-main .st-mono { white-space: normal; overflow-wrap: anywhere; }
  .win-log { position: relative; right: auto; left: auto; bottom: auto; width: 100%; max-width: none; margin-top: 16px; }
  .log { font-size: 10px; padding: 10px 12px; }
  .dl { padding-bottom: 56px; }
  .dl-tray { padding: 28px 20px; }
  .dl-grid { gap: 10px; }
  .dl-card { padding: 18px 14px; }
  .dl-head h2 { font-size: 25px; }
  .feature-tray { grid-template-columns: 1fr; padding: 18px; gap: 20px; }
  .feature-tray [role="tablist"] { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .feature-tray [role="tab"] { padding: 10px 12px; font-size: 13px; }
  .detail-body { padding: 20px; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-download { padding: 22px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 10px 16px; }
}