/* CSS变量定义 */
:root {
    /* 主题颜色 */
    --primary-color: #c61f0d;
    --primary-gradient: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%), 
                        linear-gradient(90deg, rgb(198, 31, 13) 0%, rgb(198, 31, 13) 100%);
    
    /* 辅助颜色 */
    --gray-light: #d9d9d9;
    --gray-medium: #8f8d8d;
    --gray-dark: #777575;
    --gray-text: #696868;
    --bg-cream: #fcf6ea;
    --border-gray: #838080;
    --button-gray: #c8c6c6;
    
    /* 文字颜色 */
    --text-primary: #000;
    --text-secondary: #333;
    --text-white: #fff;
    
    /* 布局尺寸 */
    --mobile-width: 375px;
    --header-height: 77px;
    --nav-height: 82px;
    
    /* 阴影 */
    --shadow-sm: 0px 1px 3px 0px rgba(0,0,0,0.25);
    --shadow-md: 0px 2px 4px 0px rgba(0,0,0,0.25);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-lg: 100px;
}

/* 容器 - 响应式 */
.container {
    width: 100%;
    max-width: 100%;  /* 移除375px限制 */
    min-width: 320px;  /* 最小支持宽度 */
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background-color: #fff;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 平板及以上：限制最大宽度 */
@media (min-width: 768px) {
    .container {
        max-width: 450px;
    }
    
    /* 无顶部栏页面（如注册页）：保持全宽 */
    .page-no-header.container {
        max-width: 100%;
    }
}

/* 桌面端：保持移动端宽度 */
@media (min-width: 1024px) {
    .container {
        max-width: 375px;
    }
    
    /* 无顶部栏页面（如注册页）：保持全宽 */
    .page-no-header.container {
        max-width: 100%;
    }
}

/* 无顶部栏页面：背景透明容器 */
.page-no-header .container {
    background-color: transparent !important;
}

/* 页面主体 */
.page-wrapper {
    position: relative;
    width: 100%;
    min-height: 100svh;
    padding-bottom: var(--nav-height);
    z-index: 1; /* 确保在背景图片上面 */
}

/* 无顶部栏页面：确保背景显示 */
.page-no-header {
    position: relative;
    width: 100%;
    min-height: 100svh;
    background: transparent;
}

/* 通用按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn:active {
    opacity: 0.7;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-gray {
    background-color: var(--button-gray);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    display: block;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.form-input:focus {
    border-color: var(--primary-color);
}

/* 文字工具类 */
.text-primary { color: var(--primary-color); }
.text-gray { color: var(--gray-dark); }
.text-white { color: var(--text-white); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-bold { font-weight: bold; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.text-xs { font-size: 10px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

/* 间距工具类 */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Flex布局 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* 显示/隐藏 */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 9999;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Loading动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 渐变背景 */
.bg-gradient {
    background: var(--primary-gradient);
}

/* 阴影 */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* ==================== 页面头部样式 ==================== */
.page-header {
    position: relative;
    height: var(--header-height);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-back {
    position: absolute;
    left: 20px;
    width: 9px;
    height: 18px;
}

.back-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-white);
    margin: 0;
    margin-left: 20px;
}

/* ==================== 底部导航样式 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    background: #FCF6EA; /* 米色背景 RGB(252, 246, 234) */
    z-index: 100;
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 450px;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        max-width: 375px;
    }
}

.nav-divider {
    height: 1px;
    background: var(--gray-light);
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 11px 0 7px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    flex: 1;
    transition: opacity 0.3s;
}

.nav-item:active {
    opacity: 0.7;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 7px;
    object-fit: contain;
    opacity: 0.6;
}

.nav-item.active .nav-icon {
    opacity: 1;
    width: 21px;
    height: 21px;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
}


/* ==================== 无顶部栏页面样式 ==================== */
.page-no-header {
    padding-bottom: var(--nav-height);
}

.page-bg-full {
    position: fixed;
    top: 0;
    left: 50%;
    width: 100%;
    max-width: 100%;
    height: 100svh;
    min-height: 812px; /* 设计稿高度作为兜底 */
    transform: translateX(-50%);
    z-index: -2; /* 确保在所有内容后面 */
    pointer-events: none;
    overflow: hidden;
}

.page-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.page-header-float {
    position: absolute;
    top: 59px;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
}

.header-back-float {
    position: absolute;
    left: 20px;
    width: 9px;
    height: 18px;
}

.page-title-float {
    position: absolute;
    left: 40px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-white);
    margin: 0;
}

