/* 响应式补丁 20261122 v7
   [1] 641-1279px 中屏：sidebar-wrapper 宽度塌陷(240px) + 侧边栏视觉层按 240px 压住主内容，
       主内容区仅剩 124px、卡片文字宽度为 0、按钮点不到。统一宽度并消除溢出。
   [2] <=1100px：顶栏一行放不下，时间条被裁并压住正文。顶栏高度自适应、时间独占一行、
       字号 12px 保持单行（不折字）。
   [3] <=640px 手机：纵向容器 flex-wrap 把内容折到第二列(屏幕外)，卡片只露一半。禁止折列。
   [4] <=1279px 表格：容器收回 100%（配合 xd-responsive.js），表格按内容展开在卡片内横向滚动，
       字号 12px、单元格不折行、操作列吸附右侧常驻可见，表格自身不设 overflow。 */

@media (min-width:641px) and (max-width:1279px){
  html, html body div[class*="sidebar-wrapper"]{--sidebar-width:172px !important;}
  html body div[class*="sidebar-wrapper"]{width:100% !important; flex:1 1 auto !important;}
  html body div[class*="sidebar-wrapper"] > div[class*="peer"]{width:172px !important; min-width:172px !important; flex:0 0 172px !important;}
  html body div[class*="sidebar-wrapper"] > div[class*="peer"] > div{width:172px !important; min-width:0 !important; max-width:172px !important;}
  html body div[class*="sidebar-wrapper"] *{max-width:100% !important;}
  html body main.ml-auto{flex:1 1 auto !important; width:auto !important; min-width:0 !important;}
}

@media (max-width:1100px){
  html body header[class*="h-16"]{height:auto !important; min-height:64px !important; row-gap:2px; padding-top:6px; padding-bottom:6px;}
  html body header div.flex-1.flex.justify-end{flex:1 1 100% !important; justify-content:flex-start !important; min-width:0 !important;}
  html body header div.flex-1.flex.justify-end *{font-size:12px !important; line-height:1.3 !important; white-space:nowrap !important;}
}

@media (max-width:640px){
  html body main div[class*="flex-col"]{flex-wrap:nowrap !important;}
}

@media (max-width:1279px){
  html body main div[class*="overflow-auto"],
  html body main div[class*="flex-col"][class*="flex-1"]{
    width:100% !important; max-width:100% !important; min-width:0 !important;
  }
  html body main table{
    table-layout:auto !important; min-width:max-content !important; width:auto !important;
    overflow:visible !important; font-size:12px !important;
  }
  html body main table th, html body main table td{padding:5px 7px !important; white-space:nowrap !important;}
  html body main table th:last-child, html body main table td:last-child{
    position:sticky !important; right:0 !important; z-index:3; background:var(--card,#fff);
    box-shadow:-8px 0 8px -8px rgba(0,0,0,.22);
  }
}

/* 触屏小按钮热区扩展（视觉不变，只放大可点范围） */
.xdr-hit{position:relative;}
.xdr-hit::after{content:'';position:absolute;inset:-7px;border-radius:8px;}

/* 超窄屏（<=480px）：顶栏换行，时间独占一行横向可滚，避免折成多行把内容压住 */
@media (max-width:480px){
  html body header{height:auto !important; min-height:52px !important; flex-wrap:wrap !important; row-gap:2px; padding:4px 8px !important;}
  html body header div.flex-1.flex.justify-end{flex:1 1 100% !important; justify-content:flex-start !important; height:auto !important; max-height:none !important; overflow-x:auto !important; overflow-y:hidden !important;}
  html body header div.flex-1.flex.justify-end *{font-size:11px !important; line-height:1.25 !important; white-space:nowrap !important;}
}

/* 底部固定悬浮球（归属）让位：内容区底部留白，分页/最后一行按钮不被压住 */
@media (min-width:481px){
  html body main div[class*="overflow-auto"],
  html body main div[class*="overflow-y-auto"],
  html body main > div:last-child{
    padding-bottom:72px !important;
  }
}
@media (max-width:480px){
  html body main div[class*="overflow-auto"],
  html body main div[class*="overflow-y-auto"]{
    padding-bottom:84px !important;
  }
}

/* v8：右下悬浮球（归属）让位 —— 窄屏下移进内容底部留白区；与按钮重叠时整体让到左侧 */
@media (max-width:640px){
  .xd-own-fab{ right:10px !important; bottom:10px !important; transform-origin:right bottom; }
}
.xdr-fab-dodge{ right:auto !important; left:12px !important; }
