/* Restored light/dark palette. Custom mode overrides color tokens via theme.js. */
:root { --detail-badge-violet: #7952b3; }
html[data-theme="dark"] { --detail-badge-violet: #b197d8; }
html[data-theme="dark"] {
  color-scheme: dark;

  --ui-axis-x: #FF7B72;
  --ui-axis-y: #7EE787;
  --ui-axis-z: #79C0FF;

  --green-500: #75b798;
  --yellow-500: #adb5bd;
  --red-500: #ea868f;

  --brand-rgb: 13, 110, 253;
  --blue-50: #212529;
  --blue-100: #2b3035;
  --blue-200: #2b3035;
  --blue-300: #2b3035;
  --blue-500: #0d6efd;
  --blue-600: #0b5ed7;
  --blue-700: #6ea8fe;
  --blue-800: #6ea8fe;
  --blue-900: #6ea8fe;

  --env-bg: #121416;
  --env-surface: #1a1d20;
  --env-sunken: #212529;
  --env-line-soft: #2b3035;
  --env-line: #2b3035;
  --env-header: #1a1d20;
  --env-footer: #121416;

  --gray-500: #6c757d;
  --gray-600: #adb5bd;
  --gray-700: #adb5bd;
  --gray-900: #f8f9fa;

  --shade: rgba(0, 0, 0, .58);

  --footer-text: #adb5bd;
  --footer-heading: #f8f9fa;
  --footer-line: #2b3035;

  --tint-green: var(--surface-3);
  --tint-yellow: var(--surface-3);
  --tint-red: var(--surface-3);
  --tint-purple: var(--surface-3);
  --tint-cyan: var(--surface-3);
  --tint-orange: var(--surface-3);
  --tint-lime: var(--surface-3);
  --tint-amber: var(--surface-3);

  --hero-border: var(--gray-200);
  --hero-bg: var(--surface);
  --hero-tag-bg: var(--surface-3);
  --cta-bg: var(--surface);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.075);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.075);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.075);
  --shadow-xl: 0 12px 34px rgba(0, 0, 0, 0.075);

  --ui-bg-sunken: var(--env-sunken);

  --ui-on-primary: #ffffff;

  --ui-info-soft: var(--surface-3);
  --ui-info-text: var(--blue-700);
  --ui-success-soft: var(--surface-3);
  --ui-warning-soft: var(--surface-3);
  --ui-danger-soft: var(--surface-3);

  --ui-success-text: var(--green-500);
  --ui-warning-text: #d5ad6d;
  --ui-danger-text: var(--red-500);

  --hero-grid-line: transparent;
  --ui-ring: 0 0 0 3px rgba(var(--brand-rgb), .26);
  --surface-glow: rgba(0, 0, 0, 0.04);
}

html[data-skin="white"] {
  --brand-rgb: 13, 110, 253;
  --blue-50: #f1f3f5;
  --blue-100: #e9ecef;
  --blue-200: #dee2e6;
  --blue-300: #ced4da;
  --blue-500: #0d6efd;
  --blue-600: #0b5ed7;
  --blue-700: #0a58ca;
  --blue-800: #0a58ca;
  --blue-900: #0a58ca;
  /* 明亮模式：页面底纯白，沉底留一档浅灰，卡片靠描边分层 */
  --env-bg: #ffffff;
  --env-surface: #ffffff;
  --env-sunken: #f4f6f8;
  --env-line-soft: #e5e8eb;
  --env-line: #dee2e6;
  --env-footer: #f7f8fa;
  --env-header: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.055);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.075);
  --shadow-xl: 0 18px 42px rgba(0, 0, 0, 0.075);
  --card-shadow: none;
  --body-ambient: none;
  --section-ambient: none;
}

html[data-skin="white"][data-theme="dark"] {
  --brand-rgb: 13, 110, 253;
  --blue-50: #212529;
  --blue-100: #2b3035;
  --blue-200: #2b3035;
  --blue-300: #2b3035;
  --blue-500: #0d6efd;
  --blue-600: #0b5ed7;
  --blue-700: #6ea8fe;
  --blue-800: #6ea8fe;
  --blue-900: #6ea8fe;

  --env-bg: #121416;
  --env-surface: #1a1d20;
  --env-sunken: #212529;
  --env-line-soft: #2b3035;
  --env-line: #2b3035;
  --env-footer: #121416;
  --env-header: #1a1d20;

  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.075);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.075), 0 1px 3px rgba(0, 0, 0, 0.075);
  --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.075), 0 4px 8px rgba(0, 0, 0, 0.075);
  --shadow-xl: 0 4px 12px rgba(0, 0, 0, 0.075);
}

body,
.header,
.footer,
.ui-mask,
.ui-modal {
  transition: background-color .28s cubic-bezier(.4, 0, .2, 1),
              color .28s cubic-bezier(.4, 0, .2, 1),
              border-color .28s cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  body, .header, .footer, .ui-mask, .ui-modal { transition: none; }
}

.tint-blue { background: var(--surface-3); }
.tint-green { background: var(--surface-3); }
.tint-yellow { background: var(--surface-3); }
.tint-red { background: var(--surface-3); }
.tint-purple { background: var(--surface-3); }
.tint-cyan { background: var(--surface-3); }
.tint-orange { background: var(--surface-3); }
.tint-lime { background: var(--surface-3); }
.tint-amber { background: var(--surface-3); }

html[data-theme="dark"] {
  --control-border: #2b3035;
  --secondary-button-bg: #212529;
  --neutral-hover: #2b3035;
  --neutral-border-hover: #495057;
  --danger-subtle: #212529;
  --success-subtle: #212529;
  --ui-control-surface-bg: #212529;
  --ui-textarea-idle-bg: #212529;
  /* 输入框范本（对齐 uiedtool）的深色适配：占位符深灰、聚焦圈换亮蓝 */
  --ui-placeholder: #6b7280;
  --ui-focus: #60a5fa;
}
/* The extended editor scrolls inside its existing dropdown, including on mobile. */
.theme-menu { max-height: min(80vh, 680px); overflow-y: auto; overscroll-behavior: contain; }
.theme-custom .tc-label { width: 72px; white-space: nowrap; }
