/* ===== 功能导航：填满设备信息行右侧整块空档 ===== */
:root{
  --fc-panel-h: 400px;
  --fc-dock-left: 60%;
  --fc-dock-top: 45px;
  --fc-dock-h: 44px;
  --fc-right-left: 62%;
}

.ctrl-tabs{
  position: fixed !important;
  top: var(--fc-menu-top, 90px) !important;
  right: 10px !important;
  left: var(--fc-menu-left, 42%) !important;
  bottom: auto !important;
  width: auto !important;
  height: 24px !important;
  min-height: 0 !important;
  max-height: 24px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 3px 4px !important;
  margin: 0 !important;
  background: #161b22 !important;
  border: 1px solid #2a3038 !important;
  border-radius: 7px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
  z-index: 95 !important;
}
.ctrl-tabs::-webkit-scrollbar{ display: none; }
.ctrl-tabs .ctrl-tab{
  height: 18px !important;
  min-height: 0 !important;
  font-size: 10.5px !important;
  line-height: 16px !important;
  padding: 0 6px !important;
  border-radius: 5px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  background: rgba(255,255,255,.04) !important;
  color: #b8c4d4 !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}
.ctrl-tabs .ctrl-tab.active{
  color: #fff !important;
  background: rgba(22,119,255,.4) !important;
  border-color: rgba(22,119,255,.9) !important;
}

/* ===== 功能面板：只占右侧一列的底部，不动左边控制区 ===== */
.ctrl-tab-content{
  position: fixed !important;
  left: var(--fc-right-left) !important;
  right: 10px !important;
  bottom: 10px !important;
  top: auto !important;
  width: auto !important;
  height: var(--fc-panel-h, 58vh) !important;
  min-height: 240px !important;
  overflow: auto !important;
  padding: 10px 10px 16px !important;
  background: #0f1318 !important;
  border: 1px solid #30363d !important;
  border-radius: 10px !important;
  box-shadow: 0 -10px 30px rgba(0,0,0,.55) !important;
  z-index: 92 !important;
}
.ctrl-tab-content .ctrl-tab-panel{
  min-height: auto !important;
  padding: 12px !important;
  border-radius: 10px !important;
}
.ctrl-tab-content .ctrl-tab-panel-head h2{ font-size: 16px !important; white-space: nowrap !important; }
.ctrl-tab-content table{ width: auto !important; min-width: 100% !important; font-size: 11px !important; }
.ctrl-tab-content th, .ctrl-tab-content td{ white-space: nowrap !important; padding: 6px 6px !important; }
.ctrl-tab-content input, .ctrl-tab-content select{ font-size: 11px !important; }
.ctrl-tab-content .ctrl-tab-action-grid{
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)) !important;
}

