/* ============================================================
   手机端适配（v2.7.23）
   目标：安卓 App（WebView）与手机浏览器上，医生能单手完成
   挂号、看诊、开方、收费。桌面端不受任何影响。
   设计原则：
     1. 触控目标 ≥ 44px（Apple/Google 的共同下限），避免误触；
     2. 表格一律横向滚动，不压缩列宽（压了反而看不清金额和剂量）；
     3. 表单输入框 16px 字号，防止 iOS/安卓点击输入时页面自动放大；
     4. 固定底栏预留安全区，刘海屏/手势条不遮挡按钮。
   ============================================================ */

@media (max-width: 768px) {
  html, body { -webkit-text-size-adjust: 100%; }

  /* ---- 触控尺寸 ---- */
  .btn, .btn-sm, button, .tab {
    min-height: 40px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .btn-sm { min-height: 34px; }
  .form-input, .form-select, select, input[type="text"], input[type="password"],
  input[type="number"], input[type="date"], textarea {
    font-size: 16px !important;     /* 防自动放大 */
    min-height: 42px;
  }

  /* ---- 表格：横向滚动而不是挤压 ---- */
  .table-wrap, .card, .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }
  table th, table td { white-space: nowrap; }

  /* ---- 登录页 ---- */
  .login-shell { grid-template-columns: 1fr !important; }
  .login-aside { display: none !important; }      /* 手机屏幕优先给表单 */
  .login-panel { padding: 22px 18px 26px !important; }
  .login-btn { height: 46px; font-size: 16px; }

  /* ---- 弹窗：接近全屏，避免小屏里表单被压成一条 ---- */
  .modal, .modal-box, .dlg, .dl-card {
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    max-height: 90vh !important;
  }
  .dl-body, .modal-body { padding-left: 14px !important; padding-right: 14px !important; }

  /* ---- 底部安全区（手势条 / 刘海） ---- */
  .content { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important; }
  .app-foot { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* ---- 顶栏：手机上只保留标题与头像，其余收起 ---- */
  .topbar-time, .topbar-select, .build-chip, #buildChip, .skin-chip { display: none !important; }

  /* ---- 打印/导出按钮在手机上不需要 ---- */
  .no-mobile { display: none !important; }
}

/* 安卓 App 内（UA 带 TCMClinicApp）专属微调 */
body.in-app .login-foot { padding-bottom: 8px; }
body.in-app { overscroll-behavior-y: contain; }   /* 防止下拉刷新把 WebView 拉白 */
