/* 核心样式 - 响应式设计/安全区/滚动条/字体定义 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 响应式容器 - 适配所有设备 */
.responsive-container {
    width: 100%;
    max-width: 375px;
    min-height: 100vh;
    margin: 0 auto;
    background: #F4F5F7;
    position: relative;
}

/* 平板端适配 (768px - 1279px) - 包括所有 iPad */
@media (min-width: 768px) and (max-width: 1279px) {
    .responsive-container {
        max-width: 1024px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    }
}

/* 桌面端适配 (>=1280px) - 仅桌面浏览器 */
@media (min-width: 1280px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 20px;
    }
    
    .responsive-container {
        max-width: 375px;
        height: 812px;
        border-radius: 40px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        position: relative;
    }
    
    /* 桌面端显示刘海 */
    .responsive-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 30px;
        background: #000;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        z-index: 1000;
    }
}

/* 手机框架样式 */
.phone-frame {
    width: 375px;
    height: 812px;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #000;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

.phone-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 状态栏背景 - 必须使用 */
.nav-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 内容容器背景 - 必须使用 */
.content-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: calc(100vh - 3rem - 3.5rem); /* 减去顶部状态栏和底部工具栏的高度 */
    overflow-y: auto;
    padding-bottom: 1rem;
}

/* 桌面端内容区域优化 */
@media (min-width: 1280px) {
    .content-bg {
        height: calc(812px - 3rem - 3.5rem);
        min-height: auto;
    }
}

/* 自定义滚动条样式 */
.content-bg::-webkit-scrollbar {
    width: 4px;
}

.content-bg::-webkit-scrollbar-track {
    background: transparent;
}

.content-bg::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* 安全区域 */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* 圆角规范 */
.rounded-card {
    border-radius: 12px;
}

.rounded-large {
    border-radius: 16px;
}

/* 字体层级 */
.text-title-large {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.text-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.text-heading {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
}

.text-body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

.text-caption {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
}

/* 平板端字体放大 */
@media (min-width: 768px) and (max-width: 1279px) {
    .text-title-large {
        font-size: 26px;
    }
    
    .text-title {
        font-size: 24px;
    }
    
    .text-heading {
        font-size: 19px;
    }
    
    .text-body {
        font-size: 16px;
    }
}

/* 响应式网格 */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* 响应式间距 */
.responsive-padding {
    padding: 16px;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .responsive-padding {
        padding: 24px;
    }
}

/* 固定定位元素优化 */
.fixed-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* 桌面端：固定元素相对于容器 */
@media (min-width: 1280px) {
    .responsive-container {
        position: relative;
    }
    
    .fixed-bottom-bar {
        position: absolute;
        max-width: 375px;
        margin: 0 auto;
    }
}
