/* ============================================================
   利刃 · 设备页 kk-v2.css  (只负责外观,几何尺寸由 kk-v2.js 直接给)
   ============================================================ */

/* ---------- 侧边功能栏(原按钮墙)竖排 ---------- */
html.kk-v2 .kk-fncol {
  padding: 4px !important; border: 1px solid #21262d !important; border-radius: 10px !important;
  background: #0d1117 !important; overflow-y: auto !important; overflow-x: hidden !important;
  display: flex !important; flex-direction: column !important; gap: 4px !important;
  scrollbar-width: none;
}
html.kk-v2 .kk-fncol::-webkit-scrollbar { width: 0; }
html.kk-v2 .kk-fncol > div.w-px { display: none !important; }
html.kk-v2 .kk-fncol > div { min-width: 0 !important; flex: 0 0 auto !important; }
html.kk-v2 .kk-fncol .grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 3px !important; }
html.kk-v2 .kk-fncol .grid > div { margin: 0 !important; min-width: 0 !important; }
html.kk-v2 .kk-fncol button {
  width: 100% !important; height: 23px !important; min-height: 23px !important;
  padding: 0 4px !important; display: flex !important; align-items: center !important; gap: 3px !important;
  border-radius: 5px !important; font-size: 10.5px !important; line-height: 1 !important;
  white-space: nowrap !important; overflow: hidden !important;
}
html.kk-v2 .kk-fncol button svg { width: 11px !important; height: 11px !important; flex: 0 0 11px !important; }
html.kk-v2 .kk-fncol button span { font-size: 11px !important; overflow: hidden; text-overflow: ellipsis; }

