/* 移动端优先通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    -webkit-text-size-adjust: 100%; /* 防止移动端字体缩放 */
}

/* 确保页面内容无额外边距 */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    overflow-x: hidden;
    position: relative;
}

/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* 设置基准字体大小 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    padding: 0 16px; /* 添加左右16px的内边距 */
    min-height: 100vh;
    overflow-x: hidden; /* 防止横向滚动 */
}

/* 页面内容区域需要为导航栏留出空间 */
.page-content {
    width: 100%;
    margin: 0;
    padding: 0 0 80px 0;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}

/* 移动端触摸优化 */
button, input, .btn {
    min-height: 44px; /* iOS 推荐的最小触摸目标尺寸 */
    touch-action: manipulation; /* 优化触摸响应 */
}

/* 响应式断点设计 */
@media (max-width: 480px) {
    html {
        font-size: 14px; /* 小屏设备字体适当缩小 */
    }
    
    body {
        padding: 0 16px; /* 保持左右16px的内边距 */
    }
    
    .page-content {
        width: 100%;
        margin: 0;
        padding: 0 0 70px 0; /* 移除左右padding，只保留底部padding */
        min-height: calc(100vh - 70px);
        box-sizing: border-box;
    }
}

@media (max-width: 375px) {
    html {
        font-size: 13px;
    }
    
    body {
        padding: 0 16px; /* 保持左右16px的内边距 */
    }
}

/* 安全区域适配（iPhone X及更新机型） */
@supports(padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}