/* 主样式文件 - 基于项目规范的配色和布局 */

/* ==================== 颜色变量 ==================== */
:root {
    /* 主色调 - 根据项目规范 */
    --primary-red: #E31937;        /* 帝王朱红 - 主按钮、重要标签 */
    --primary-blue: #2667C9;       /* 青金石蓝 - 导航栏、全局背景色 */
    --accent-gold: #FFD700;        /* 琉璃金 - 边框描边、图标描边 */
    
    /* 中性色系 */
    --text-primary: #333333;       /* 主要文字 */
    --text-secondary: #666666;     /* 次要文字 */
    --text-light: #999999;         /* 辅助文字 */
    --text-white: #FFFFFF;         /* 白色文字 */
    
    /* 背景色 */
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-section: #F5F7FA;
    
    /* 边框色 */
    --border-light: #E5E5E5;
    --border-medium: #CCCCCC;
    
    /* 状态色 */
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    
    /* 阴影 */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    /* 圆角 */
    --radius-small: 6px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-xlarge: 16px;
    
    /* 间距 */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-xxl: 64px;
    
    /* 字体大小 - 根据项目规范 */
    --font-size-h1: 32px;          /* H1 */
    --font-size-h2: 24px;          /* H2 */
    --font-size-h3: 20px;          /* H3 */
    --font-size-body: 16px;        /* 正文 */
    --font-size-small: 14px;       /* 辅助说明 */
    --font-size-caption: 12px;     /* Caption */
    
    /* 行高 */
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    --line-height-loose: 1.8;
    
    /* 过渡效果 */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ==================== 基础样式 ==================== */

/* 标题样式 */
h1, .h1 {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-tight);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h2, .h2 {
    font-size: var(--font-size-h2);
    line-height: var(--line-height-tight);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

h3, .h3 {
    font-size: var(--font-size-h3);
    line-height: var(--line-height-tight);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

p {
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* ==================== 按钮组件 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: var(--font-size-body);
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: var(--transition-normal);
    min-height: 44px;
    min-width: 44px;
    gap: var(--space-xs);
}

/* 主按钮 - 帝王朱红 */
.btn-primary {
    background-color: var(--primary-red);
    color: var(--text-white);
    border-color: var(--primary-red);
}

.btn-primary:hover {
    background-color: #C41530;
    border-color: #C41530;
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.btn-primary:disabled {
    background-color: var(--border-medium);
    border-color: var(--border-medium);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 次按钮 - 琉璃金描边 */
.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--accent-gold);
}

.btn-outline:hover {
    background-color: rgba(255, 215, 0, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-light);
}

.btn-outline:active {
    background-color: rgba(255, 215, 0, 0.2);
}

/* 按钮尺寸 */
.btn-small {
    padding: 8px 16px;
    font-size: var(--font-size-small);
    min-height: 36px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
}

.btn-search {
    padding: 12px 20px;
    border-radius: var(--radius-small);
}

/* ==================== 表单组件 ==================== */
.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-body);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    transition: var(--transition-normal);
    height: 44px;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(38, 103, 201, 0.1);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-light);
}

/* ==================== 卡片组件 ==================== */
.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: var(--space-md);
}

.card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-light);
}

/* ==================== 网格布局 ==================== */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==================== 部分布局 ==================== */

/* 章节标题 */
.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: var(--font-size-h2);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
}

.section-footer {
    text-align: center;
    margin-top: var(--space-xl);
}

/* 间距调整 */
.section {
    padding: var(--space-xxl) 0;
}

.section-sm {
    padding: var(--space-xl) 0;
}

.section-lg {
    padding: 80px 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .section {
        padding: var(--space-xl) 0;
    }
    
    h1, .h1 {
        font-size: 28px;
    }
    
    h2, .h2 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 var(--space-sm);
    }
    
    .section {
        padding: var(--space-lg) 0;
    }
    
    h1, .h1 {
        font-size: 24px;
    }
    
    h2, .h2 {
        font-size: 20px;
    }
    
    h3, .h3 {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: var(--font-size-small);
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: var(--font-size-body);
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .section-header {
        margin-bottom: var(--space-lg);
    }
    
    .section-footer {
        margin-top: var(--space-lg);
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* ==================== 工具类 ==================== */
.text-primary {
    color: var(--primary-red) !important;
}

.text-blue {
    color: var(--primary-blue) !important;
}

.text-gold {
    color: var(--accent-gold) !important;
}

.bg-primary {
    background-color: var(--primary-red) !important;
}

.bg-blue {
    background-color: var(--primary-blue) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.border-gold {
    border-color: var(--accent-gold) !important;
}

.rounded {
    border-radius: var(--radius-medium) !important;
}

.rounded-lg {
    border-radius: var(--radius-large) !important;
}

.shadow {
    box-shadow: var(--shadow-light) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-medium) !important;
}