/* 形态 token，与主题无关 */
:root {
  --radius: 10px;
  --font: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --aside: 350px;
  --rail: 280px;
}

/* 深蓝工业：对齐 electro-control html.industry-blue */
html[data-theme="blue"],
html:not([data-theme]) {
  --bg: #161d2b;
  --bg-glow-1: #1c2740;
  --bg-glow-2: #121824;
  --ink: #dfe7f3;
  --muted: #8b9bb4;
  --line: #33415c;
  --panel: #222e44;
  --panel-2: #28354e;
  --accent: #3b82f6;
  --accent-soft: #1e3358;
  --accent-ink: #f4f8ff;
  --danger: #ef4444;
  --pill-on-bg: #3b82f6;
  --pill-on-fg: #f8fbff;

  --stage: #121824;
  --stage-deep: #0e1420;
  --stage-bar: #161d2b;
  --stage-line: #2a3850;
  --stage-text: #c8d2e3;
  --stage-muted: #8b9bb4;
  --stage-label: #5f6f8a;
  --stage-strong: #dfe7f3;
  --stage-control: #28354e;
  --tag-bg: rgba(14, 20, 32, 0.82);
  --empty-title: #dfe7f3;
  --scrollbar-track: #161d2b;
  --scrollbar-thumb: #3a4a66;
  --scrollbar-thumb-hover: #4d6080;
}

/* 暖纸：对齐 electro-control html.rhine-life */
html[data-theme="warm"] {
  --bg: #ebe6da;
  --bg-glow-1: #f7f3ea;
  --bg-glow-2: #e3ddd1;
  --ink: #080a08;
  --muted: #77756d;
  --line: #cfc9bc;
  --panel: #f7f3ea;
  --panel-2: #fffaf0;
  --accent: #9b7247;
  --accent-soft: #efe4d4;
  --accent-ink: #fffaf3;
  --danger: #c45c5c;
  --pill-on-bg: #2c2b28;
  --pill-on-fg: #f7f3ea;

  --stage: #f7f3ea;
  --stage-deep: #fffaf0;
  --stage-bar: #efebe3;
  --stage-line: #ddd8cc;
  --stage-text: #2c2b28;
  --stage-muted: #77756d;
  --stage-label: #9a968c;
  --stage-strong: #080a08;
  --stage-control: #fffaf0;
  --tag-bg: rgba(255, 250, 240, 0.88);
  --empty-title: #080a08;
  --scrollbar-track: #ebe6da;
  --scrollbar-thumb: #cfc9bc;
  --scrollbar-thumb-hover: #b8b1a3;
}

/* 滚动条跟随主题（Firefox + WebKit） */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  color-scheme: dark;
}
html[data-theme="warm"] {
  color-scheme: light;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/*
 * WebKit 轨道贴边时圆角会被裁掉；
 * 两端放透明 scrollbar-button 顶出空隙后，border-radius 才会露出来。
 */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: transparent;
}
::-webkit-scrollbar-button:vertical:start:decrement,
::-webkit-scrollbar-button:vertical:end:increment {
  display: block;
  height: 10px;
  width: 12px;
  background: transparent;
}
::-webkit-scrollbar-button:horizontal:start:decrement,
::-webkit-scrollbar-button:horizontal:end:increment {
  display: block;
  width: 10px;
  height: 12px;
  background: transparent;
}
::-webkit-scrollbar-track {
  background-color: var(--scrollbar-track);
  border-radius: 999px;
  margin: 0 2px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background-clip: padding-box;
  min-height: 32px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
