
/* home/static/home/css/home_page.css */

/* ===== CSS 自定义属性 ===== */
:root {
    --primary-color: #3273dc;
    --footer-gradient-start: #667eea;
    --footer-gradient-end: #764ba2;
    --text-muted: #7a7a7a;

    /* 背景色系 - 青少年编程主题 */
    --bg-white: #ffffff;
    --bg-light-blue: #f0f4ff;
    --bg-light-purple: #f5f0ff;
    --bg-light-cyan: #e8f8ff;

    --border-light: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --white-alpha-20: rgba(255, 255, 255, 0.2);
    --white-alpha-40: rgba(255, 255, 255, 0.4);
    --white-alpha-80: rgba(255, 255, 255, 0.8);
    --white-alpha-90: rgba(255, 255, 255, 0.9);
    --accent-yellow: #ffdd57;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    --radius-md: 0.75rem;

    --container-max-width: 1400px;

    --transition-base: all 0.3s;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid var(--border-light);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== 频道入口卡片 ===== */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.channel-card {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    color: white;
    box-shadow: var(--shadow-sm);
}

.channel-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.channel-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.channel-card .title {
    color: white;
    font-size: 1.3rem;
}

/* ===== 关于我们区块 ===== */
.about-section {
    padding: var(--spacing-xl) 0;
}

.about-section .content {
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ===== 关于我们全宽背景 ===== */
.about-fullwidth {
    background: #f0faf9;
    width: 100%;
    padding-bottom: 0;
}

/* ===== 主容器样式 ===== */
.main-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* ===== 轮播图全宽样式 ===== */
.swiper-fullwidth {
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg-white);
}

.swiper-fullwidth .swiper {
    border-radius: 0;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .about-section {
        padding: var(--spacing-md) 0;
    }

    .about-section .content {
        font-size: 0.95rem;
    }

    .channel-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: var(--spacing-sm);
    }

    .channel-card {
        padding: var(--spacing-md) 0.5rem;
    }

    .channel-icon {
        font-size: 2.5rem;
    }

    .channel-card .title {
        font-size: 1.1rem;
    }
}

/* ===== 网站公告区块 ===== */
.announcement-section {
    background: #ffffff;
    padding: var(--spacing-xl) 0;
}

.announcement-section .section-title-wrapper {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--spacing-md);
}

.announcement-content {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.announcement-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.announcement-content li {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 0.75rem;
    border-left: 4px solid #ffc107;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    line-height: 1.8;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
}

.announcement-content li::before {
    content: '📌';
    position: absolute;
    left: -2.5rem;
    top: 1.25rem;
    font-size: 1.2rem;
}

.announcement-content li:last-child {
    margin-bottom: 0;
}

.announcement-content li:hover {
    transform: translateX(8px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.25);
    border-left-color: #ff9800;
}

.announcement-content p {
    margin: 0.5rem 0;
    line-height: 1.8;
}

.announcement-content strong {
    color: #856404;
    font-weight: 600;
}

.announcement-content a {
    color: #ff9800;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed #ff9800;
}

.announcement-content a:hover {
    color: #f57c00;
    border-bottom-style: solid;
}

/* ===== 通用区块样式 ===== */
.content-section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

/* 最新真题区块 - 浅蓝色背景 */
.content-section[aria-label="最新真题"] {
    background: #e3f2fd;
}

/* 最新文章区块 - 浅紫色背景 */
.content-section.article-section {
    background: #f3e5f5;
    padding-bottom: calc(var(--spacing-xl) + 2rem);
    margin-bottom: 0;
}

.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: none;
}

.section-title-wrapper .title {
    margin-bottom: 0;
    font-weight: 600;
    flex: 1;
    text-align: center;
    font-size: 1.75rem;
}

.section-title-wrapper .button {
    font-weight: 600;
    border-width: 2px;
}

@media (max-width: 768px) {
    .section-title-wrapper {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .section-title-wrapper .title {
        text-align: left;
        font-size: 1.5rem;
    }
}

/* ===== 查看更多卡片样式 - 统一风格 */
.view-more-card {
    background: #f8f9fa;
    border: 2px dashed #ced4da;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.view-more-card .exam-card-header,
.view-more-card .article-card-image {
    display: none;
}

.view-more-card .exam-card-body,
.view-more-card .article-card-body {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.view-more-card .exam-card-title,
.view-more-card .article-card-title {
    color: #495057;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.view-more-card .exam-card-footer,
.view-more-card .article-card-meta {
    color: #868e96;
    font-size: 0.9rem;
    justify-content: center;
}

.view-more-card .exam-card-footer i,
.view-more-card .article-card-meta i {
    margin-right: 0.3rem;
}

.view-more-card:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.view-more-card:hover .exam-card-title,
.view-more-card:hover .article-card-title {
    color: #667eea;
}

.view-more-card:hover .exam-card-footer,
.view-more-card:hover .article-card-meta {
    color: #667eea;
}

.view-more-card:hover i {
    color: #667eea !important;
}

/* ===== 最新真题卡片 ===== */
.exam-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.exam-preview-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.exam-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.exam-card-header {
    display: flex;
    gap: var(--spacing-xs);
}

.exam-level-badge,
.exam-lang-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.exam-level-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.exam-lang-badge {
    background: var(--bg-light);
    color: var(--text-muted);
}

.exam-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
}

.exam-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.exam-date i {
    color: var(--primary-color);
}

.exam-arrow-icon {
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-base);
}

.exam-preview-card:hover .exam-arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* ===== 最新文章卡片 ===== */
.article-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--spacing-md);
}

.article-preview-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.article-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.article-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.article-card-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.article-card-image.no-image {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.article-preview-card:hover .article-card-image img {
    transform: scale(1.08);
}

.article-category-tag {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.article-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin: 0 0 var(--spacing-sm) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
    transition: color 0.3s;
}

.article-preview-card:hover .article-card-title {
    color: var(--primary-color);
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--border-light);
}

.article-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.article-card-meta i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state i {
    color: #ddd;
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ===== 响应式适配 ===== */
@media (max-width: 768px) {
    .section-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .exam-card-grid {
        grid-template-columns: 1fr;
    }

    .article-card-grid {
        grid-template-columns: 1fr;
    }

    .article-card-image {
        height: 200px;
    }
}

/* ===== 底部样式 ===== */
.footer-fullwidth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-top: 0;
    width: 100%;
}
