/* ─── 移动端抽屉导航 (2026-09-09 全站注入 v1) ───
   解决：手机打开页面侧边栏被 display:none 隐藏，访客看不到全站模块
   方案：≤768px 时 topbar 内显示 ☰ 按钮 → 点击滑出完整侧边栏
   配套：js/mobile-nav.js（按钮注入/开合逻辑） */
@media(max-width:768px){
  /* 内容区不被 sidebar-resizer.css 的 220px !important 挤偏 */
  body .main-content{margin-left:0 !important}
  body .content{margin-left:0 !important}

  /* topbar 内嵌汉堡按钮 */
  #wxma-menu-btn{
    flex:0 0 auto;
    width:38px;height:38px;border-radius:9px;
    background:#ffffff;color:#1a365d;
    display:flex;align-items:center;justify-content:center;
    font-size:17px;font-weight:700;border:none;cursor:pointer;
    box-shadow:0 1px 4px rgba(0,0,0,.2);
    margin-right:10px;
    -webkit-tap-highlight-color:transparent;
  }
  body .topbar{padding-left:14px;gap:0}

  /* 侧边栏改为抽屉（覆盖页面内联 .sidebar{display:none}） */
  body .sidebar{
    display:flex !important;
    position:fixed;
    top:0;left:0;bottom:0;
    width:260px !important;
    max-width:84vw;
    z-index:10000;
    transform:translateX(-105%);
    transition:transform .28s ease;
    box-shadow:none !important;
    border-right:1px solid #e2e8f0 !important;
  }
  body .sidebar.wxma-open{transform:translateX(0);box-shadow:2px 0 16px rgba(0,0,0,.18) !important}

  /* 桌面端拖拽手柄在移动端隐藏 */
  .sidebar-resizer{display:none !important}

  /* 遮罩 */
  #wxma-mask{
    position:fixed;top:0;left:0;right:0;bottom:0;
    background:rgba(0,0,0,.45);z-index:9999;
    opacity:0;visibility:hidden;transition:opacity .25s;
  }
  #wxma-mask.wxma-show{opacity:1;visibility:visible}
  body.wxma-locked{overflow:hidden}

  /* 侧边栏打开时按钮浮到右上角（脱离 topbar 层叠上下文） */
  #wxma-menu-btn.wxma-shift{
    position:fixed;top:10px;right:10px;left:auto;
    z-index:10002;margin-right:0;
    box-shadow:0 2px 8px rgba(0,0,0,.3);
  }
}
/* 桌面端隐藏按钮与遮罩 */
@media(min-width:769px){
  #wxma-menu-btn,#wxma-mask{display:none !important}
}

/* ─── 移动端内容自适应修复 (2026-09-09) ───
   解决 search.html / lixiang-dashboard.html 手机端横向溢出：
   main-content 是 flex 子项，默认 min-width:auto 会被内部内容(2800px时间线/宽表格)撑开
   → 加 min-width:0 让容器收缩到视口宽度；内部滚动容器(overflow-x:auto)保持可横向滑动 */
@media(max-width:768px){
  body .main-content{min-width:0 !important;max-width:100% !important}
  body .content{min-width:0 !important;max-width:100% !important}
  body .ds-card{min-width:0 !important;max-width:100% !important}
  body .table-wrap{min-width:0 !important;max-width:100% !important}
}
