/* 全局自适应基础 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f8f9fa;
}

/* 移动端容器 - 响应式设计 */
.mobile-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

/* 平板和桌面端适配 */
@media screen and (min-width: 768px) {
  .mobile-container {
    max-width: 480px;
    height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 12px;
  }
  
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
}

/* 背景图片自适应 */
.bg-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* 最外层自适应容器（你所有内容都放这里面） */
.auto-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media screen and (min-width: 768px) {
  .auto-container {
    max-width: 480px;
    height: 100vh;
  }
}

/* 上方内容区域 */
.content-area {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 底部导航栏 */
.nav-area {
  flex-shrink: 0;
  width: 100%;
  display: flex;
}

/* 导航按钮自动平分宽度 */
.nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 图片永远自适应，不拉伸 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 防止双击缩放 */
* {
  touch-action: manipulation;
}

/* 媒体查询，适配不同屏幕 */
@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  html {
    font-size: 12px;
  }
}

/* 大屏幕适配 */
@media screen and (min-width: 1024px) {
  html {
    font-size: 18px;
  }
}

/* 安全区域适配（针对有刘海屏的设备） - 可选，根据需要启用
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}
*/

