/* 阿若管理台 iOS/手机端外壳覆盖样式（在 app.css 之后加载）。
 * 仅做响应式覆盖，不改任何业务 js / 桌面端文件。
 * 窄屏（<900px）把桌面「侧栏折叠」复用为「抽屉」：body.nav-collapsed = 抽屉隐藏。
 */

html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
.content, .sidebar-menu { -webkit-overflow-scrolling: touch; }

/* iOS 加主屏提示条 */
.install-hint {
  position: fixed; left: 10px; right: 10px; z-index: 900;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.5;
  color: #f3e6c4; background: rgba(11,12,16,.94); border: 1px solid rgba(240,193,75,.35);
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.8);
}
.install-hint span { flex: 1; }
.install-hint button {
  width: 24px; height: 24px; flex-shrink: 0; border: none; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.08); color: #9aa3b6; font-size: 15px; line-height: 1;
}

@media (max-width: 899px) {

  /* ---------- 侧栏 → 抽屉 ---------- */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 60;
    transform: translateX(0); transition: transform .24s cubic-bezier(.4,0,.2,1);
    box-shadow: 12px 0 40px rgba(0,0,0,.5);
  }
  body.nav-collapsed .sidebar { width: 264px; transform: translateX(-105%); box-shadow: none; }

  /* 撤销桌面折叠态对文案的隐藏（手机上抽屉展开要看到完整菜单） */
  body.nav-collapsed .sidebar-brand { justify-content: flex-start; padding: 20px 18px 16px; font-size: 15px; gap: 10px; }
  body.nav-collapsed .nav-group-label { display: flex; }
  body.nav-collapsed .nav-link span.txt { display: inline; }
  body.nav-collapsed .sidebar-expire { display: block; }
  body.nav-collapsed .nav-link { justify-content: flex-start; padding: 9px 10px; }

  /* 抽屉打开时的遮罩 */
  body:not(.nav-collapsed)::after {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55;
  }

  /* ---------- 顶栏 / 安全区 ---------- */
  .topbar {
    height: auto; min-height: 52px; gap: 10px;
    padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  }
  .topbar-chip { max-width: 46vw; font-size: 11.5px; padding: 4px 10px; }
  .topbar-title { font-size: 14px; }
  .content-inner { padding: 14px 12px calc(30px + env(safe-area-inset-bottom)); }

  /* ---------- 登录页 ---------- */
  .login-page { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .login-box, .login-ad { width: 100%; max-width: 100%; }
  .login-form-card { width: 100%; max-width: 100%; padding: 26px 20px 24px; }
  .login-logo b { font-size: 18px; }
  .role-cards { grid-template-columns: 1fr; gap: 12px; }
  .role-card { padding: 20px 16px; }

  /* ---------- 工作区 ---------- */
  .page-header h2 { font-size: 17px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-cells { gap: 14px; }
  .stat-value { font-size: 22px; }
  .bars { height: 140px; gap: 8px; }

  /* 表格横向滚动 */
  table.tbl { min-width: 620px; }
  .tbl th, .tbl td { padding: 10px 10px; }

  /* 工具条输入撑满 */
  .toolbar { gap: 8px; }
  .toolbar .f-input, .toolbar .f-select { width: 100%; min-width: 0; }

  /* 防止 iOS 聚焦输入自动放大：字号提到 16px */
  .f-input, .f-select, .f-textarea, .lg-input { font-size: 16px; }

  .img-pick { width: 90px; height: 90px; }
  .scan-default { flex-direction: column; }

  /* ---------- 弹窗近全屏 ---------- */
  .modal-mask { padding: 12px; }
  .modal-pop, .modal-w-lg, .modal-w-xl { width: 100%; max-width: 100%; max-height: calc(100vh - 24px); }
  .modal-head { padding: 14px 16px 0; }
  .modal-body { padding: 14px 16px 18px; }
  .modal-btns { padding: 12px 16px 16px; }

  .toast { max-width: 86vw; }
}