/* 面板关闭按钮 */
.fc-panel-close{
  position: fixed;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #3a4250; border-radius: 5px;
  background: #21262d; color: #c9d4e3;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  z-index: 94; font-family: inherit; display: none;
}
.fc-panel-close:hover{ background: #2a323d; color: #fff; }
/* ===== 右下角功能面板（内嵌视图，不影响左侧控制区） ===== */
.fc-mod-panel{
  position: fixed;
  left: var(--fc-right-left, 62%);
  right: 10px;
  bottom: 10px;
  height: var(--fc-panel-h, 58vh);
  min-height: 240px;
  display: none;
  flex-direction: column;
  background: #0f1318;
  border: 1px solid #30363d;
  border-radius: 10px;
  box-shadow: 0 -10px 34px rgba(0,0,0,.6);
  overflow: hidden;
  z-index: 92;
}
.fc-mod-panel.open{ display: flex; }
.fc-mod-head{
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: #161b22;
  border-bottom: 1px solid #262d36;
  font-size: 12px; color: #c9d4e3; flex: 0 0 auto;
}
.fc-mod-title{ font-weight: 600; color: #e6edf6; }
.fc-mod-close{
  margin-left: auto; width: 20px; height: 20px; padding: 0;
  border: 1px solid #3a4250; border-radius: 5px;
  background: #21262d; color: #c9d4e3; font-size: 13px; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.fc-mod-close:hover{ background: #2a323d; color: #fff; }
.fc-mod-frame{
  flex: 1 1 auto; width: 100%; border: 0; background: #0f1318;
  opacity: 0; transition: opacity .15s;
}
.fc-mod-panel.ready .fc-mod-frame{ opacity: 1; }
.ctrl-tab.fc-active{
  color: #fff !important;
  background: rgba(22,119,255,.4) !important;
  border-color: rgba(22,119,255,.9) !important;
}

/* ===== 功能面板镶嵌在右侧栏下方（ADB 面板让位并保持可滚动） ===== */
/* 打开功能时，右侧栏原地切换成功能面板（ADB 面板先隐藏，尺寸保持不变） */
html.fc-mod-open .home-tab-right > *{
  visibility: hidden !important;
}
.fc-mod-panel{
  position: fixed;
  left: var(--fc-mod-x, 62%);
  top: var(--fc-mod-y, 90px);
  width: var(--fc-mod-w, 480px);
  height: var(--fc-mod-h, 700px);
  display: none;
  flex-direction: column;
  background: #0f1318;
  border: 1px solid #30363d;
  border-radius: 10px;
  box-shadow: 0 -8px 26px rgba(0,0,0,.55);
  overflow: hidden;
  z-index: 92;
}
.fc-mod-panel.open{ display: flex; }

/* 菜单独占一行，内容整体下移 */
.home-tab-split{ margin-top: 30px !important; }

/* 左侧投屏区贴到左上角，与其它列对齐 */
.home-tab-split{
  margin-left: 0 !important;
  width: 100% !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  box-sizing: border-box !important;
  gap: 12px !important;
}
.ctrl-body{ min-height: 0 !important; }

/* fc-leftfix：宽屏下投屏区按内容定宽，中间控制列紧跟其后并固定；ADB 区吸收剩余宽度向左扩展 */
@media (min-width: 1480px){
  .home-tab-split{
    grid-template-columns: 890px minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  .home-tab-left, .ctrl-body{ min-width: 0 !important; }
  .home-tab-left > .ctrl-body{ column-gap: 12px !important; gap: 12px !important; }
  .ctrl-screen-area{ align-items: flex-start !important; }
}

/* fc-mirror-up：投屏区上提，贴住设备信息行；其它列不动 */
@media (min-width: 1480px){
  .ctrl-screen-area{
    margin-top: -34px !important;
  }
}

/* fc-side-narrow：屏幕控制列 210 固定，内部自适应 */
@media (min-width: 1480px){
  .home-tab-left > .ctrl-body > .ctrl-sidebar-panel{
    flex: 0 0 210px !important;
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  .ctrl-sidebar-panel > *{ min-width: 0 !important; }
  .ctrl-sidebar-panel button{ white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
}

/* fc-mirror-stretch：两个投屏框向下撑满可用高度 */
.ctrl-screen-area div[style*="flex-direction: row"][style*="gap: 16px"]{
  align-items: stretch !important;
}
.ctrl-screen-area div[style*="border-radius: 12px"][style*="flex-direction: column"]{
  height: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* 打开功能面板时隐藏右下角悬浮块（不影响首页） */
html.fc-mod-open .fc-floater{ display: none !important; }

/* 打开功能面板时，隐藏 body 下所有无 class 的内联 fixed 悬浮块（微信检测/支付宝/虚拟键盘/调试计时等） */
html.fc-mod-open body div[style*="fixed"]:not([class]):not(.fc-mod-panel):not(.fc-mod-panel *),
html.fc-mod-open body div[style*="position:fixed"]:not([class]):not(.fc-mod-panel *){ display: none !important; }

/* 原始悬浮块永久隐藏（功能由顶部胶囊按钮代劳） */
body > .fc-away{ display: none !important; }
/* 顶部功能胶囊 */
.fc-chip-row{ display: flex; gap: 6px; justify-content: flex-end; padding: 4px 12px 10px; width: 100%; box-sizing: border-box; }

.fc-chip{
  height: 22px; padding: 0 9px; display: inline-flex; align-items: center;
  font-size: 10.5px; font-family: inherit; color: #cbd5e1; cursor: pointer;
  background: #161b22; border: 1px solid #2a3038; border-radius: 6px;
}
.fc-chip:hover{ color:#fff; background:#1f2632; border-color:#4b5563; }

.fc-chip.on{ color:#fff; background:rgba(22,119,255,.45); border-color:rgba(22,119,255,.9); }

/* 打开任意功能模块时，底部三个胶囊一并隐藏，避免盖住内容 */
html.fc-mod-open .fc-chip-row{ display: none !important; }
html.fc-mod-open .fc-floater{ display: none !important; }

/* 彻底兜底：任何无 class 的内联 fixed 悬浮层一律不显示 */
body > div[style*="position: fixed"]:not([class]),
body > div[style*="position:fixed"]:not([class]),
body > button[style*="position: fixed"]:not([class]),
body > button[style*="position:fixed"]:not([class]),
body > .fc-away{ display: none !important; }
