/* ================= KK Build Dashboard (2026-10-23) ================= */
html[data-kk-theme="dark"]{background:#050914!important}
html[data-kk-theme="dark"] body{isolation:isolate;background-color:transparent!important}
#root{position:relative;z-index:1}
.sd-cosmos{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(24,120,230,.55) 0%, transparent 46%),
    radial-gradient(ellipse at 12% 78%, rgba(16,64,150,.32) 0%, transparent 32%),
    radial-gradient(ellipse at 88% 70%, rgba(20,90,190,.28) 0%, transparent 30%),
    linear-gradient(180deg,#050914 0%,#071428 42%,#0a2450 74%,#0e3d82 100%)}
html[data-kk-theme="white"] .sd-cosmos{display:none}
.sd-stars{position:absolute;inset:0;width:100%;height:100%;z-index:1}
.sd-aurora{position:absolute;border-radius:50%;filter:blur(70px);opacity:.28}
.sd-a1{width:78vw;height:56vw;top:-20%;left:10%;background:radial-gradient(circle,rgba(80,170,255,.22),transparent 76%);animation:sdDriftA 22s ease-in-out infinite}
.sd-a2{width:64vw;height:64vw;right:-20%;bottom:-24%;background:radial-gradient(circle,rgba(20,90,210,.24),transparent 78%);animation:sdDriftB 28s ease-in-out infinite}
.sd-a3{width:50vw;height:42vw;left:-18%;bottom:4%;background:radial-gradient(circle,rgba(40,140,255,.14),transparent 74%);animation:sdDriftC 26s ease-in-out infinite}
.sd-a4{width:36vw;height:36vw;top:18%;left:28%;background:radial-gradient(circle,rgba(170,214,255,.12),transparent 76%);animation:sdDriftA 31s ease-in-out infinite reverse}
.sd-milky{position:absolute;inset:-20%;background:linear-gradient(118deg,transparent 28%,rgba(70,140,220,.10) 42%,rgba(160,210,255,.16) 50%,rgba(40,100,200,.10) 58%,transparent 72%);filter:blur(16px);opacity:.22;mix-blend-mode:screen}
.sd-fog{position:absolute;left:-30%;width:160%;bottom:-8%;filter:blur(42px);opacity:.45;mix-blend-mode:screen}
.sd-f1{height:36%;background:radial-gradient(ellipse at 50% 100%,rgba(60,140,220,.14),transparent 72%);animation:sdFog 22s ease-in-out infinite}
.sd-f2{height:28%;bottom:-6%;background:radial-gradient(ellipse at 18% 100%,rgba(16,48,110,.18),transparent 74%);animation:sdFog 18s ease-in-out infinite reverse}
.sd-f3{height:26%;background:radial-gradient(ellipse at 40% 100%,rgba(140,200,255,.08),transparent 74%);animation:sdFog 26s ease-in-out infinite}
.sd-dune{position:absolute;border-radius:50%}
.sd-d1{left:-8%;right:-8%;bottom:-24vh;height:32vh;background:#06101e}
.sd-d2{left:-28%;right:38%;bottom:-22vh;height:28vh;background:#081428}
.sd-d3{left:22%;right:8%;bottom:-26vh;height:30vh;background:#0a1c38}
@keyframes sdDriftA{50%{transform:translate(4%,6%) scale(1.08)}}
@keyframes sdDriftB{50%{transform:translate(-6%,-4%) scale(1.12)}}
@keyframes sdDriftC{50%{transform:translate(8%,-5%)}}
@keyframes sdFog{50%{transform:translateX(-6%)}}
@media (prefers-reduced-motion: reduce){.sd-aurora,.sd-fog{animation:none!important}}
html[data-kk-theme="dark"] main,html[data-kk-theme="dark"] main .bg-background,html[data-kk-theme="dark"] main .bg-white{background:transparent!important}
html[data-kk-theme="dark"] main .bg-\[\#0d1117\],html[data-kk-theme="dark"] main .bg-\[\#0d1117\]\/80,html[data-kk-theme="dark"] main .bg-\[\#0d1117\]\/50{background-color:transparent!important}
html[data-kk-theme="dark"] .bg-\[\#161b22\]{background-color:rgba(13,20,32,.72)!important}
html[data-kk-theme="dark"] aside,html[data-kk-theme="dark"] [data-sidebar="sidebar"]{background-color:rgba(6,14,32,.86)!important}

.kkb-grid{display:grid;gap:16px;align-items:start;height:100%;min-height:0;overflow:auto;padding:2px 2px 24px}
.kkb-grid.kkb-wide{grid-template-columns:var(--kk-c1,600px) var(--kk-c2,420px) minmax(0,1fr)}
.kkb-grid.kkb-narrow{grid-template-columns:minmax(0,1fr) 360px}
.kkb-dc{display:contents!important}
.kkb-card{background:transparent!important;border:1px solid rgba(94,182,255,.28);border-radius:12px;padding:16px;min-width:0;backdrop-filter:none!important}
.kkb-form{grid-column:2;grid-row:1;max-height:none!important;overflow-y:auto!important;min-height:0;padding:10px!important}
.kkb-form.space-y-4>*+*{margin-top:6px!important}
.kkb-form input,.kkb-form select{height:28px!important;padding-top:0!important;padding-bottom:0!important;font-size:12px!important}
.kkb-form .grid{gap:6px!important}

.kkb-preview{grid-column:1/span 2;grid-row:2;height:672px!important;min-height:672px;overflow:hidden;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important;backdrop-filter:none!important}
.kkb-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 4px;min-height:30px}
.kkb-toolbar>.kkb-icon-sec,.kkb-toolbar>.kkb-adapt-sec{display:flex;align-items:center;gap:8px;margin:0;min-width:0}
.kkb-toolbar>.kkb-icon-sec>p,.kkb-toolbar>.kkb-adapt-sec>p{display:none!important}
.kkb-toolbar>.kkb-icon-sec>div,.kkb-toolbar>.kkb-adapt-sec>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0}
.kkb-toolbar button:not(.relative){height:28px!important;padding:0 8px!important;font-size:12px!important}
.kkb-toolbar .kkb-icon-sec svg{width:14px!important;height:14px!important}
.kkb-preview>div.pt-1{display:none!important}
.kkb-preview>p{display:none!important}
html[data-kk-theme="dark"] .kkb-preview .bg-white{background:#fff!important}
.kkb-cdn{grid-column:1;grid-row:1}
.kkb-cdn .kkb-bd{gap:6px}
.kkb-cdn .kkb-grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px}
.kkb-cdn .kkb-field{gap:2px}
.kkb-cdn .kkb-field label{font-size:11px;line-height:1.2}
.kkb-cdn .kkb-field input,.kkb-cdn .kkb-field select{height:28px!important;padding:3px 6px!important;font-size:11px!important}

.kkb-auto{grid-column:1;grid-row:3}
.kkb-history{grid-column:3;grid-row:1/span 2;min-height:0;max-height:calc(100vh - 120px);overflow:hidden}
.kkb-grid.kkb-wide .kkb-history{height:300px!important;max-height:300px!important}
.kkb-rail{display:flex;flex-direction:column;gap:16px;min-width:0}

.kkb-panel{background:transparent!important;border:1px solid rgba(94,182,255,.28);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:6px;min-width:0;color:#c9d1d9;font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;backdrop-filter:none!important}
.kkb-panel.in-rail{width:100%}
.kkb-hd{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.kkb-hd b{color:#e6edf3;font-size:12px}
.kkb-hd-r{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.kkb-bd{display:flex;flex-direction:column;gap:8px;min-height:0}
.kkb-panel{padding:8px 10px;gap:6px}
.kkb-bd{gap:2px}
.kkb-field{gap:0}
.kkb-field input,.kkb-field select{height:24px!important;padding:1px 6px!important;font-size:11px!important}

.kkb-field{display:flex;flex-direction:column;gap:0}
.kkb-field label{color:#8b949e;font-size:10px;line-height:1.1}
.kkb-field input,.kkb-field select{background:#0d1117;border:1px solid #30363d;border-radius:6px;color:#e6edf3;padding:1px 6px;font-size:11px;outline:none;min-width:0;height:24px!important}
.kkb-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:2px}
.kkb-btn{cursor:pointer;border:1px solid #30363d;background:#21262d;color:#c9d1d9;border-radius:8px;padding:5px 10px;font-size:12px;line-height:1.2}
.kkb-btn:hover{background:#30363d;color:#e6edf3}
.kkb-btn.primary{background:#1f6feb;border-color:#1f6feb;color:#fff}
.kkb-btn.primary:hover{background:#2a7bf0}
.kkb-btn.danger{background:rgba(248,81,73,.1);border-color:rgba(248,81,73,.25);color:#f85149}
.kkb-btn.danger:hover{background:rgba(248,81,73,.2)}
.kkb-btn.xs{padding:3px 8px;font-size:11px}
.kkb-pill{font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid #30363d;color:#8b949e}
.kkb-pill.on{color:#3fb950;border-color:rgba(63,185,80,.35);background:rgba(63,185,80,.1)}
.kkb-msg{font-size:11px;color:#8b949e}
.kkb-row{display:flex;align-items:center;gap:8px}
.kkb-sub{color:#8b949e;font-size:12px}
.kkb-grow{flex:1;min-width:0;color:#e6edf3}
.kkb-num{width:84px;background:#0d1117;border:1px solid #30363d;border-radius:8px;color:#e6edf3;padding:4px 8px;font-size:12px}
.kkb-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px;overflow:auto;min-height:0;padding-right:2px}
.kkb-empty{color:#8b949e;font-size:12px;padding:10px 0}
.kkb-hcard{border:1px solid #21262d;background:rgba(13,20,32,.38);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:6px;min-width:0}
.kkb-hcard:hover{border-color:rgba(94,182,255,.35)}
.kkb-card-top{display:flex;align-items:center;justify-content:space-between;gap:6px}
.kkb-ico{width:34px;height:34px;border-radius:8px;background:#161b22;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#8b949e;font-weight:700}
.kkb-ico img{width:100%;height:100%;object-fit:cover}
.kkb-badge{font-size:11px;padding:1px 6px;border-radius:5px;border:1px solid transparent}
.kkb-badge.done{color:#3fb950;background:rgba(63,185,80,.1);border-color:rgba(63,185,80,.25)}
.kkb-badge.building{color:#fb923c;background:rgba(251,146,60,.1);border-color:rgba(251,146,60,.25)}
.kkb-badge.pending{color:#8b949e;background:rgba(139,148,158,.1);border-color:rgba(139,148,158,.25)}
.kkb-badge.failed{color:#f85149;background:rgba(248,81,73,.1);border-color:rgba(248,81,73,.25)}
.kkb-pkg{color:#e6edf3;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kkb-meta{color:#8b949e;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kkb-card-acts{display:flex;gap:6px;flex-wrap:wrap}
.kkb-mask{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:100000;display:flex;align-items:center;justify-content:center}
.kkb-modal{width:min(680px,92vw);max-height:80vh;overflow:auto;background:#0d1522;border:1px solid #30363d;border-radius:12px;color:#c9d1d9;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.kkb-modal-hd{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #21262d;color:#e6edf3}
.kkb-modal-bd{padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.kkb-x{cursor:pointer;background:transparent;border:0;color:#8b949e;font-size:16px}
.kkb-pre{white-space:pre-wrap;word-break:break-all;background:#0a101c;border:1px solid #21262d;border-radius:8px;padding:10px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#c9d1d9;max-height:50vh;overflow:auto}
.kkb-log{border-bottom:1px solid #161b22;padding-bottom:8px}
.kkb-qr{text-align:center}
.kkb-qr img{max-width:260px;width:100%;border-radius:8px;background:#fff;padding:8px}

/* 白色主题适配 */
html[data-kk-theme="white"] .kkb-card,
html[data-kk-theme="white"] .kkb-panel,
html[data-kk-theme="white"] .kkb-hcard{background:rgba(255,255,255,.92);border-color:#d0d7de;color:#1f2328}
html[data-kk-theme="white"] .kkb-hd b,
html[data-kk-theme="white"] .kkb-pkg,
html[data-kk-theme="white"] .kkb-grow{color:#1f2328}
html[data-kk-theme="white"] .kkb-field label,
html[data-kk-theme="white"] .kkb-sub,
html[data-kk-theme="white"] .kkb-meta,
html[data-kk-theme="white"] .kkb-msg{color:#57606a}
html[data-kk-theme="white"] .kkb-field input,
html[data-kk-theme="white"] .kkb-field select,
html[data-kk-theme="white"] .kkb-num{background:#fff;border-color:#d0d7de;color:#1f2328}
html[data-kk-theme="white"] .kkb-btn{background:#f6f8fa;border-color:#d0d7de;color:#1f2328}
html[data-kk-theme="white"] .kkb-btn:hover{background:#eef1f4}
html[data-kk-theme="white"] .kkb-btn.primary{background:#1f6feb;border-color:#1f6feb;color:#fff}
html[data-kk-theme="white"] .kkb-hcard{border-color:#e1e4e8}
html[data-kk-theme="white"] .kkb-ico{background:#f6f8fa}
html[data-kk-theme="white"] .kkb-pill{border-color:#d0d7de;color:#57606a}
html[data-kk-theme="white"] .kkb-modal{background:#fff;border-color:#d0d7de;color:#1f2328}
html[data-kk-theme="white"] .kkb-modal-hd{color:#1f2328;border-color:#eaeef2}
html[data-kk-theme="white"] .kkb-pre{background:#f6f8fa;border-color:#e1e4e8;color:#1f2328}

/* 登录页：参考服星空风格（移除 KK 大图） */
.login-split{background-color:transparent!important;background-image:none!important}
.min-h-screen:has(.login-split){background:transparent!important}
.login-split > div:last-child{background:linear-gradient(90deg,transparent,rgba(8,20,48,.35) 18%,rgba(6,16,40,.72) 42%)!important}
html[data-kk-theme="white"] .login-split{background-color:#f3f6fb!important}
html[data-kk-theme="white"] .min-h-screen:has(.login-split){background:#f3f6fb!important}
html[data-kk-theme="white"] .login-split > div:last-child{background:linear-gradient(90deg,transparent,rgba(255,255,255,.55) 18%,rgba(255,255,255,.92) 42%)!important}

/* APK构建页：模块只用主背景，不要单独黑底 */
html[data-kk-theme="dark"] .kkb-grid .bg-\[\#161b22\]{background-color:transparent!important}
