/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #007bff;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/hero.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 6rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* 按钮 */
.btn {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}

/* 最新文章 */
.latest-posts {
    padding: 4rem 0;
}

.latest-posts h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

/* 文章网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* 文章卡片 */
.post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.post-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-meta span {
    margin-right: 0.5rem;
}

.post-content h3 {
    margin-bottom: 1rem;
}

.post-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content h3 a:hover {
    color: #007bff;
}

.post-content p {
    color: #666;
    margin-bottom: 1rem;
}

.read-more {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* 博客页 */
.blog {
    padding: 4rem 0;
}

.blog h1 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.page-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    background-color: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #007bff;
    color: #fff;
}

.page-link.active {
    background-color: #007bff;
    color: #fff;
}

/* 文章详情页 */
.post {
    padding: 4rem 0;
}

.post-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.featured-img {
    width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 8px;
}

.post-body h2 {
    margin: 2rem 0 1rem;
    color: #333;
}

.post-body p {
    margin-bottom: 1rem;
    color: #555;
}

.post-body ul {
    margin: 1rem 0;
    padding-left: 2rem;
    color: #555;
}

.post-body li {
    margin-bottom: 0.5rem;
}

/* 评论区 */
.comments {
    margin-top: 4rem;
}

.comments h2 {
    margin-bottom: 2rem;
    color: #333;
}

.comment-form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.comment-form h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* 评论列表 */
.comments-list h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.comment {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.comment-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.comment-content {
    color: #555;
}

/* 相关文章 */
.related-posts {
    margin-top: 4rem;
}

.related-posts h2 {
    margin-bottom: 2rem;
    color: #333;
}

/* 关于页 */
.about {
    padding: 4rem 0;
}

.about-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-content h1 {
    margin-bottom: 2rem;
    color: #333;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* 联系页 */
.contact {
    padding: 4rem 0;
}

.contact-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-content h1 {
    margin-bottom: 2rem;
    color: #333;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 1rem;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #007bff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
    }

    .nav-menu {
        margin-top: 1rem;
    }

    .nav-menu li {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .blog h1,
    .latest-posts h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .post-content,
    .comment-form,
    .comment {
        padding: 1.5rem;
    }

    .footer {
        padding: 2rem 0;
    }
}