/* kankan-theme.css — 全站主题（浅/深两态）
 * 由 ls-ext.js / boot_ext.js 在页面加载时注入；主题唯一来源：localStorage['kankan-theme']。
 * 深色：冷深蓝调（与 NB 首页一致）；浅色：暖米白调（与首页浅色 token 一致）。
 * 仅覆盖 LS 的 sand/neutral 令牌，组件按令牌自动换色；个别硬编码组件在文件末尾单独补。
 */

/* ============ 深色 ============ */
html[data-lsx-theme="dark"] {
  color-scheme: dark;

  --color-sand-000: #eef3fb;
  --color-sand-100: #eaf0fb;
  --color-sand-200: #c7d5ea;
  --color-sand-300: #a9bad4;
  --color-sand-400: #93a0b8;
  --color-sand-500: #7c8aa3;
  --color-sand-600: #5c6675;
  --color-sand-700: #232b3d;
  --color-sand-800: #121620;
  --color-sand-850: #1a2030;
  --color-sand-900: #0e1118;
  --color-sand-950: #0b0e14;

  --color-neutral-surface-raw: 26 32 48;
  --color-neutral-on-dark-surface-raw: 18 22 32;
  --color-neutral-on-dark-surface-hover-raw: 26 32 48;
  --color-neutral-on-dark-surface-active-raw: 14 17 24;
  --color-neutral-on-dark-background-raw: 26 32 48;
  --color-neutral-on-dark-background-bold-raw: 18 22 32;
  --color-neutral-surface-hover-raw: 31 38 56;
  --color-neutral-surface-active-raw: 14 17 24;
  --color-neutral-surface-inset-raw: 11 14 20;
  --color-neutral-background-raw: 18 22 32;
  --color-neutral-background-bold-raw: 14 17 24;
  --color-neutral-inverted-surface-raw: 199 213 234;
  --color-neutral-inverted-surface-hover-raw: 220 230 245;
  --color-neutral-inverted-surface-active-raw: 169 186 212;
  --color-neutral-shadow-raw: 11 14 20;
}

/* ============ 浅色 ============ */
html[data-lsx-theme="light"] {
  color-scheme: light;

  --color-sand-000: #faf7f2;
  --color-sand-100: #ffffff;
  --color-sand-200: #f2ece3;
  --color-sand-300: #ece4d8;
  --color-sand-400: #d8cbbb;
  --color-sand-500: #b3a696;
  --color-sand-600: #8b7f6f;
  --color-sand-700: #6f655a;
  --color-sand-800: #3f382f;
  --color-sand-850: #2a241d;
  --color-sand-900: #1e1913;
  --color-sand-950: #15110c;
}

/* ============ 基础层 ============ */
html[data-lsx-theme] body,
html[data-lsx-theme] .app-wrapper,
html[data-lsx-theme] .lsf-content-wrapper,
html[data-lsx-theme] .lsf-content-wrapper__body,
html[data-lsx-theme] .lsf-content-wrapper__content {
  background-color: var(--color-neutral-background) !important;
  color: var(--color-neutral-content);
}

html[data-lsx-theme] ::selection {
  background: rgba(77, 124, 255, 0.35);
  color: inherit;
}

html[data-lsx-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-lsx-theme="dark"] ::-webkit-scrollbar-thumb { background: #2b3650; border-radius: 8px; border: 2px solid #121620; }
html[data-lsx-theme="dark"] ::-webkit-scrollbar-track { background: #121620; }

/* 深色下顶栏/侧栏与首页一致 */
html[data-lsx-theme="dark"] .lsf-menu-header,
html[data-lsx-theme="dark"] .lsf-sidebar,
html[data-lsx-theme="dark"] .lsf-main-menu {
  background-color: #0e1118 !important;
  border-color: #232b3d !important;
}

/* 浅色下顶栏/侧栏用白，内容区留米白，拉开层次 */
html[data-lsx-theme="light"] .lsf-menu-header,
html[data-lsx-theme="light"] .lsf-sidebar,
html[data-lsx-theme="light"] .lsf-main-menu {
  background-color: #ffffff !important;
  border-color: #ece4d8 !important;
}
html[data-lsx-theme="light"] .lsf-project-card,
html[data-lsx-theme="light"] .lsf-people-list__wrapper,
html[data-lsx-theme="light"] .lsf-panel,
html[data-lsx-theme="light"] .lsf-card {
  background-color: #ffffff !important;
  border-color: #e9e1d4 !important;
  box-shadow: 0 1px 2px rgba(63, 56, 47, 0.06) !important;
}
html[data-lsx-theme="dark"] .lsf-menu-header__logo,
html[data-lsx-theme="dark"] .lsf-menu-header__logo img {
  filter: none;
}
html[data-lsx-theme="dark"] .lsf-main-menu__item {
  color: #a9bad4;
}
html[data-lsx-theme="dark"] .lsf-main-menu__item:hover {
  background: #1a2030;
  color: #eaf0fb;
}
html[data-lsx-theme="dark"] .lsf-main-menu__item_active {
  background: rgba(77, 124, 255, 0.16);
  color: #ffffff;
}

/* 卡片/面板（部分组件把背景写死在 var 之外的兜底） */
html[data-lsx-theme="dark"] .lsf-project-card,
html[data-lsx-theme="dark"] .lsf-people-list__wrapper,
html[data-lsx-theme="dark"] .lsf-panel,
html[data-lsx-theme="dark"] .lsf-card {
  background-color: #1a2030 !important;
  border-color: #232b3d !important;
}

/* 输入框 / 下拉 / 表格 */
html[data-lsx-theme="dark"] input,
html[data-lsx-theme="dark"] textarea,
html[data-lsx-theme="dark"] select {
  background-color: #151b28 !important;
  border-color: #2a3446 !important;
  color: #eaf0fb !important;
}
html[data-lsx-theme="dark"] .lsf-people-list__user:nth-child(odd):not(.lsf-people-list__user_active) {
  background-color: #171d2a !important;
}

/* 加载页跟随主题：深色时反白 logo、深底 */
html[data-lsx-theme="dark"] #lsx-loader { background: #121620 !important; }
html[data-lsx-theme="dark"] #lsx-loader .lsx-loader-img { filter: brightness(0) invert(1); opacity: 0.92; }
html[data-lsx-theme="dark"] #lsx-loader .lsx-loader-tip { color: #93a0b8; }

/* 登录页不参与（服务端渲染，浅色品牌页） */
