:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1f5; --panel: #fff; --p2: #f4f6f9; --ink: #1d2939;
  --muted: #626f81; --line: #dce2ea; --blue: #235eb0; --red: #c3374c;
  --green: #087e62; --nav: #fff; --grid: #e2e7ee; --input: #f9fafc;
  --hover: #edf2f8; --tip: #fff; --selected: #e7effa; --selected-line: #8eadd5;
  --row-line: #e9edf2; --control-active: #e1e8f1; --control-line: #b9c7d8;
  --thumb: #edf1f7; --numeric: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --fill-secondary: var(--p2); --fill-strong: var(--hover); --surface-alt: var(--p2);
  --accent: var(--blue); --focus-ring: var(--blue); --shadow: none; --card-shadow: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090c10; --panel: #10151c; --p2: #161d26; --ink: #e1e7ef;
  --muted: #91a0b3; --line: #232c38; --blue: #6aa9ff; --red: #ef6777;
  --green: #36c6a0; --nav: #10151c; --grid: #202833; --input: #0c1118;
  --hover: #19222e; --tip: #19212d; --selected: #192738; --selected-line: #416b9c;
  --row-line: #1b232e; --control-active: #293442; --control-line: #354354;
  --thumb: #151e29;
}
:root[data-theme] body { background: var(--bg); color: var(--ink); }
.theme-switch { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; white-space: nowrap; font: 11px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; color: var(--muted); }
.theme-switch select, :root[data-theme] .theme-switch select {
  display: block; box-sizing: border-box; width: 86px; height: 30px; min-height: 30px;
  margin: 0; padding: 0 22px 0 8px; border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); background-color: var(--input); font: inherit; line-height: normal;
}
.theme-switch select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-theme] select option { color: var(--ink); background: var(--panel); }
@media(max-width: 640px) { .theme-switch>span { display: none; } .theme-switch select { width: 78px; } }
