/* ===== 2410：应用列表列宽/遮挡修正（表格类名 zapps，命中真实 DOM） ===== */

/* 1) 应用列表表格：铺满容器、固定布局，列宽写死，包名不再被按钮压住 */
main table.zapps {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
main table.zapps colgroup col:nth-child(1) { width: 36px !important; }
main table.zapps colgroup col:nth-child(2) { width: 26% !important; }
main table.zapps colgroup col:nth-child(3) { width: auto !important; }
main table.zapps colgroup col:nth-child(4) { width: 200px !important; }

main table.zapps th,
main table.zapps td {
  padding-left: 6px !important;
  padding-right: 6px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
/* 单元格里的内层 div 也必须裁剪，否则长包名会溢出压到操作按钮上 */
main table.zapps td > div {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* 操作列：内容只在自己格里换行，绝不向左溢出遮挡包名 */
main table.zapps td:nth-child(4),
main table.zapps th:nth-child(4) {
  white-space: normal !important;
  overflow: hidden !important;
}
main table.zapps td:nth-child(4) > div {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  max-width: 100% !important;
  overflow: visible !important;
}
main table.zapps td:nth-child(4) button {
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 4px !important;
  font-size: 11px !important;
  line-height: 20px !important;
  flex: 0 0 auto !important;
}
main table.zapps td:nth-child(4) button svg { width: 12px !important; height: 12px !important; }


/* 包名列：宁可折行也要显示完整，绝不截断/遮挡 */
main table.zapps td:nth-child(3),
main table.zapps td:nth-child(3) > div {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-all !important;
  text-overflow: clip !important;
  overflow: visible !important;
  line-height: 1.25 !important;
}

@media (max-width: 900px) {
  main table.zapps colgroup col:nth-child(2) { width: 30% !important; }
  main table.zapps colgroup col:nth-child(4) { width: 168px !important; }
  main table.zapps { font-size: 11px !important; }
}

/* 2) 注入模板表格（名称/包名/地区/状态）单独定列宽 */
main table.zinj {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
main table.zinj colgroup col:nth-child(1) { width: 26% !important; }
main table.zinj colgroup col:nth-child(2) { width: auto !important; }
main table.zinj colgroup col:nth-child(3) { width: 78px !important; }
main table.zinj colgroup col:nth-child(4) { width: 84px !important; }
main table.zinj th,
main table.zinj td {
  padding-left: 6px !important;
  padding-right: 6px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
main table.zinj td > div {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
main table.zinj td:nth-child(4),
main table.zinj th:nth-child(4) { overflow: hidden !important; white-space: normal !important; }
main table.zinj td:nth-child(4) button {
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 4px !important;
  font-size: 11px !important;
  line-height: 20px !important;
}
@media (max-width: 760px) {
  main table.zinj colgroup col:nth-child(1) { width: 24% !important; }
  main table.zinj colgroup col:nth-child(3) { width: 66px !important; }
  main table.zinj colgroup col:nth-child(4) { width: 74px !important; }
  main table.zinj { font-size: 11px !important; }
}

/* 3) 控制页两栏：窄屏时右侧应用列表占满，左侧投屏不再挤压表格 */
@media (max-width: 1499px) {
  html, body { overflow-x: hidden !important; }
  main div.flex.gap-3.flex-1:has([role=tablist]) {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 auto !important;
  }
  main div.flex.gap-3.flex-1:has([role=tablist]) > div:first-child {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 48% !important;
  }
  main div.flex.gap-3.flex-1:has([role=tablist]) > div:last-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
  }
}
