/* ===== 手机端适配层（只在 ≤820px 或手机 UA 生效；桌面版完全不受影响） ===== */
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {

  /* ① 治「划不动」：任何固定高度/隐藏溢出的老布局，手机上统统允许竖滑 */
  html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;
  }
  body { padding-bottom: 78px !important; }
  html.lt-mobile body { padding-bottom: 78px !important; }

  /* ② 治「太小」：正文与控件放大到能看清、能点到 */
  body, p, td, th, span, div, label, li { font-size: 15.5px !important; line-height: 1.7 !important; }
  h1 { font-size: 22px !important; } h2 { font-size: 19px !important; } h3 { font-size: 17px !important; }
  input, textarea, select { font-size: 16px !important; min-height: 42px; }
  button, .btn, input[type=button], input[type=submit], .tab, .card, a.btn {
    min-height: 44px !important; font-size: 15px !important; padding: 9px 14px !important;
  }
  small, .mut, .hint, .desc { font-size: 13.5px !important; }

  /* ③ 治「找不到入口」：顶栏收成一行可横滑，不再挤成三行 */
  #__topbar {
    height: auto !important; min-height: 46px;
    flex-wrap: nowrap !important; overflow-x: auto !important; white-space: nowrap;
    gap: 10px !important; padding: 7px 10px !important; font-size: 13.5px !important;
    -webkit-overflow-scrolling: touch;
  }
  #__topbar a, #__topbar span { font-size: 13.5px !important; line-height: 1.7 !important; flex: 0 0 auto; }
  #__topbar #__acct, #__topbar #__pt { margin-left: 0 !important; }
  #__topbar #__acct { margin-left: auto !important; }
  body { padding-top: 54px !important; }

  /* ④ 图片/视频/表格不撑破屏幕；宽表格允许横向滑动看全 */
  img, video, canvas, iframe, svg { max-width: 100% !important; height: auto; }
  table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-all; }

  /* ⑤ 底部大按钮导航（手机专属，六个入口一眼可见） */
  #__mnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
    display: flex; background: #0b0f19; border-top: 1px solid #26314a;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .45);
    box-sizing: border-box; padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #__mnav a {
    flex: 1; text-align: center; padding: 7px 2px 6px; color: #8ea0c0;
    text-decoration: none; font: 11.5px/1.5 'Microsoft YaHei', system-ui, sans-serif;
    min-height: 0 !important;
  }
  #__mnav a b { display: block; font-size: 20px; line-height: 1.3; font-weight: 400; }
  #__mnav a.on { color: #f5c451; }

  /* ⑥ 首页/工作台卡片改单列大卡，别再左右分栏挤成两条 */
  .grid, .cards, .row, .cols { grid-template-columns: 1fr !important; flex-wrap: wrap !important; }
  .wrap, .container, .main { padding-left: 12px !important; padding-right: 12px !important; }

  /* ⑦ 客服浮窗抬到导航栏上方，别被挡住 */
  #ltChatHost { right: 10px !important; bottom: 82px !important; }

  /* ⑧ 弹窗/浮层打开时：收起底导航与客服气泡，免得挡住弹窗里的按钮 */
  html.lt-modal-open #__mnav { display: none !important; }
  html.lt-modal-open #ltChatHost { display: none !important; }
  html.lt-modal-open body { padding-bottom: 14px !important; }
}
