/* =========================================================
   利刃 · 统一主题层 v8  (kk-theme-v8.css)
   唯一一套切色:暗 / 亮 / 米色,整站(侧栏 + 顶栏 + 卡片 + 表格 + 输入框 + 弹层)一起切
   由 kk-theme-v8.js 在 html 上写 data-kk-theme
   ========================================================= */

/* ---------- 1. 语义色板:三套,全部 !important 压住旧层 ---------- */
html[data-kk-theme="dark"],
html:not([data-kk-theme]) {
  color-scheme: dark;
  --background: #07111e !important;
  --foreground: #eef5ff !important;
  --card: #0f1a2d !important;
  --card-foreground: #eef5ff !important;
  --popover: #122033 !important;
  --popover-foreground: #eef5ff !important;
  --primary: #1a9ae6 !important;
  --primary-foreground: #ffffff !important;
  --secondary: #15263c !important;
  --secondary-foreground: #eef5ff !important;
  --muted: #122033 !important;
  --muted-foreground: #8ea0b8 !important;
  --accent: #16304c !important;
  --accent-foreground: #eef5ff !important;
  --border: #26364f !important;
  --input: #26364f !important;
  --ring: #38a8ff !important;
  --sidebar: #050d1a !important;
  --sidebar-foreground: #eef5ff !important;
  --sidebar-primary: #1a9ae6 !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #12263d !important;
  --sidebar-accent-foreground: #eef5ff !important;
  --sidebar-border: #1c3048 !important;
  --kk-bg: #0d1117 !important;
  --kk-panel: #161b22 !important;
  --kk-inset: #0d1117 !important;
  --kk-line: #30363d !important;
  --kk-fg: #c9d1d9 !important;
  --kk-fg2: #8b949e !important;
  --kk-mute: #484f58 !important;
}

html[data-kk-theme="light"] {
  color-scheme: light;
  --background: #f2f4f7 !important;
  --foreground: #1f2430 !important;
  --card: #ffffff !important;
  --card-foreground: #1f2430 !important;
  --popover: #ffffff !important;
  --popover-foreground: #1f2430 !important;
  --primary: #1a9ae6 !important;
  --primary-foreground: #ffffff !important;
  --secondary: #eef2f6 !important;
  --secondary-foreground: #1f2430 !important;
  --muted: #f4f6f9 !important;
  --muted-foreground: #5b6572 !important;
  --accent: #e9eef3 !important;
  --accent-foreground: #1f2430 !important;
  --border: #dce2e8 !important;
  --input: #dce2e8 !important;
  --ring: #1a9ae6 !important;
  --sidebar: #ffffff !important;
  --sidebar-foreground: #24292f !important;
  --sidebar-primary: #1a9ae6 !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #eef2f6 !important;
  --sidebar-accent-foreground: #0d1117 !important;
  --sidebar-border: #e3e8ee !important;
  --kk-bg: #f2f4f7 !important;
  --kk-panel: #ffffff !important;
  --kk-inset: #f7f8fa !important;
  --kk-line: #d6dbe3 !important;
  --kk-fg: #1f2430 !important;
  --kk-fg2: #5b6572 !important;
  --kk-mute: #8a919a !important;
}

html[data-kk-theme="sepia"] {
  color-scheme: light;
  --background: #efe6d8 !important;
  --foreground: #3b3325 !important;
  --card: #faf4e8 !important;
  --card-foreground: #3b3325 !important;
  --popover: #fdf9f0 !important;
  --popover-foreground: #3b3325 !important;
  --primary: #c8351f !important;
  --primary-foreground: #ffffff !important;
  --secondary: #f4ecd9 !important;
  --secondary-foreground: #3b3325 !important;
  --muted: #f4ecdc !important;
  --muted-foreground: #7d6f58 !important;
  --accent: #eee2ca !important;
  --accent-foreground: #241d12 !important;
  --border: #d8c8ac !important;
  --input: #d8c8ac !important;
  --ring: #c8351f !important;
  --sidebar: #f5ecd9 !important;
  --sidebar-foreground: #3b3325 !important;
  --sidebar-primary: #c8351f !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #eadfc6 !important;
  --sidebar-accent-foreground: #241d12 !important;
  --sidebar-border: #d8c8ac !important;
  --kk-bg: #efe6d8 !important;
  --kk-panel: #faf4e8 !important;
  --kk-inset: #f4ecdc !important;
  --kk-line: #d8c8ac !important;
  --kk-fg: #3b3325 !important;
  --kk-fg2: #7d6f58 !important;
  --kk-mute: #9c8e75 !important;
}

