/* A8 控制台 · 移动端适配补丁（仅窄屏生效；用 !important 覆盖工具原样式，加载在样式表末尾） */
@media (max-width: 760px) {
  html, body { -webkit-text-size-adjust: 100%; }

  /* 顶栏：横向排不下的按钮改成换行，不再溢出到屏幕外 */
  .app-nav {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    row-gap: 8px !important;
    height: auto !important;
    min-height: 56px !important;
    padding: 8px 0 !important;
  }
  .app-nav .btn { flex: 0 0 auto !important; min-height: 40px !important; }

  /* 弹窗：高度限制在视口内，内部滚动（原来 overflow:visible，底部条会盖住表单） */
  .modal {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px !important;
    align-items: flex-start !important;
  }
  .modal-content {
    max-height: calc(100dvh - 20px) !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }
  .modal-header { position: sticky !important; top: 0 !important; z-index: 7 !important; background: #101725 !important; }
  .close-btn { width: 42px !important; height: 42px !important; min-width: 42px !important; font-size: 22px !important; line-height: 1 !important; }

  /* 钱包组弹窗：左右两栏 → 上下排列 */
  .wallet-groups-layout { display: block !important; }
  .wallet-groups-sidebar,
  .wallet-group-editor { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  /* 手机上都用弹窗自身滚动，列表不做内部滚动，避免行被裁切/溢出到表单上 */
  .wallet-groups-sidebar { display: block !important; position: static !important; height: auto !important; max-height: none !important; overflow: visible !important; }
  .wallet-groups-list { display: block !important; position: static !important; height: auto !important; max-height: none !important; overflow: visible !important; }
  .wallet-groups-list > * { flex: none !important; min-height: auto !important; margin-bottom: 6px; }

  /* 底部操作条：吸底 + 给编辑区留出足够内边距，任何输入框都不会被盖住 */
  .wallet-group-editor { padding-bottom: 84px !important; }
  .wallet-group-editor-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 8 !important;
    background: #101725 !important;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    gap: 10px !important;
    box-shadow: 0 -8px 16px rgba(0,0,0,.35);
  }
  .wallet-group-editor-actions .btn { flex: 1 1 auto !important; min-height: 46px !important; }

  /* 触摸目标：单选框/复选框原来 13px，手指点不到 */
  input[type="radio"], input[type="checkbox"] {
    width: 22px !important; height: 22px !important;
    min-width: 22px !important; min-height: 22px !important;
    margin: 0 8px 0 2px !important;
    accent-color: #8b7cff;
  }
  label { min-height: 38px !important; display: inline-flex !important; align-items: center !important; }
  button, .btn { min-height: 40px !important; }

  /* 输入框字号 16px，避免 iOS 聚焦时页面被自动放大 */
  input:not([type="radio"]):not([type="checkbox"]),
  select, textarea { font-size: 16px !important; }

  /* 合约交互结果条：手机上不吸底，改为正常文档流，避免盖住 calldata/金额/按钮 */
  .interaction-footer {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    height: auto !important;
    max-height: none !important;
    margin-top: 14px !important;
    z-index: auto !important;
  }
  .interaction-footer > * { flex: 1 1 46% !important; min-width: 0 !important; }
  .transfer-status { position: static !important; }

  /* 下拉框加高到 44px 并去掉 300ms 点击延迟，手机上更容易点开 */
  select { min-height: 44px !important; padding: 8px 10px !important; }
  select, button, .btn, label { touch-action: manipulation !important; -webkit-tap-highlight-color: transparent; }

  /* 点标签也能聚焦/展开对应控件 */
  .form-group > label, label { cursor: pointer; }

  /* 宽表格 / 日志横向滚动，不撑破页面 */
  table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  pre { overflow-x: auto !important; }
}
