/* [NEW] CHG-20261020-105508 控制页三栏布局：导航移入右栏
   只做视觉布局，不改功能；回滚=从 index.html 注释掉本文件引用 */
body.layout-shell-on .ctrl-header {
  grid-template-rows: 46px 0 !important;
}

/* 左（屏幕）/ 右（标签+ADB）比例，右栏加宽 */
body.layout-shell-on .home-tab-split {
  grid-template-columns: minmax(0, 1.35fr) minmax(420px, 1fr) !important;
  gap: 12px !important;
}

body.layout-shell-on .home-tab-right {
  overflow: hidden !important;
}

/* 搬进右栏的导航：顶部、可换行、可滚动 */
body.layout-shell-on .home-tab-right > .ctrl-tabs {
  order: -1;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 88px;
  margin: 0 0 6px;
  padding: 2px 0 6px;
  gap: 6px;
  background: transparent;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

body.layout-shell-on .home-tab-right > .ctrl-tabs .ctrl-tab {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* 右栏其余内容占满剩余高度并可滚动 */
body.layout-shell-on .home-tab-right > div:not(.ctrl-tabs) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: 1fr !important;
  }
  body.layout-shell-on .home-tab-right {
    margin-top: 8px !important;
  }
}

/* [NEW] CHG-20261020-110419 右栏 iframe 局部切换（方案A） */
body.layout-shell-on .home-tab-right.shell-tab-mode > div:not(.ctrl-tabs):not(.shell-iframe-wrap) {
  display: none !important;
}

.shell-iframe-wrap {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

body.layout-shell-on .home-tab-right.shell-tab-mode .shell-iframe-wrap {
  display: flex;
}

.shell-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #0d1117;
}
/* [NEW] CHG-20261020-110419 修正 iframe 高度：右栏跟随行高拉伸，避免塌成 150px */
body.layout-shell-on .home-tab-split {
  align-items: stretch !important;
}
body.layout-shell-on .home-tab-right {
  align-self: stretch !important;
}
body.layout-shell-on .home-tab-right.shell-tab-mode .shell-iframe-wrap {
  min-height: 0;
}
/* [NEW] CHG-20261020-112738 小屏自适应：断点 + 全屏浮层 + 返回按钮 */
@media (max-width: 1440px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr) !important;
  }
  body.layout-shell-on .home-tab-right > .ctrl-tabs .ctrl-tab {
    font-size: 11px;
    padding: 0 8px;
  }
}

@media (max-width: 1200px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr) !important;
  }
  body.layout-shell-on .ctrl-sidebar-panel {
    min-width: 240px !important;
  }
}

@media (max-width: 1100px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: 1fr !important;
  }
}

body.shell-overlay-open {
  overflow: hidden !important;
}

body.shell-overlay-open .shell-iframe-wrap {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  background: #0d1117 !important;
  padding: 8px !important;
}

body.shell-overlay-open .shell-iframe {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.shell-back-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(22, 27, 34, 0.95);
  color: #e6edf3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

body.shell-overlay-open .shell-back-btn {
  display: block;
}