/* ---------- 2. 页面底色:亮色 / 米色模式下整页统一 ---------- */
html[data-kk-theme="light"] { background: #f2f4f7 !important; }
html[data-kk-theme="sepia"] { background: #efe6d8 !important; }
html[data-kk-theme="dark"] { background: #07111e !important; }
html[data-kk-theme="light"] body,
html[data-kk-theme="light"] main { background-color: #f2f4f7 !important; color: #1f2430 !important; }
html[data-kk-theme="sepia"] body,
html[data-kk-theme="sepia"] main { background-color: #efe6d8 !important; color: #3b3325 !important; }

/* ---------- 3. 硬编码色值类:逐色对齐(含 hover:/data- 状态) ---------- */
/* 亮色 */
html[data-kk-theme="light"] body [class*="bg-[#0d1117]"] { background-color: #f2f4f7 !important; }
html[data-kk-theme="light"] body [class*="bg-[#161b22]"] { background-color: #ffffff !important; }
html[data-kk-theme="light"] body [class*="bg-[#1c2128]"] { background-color: #eef1f4 !important; }
html[data-kk-theme="light"] body [class*="bg-[#2d333b]"] { background-color: #e9edf1 !important; }
html[data-kk-theme="light"] body [class*="bg-[#30363d]"] { background-color: #e7eaef !important; }
html[data-kk-theme="light"] body [class*="border-[#30363d]"] { border-color: #d8dfe6 !important; }
html[data-kk-theme="light"] body [class*="border-[#21262d]"] { border-color: #e3e8ee !important; }
html[data-kk-theme="light"] body [class*="text-[#e6edf3]"] { color: #10161f !important; }
html[data-kk-theme="light"] body [class*="text-[#c9d1d9]"] { color: #1f2430 !important; }
html[data-kk-theme="light"] body [class*="text-[#8b949e]"] { color: #5b6572 !important; }
html[data-kk-theme="light"] body [class*="text-[#6e7681]"] { color: #6c7684 !important; }
html[data-kk-theme="light"] body [class*="text-[#484f58]"] { color: #8a919a !important; }

/* 米色 */
html[data-kk-theme="sepia"] body [class*="bg-[#0d1117]"] { background-color: #efe6d8 !important; }
html[data-kk-theme="sepia"] body [class*="bg-[#161b22]"] { background-color: #faf4e8 !important; }
html[data-kk-theme="sepia"] body [class*="bg-[#1c2128]"] { background-color: #f2ead9 !important; }
html[data-kk-theme="sepia"] body [class*="bg-[#2d333b]"] { background-color: #ece2cf !important; }
html[data-kk-theme="sepia"] body [class*="bg-[#30363d]"] { background-color: #ece2cf !important; }
html[data-kk-theme="sepia"] body [class*="border-[#30363d]"] { border-color: #d8c8ac !important; }
html[data-kk-theme="sepia"] body [class*="border-[#21262d]"] { border-color: #ddceb2 !important; }
html[data-kk-theme="sepia"] body [class*="text-[#e6edf3]"] { color: #241d12 !important; }
html[data-kk-theme="sepia"] body [class*="text-[#c9d1d9]"] { color: #3b3325 !important; }
html[data-kk-theme="sepia"] body [class*="text-[#8b949e]"] { color: #7d6f58 !important; }
html[data-kk-theme="sepia"] body [class*="text-[#6e7681]"] { color: #847457 !important; }
html[data-kk-theme="sepia"] body [class*="text-[#484f58]"] { color: #9c8e75 !important; }




/* ---------- 0. 旧主题按钮一律隐藏(新按钮接管,登录页也不留) ---------- */
#kk-theme-btn, #kk-theme-toggle, .kk-theme-btn, .kk-theme-toggle,
#kk-theme-btn2 { display: none !important; visibility: hidden !important; }

/* ---------- 3.6 侧栏激活项:亮色/米色下用深红字,压过 kk-lean 的白字 ---------- */
html[data-kk-theme="light"] .kk-ready div[class*="text-sidebar-foreground"] [data-slot="sidebar-menu-button"][data-active="true"],
html[data-kk-theme="light"] .kk-ready div[class*="text-sidebar-foreground"] [data-slot="sidebar-menu-button"][data-active="true"] * {
  background: rgba(226, 62, 87, .10) !important;
  border-color: rgba(226, 62, 87, .35) !important;
  color: #c0271b !important;
}
html[data-kk-theme="sepia"] .kk-ready div[class*="text-sidebar-foreground"] [data-slot="sidebar-menu-button"][data-active="true"],
html[data-kk-theme="sepia"] .kk-ready div[class*="text-sidebar-foreground"] [data-slot="sidebar-menu-button"][data-active="true"] * {
  color: #a3241a !important;
}

/* ---------- 3.5