/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: #2979ff;
    transition: all 0.3s ease;
}

a:hover {
    color: #0056b3;
}

ul {
    list-style: none;
}

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

/* 头部样式 */
header {
    background-color: #1a237e;
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo h1 {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

nav ul {
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: #fff;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 4px;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 横幅区域样式 */
.banner {
    background: linear-gradient(135deg, #3949ab 0%, #1a237e 100%);
    color: #fff;
    padding: 60px 0;
}

.banner .container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.banner-content {
    flex: 1;
}

.banner-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.banner-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-box {
    display: flex;
    max-width: 500px;
    margin-top: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
}

.search-box button {
    background-color: #ff5722;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #e64a19;
}

/* 通用区块样式 */
.section {
    padding: 60px 0;
}

.bg-light {
    background-color: #f5f7fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    color: #1a237e;
    position: relative;
    padding-left: 15px;
}

.section-header h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 25px;
    background-color: #ff5722;
    border-radius: 3px;
}

.more {
    color: #757575;
    font-size: 16px;
}

/* 卡片样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-image {
    position: relative;
    height: 0;
    padding-bottom: 140%;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.card-content p {
    color: #757575;
    font-size: 14px;
    margin-bottom: 8px;
}

.rating {
    color: #ff9800;
    font-size: 14px;
}

.update-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff5722;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 3px;
}

/* 分类浏览样式 */
.category-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.category-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.category-item h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 15px 10px 10px;
    font-size: 16px;
    text-align: center;
}

/* 排行榜样式 */
.rank-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.rank-list {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.rank-list h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #1a237e;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.rank-list ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.rank-list ul li:last-child {
    border-bottom: none;
}

.rank-num {
    width: 24px;
    height: 24px;
    background-color: #e0e0e0;
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.rank-list ul li:nth-child(1) .rank-num {
    background-color: #f44336;
    color: #fff;
}

.rank-list ul li:nth-child(2) .rank-num {
    background-color: #ff9800;
    color: #fff;
}

.rank-list ul li:nth-child(3) .rank-num {
    background-color: #ffc107;
    color: #fff;
}

.rank-name {
    flex: 1;
    padding: 0 15px;
    font-size: 16px;
}

.rank-score {
    color: #ff5722;
    font-weight: bold;
}

/* 文章样式 */
.article-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 25px;
}

.article-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.article-item h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1a237e;
}

.article-meta {
    color: #757575;
    font-size: 14px;
    margin-bottom: 15px;
}

.article-item p {
    color: #555;
    line-height: 1.8;
    text-align: justify;
}

/* 页脚样式 */
footer {
    background-color: #1a237e;
    color: #fff;
    padding: 60px 0 20px;
}

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

.footer-logo p {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.footer-logo p:nth-child(2) {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.7;
}

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

.footer-links-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links-column h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: #ff5722;
}

.footer-links-column ul li {
    margin-bottom: 10px;
}

.footer-links-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links-column ul li a:hover {
    color: #fff;
}

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

.footer-bottom p {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .card-container, .category-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .banner .container {
        flex-direction: column;
    }
    
    .card-container, .category-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rank-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .card-container, .category-container {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 40px 0;
    }
}