/* ============================================================
 * 雄鹰面板 · 全站主题切换（白色为默认）
 *   白色：浅底 + 白色卡片 + 深色文字（登录页与后台同一套）
 *   深色：保持原样（GitHub Dark）
 * 说明：选择器统一用 [class~="…"] 精确匹配单个 class，
 *       避免 hover:bg-[…] 这类复合类被基础规则误伤。
 * ============================================================ */

/* ===== 右下角圆形按钮 ===== */
#kk-theme-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 4000;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(22, 119, 232, .45);
  background: #ffffff; color: #1677e8;
  box-shadow: 0 8px 22px rgba(16, 32, 56, .18);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s, color .15s;
}
#kk-theme-float[hidden] { display: none !important; }
#kk-theme-float svg { width: 20px; height: 20px; display: block; }
#kk-theme-float:hover { transform: scale(1.07); }
html[data-kk-theme="dark"] #kk-theme-float { background: #0c1e3a; color: #c5e4ff; border-color: rgba(90, 170, 255, .45); }
html[data-kk-theme="dark"] #kk-theme-float:hover { background: #123056; }

/* ===== 登录页左栏主图 =====
 * 白色（默认）：新机自带雄鹰 + 浅白底的 /eagle-white.png
 * 深色：        新机自带原始主图 /login-bg.png
 */
