/* 全局样式重置 */
* {
    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 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 菜单切换按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    position: relative;
    transition: background-color 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: white;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

/* 菜单打开状态 */
.navbar.open .menu-icon {
    background-color: transparent;
}

.navbar.open .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.navbar.open .menu-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #4CAF50;
}

/* BANNER样式 */
.banner {
    height: 60vh;
    background-image: url('../images/banner.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.banner h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.banner p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* 主要内容样式 */
.main-content {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
}

/* 文章列表样式 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card-content {
    padding: 1.5rem;
}

.article-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.article-card-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.article-card-excerpt {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.article-card a {
    text-decoration: none;
    color: #4CAF50;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-card a:hover {
    color: #45a049;
}

/* 文章内容样式 */
.article-content {
    padding: 4rem 0;
}

.article {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.article-meta {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

.article-meta span {
    margin-right: 1rem;
}

.article-featured-image {
    margin-bottom: 2rem;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.article-body {
    color: #333;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #333;
}

.article-body h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: #444;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

/* 相关文章样式 */
.related-articles {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.related-articles h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.related-item {
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: translateY(-3px);
}

.related-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.related-item h4 {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

/* 关于我们和联系我们样式 */
.about-section,
.contact-section {
    background-color: white;
    padding: 4rem 0;
    text-align: center;
}

.about-section p,
.contact-section p {
    max-width: 800px;
    margin: 0 auto 1rem;
    color: #555;
    line-height: 1.8;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 显示菜单切换按钮 */
    .menu-toggle {
        display: block;
    }
    
    /* 隐藏默认导航菜单 */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(51, 51, 51, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: 0;
        transition: right 0.3s ease;
    }
    
    /* 菜单打开状态 */
    .navbar.open .nav-menu {
        right: 0;
    }
    
    .nav-menu li {
        margin: 1.5rem 0;
    }
    
    .nav-menu a {
        font-size: 1.2rem;
    }
    
    .banner h2 {
        font-size: 2rem;
    }
    
    .banner p {
        font-size: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .banner h2 {
        font-size: 1.5rem;
    }
    
    .article {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}