/* 全局样式 */
:root {
    --primary-color: #6a3de8;
    --secondary-color: #ff7a45;
    --accent-color: #ffb74d;
    --light-color: #f5f7fa;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #666;
    --border-color: #eaeaea;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    object-fit: cover;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

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

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.main-nav ul {
    display: flex;
    gap: 20px;
}

.main-nav a {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--text-color);
}

.main-nav a:hover {
    color: var(--primary-color);
    background-color: rgba(106, 61, 232, 0.05);
}

/* 轮播图样式 */
.banner {
    padding: 30px 0;
    background-color: var(--light-color);
}

.slider {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.slide {
    position: relative;
    height: 400px;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
}

.slide-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

/* 章节头部样式 */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

.section-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* 卡片样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.card-content p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: rgba(106, 61, 232, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 文章样式 */
.article-container {
    margin-top: 30px;
}

.article {
    display: flex;
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.article-img {
    flex: 0 0 300px;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
    padding: 20px;
}

.article-content.full-width {
    padding: 30px;
}

.article-content h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.article-content p {
    color: var(--text-color);
    line-height: 1.8;
    text-align: justify;
}

/* 排行榜样式 */
.rank-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rank-item {
    display: flex;
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.rank-num {
    flex: 0 0 50px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-img {
    flex: 0 0 120px;
    height: 120px;
}

.rank-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rank-content h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.rank-content p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.rank-info {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* 分类索引样式 */
.category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category-group h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tags .tag {
    cursor: pointer;
    transition: var(--transition);
}

.category-tags .tag:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* 页脚样式 */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-link-group h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.footer-link-group ul li {
    margin-bottom: 10px;
}

.footer-link-group a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-link-group a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.footer-bottom a {
    color: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .footer-content {
        flex-direction: column;
    }
    
    .footer-logo {
        margin-bottom: 30px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .slide {
        height: 300px;
    }
    
    .article {
        flex-direction: column;
    }
    
    .article-img {
        flex: none;
        height: 200px;
    }
    
    .footer-links {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 26px;
    }
    
    .slide {
        height: 200px;
    }
    
    .slide-content h2 {
        font-size: 22px;
    }
    
    .card-container {
        grid-template-columns: 1fr;
    }
    
    .category-container {
        grid-template-columns: 1fr;
    }
}