/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.logo h1 {
    font-size: 18px;
    color: #2c3e50;
}

.nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav a {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s;
}

.nav a.active, .nav a:hover {
    background-color: #3498db;
    color: #fff;
}

/* 主要内容 */
.main {
    padding: 30px 0;
}

section {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

section h2 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 文章列表样式 */
.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.article-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content {
    padding: 15px;
}

.article-card-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.article-card-title a:hover {
    color: #3498db;
}

.article-card-category {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 8px;
}

.article-card-desc {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 栏目列表样式 */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    display: block;
    background-color: #f5f8ff;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.category-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.category-card span {
    font-size: 12px;
    color: #3498db;
}

/* 栏目页样式 */
.category-article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.category-article-item:last-child {
    border-bottom: none;
}

.category-article-item img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.category-article-content {
    flex: 1;
}

.category-article-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.category-article-title a:hover {
    color: #3498db;
}

.category-article-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-article-meta {
    font-size: 12px;
    color: #999;
}

/* 文章详情页样式 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-detail-header {
    text-align: center;
    margin-bottom: 30px;
}

.article-detail-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.article-detail-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.article-detail-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.article-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-detail-content h3 {
    font-size: 22px;
    margin: 25px 0 15px;
    color: #2c3e50;
}

.article-detail-content p {
    margin-bottom: 20px;
}

.article-detail-content ul, .article-detail-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

/* 底部样式 */
.footer {
    background-color: #406285;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

.footer a {
    color: #fff;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .article-list {
        grid-template-columns: 1fr;
    }
    .category-article-item {
        flex-direction: column;
    }
    .category-article-item img {
        width: 100%;
        height: auto;
    }
    .header .container {
        flex-direction: column;
        align-items: flex-start;
    }
}