/* iOS安全区域适配样式 */

/* 设置CSS变量 */
:root {
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-right: env(safe-area-inset-right);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
  --safe-area-inset-left: env(safe-area-inset-left);
}

/* 确保body占满整个视口 */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

/* tabbar适配 */
.uni-tabbar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999 !important;
  background-color: #FFFFFF !important;
  border-top: 1px solid #e5e5e5 !important;
  padding-bottom: var(--safe-area-inset-bottom, 0) !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 50px !important;
}

/* tabbar内容区域 */
.uni-tabbar .uni-tabbar__item {
  padding-bottom: var(--safe-area-inset-bottom, 0) !important;
  box-sizing: border-box !important;
}

/* 页面内容区域适配 */
.uni-page-body {
  padding-bottom: calc(50px + var(--safe-area-inset-bottom, 0)) !important;
  box-sizing: border-box !important;
  min-height: 100vh !important;
  min-height: -webkit-fill-available !important;
}

/* 确保页面内容不被tabbar遮挡 */
.uni-page {
  min-height: 100vh !important;
  min-height: -webkit-fill-available !important;
  padding-bottom: calc(50px + var(--safe-area-inset-bottom, 0)) !important;
  box-sizing: border-box !important;
}

/* 修复iOS Safari的视口高度问题 */
@supports (-webkit-touch-callout: none) {
  .uni-page {
    min-height: -webkit-fill-available !important;
  }
  
  .uni-page-body {
    min-height: -webkit-fill-available !important;
  }
}

/* 确保内容区域正确显示 */
.uni-page__content {
  padding-bottom: calc(50px + var(--safe-area-inset-bottom, 0)) !important;
  box-sizing: border-box !important;
}

/* 修复iOS Safari的100vh问题 */
@supports (-webkit-touch-callout: none) {
  .uni-page,
  .uni-page-body {
    height: 100vh;
    height: -webkit-fill-available;
  }
}

/* 确保tabbar在iOS上正确显示 */
.uni-tabbar .uni-tabbar-border {
  height: 1px;
  background-color: #e5e5e5;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* 修复iOS底部安全区域问题 */
.uni-tabbar .uni-tabbar__item {
  position: relative;
  z-index: 1;
}

/* 确保页面滚动正常 */
.uni-page-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 修复iOS Safari的滚动问题 */
@supports (-webkit-touch-callout: none) {
  .uni-page-body {
    -webkit-overflow-scrolling: touch;
  }
} 