/* responsive-layout.css
 * CHG-20261030-151835  桌面布局自适应（1280~3840，含窗口拖拽）
 * 只作用于 body.layout-shell-on（控制页），其它页面零影响
 * 回滚：注释 index.html 中本文件的 <link>，或删除本文件
 */

/* ---------- 0. 高度链：一屏填满，内部各自滚动 ---------- */
html, body, #root { height: 100%; }

body.layout-shell-on .control-page {
  height: 100vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.layout-shell-on .home-tab-split {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
}
body.layout-shell-on .home-tab-left,
body.layout-shell-on .home-tab-right {
  height: 100% !important;
  min-height: 0 !important;
}
body.layout-shell-on .home-tab-right {
  display: flex !important;
  flex-direction: column !important;
}
body.layout-shell-on .shell-iframe-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
body.layout-shell-on .shell-iframe { height: 100% !important; }

/* ---------- 1. 左栏：屏幕区 + 控制列 ---------- */
body.layout-shell-on .ctrl-body {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.layout-shell-on .ctrl-screen-area {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}
body.layout-shell-on .ctrl-screen-area > div {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel {
  flex: 0 0 340px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
}

/* ---------- 2. 屏幕区两列：阅读器（窄） | 镜像（吃满剩余） ---------- */
body.layout-shell-on .ctrl-screen-area div:has(> div > .a11y-screen-header) {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 12px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
body.layout-shell-on .ctrl-screen-area div:has(> .a11y-text-input) {
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: clamp(200px, 18vw, 300px) !important;
  min-width: 170px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.layout-shell-on .ctrl-screen-area div:has(> .a11y-nav) {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 320px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.layout-shell-on .ctrl-phone-frame,
body.layout-shell-on .ctrl-phone-screen {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
body.layout-shell-on .ctrl-phone-screen img,
body.layout-shell-on .ctrl-phone-screen canvas {
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* ---------- 3. 两栏比例（桌面 5 档） ---------- */
body.layout-shell-on .home-tab-split {
  grid-template-columns: minmax(0, 1.35fr) minmax(560px, 1fr) !important;
}
@media (max-width: 1919px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.45fr) minmax(540px, 1fr) !important;
  }
  body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel { flex-basis: 320px !important; }
}
@media (max-width: 1599px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.55fr) minmax(500px, 1fr) !important;
  }
  body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel { flex-basis: 300px !important; }
}
@media (max-width: 1439px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.7fr) minmax(470px, 1fr) !important;
  }
  body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel { flex-basis: 280px !important; }
  body.layout-shell-on .ctrl-screen-area div:has(> .a11y-text-input) {
    max-width: 180px !important;
    min-width: 150px !important;
  }
}
@media (max-width: 1279px) {
  body.layout-shell-on .home-tab-split {
    grid-template-columns: minmax(0, 1.9fr) minmax(420px, 1fr) !important;
  }
  body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel { flex-basis: 260px !important; }
  body.layout-shell-on .ctrl-screen-area div:has(> .a11y-text-input) { display: none !important; }
}

/* ---------- 4. 标签栏：宽屏换行，窄屏单行横滚 ---------- */
body.layout-shell-on .home-tab-right > .ctrl-tabs {
  flex: 0 0 auto !important;
  height: 44px !important;
  max-height: 44px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  align-items: center !important;
  padding: 4px 8px !important;
}
body.layout-shell-on .home-tab-right > .ctrl-tabs .ctrl-tab { flex: 0 0 auto !important; }
@media (min-width: 1600px) {
  body.layout-shell-on .home-tab-right > .ctrl-tabs {
    height: auto !important;
    max-height: 88px !important;
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
  }
}

/* ---------- 5. 顶栏 ---------- */
body.layout-shell-on .ctrl-header { grid-template-rows: auto auto !important; }
body.layout-shell-on .home-tab-topbar { flex-wrap: wrap !important; row-gap: 4px !important; }

/* ---------- 6. 应用列表表格 ---------- */
.applist-scroll-wrap { overflow: auto !important; -webkit-overflow-scrolling: touch; }

@media (min-width: 1400px) {
  table.applist-fixed { min-width: 1116px !important; }
}
@media (max-width: 1399px) {
  table.applist-fixed {
    min-width: 480px !important;
    table-layout: fixed !important;
    width: 100% !important;
  }
  table.applist-fixed th:nth-child(4), table.applist-fixed td:nth-child(4) { display: none !important; }
  table.applist-fixed th:nth-child(5), table.applist-fixed td:nth-child(5) { display: none !important; }
  table.applist-fixed th:nth-child(1), table.applist-fixed td:nth-child(1) { width: 52px !important; }
  table.applist-fixed th:nth-child(2), table.applist-fixed td:nth-child(2) {
    width: 150px !important;
    max-width: 150px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  table.applist-fixed th:nth-child(3), table.applist-fixed td:nth-child(3) {
    width: auto !important;
    max-width: none !important;
  }
  table.applist-fixed th:nth-child(6), table.applist-fixed td:nth-child(6) { width: 130px !important; max-width: 130px !important; }
}

/* ---------- 7. [CHG-20261030-154448] 两块面板等宽 + 控制列顶部对齐 ---------- */
body.layout-shell-on .ctrl-screen-area div:has(> .a11y-text-input),
body.layout-shell-on .ctrl-screen-area div:has(> .a11y-nav) {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
/* 工具条固定单行：避免换行后高度变化导致对齐漂移 */
body.layout-shell-on .reader-style-bar {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  scrollbar-width: none;
}
body.layout-shell-on .reader-style-bar::-webkit-scrollbar { display: none; }
/* 工具条 34 + 上内边距 10 + 间距 6 = 50px，让控制列首卡与面板标题齐平 */
body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel {
  padding-top: 50px !important;
}

/* ---------- 8. [CHG-20261030-155051] 兼容不支持 :has() 的浏览器（Chrome/Edge <105） ---------- */
body.layout-shell-on .ctrl-screen-area > div > div:nth-of-type(2) > div {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* ---------- 9. [CHG-20261030-160316] 顶部工具条与面板拉开间距 + 禁止划词 ---------- */
body.layout-shell-on .ctrl-screen-area > div { row-gap: 10px !important; }

body.layout-shell-on .reader-style-bar {
  position: relative !important;
  z-index: 3 !important;
  margin-bottom: 2px !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.layout-shell-on .ctrl-header,
body.layout-shell-on .home-tab-topbar,
body.layout-shell-on .ctrl-tabs,
body.layout-shell-on .ctrl-sidebar-panel {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* 工具条 34 + 上内边距 10 + 间距 12 = 56，保持控制列首卡与面板标题齐平 */
body.layout-shell-on .home-tab-left > .ctrl-body > .ctrl-sidebar-panel {
  padding-top: 56px !important;
}

/* ---------- 10. [CHG-20261030-161052] 设备栏右侧状态盒（48px 高）下溢 17px，给内容区留出 16px 空白带 ---------- */
body.layout-shell-on .home-tab-split {
  margin-top: 16px !important;
}

/* [OLD] CHG-20261030-161447 原：.home-tab-topbar-pwd { height:36px; padding:0 10px; overflow:hidden } —— 压扁导致黄色边框被裁，本单改为 48px，旧值保留于此 */
/* ---------- 12. [CHG-20261030-161844] 设备栏抬到 52px，状态盒恢复 48px 自然高度，黄色边框完整显示 ---------- */
body.layout-shell-on .home-tab-topbar {
  height: 52px !important;
  min-height: 52px !important;
  max-height: none !important;
  align-items: center !important;
}

body.layout-shell-on .home-tab-topbar-pwd {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 8px 16px !important;
  gap: 8px !important;
  overflow: visible !important;
}

body.layout-shell-on .home-tab-topbar-pwd > * {
  height: auto !important;
  line-height: normal !important;
}

body.layout-shell-on .home-tab-split {
  margin-top: 0 !important;
}
