/* KK 登录页外观。表单、记住密码、两步验证仍走原来的组件。 */
.login-split {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100svh;
  height: 100svh;
  align-items: stretch !important;
  justify-items: stretch !important;
  display: grid !important;
  grid-template-columns: 64% 36%;
  background-color: #030918;
  background-image: url(/kk-eagle-bg.png);
  background-size: cover;
  background-position: center;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
.min-h-screen:has(.login-split) {
  background: #030918 !important;
}
.login-split > div:first-child {
  background: none !important;
  min-height: 100svh;
}
.login-split > div:first-child > * {
  display: none !important;
}
.login-split > div:last-child {
  position: relative;
  min-height: 100svh;
  background: linear-gradient(90deg, transparent, rgba(3, 9, 24, .25) 20%) !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 36px 64px !important;
}
.login-split.kk-login-main .sm\:w-\[380px\] {
  width: 100% !important;
  max-width: 360px !important;
}
.login-split input {
  height: 50px !important;
  border: 1px solid #26364f !important;
  border-radius: 9px !important;
  background: rgba(15, 26, 45, .85) !important;
  color: #fff !important;
  padding: 0 15px !important;
  font-size: 15px !important;
  box-shadow: none !important;
}
.login-split input:focus {
  border-color: #38a8ff !important;
  box-shadow: 0 0 0 3px #2398ff20 !important;
  outline: none !important;
}
.login-split input::placeholder {
  color: #62718a;
}
.login-split label {
  color: #c4d0e3 !important;
  font-size: 13px !important;
}
.login-split button[type="submit"] {
  height: 50px !important;
  border: 1px solid #52bfff !important;
  border-radius: 9px !important;
  background: linear-gradient(105deg, #167be5, #1aabe8) !important;
  color: #fff !important;
  letter-spacing: 4px;
  font-weight: 600;
  box-shadow: 0 7px 26px #0789e32a !important;
}
.login-split button[type="submit"]:hover {
  filter: brightness(1.12);
}
.login-split input[type="checkbox"] {
  accent-color: #2aabff;
  width: 15px;
  height: 15px;
}

.login-split.kk-login-main .text-center {
  text-align: left !important;
}
.login-split.kk-login-main h1 {
  font-size: 30px !important;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 0 0 10px;
}
.login-split.kk-login-main h1::before {
  content: "KK TECHNOLOGY";
  display: block;
  color: #59bfff;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 400;
  margin-bottom: 15px;
}
.login-split.kk-login-main h1 + p {
  color: #8595af !important;
  font-size: 14px !important;
  margin: 0 0 38px !important;
}
.login-split.kk-login-main form {
  display: flex;
  flex-direction: column;
}
.login-split.kk-login-main form > div:nth-child(2) {
  position: relative;
}
.login-split.kk-login-main form > div:nth-child(2) button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #91a6c4;
  font-size: 12px;
  z-index: 2;
}
.login-split.kk-login-main form > div:nth-child(2) button svg {
  display: none;
}
.login-split.kk-login-main form > div:has(input.input-masked) button::after {
  content: "显示";
}
.login-split.kk-login-main form > div:not(:has(input.input-masked)) button::after {
  content: "隐藏";
}
.login-split.kk-login-main form > div:nth-child(2) input {
  padding-right: 65px !important;
}
.login-split.kk-login-main button[type="submit"] svg {
  display: none;
}
.login-split.kk-login-main form::after {
  content: "KK科技 · 管理平台";
  display: block;
  font-size: 12px;
  color: #667a97;
  text-align: center;
  margin-top: 25px;
  line-height: 1.8;
}
.login-split.kk-login-main > div:last-child::after {
  content: "KK科技";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 11px;
  color: #536681;
  letter-spacing: 1px;
  pointer-events: none;
}

@media (min-aspect-ratio: 2/1) {
  .login-split {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
  }
}
@media (max-width: 1023px) {
  .login-split {
    display: flex !important;
    flex-direction: column;
    background-image: none !important;
  }
  .login-split > div:first-child {
    display: block !important;
    height: 42svh;
    min-height: 0 !important;
    flex: none;
    background-color: #030918 !important;
    background-image: url(/kk-eagle-bg.png) !important;
    background-size: auto 100% !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
  }
  .login-split > div:last-child {
    background: #030918 !important;
    flex: 1;
    padding: 26px 28px 28px !important;
  }
  .login-split.kk-login-main > div:last-child::after {
    position: static;
    display: block;
    padding: 8px 0 0;
  }
  .login-split.kk-login-main h1 {
    font-size: 26px !important;
  }
}

/* 登录后的页面：底色和主色靠向同一套深蓝，危险和状态红保留。 */
html[data-kk-theme="dark"]:not(:has(.login-split)) {
  --background: #07111e;
  --foreground: #eef5ff;
  --card: #0f1a2d;
  --card-foreground: #eef5ff;
  --popover: #122033;
  --popover-foreground: #eef5ff;
  --primary: #1a9ae6;
  --primary-foreground: #ffffff;
  --secondary: #15263c;
  --secondary-foreground: #eef5ff;
  --muted: #122033;
  --muted-foreground: #8ea0b8;
  --accent: #16304c;
  --accent-foreground: #eef5ff;
  --border: #26364f;
  --input: #26364f;
  --ring: #38a8ff;
  --sidebar: #050d1a;
  --sidebar-foreground: #eef5ff;
  --sidebar-primary: #1a9ae6;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #12263d;
  --sidebar-accent-foreground: #eef5ff;
  --sidebar-border: #1c3048;
  --sidebar-ring: #38a8ff;
  --sidebar-background: 216 68% 6%;
  --chart-1: #38a8ff;
  --chart-2: #1aabe8;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #07111e;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#0d1117\],
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#0d1117\]\/80,
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#0d1117\]\/50 {
  background-color: #07111e !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#161b22\] {
  background-color: #0f1a2d !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#1c2128\],
html[data-kk-theme="dark"]:not(:has(.login-split)) .bg-\[\#21262d\] {
  background-color: #122033 !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .border-\[\#30363d\],
html[data-kk-theme="dark"]:not(:has(.login-split)) .\!border-\[\#30363d\] {
  border-color: #26364f !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .border-\[\#21262d\],
html[data-kk-theme="dark"]:not(:has(.login-split)) .divide-\[\#21262d\] > :not(:last-child) {
  border-color: #1c3048 !important;
}
button img[src*="kk-logo.png"] {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  border-radius: 4px;
}
button img[src*="kk-logo.png"] + span {
  overflow: visible !important;
  text-overflow: clip !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .peer\/menu-button[data-active="true"] {
  color: #7ecbff !important;
  background-color: rgba(26, 154, 230, .14) !important;
  border-color: rgba(56, 168, 255, .4) !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) .from-red-500 { --tw-gradient-from: #59bfff !important; }
html[data-kk-theme="dark"]:not(:has(.login-split)) .to-orange-500 { --tw-gradient-to: #167be5 !important; }
html[data-kk-theme="dark"]:not(:has(.login-split)) .from-red-400 { --tw-gradient-from: #8fd4ff !important; }
html[data-kk-theme="dark"]:not(:has(.login-split)) .to-orange-400 { --tw-gradient-to: #1aabe8 !important; }
html[data-kk-theme="dark"]:not(:has(.login-split)) .focus\:border-red-500:focus {
  border-color: #38a8ff !important;
}
html[data-kk-theme="dark"]:not(:has(.login-split)) ::-webkit-scrollbar-track { background: #07111e; }
html[data-kk-theme="dark"]:not(:has(.login-split)) ::-webkit-scrollbar-thumb { background: #26364f; }
html[data-kk-theme="dark"]:not(:has(.login-split)) ::-webkit-scrollbar-thumb:hover { background: #3a5270; }

/* 白色主题。页面里的深色类名保持不变，这里把它们改成白底深字。 */
html[data-kk-theme="white"] {
  --background: #f4f7fb;
  --foreground: #1a2332;
  --card: #ffffff;
  --card-foreground: #1a2332;
  --popover: #ffffff;
  --popover-foreground: #1a2332;
  --primary: #1677d2;
  --primary-foreground: #ffffff;
  --secondary: #eef2f7;
  --secondary-foreground: #1a2332;
  --muted: #eef2f7;
  --muted-foreground: #5c6b80;
  --accent: #e7eef8;
  --accent-foreground: #1a2332;
  --border: #d5deea;
  --input: #d5deea;
  --ring: #1677d2;
  --sidebar: #ffffff;
  --sidebar-foreground: #1a2332;
  --sidebar-primary: #1677d2;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e7eef8;
  --sidebar-accent-foreground: #1a2332;
  --sidebar-border: #e1e7f0;
  --sidebar-ring: #1677d2;
  --sidebar-background: 216 33% 98%;
  color-scheme: light;
}
html[data-kk-theme="white"] body { background: #f4f7fb; color: #1a2332; }
html[data-kk-theme="white"] .bg-\[\#0d1117\],
html[data-kk-theme="white"] .bg-\[\#0d1117\]\/80,
html[data-kk-theme="white"] .bg-\[\#0d1117\]\/50,
html[data-kk-theme="white"] .hover\:bg-\[\#0d1117\]:hover,
html[data-kk-theme="white"] .focus\:bg-\[\#0d1117\]:focus { background-color: #f4f7fb !important; }
html[data-kk-theme="white"] .bg-\[\#161b22\],
html[data-kk-theme="white"] .hover\:bg-\[\#161b22\]:hover { background-color: #ffffff !important; }
html[data-kk-theme="white"] .bg-\[\#1c2128\],
html[data-kk-theme="white"] .bg-\[\#21262d\],
html[data-kk-theme="white"] .bg-\[\#21262d\]\/50,
html[data-kk-theme="white"] .bg-\[\#262c36\],
html[data-kk-theme="white"] .bg-\[\#2d333b\],
html[data-kk-theme="white"] .bg-\[\#1c2333\],
html[data-kk-theme="white"] .hover\:bg-\[\#1c2128\]:hover,
html[data-kk-theme="white"] .hover\:bg-\[\#21262d\]:hover,
html[data-kk-theme="white"] .hover\:bg-\[\#1c2333\]:hover,
html[data-kk-theme="white"] .focus\:bg-\[\#1c2128\]:focus { background-color: #eef2f7 !important; }
html[data-kk-theme="white"] .bg-\[\#30363d\],
html[data-kk-theme="white"] .bg-\[\#30363d\]\/50,
html[data-kk-theme="white"] .hover\:bg-\[\#30363d\]:hover { background-color: #e4ebf3 !important; }
html[data-kk-theme="white"] .border-\[\#30363d\],
html[data-kk-theme="white"] .\!border-\[\#30363d\],
html[data-kk-theme="white"] .border-\[\#30363d\]\/50,
html[data-kk-theme="white"] .border-\[\#30363d\]\/30,
html[data-kk-theme="white"] .border-\[\#21262d\],
html[data-kk-theme="white"] .border-\[\#484f58\],
html[data-kk-theme="white"] .border-\[\#3a4250\],
html[data-kk-theme="white"] .hover\:border-\[\#30363d\]:hover,
html[data-kk-theme="white"] .hover\:border-\[\#484f58\]:hover,
html[data-kk-theme="white"] .divide-\[\#21262d\] > :not(:last-child) { border-color: #d5deea !important; }
html[data-kk-theme="white"] .text-\[\#e6edf3\],
html[data-kk-theme="white"] .hover\:text-\[\#e6edf3\]:hover { color: #1a2332 !important; }
html[data-kk-theme="white"] .text-\[\#c9d1d9\],
html[data-kk-theme="white"] .hover\:text-\[\#c9d1d9\]:hover { color: #243044 !important; }
html[data-kk-theme="white"] .text-\[\#8b949e\],
html[data-kk-theme="white"] .text-\[\#6e7681\],
html[data-kk-theme="white"] .text-\[\#9aa0a6\],
html[data-kk-theme="white"] .text-\[\#484f58\],
html[data-kk-theme="white"] .placeholder-\[\#8b949e\]::placeholder,
html[data-kk-theme="white"] .placeholder-\[\#484f58\]::placeholder { color: #5c6b80 !important; }
html[data-kk-theme="white"] .text-\[\#58a6ff\] { color: #1677d2 !important; }
html[data-kk-theme="white"] .peer\/menu-button[data-active="true"] {
  color: #1677d2 !important;
  background-color: #e7eef8 !important;
  border-color: #b9d4f5 !important;
}
html[data-kk-theme="white"] input,
html[data-kk-theme="white"] textarea,
html[data-kk-theme="white"] select {
  background-color: #ffffff;
  color: #1a2332;
  border-color: #d5deea;
}
html[data-kk-theme="white"] ::-webkit-scrollbar-track { background: #f4f7fb; }
html[data-kk-theme="white"] ::-webkit-scrollbar-thumb { background: #c5d0de; }
html[data-kk-theme="white"] ::-webkit-scrollbar-thumb:hover { background: #a8b6c9; }

html[data-kk-theme="white"] .min-h-screen:has(.login-split) { background: #f4f7fb !important; }
html[data-kk-theme="white"] .login-split { background-color: #f4f7fb; }
html[data-kk-theme="white"] .login-split > div:last-child {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.78) 16%, #ffffff 40%) !important;
}
html[data-kk-theme="white"] .login-split input {
  background: #ffffff !important;
  color: #1a2332 !important;
  border-color: #d5deea !important;
}
html[data-kk-theme="white"] .login-split input::placeholder { color: #8aa0b8; }
html[data-kk-theme="white"] .login-split label,
html[data-kk-theme="white"] .login-split.kk-login-main h1 { color: #1a2332 !important; }
html[data-kk-theme="white"] .login-split.kk-login-main h1 + p,
html[data-kk-theme="white"] .login-split.kk-login-main form::after,
html[data-kk-theme="white"] .login-split.kk-login-main > div:last-child::after { color: #5c6b80 !important; }
html[data-kk-theme="white"] .kk-tg-login {
  background: #ffffff !important;
  color: #1a2332 !important;
  border-color: #d5deea !important;
}
@media (max-width: 1023px) {
  html[data-kk-theme="white"] .login-split > div:last-child { background: #ffffff !important; }
}

#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, 210, .28);
  background: #ffffff;
  color: #1677d2;
  box-shadow: 0 8px 22px rgba(16, 32, 56, .16);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#kk-theme-float svg { width: 20px; height: 20px; display: block; }
html[data-kk-theme="dark"] #kk-theme-float {
  background: #122033;
  color: #8fd4ff;
  border-color: #26364f;
}
