/* ============ 手机版适配（≤768px）============
   侧栏变为抽屉，顶部出现 ☰ 按钮；表格横向滚动；栅格降列。
   由 workbench.html / admin.html 引入。 */

@media (max-width: 768px) {
  /* 框架：侧栏抽屉化 */
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    width: 78%; max-width: 300px;
    transform: translateX(-105%); transition: transform .22s ease;
    overflow-y: auto; box-shadow: 0 0 30px rgba(0,0,0,.18);
  }
  body.sb-open .sidebar { transform: translateX(0); }
  .sb-mask {
    display: none; position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 20, 35, .45);
  }
  body.sb-open .sb-mask { display: block; }

  /* 顶栏：塞下汉堡按钮 */
  .topbar { padding: 0 14px; height: 52px; }
  .sb-burger { display: inline-flex !important; }
  .content { padding: 14px; }

  /* 顶栏右侧的设置下拉定位修正 */
  .tabstrip { padding: 0 12px; overflow-x: auto; }

  /* 栅格降列 */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .app-grid { grid-template-columns: 1fr !important; }
  .emp-grid { grid-template-columns: 1fr !important; }
  .sched-grid { display: block !important; }
  .sched-grid > div { margin-bottom: 14px; }
  .lead-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }

  /* 表格在卡片内横向滚动，不撑破屏幕 */
  .card { padding: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 560px; }

  /* 智能中枢办公室卡片 */
  .office-card { flex-direction: column; align-items: stretch !important; }
  .office-head { flex-wrap: wrap; gap: 8px; }
  .office-stats { flex-wrap: wrap; }

  /* 表单/按钮铺满好按 */
  .btn { padding: 10px 16px; }
  .input { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
  .modal { width: 94vw !important; max-width: 94vw !important; }
}

/* 汉堡按钮默认隐藏，仅窄屏显示 */
.sb-burger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-right: 10px;
  border: none; border-radius: 8px; background: var(--bg-gray, #f2f3f7);
  font-size: 18px; cursor: pointer; flex-shrink: 0;
}