.login-split > div:first-child {
  background-image: url("/eagle-white.png") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
html[data-kk-theme="dark"] .login-split > div:first-child {
  background-image: url("/login-bg.png") !important;
}

/* ===== 白色主题 · 覆写面板自身的配色变量 =====
 * 面板用了一套 CSS 变量（--background / --foreground / --sidebar …）驱动
 * 语义类（bg-background、text-foreground、bg-sidebar…）。
 * 在这里一次性换掉变量的值，比逐个类覆盖更彻底、更稳。
 * 注意：--sidebar-background 是 HSL 三元组写法（220 20% 2%），其余是十六进制。
 */
html[data-kk-theme="white"] {
  --background: #eef4fb;
  --foreground: #0b1c33;
  --card: #ffffff;
  --card-foreground: #0b1c33;
  --popover: #ffffff;
  --popover-foreground: #0b1c33;
  --secondary: #f6f8fa;
  --secondary-foreground: #0b1c33;
  --muted: #f2f6fb;
  --muted-foreground: #5b6673;
  --border: #d8dee6;
  --input: #d8dee6;
  --sidebar: #ffffff;
  --sidebar-foreground: #0b1c33;
  --sidebar-accent: #eef2f7;
  --sidebar-accent-foreground: #0b1c33;
  --sidebar-border: #e5e9ef;
  --sidebar-background: 0 0% 100%;
  --sidebar-primary-foreground: #ffffff;
}

/* 语义类的兜底（变量万一没被 Tailwind 映射到也生效） */
html[data-kk-theme="white"] .bg-background { background-color: #eef4fb !important; }
html[data-kk-theme="white"] .bg-card { background-color: #ffffff !important; }
html[data-kk-theme="white"] .bg-popover { background-color: #ffffff !important; }
html[data-kk-theme="white"] .bg-sidebar { background-color: #ffffff !important; }
html[data-kk-theme="white"] .bg-secondary { background-color: #f6f8fa !important; }
html[data-kk-theme="white"] .bg-muted { background-color: #f2f6fb !important; }
html[data-kk-theme="white"] .text-foreground { color: #0b1c33 !important; }
html[data-kk-theme="white"] .text-card-foreground { color: #0b1c33 !important; }
html[data-kk-theme="white"] .text-muted-foreground { color: #5b6673 !important; }
html[data-kk-theme="white"] .border-border { border-color: #d8dee6 !important; }

/* ===== 白色主题 · 页面底色 ===== */
html[data-kk-theme="white"] body,
html[data-kk-theme="white"] #root,
html[data-kk-theme="white"] #root > div,
html[data-kk-theme="white"] .min-h-screen { background: #eef4fb !important; }

/* ===== 白色主题 · 后台配色映射 ===== */
html[data-kk-theme="white"] [class~="bg-[#0d1117]"] { background-color: #eef4fb !important; }
html[data-kk-theme="white"] [class~="bg-[#161b22]"] { background-color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#1c2128]"] { background-color: #f2f6fb !important; }
html[data-kk-theme="white"] [class~="bg-[#21262d]"] { background-color: #f6f8fa !important; }
html[data-kk-theme="white"] [class~="bg-[#30363d]"] { background-color: #e8edf3 !important; }
html[data-kk-theme="white"] [class~="bg-[#2d333b]"] { background-color: #eef2f7 !important; }
html[data-kk-theme="white"] [class~="bg-[#262c36]"] { background-color: #eef2f7 !important; }
html[data-kk-theme="white"] [class~="bg-[#1c2333]"] { background-color: #eef2f7 !important; }
html[data-kk-theme="white"] [class~="bg-[#1c1c1c]"] { background-color: #eef2f7 !important; }

html[data-kk-theme="white"] [class~="border-[#30363d]"] { border-color: #d8dee6 !important; }
html[data-kk-theme="white"] [class~="border-[#21262d]"] { border-color: #e5e9ef !important; }
html[data-kk-theme="white"] [class~="border-[#484f58]"] { border-color: #c2cad4 !important; }
html[data-kk-theme="white"] [class~="border-[#8b949e]"] { border-color: #aab4c0 !important; }

html[data-kk-theme="white"] [class~="text-[#e6edf3]"] { color: #0b1c33 !important; }
html[data-kk-theme="white"] [class~="text-[#c9d1d9]"] { color: #1f2933 !important; }
html[data-kk-theme="white"] [class~="text-[#8b949e]"] { color: #5b6673 !important; }
html[data-kk-theme="white"] [class~="text-[#6e7681]"] { color: #6b7280 !important; }
html[data-kk-theme="white"] [class~="text-[#484f58]"] { color: #9aa5b1 !important; }
html[data-kk-theme="white"] [class~="text-[#30363d]"] { color: #c2cad4 !important; }

html[data-kk-theme="white"] [class~="placeholder-[#484f58]"]::placeholder { color: #9aa5b1 !important; }
html[data-kk-theme="white"] [class~="placeholder-[#8b949e]"]::placeholder { color: #a3adba !important; }

/* ===== 白色主题 · 带透明度后缀的色值（如 bg-[#0d1117]/80）=====
 * 这类写法不会命中 [class~="bg-[#0d1117]"]，必须单独处理；
 * 设备卡片正是 bg-[#0d1117]/80，漏掉就会出现一块灰底。
 */
html[data-kk-theme="white"] [class*="bg-[#0d1117]/"] { background-color: rgba(238, 244, 251, .96) !important; }
html[data-kk-theme="white"] [class*="bg-[#161b22]/"] { background-color: rgba(255, 255, 255, .96) !important; }
html[data-kk-theme="white"] [class*="bg-[#1c2128]/"] { background-color: rgba(242, 246, 251, .96) !important; }
html[data-kk-theme="white"] [class*="bg-[#21262d]/"] { background-color: rgba(246, 248, 250, .96) !important; }
html[data-kk-theme="white"] [class*="border-[#30363d]/"] { border-color: rgba(216, 222, 230, .75) !important; }
html[data-kk-theme="white"] [class*="border-[#8b949e]/"] { border-color: rgba(170, 180, 192, .65) !important; }

/* 面板里少量半透明白/黑：白底上白不可见，改成品灰 */
html[data-kk-theme="white"] [class~="bg-white/10"],
html[data-kk-theme="white"] [class~="bg-white/15"] { background-color: rgba(16, 32, 56, .045) !important; }
html[data-kk-theme="white"] [class~="border-white/20"],
html[data-kk-theme="white"] [class~="border-white/30"] { border-color: rgba(16, 32, 56, .14) !important; }

/* ===== 白色主题 · 悬停 / 选中 / 焦点态 ===== */
html[data-kk-theme="white"] [class~="hover:bg-[#21262d]"]:hover { background-color: #eef2f7 !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#30363d]"]:hover { background-color: #dfe6ee !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#0d1117]"]:hover { background-color: #e7eef8 !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#1c2128]"]:hover { background-color: #eaf0f8 !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#1c2333]"]:hover { background-color: #eaf0f8 !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#161b22]"]:hover { background-color: #f7fafd !important; }
html[data-kk-theme="white"] [class~="hover:bg-[#2ea043]"]:hover { background-color: #1f8a3b !important; }
html[data-kk-theme="white"] [class~="data-[state=selected]:bg-[#1c2128]"][data-state="selected"] { background-color: #e6edf7 !important; }
html[data-kk-theme="white"] [class~="hover:text-[#e6edf3]"]:hover { color: #0b1c33 !important; }
html[data-kk-theme="white"] [class~="hover:text-[#c9d1d9]"]:hover { color: #1f2933 !important; }
html[data-kk-theme="white"] [class~="hover:border-[#484f58]"]:hover { border-color: #a9b4c1 !important; }
html[data-kk-theme="white"] [class~="focus:border-[#484f58]"]:focus { border-color: #a9b4c1 !important; }
html[data-kk-theme="white"] [class~="hover:border-[#8b949e]"]:hover { border-color: #98a4b2 !important; }
html[data-kk-theme="white"] [class~="focus:border-[#8b949e]"]:focus { border-color: #98a4b2 !important; }
html[data-kk-theme="white"] [class~="hover:border-[#30363d]"]:hover { border-color: #c2cad4 !important; }
html[data-kk-theme="white"] [class~="focus:border-[#30363d]"]:focus { border-color: #c2cad4 !important; }
html[data-kk-theme="white"] [class~="hover:border-[#58a6ff]"]:hover { border-color: #2678f0 !important; }
html[data-kk-theme="white"] [class~="focus:border-[#58a6ff]"]:focus { border-color: #2678f0 !important; }
html[data-kk-theme="white"] [class~="focus:bg-[#0d1117]"]:focus { background-color: #eaf0f8 !important; }

/* ===== 白色主题 · 登录页专用 ===== */
/* 左栏主图是浅色底，栏内文字必须转深色，否则白字看不见 */
html[data-kk-theme="white"] .login-split > div:first-child,
html[data-kk-theme="white"] .login-split > div:first-child * { color: #0b1c33 !important; }

/* 右侧登录区做成浮起的白色卡片，避免与浅蓝底色拼接出硬边 */
html[data-kk-theme="white"] .login-split > div:last-child {
  background: #ffffff !important;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(16, 32, 56, .10);
  margin: 0 24px;
}
html[data-kk-theme="white"] .login-split label,
html[data-kk-theme="white"] .login-split p,
html[data-kk-theme="white"] .login-split a { color: #4a5563 !important; }
html[data-kk-theme="white"] .login-split h1,
html[data-kk-theme="white"] .login-split h2 { color: #0b1c33 !important; }
html[data-kk-theme="white"] .login-split button[class*="text-gray-"] { color: #6b7280 !important; }

/* ===== 白色主题 · 输入框统一浅底深字 ===== */
html[data-kk-theme="white"] input,
html[data-kk-theme="white"] textarea,
html[data-kk-theme="white"] select {
  background-color: #ffffff !important;
  color: #1f2328 !important;
  border-color: #d0d7de !important;
}
html[data-kk-theme="white"] input::placeholder,
html[data-kk-theme="white"] textarea::placeholder { color: #9aa5b1 !important; }

/* ===== 白色主题 · 红/绿/蓝实心按钮保持白字（放在文字规则之后，靠顺序覆盖）===== */
html[data-kk-theme="white"] [class~="bg-[#dc3545]"],
html[data-kk-theme="white"] [class~="bg-[#dc3545]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#ff1744]"],
html[data-kk-theme="white"] [class~="bg-[#ff1744]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#22c55e]"],
html[data-kk-theme="white"] [class~="bg-[#22c55e]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#238636]"],
html[data-kk-theme="white"] [class~="bg-[#238636]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#2ea043]"],
html[data-kk-theme="white"] [class~="bg-[#2ea043]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] [class~="bg-[#4285f4]"],
html[data-kk-theme="white"] [class~="bg-[#4285f4]"] * { color: #ffffff !important; }
html[data-kk-theme="white"] .login-split button[type="submit"],
html[data-kk-theme="white"] .login-split button[type="submit"] * { color: #ffffff !important; }

/* ===== 白色主题 · 滚动条 ===== */
html[data-kk-theme="white"] ::-webkit-scrollbar-track { background: #f2f6fb !important; }
html[data-kk-theme="white"] ::-webkit-scrollbar-thumb { background: #c8d2de !important; }
