/* Zaka Exchange — 移动端全局适配补丁
 * 目标:锁死缩放、消除横向溢出、适配刘海屏安全区、保证移动端排版不溢出
 */
:root {
  --zk-safe-top: env(safe-area-inset-top, 0px);
  --zk-safe-bottom: env(safe-area-inset-bottom, 0px);
  --zk-safe-left: env(safe-area-inset-left, 0px);
  --zk-safe-right: env(safe-area-inset-right, 0px);
}

/* 1. 禁止 iOS 文字自动放大 */
html {
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

/* 2. 禁止横向溢出(移动端"页面变大"的主因之一) */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
}

body {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* 3. 媒体元素不撑破容器 */
img, video, canvas {
  max-width: 100%;
}

/* 4. iPhone 安全区 */
.app-tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: auto !important;
  box-sizing: border-box !important;
}
.app-header, .sub-page-header, .page-header {
  padding-top: env(safe-area-inset-top, 0px);
}

/* 5. 宽内容横向滚动而不是撑破 */
.table-wrap, .table-responsive, .scroll-x {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* 6. 小屏弹窗/抽屉不超屏 */
@media (max-width: 768px) {
  .el-dialog, .modal-dialog, .van-dialog {
    max-width: 94vw !important;
  }
  .el-message-box {
    width: 86vw !important;
  }
}

/* 7. 微小屏幕(<=360px)进一步收紧 */
@media (max-width: 360px) {
  body {
    font-size: 14px;
  }
}