/* ---------- ADB 列 ---------- */
html.kk-v2 .kk-adbcol {
  display: flex !important; flex-direction: column !important; gap: 6px !important;
  min-width: 0 !important; overflow: hidden !important;
}
html.kk-v2 .kk-adb-screen { display: none !important; }
html.kk-v2 .kk-adb-top {
  display: flex; align-items: center; gap: 6px; height: 26px; flex: 0 0 26px;
  padding: 0 8px; border: 1px solid #30363d; border-radius: 7px; background: #161b22;
  font-size: 11.5px; color: #8b949e; overflow: hidden; white-space: nowrap;
}
html.kk-v2 .kk-adb-top b { color: #e6edf3; font-size: 11.5px; letter-spacing: .04em; }
html.kk-v2 .kk-adb-top .kk-adb-id { color: #58a6ff; font-family: ui-monospace, monospace; }
html.kk-v2 .kk-adb-top .kk-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 6px #3fb950; flex: 0 0 6px;
}

/* ---------- 两个小屏 ---------- */
html.kk-v2 .kk-mini {
  display: flex !important; flex-direction: column !important;
  border: 1px solid #30363d; border-radius: 8px; background: #0d1117;
  overflow: hidden !important; min-height: 0 !important;
}
html.kk-v2 .kk-mini-h {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: 24px; flex: 0 0 24px; padding: 0 8px; background: #161b22;
  border-bottom: 1px solid #21262d;
}
html.kk-v2 .kk-mini-h b { font-size: 11.5px; color: #e6edf3; font-weight: 600; letter-spacing: .03em; }
html.kk-v2 .kk-mini-h em.kk-mini-live {
  font-style: normal; font-size: 9.5px; color: #3fb950; cursor: default;
  padding: 1px 5px; border: 1px solid #3fb95044; border-radius: 9px; letter-spacing: .04em;
  background: #3fb95012;
}
html.kk-v2 .kk-mini-empty { opacity: .55; font-size: 10.5px; }
html.kk-v2 .kk-mini-b {
  flex: 1 1 auto; overflow-y: auto; padding: 4px 7px; font-size: 11px; color: #8b949e;
  display: flex; flex-direction: column; gap: 3px; scrollbar-width: none;
}
html.kk-v2 .kk-mini-b::-webkit-scrollbar { width: 0; }
html.kk-v2 .kk-mini-b .kk-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  white-space: normal; word-break: break-all; overflow: visible;
  border-bottom: 1px dashed #21262d; padding-bottom: 2px;
}
html.kk-v2 .kk-mini-b .kk-row i { font-style: normal; color: #e6edf3; font-weight: 600; }
html.kk-v2 .kk-mini-b .kk-row s {
  text-decoration: none; color: #6e7681; font-size: 9.5px; font-family: ui-monospace, monospace;
  white-space: nowrap; letter-spacing: .02em;
}
html.kk-v2 .kk-mini-b .kk-row u {
  text-decoration: none; color: #8b949e; font-family: ui-monospace, monospace; font-size: 10.5px;
  line-height: 1.35; white-space: normal; word-break: break-all; overflow: visible; text-overflow: clip;
}

/* ---------- 顶部信息栏 ---------- */
html.kk-v2 .kk-fi-note { flex: 1 1 auto !important; min-width: 240px !important; }
html.kk-v2 .kk-fi-note input { width: 100% !important; }

/* ---------- 亮色主题适配 ---------- */
html.kk-light.kk-v2 .kk-fncol { background: #f6f8fa !important; border-color: #d0d7de !important; }
html.kk-light.kk-v2 .kk-adb-top { background: #f6f8fa; border-color: #d0d7de; color: #57606a; }
html.kk-light.kk-v2 .kk-adb-top b { color: #1f2328; }
html.kk-light.kk-v2 .kk-mini { background: #fff; border-color: #d0d7de; }
html.kk-light.kk-v2 .kk-mini-h { background: #f6f8fa; border-color: #d8dee4; }
html.kk-light.kk-v2 .kk-mini-h b { color: #1f2328; }
html.kk-light.kk-v2 .kk-mini-b { color: #57606a; }
html.kk-light.kk-v2 .kk-mini-h em.kk-mini-live { color: #1a7f37; border-color: #1a7f3733; background: #1a7f3708; }
html.kk-light.kk-v2 .kk-mini-b .kk-row i { color: #1f2328; }

/* ---------- 窄屏自适应 ---------- */
@media (max-width: 1280px) {
  html.kk-v2 .kk-mini-b { font-size: 10.5px; }
}
@media (max-width: 900px) {
  html.kk-v2 .kk-fncol { display: none !important; }
}


/* ---------- 应用 / 注入 列表:行高压到原来的五分之一 ---------- */
html.kk-v2 main table { table-layout: fixed !important; }
html.kk-v2 main table thead th {
  height: 26px !important; padding: 0 6px !important; font-size: 11px !important; line-height: 26px !important;
  white-space: nowrap;
}
html.kk-v2 main table tbody td {
  height: 34px !important; padding: 2px 6px !important; font-size: 11.5px !important; line-height: 1.25 !important;
  vertical-align: middle !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html.kk-v2 main table tbody tr { height: 34px !important; }
html.kk-v2 main table tbody td .flex { flex-wrap: nowrap !important; flex-direction: row !important; gap: 3px !important; }
html.kk-v2 main table tbody td button {
  height: 22px !important; min-height: 22px !important; padding: 0 5px !important;
  font-size: 10.5px !important; line-height: 1 !important; white-space: nowrap !important;
}
html.kk-v2 main table tbody td button svg { width: 11px !important; height: 11px !important; }
html.kk-v2 main table tbody td:first-child { width: 300px !important; }
html.kk-v2 main table tbody td img,
html.kk-v2 main table tbody td span.w-8,
html.kk-v2 main table tbody td span.h-8 { width: 20px !important; height: 20px !important; }

/* ============================================================
   功能栏 v3:左列(屏幕/遮挡) + 右列(ADB/贯通) + 权限折叠
   ============================================================ */
html.kk-v2 .kk-fncol > div[data-kk-orig-block] { display: none !important; }
html.kk-v2 .kk-fncol { padding: 5px !important; gap: 5px !important; overflow-y: auto !important; overflow-x: hidden !important; justify-content: flex-start !important; }
html.kk-v2 .kk-fn-cols { display: flex !important; gap: 4px !important; width: 100% !important; flex: 0 0 auto !important; align-items: stretch !important; }
html.kk-v2 .kk-fn-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
html.kk-v2 .kk-fn-sec { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html.kk-v2 .kk-fn-grp { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
html.kk-v2 .kk-fn-h {
  font-size: 10px; color: #7d8b99; letter-spacing: .4px; text-align: center;
  padding: 1px 0 3px; border-bottom: 1px solid #21262d; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.kk-v2 .kk-fncol .kk-fnb {
  width: 100% !important; height: 23px !important; min-height: 23px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  padding: 0 4px !important; border-radius: 5px !important;
  border: 1px solid #263140 !important; background: #161d26 !important; color: #c9d6e4 !important;
  font-size: 10.5px !important; line-height: 1 !important;
  white-space: nowrap !important; overflow: hidden !important; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
html.kk-v2 .kk-fncol .kk-fnb span { overflow: hidden; text-overflow: ellipsis; font-size: 10.5px !important; }
html.kk-v2 .kk-fncol .kk-fnb:hover { border-color: #3d5670 !important; background: #1c2735 !important; color: #fff !important; }
html.kk-v2 .kk-fncol .kk-fnb:active { transform: translateY(1px); }
html.kk-v2 .kk-fncol .kk-fnb.on {
  background: #3a1420 !important; border-color: #e23e57 !important; color: #ff6b81 !important;
  box-shadow: inset 0 0 0 1px rgba(226, 62, 87, .25) !important;
}
html.kk-v2 .kk-fn-more { width: 100%; flex: 0 0 auto; display: flex; flex-direction: column; gap: 3px; }
html.kk-v2 .kk-fn-more-h {
  width: 100% !important; height: 24px !important; min-height: 24px !important;
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  padding: 0 7px !important; border-radius: 5px !important; border: 1px dashed #2b3542 !important;
  background: #11161d !important; color: #7d8b99 !important; font-size: 10.5px !important; cursor: pointer;
}
html.kk-v2 .kk-fn-more-h:hover { color: #c9d6e4 !important; border-color: #3d5670 !important; }
html.kk-v2 .kk-fn-more-h em { font-style: normal; transition: transform .15s; }
html.kk-v2 .kk-fn-more.open .kk-fn-more-h em { transform: rotate(180deg); }
html.kk-v2 .kk-fn-more-b { display: none; grid-template-columns: 1fr 1fr; gap: 3px; }
html.kk-v2 .kk-fn-more.open .kk-fn-more-b { display: grid; }
html.kk-v2 .kk-fn-more-b .kk-fnb { height: 24px !important; min-height: 24px !important; font-size: 10.5px !important; }
html.kk-light.kk-v2 .kk-fncol .kk-fnb { background: #fff !important; border-color: #d0d7de !important; color: #1f2328 !important; }
html.kk-light.kk-v2 .kk-fncol .kk-fnb:hover { background: #f3f6f9 !important; }
html.kk-light.kk-v2 .kk-fncol .kk-fnb.on { background: #ffe9ed !important; border-color: #e23e57 !important; color: #c0304a !important; }
html.kk-light.kk-v2 .kk-fn-h { color: #6b7684; border-color: #e3e8ee; }
html.kk-light.kk-v2 .kk-fn-more-h { background: #f6f8fa !important; color: #6b7684 !important; border-color: #d0d7de !important; }

/* ============================================================
   v3 修正:主屏浮窗回位(压掉 kk-screen-float 的隐藏规则)
   + 干掉左侧那条 84px 的装饰竖条
   ============================================================ */
html.kk-v2 .kk-sf-panel {
  position: static !important;
  left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
  opacity: 1 !important; visibility: visible !important; pointer-events: auto !important;
  transform: none !important; z-index: auto !important;
  max-height: none !important; overflow: visible !important;
  background: transparent !important; border: 0 !important; padding: 0 !important;
  box-shadow: none !important; transition: none !important;
}
html.kk-v2 .kk-sf-panel > div:first-child { width: 100% !important; }
html.kk-v2 div.p-4.flex.flex-col.gap-3::after { display: none !important; content: none !important; }
html.kk-v2 .kk-facecol video, html.kk-v2 .kk-sf-panel canvas { margin: 0 auto !important; }

/* v3:功能栏内容顶端对齐(页面自带 items-center/justify-center 会把它居中) */
html.kk-v2 .kk-fncol { justify-content: flex-start !important; align-items: stretch !important; }
html.kk-v2 .kk-fncol > .kk-fn-cols, html.kk-v2 .kk-fncol > .kk-fn-more { align-self: stretch !important; margin: 0 !important; }

/* ============================================================
   v3.2:ADB 投屏屏 高度可拖 + 屏幕放大(几何由 kk-v2.js 写入)
   ============================================================ */
html.kk-v2 .kk-adbs {
  border: 1px solid #30363d !important;
  border-radius: 10px !important;
  background: #000 !important;
  overflow: hidden !important;
  position: relative !important;
}
html.kk-v2 .kk-adbs img { display: block !important; margin: 0 auto !important; }
html.kk-v2 .kk-adbs-grip {
  position: relative;
  cursor: ns-resize;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #161b22;
  border: 1px solid #26303c;
  transition: background .12s, border-color .12s;
  touch-action: none;
  user-select: none;
}
html.kk-v2 .kk-adbs-grip i {
  display: block; width: 30px; height: 3px; transition: width .12s, background .12s; border-radius: 2px; background: #3d5670;
}
html.kk-v2 .kk-adbs-grip:hover { background: #1c2735; border-color: #3d5670; }
html.kk-v2 .kk-adbs-grip:hover i { background: #e23e57; }
html.kk-v2 .kk-adbs-grip:hover i { width: 40px; }
html.kk-adbs-dragging, html.kk-adbs-dragging * { cursor: ns-resize !important; user-select: none !important; }
html.kk-light.kk-v2 .kk-adbs { border-color: #d0d7de !important; }
html.kk-light.kk-v2 .kk-adbs-grip { background: #f6f8fa; border-color: #d0d7de; }
html.kk-light.kk-v2 .kk-adbs-grip i { background: #b6c2cf; }
