/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --light-text: #666;
    --border-color: #e0e0e0;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --accent: #e74c3c;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    color: var(--light-text);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    font-size: 16px;
    font-weight: 500;
    padding: 10px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a.active {
    color: var(--primary-color);
}

/* 主内容区布局 */
main.container {
    display: flex;
    gap: 30px;
    padding: 40px 20px;
}

.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 文章列表 */
.section-title {
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--secondary-color);
}

.article-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 25px;
}

.article-content h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.article-content h3 a {
    color: var(--secondary-color);
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 15px;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-excerpt {
    color: var(--light-text);
    margin-bottom: 15px;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    padding: 8px 0;
}

.read-more:hover {
    text-decoration: underline;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 10px 15px;
    background: var(--white);
    border-radius: 5px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.pagination a {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
}

.pagination .current {
    background: var(--primary-color);
    color: var(--white);
}

/* 侧边栏小部件 */
.widget {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.widget h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--secondary-color);
}

/* 关于博主 */
.avatar {
    text-align: center;
    margin-bottom: 15px;
}

.avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.about-me p {
    color: var(--light-text);
    margin-bottom: 15px;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    display: inline-block;
    padding: 8px 15px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 分类列表 */
.categories ul {
    list-style: none;
}

.categories li {
    border-bottom: 1px solid var(--border-color);
}

.categories li:last-child {
    border-bottom: none;
}

.categories a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--text-color);
    transition: padding-left 0.3s ease;
}

.categories a:hover {
    padding-left: 10px;
    color: var(--primary-color);
}

.categories span {
    color: var(--light-text);
    font-size: 14px;
}

/* 热门文章 */
.popular-posts ul {
    list-style: none;
}

.popular-posts li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-posts li:last-child {
    border-bottom: none;
}

.popular-posts a {
    display: block;
    color: var(--text-color);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.popular-posts a:hover {
    color: var(--primary-color);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 页脚 */
.site-footer {
    /* background: var(--secondary-color); */
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section p,
.footer-section li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

.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;
}

/* 响应式设计 */
@media (max-width: 992px) {
    main.container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .article-image {
        height: 200px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .article-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    main.container {
        padding: 20px 15px;
    }
    
    .article-image {
        height: 180px;
    }
    
    .pagination a,
    .pagination .current {
        padding: 8px 12px;
        font-size: 14px;
    }
}