/* ============================================================
   mobile.css — H5 响应式（<900px 抽屉侧栏 + 底部导航）
   ============================================================ */

/* ---------- 底部导航（仅 H5） ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  justify-content: space-around;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  flex: 1; height: 56px;
  font-size: 10.5px; color: var(--ink-3);
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a .t-ico { height: 20px; display: flex; align-items: center; justify-content: center; transition: transform .2s ease; }
.tabbar a .t-ico svg { width: 19px; height: 19px; }
.tabbar a.active { color: var(--g-600); font-weight: 650; }
.tabbar a.active .t-ico { transform: scale(1.1); }
/* 激活项顶部金色指示条 */
.tabbar a.active::before {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--grad-gold);
}
.tabbar a:active .t-ico { transform: scale(.92); }

@media (max-width: 900px) {
  /* 壳层 */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform .24s ease;
    box-shadow: none; width: 250px;
  }
  .sidebar.open { transform: none; box-shadow: var(--sh-lg); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .topbar { height: 54px; padding: 0 16px; gap: 10px; }
  .topbar h2 { font-size: 16px; }
  .view { padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }

  /* 登录页单列 */
  .login-page { flex-direction: column; overflow-y: auto; }
  .login-hero { flex: none; min-height: 300px; padding: 40px 26px 32px; }
  .login-hero h1 { font-size: 27px; }
  .fx-ring.r1 { width: 300px; height: 300px; right: -90px; top: 4%; }
  .fx-ring.r2 { width: 210px; height: 210px; right: -20px; top: 18%; }
  .fx-orb.o1 { width: 300px; height: 300px; }
  .login-panel { padding: 28px 22px 44px; }

  /* hero 面板 */
  .hero-panel { flex-direction: column; padding: 20px; border-radius: 16px; }
  .hero-deco { display: none; }
  .hero-panel h2 { font-size: 19px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stat { padding: 10px 12px; }
  .hero-stat .v { font-size: 17px; }
  .hero-stat .k { font-size: 11px; }

  /* 网格 */
  .mod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .proj-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 20px; }

  /* 卡片与表格 */
  .card { padding: 15px 14px; border-radius: 14px; }
  .tbl { font-size: 12px; }
  .tbl thead th, .tbl tbody td { padding: 7px 8px; }
  .cell-prod { min-width: 150px; max-width: 220px; }

  /* stepper 横滚 */
  .stepper { padding: 12px 14px; }
  .guide { font-size: 12.5px; gap: 8px; }

  /* 工作台 */
  .wb-toolbar { padding: 10px 12px; gap: 7px; }
  .wb-toolbar input { width: 130px; }
  .wb-table-wrap { max-height: 56vh; }
  .wb-tbl { font-size: 11.5px; }
  .wb-tbl thead th, .wb-tbl tbody td { padding: 7px 8px; }

  /* 模态与 toast */
  .modal { padding: 18px; border-radius: 16px; }
  .toasts { top: 10px; right: 10px; left: 10px; }
  .toast { max-width: none; }

  .field { min-width: 130px; }

  /* ---------- H5 触摸体验增强 ---------- */
  /* 大触摸目标 + 防 iOS 聚焦缩放（≥16px） */
  .btn { min-height: 38px; }
  .btn.mini { padding: 7px 13px; min-height: 32px; border-radius: 9px; }
  .btn.xl { padding: 14px 20px; font-size: 15.5px; }
  input, textarea, select { font-size: 15px; }
  .form-card textarea { font-size: 14px; }
  .tbl tbody td { padding: 9px 8px; }
  .cell-prod .thumb, .cell-prod .img-ph { width: 38px; height: 38px; }
  a, .chip, .seg button, .tabs a { -webkit-tap-highlight-color: transparent; }

  /* 模块页主操作：粘性底部常驻（滚动也能一键运行） */
  .form-footer {
    position: sticky; bottom: 10px; z-index: 6;
    margin: 14px -14px -15px; padding: 12px 14px;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 -6px 20px -12px rgba(7, 38, 26, .28);
  }
  .form-footer .btn.xl { flex: 1; min-width: 0; }

  /* 模态：H5 底部弹层（action sheet 风格） */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    position: relative;
    max-width: none; width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 84vh;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    animation: sheetUp .3s cubic-bezier(.22, 1, .36, 1);
  }
  .modal::before {
    content: ""; position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 4px;
    background: var(--bg-soft);
  }
  .modal h3 { text-align: center; }
  .modal-foot { gap: 8px; }
  .modal-foot .btn { flex: 1; padding: 11px; }

  /* hero / 引导条紧凑化 */
  .guide { gap: 8px; padding: 11px 12px; border-radius: 12px; }
  .guide .g-step { padding: 3px 8px 3px 4px; font-size: 12px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1; min-width: 0; }

  /* 运行监控条：竖排更清晰 */
  .run-strip { gap: 8px 18px; padding: 11px 12px; }
  .stage-track { padding-bottom: 4px; }
}

@keyframes sheetUp { from { transform: translateY(48px); opacity: .4; } to { transform: none; opacity: 1; } }

@media (max-width: 480px) {
  .mod-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-points span { font-size: 12px; padding: 6px 10px; }
}
