/* 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: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:not(:has(.login-split)) body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #07111e;
}
html:not(:has(.login-split)) .bg-\[\#0d1117\],
html:not(:has(.login-split)) .bg-\[\#0d1117\]\/80,
html:not(:has(.login-split)) .bg-\[\#0d1117\]\/50 {
  background-color: #07111e !important;
}
html:not(:has(.login-split)) .bg-\[\#161b22\] {
  background-color: #0f1a2d !important;
}
html:not(:has(.login-split)) .bg-\[\#1c2128\],
html:not(:has(.login-split)) .bg-\[\#21262d\] {
  background-color: #122033 !important;
}
html:not(:has(.login-split)) .border-\[\#30363d\],
html:not(:has(.login-split)) .\!border-\[\#30363d\] {
  border-color: #26364f !important;
}
html:not(:has(.login-split)) .border-\[\#21262d\],
html: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: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:not(:has(.login-split)) .from-red-500 { --tw-gradient-from: #59bfff !important; }
html:not(:has(.login-split)) .to-orange-500 { --tw-gradient-to: #167be5 !important; }
html:not(:has(.login-split)) .from-red-400 { --tw-gradient-from: #8fd4ff !important; }
html:not(:has(.login-split)) .to-orange-400 { --tw-gradient-to: #1aabe8 !important; }
html:not(:has(.login-split)) .focus\:border-red-500:focus {
  border-color: #38a8ff !important;
}
html:not(:has(.login-split)) ::-webkit-scrollbar-track { background: #07111e; }
html:not(:has(.login-split)) ::-webkit-scrollbar-thumb { background: #26364f; }
html:not(:has(.login-split)) ::-webkit-scrollbar-thumb:hover { background: #3a5270; }

/* ===========================================================================
   注入页 / 应用列表：操作按钮紧凑并靠右，把宽度让给操作区（2026 改版）
   =========================================================================== */
/* 操作列按钮：矮、窄、不折行，整体靠右贴边 */
main table td:last-child > div,
main table td:last-child > span:last-child { justify-content: flex-end !important; }
main table td:last-child { padding-right: 6px !important; }
main table td:last-child button {
  height: 22px !important; min-height: 22px !important; max-height: 22px !important;
  padding: 0 5px !important; font-size: 11px !important; line-height: 1 !important;
  border-radius: 5px !important; white-space: nowrap !important;
}
main table td:last-child { white-space: nowrap !important; }
/* 已注入行淡蓝底，跟"可注入"行一眼区分（配合置顶排序） */
main table tbody tr[data-kk-state="1"] { background: rgba(56,168,255,.07) !important; }
main table tbody tr[data-kk-state="0"]:hover { background: rgba(56,168,255,.04) !important; }

/* 批量按钮（全部注入 / 全部取消注入），由 kk-inject-page.js 注入到工具栏 */
.kk-batch-btn {
  height: 26px; padding: 0 9px; margin-left: 6px; font-size: 12px; line-height: 1;
  border-radius: 6px; border: 1px solid #26364f; background: #122033; color: #cfe3ff;
  cursor: pointer; white-space: nowrap;
}
.kk-batch-btn.is-inject { border-color: rgba(56,168,255,.55); background: rgba(26,154,230,.18); color: #8fd4ff; }
.kk-batch-btn.is-uninject { border-color: rgba(255,159,64,.4); background: rgba(255,159,64,.1); color: #ffc38f; }
.kk-batch-btn:hover { filter: brightness(1.18); }

/* 操作反馈提示条 */
.kk-toast {
  position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px; z-index: 9999;
  background: rgba(9,20,34,.96); border: 1px solid #26364f; color: #d9e8ff; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); transition: opacity .4s ease, transform .4s ease;
}
.kk-toast.kk-out { opacity: 0; transform: translate(-50%, 12px); }

/* 手机功能按钮（投屏下方 返回/主页/多任务/音量/电源 等）：再放大一档，吃满可用宽度 */
main div.flex.gap-3.flex-1:has([role=tablist]) > div:first-child button.h-9 {
  height: 40px !important; min-height: 40px !important; font-size: 13.5px !important;
  padding-left: 10px !important; padding-right: 10px !important;
}
main div.flex.gap-3.flex-1:has([role=tablist]) > div:first-child button.h-9 svg {
  width: 18px !important; height: 18px !important;
}
/* 手机功能按钮所在的按钮排：均分铺满，不留空隙 */
main div.flex.gap-3.flex-1:has([role=tablist]) > div:first-child [class*="grid-cols-5"] {
  gap: 4px !important;
}
main div.flex.gap-3.flex-1:has([role=tablist]) > div:first-child [class*="grid-cols-5"] button {
  min-height: 36px !important; font-size: 12px !important;
}

/* ==========================================================================
   注入/应用表格布局优化（按截图批注：操作按钮竖排 + 移到最左 + 列表紧凑）
   由 kk-inject-page.js 给表格打 data-kk-act-first 标记后生效，不影响其它表格
   ========================================================================== */
main table[data-kk-act-first="1"] thead th:first-child,
main table[data-kk-act-first="1"] tbody td:first-child {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  position: sticky; left: 0; z-index: 2;
  background: inherit;
}
main table[data-kk-act-first="1"] thead th:first-child { z-index: 6; background: var(--kk-th-bg, #10161d); }
/* 操作按钮竖排：现在的横排按钮组改成上下堆叠 */
main table[data-kk-act-first="1"] tbody td:first-child > div,
main table[data-kk-act-first="1"] tbody td:first-child > span {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 3px !important;
}
main table[data-kk-act-first="1"] tbody td:first-child button {
  width: 100% !important;
  height: 24px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap;
}
/* 列表紧凑：行高/字号收一点，把宽度让给包名和状态 */
main table[data-kk-act-first="1"] tbody td { padding-top: 4px !important; padding-bottom: 4px !important; font-size: 12.5px !important; }
main table[data-kk-act-first="1"] thead th { padding-top: 6px !important; padding-bottom: 6px !important; font-size: 12px !important; }
