/* dsh 手机端适配层 v5（由 nginx sub_filter 注入，升级 dsh 不丢失）
   启用由 JS 的 UA 检测驱动（body.dsh-msb-mobile），不用视口媒体查询——
   Edge 手机版可能以桌面模式渲染（视口 >767px），媒体查询会失效。
   布局模型：侧栏始终 fixed 浮层（56px 图标栏 <-> 330px 抽屉，宽度过渡
   平滑，无定位模式切换的跳变）；主框架 grid 恒为 56px + 全宽对话区。 */

/* 主框架：第一列恒为图标栏宽度，对话区全宽 */
body.dsh-msb-mobile .dsh-msb-frame {
  grid-template-columns: 56px minmax(0, 1fr) !important;
}

/* 侧栏浮层：收起态 56px 图标栏，展开态 330px 抽屉（宽度平滑过渡） */
body.dsh-msb-mobile .dsh-msb-side {
  position: fixed !important;
  top: 0;
  bottom: 0;
  left: 0;
  width: 56px !important;
  z-index: 90;
  transition: width 0.18s ease;
}
body.dsh-msb-mobile.dsh-msb-open .dsh-msb-side {
  width: min(80vw, 330px) !important;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.22);
}

/* 遮罩：抽屉打开时盖住对话区，点击关闭 */
body.dsh-msb-mobile #dsh-msb-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.4);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
body.dsh-msb-mobile.dsh-msb-open #dsh-msb-mask {
  opacity: 1;
  pointer-events: auto;
}

/* 拖拽把手在触屏上无意义（仅手机作用域隐藏，桌面拖拽不受影响） */
body.dsh-msb-mobile .dsh-msb-handle {
  display: none !important;
}

/* 登出悬浮球：登录后显示于左上角，可拖动（交互参考 ruoyi-vue3 AiAssistant） */
#dsh-logout-fab {
  position: fixed;
  z-index: 95;
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--dsw-radius-lg, 12px) !important;
  background: linear-gradient(135deg, rgb(55, 65, 81), rgb(31, 41, 55)) !important;
  color: rgb(229, 231, 235);
  font-size: 20px;
  line-height: 44px;
  text-align: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 0.75;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
#dsh-logout-fab:hover {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}
#dsh-logout-fab.dragging {
  cursor: grabbing;
  transform: none;
  opacity: 1;
}
body.dsh-fab-dragging {
  user-select: none;
}
