/* 全局样式 */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #388E3C;
    --light-green: #C8E6C9;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    background: url('../images/logo.png') no-repeat;
    width: 160px;
    height:60px;
}

.logo span {
    color: var(--secondary-color);
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.nav a:hover {
    color: var(--primary-color);
}

.nav a.active {
    color: var(--primary-color);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--light-gray);
    border-radius: var(--radius);
    padding: 8px 15px;
    width: 300px;
    position: relative;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 5px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    position: absolute;
    right: 20px;
    top: 12px;
}

/* 主要内容区域 */
.main-content {
    padding: 40px 0;
}

/* 首页特色区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: 16px;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--light-green);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 文章卡片 */
.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.article-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-category {
    display: inline-block;
    background-color: var(--light-green);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.article-title {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-color);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 侧边栏 */
.sidebar {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
    color: var(--text-color);
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 12px;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    color: var(--text-color);
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.category-item a:hover {
    color: var(--primary-color);
}

.category-count {
    background-color: var(--light-gray);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* 热门文章 */
.popular-articles {
    list-style: none;
}

.popular-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.popular-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
}

.popular-content h4 {
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.popular-content h4 a {
    color: var(--text-color);
}

.popular-content h4 a:hover {
    color: var(--primary-color);
}

.popular-date {
    font-size: 12px;
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 500;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 底部 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: white;
}

.footer-section p {
    margin-bottom: 20px;
    opacity: 0.8;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: #bdc3c7;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 18px;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    opacity: 0.7;
}

/* 文章详情页 */
.article-header {
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: 36px;
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-meta-large {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.article-meta-large span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.article-body {
    font-size: 18px;
    line-height: 1.8;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body h2 {
    font-size: 28px;
    margin: 30px 0 20px;
    color: var(--text-color);
}

.article-body h3 {
    font-size: 24px;
    margin: 25px 0 15px;
    color: var(--text-color);
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 20px 0;
}

.article-tags {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--light-gray);
    color: var(--text-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.tag:hover {
    background-color: var(--light-green);
    color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .search-box {
        width: 100%;
        max-width: 500px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 26px;
    }

    .section-title {
        font-size: 24px;
    }

    .article-header h1 {
        font-size: 28px;
    }

    .article-featured-image {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    .article-meta-large {
        flex-direction: column;
        gap: 10px;
    }
}

/* 补充样式 */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* 作者信息 */
.author-widget {
    text-align: center;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--light-green);
}

.author-info h4 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.author-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.author-social {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--light-gray);
    border-radius: 50%;
    color: var(--text-color);
    font-size: 16px;
}

.author-social a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 文章目录 */
.table-of-contents {
    list-style: none;
}

.table-of-contents li {
    margin-bottom: 10px;
    padding-left: 15px;
    position: relative;
}

.table-of-contents li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.table-of-contents a {
    color: var(--text-color);
}

.table-of-contents a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 文章分享 */
.article-share {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.article-share p {
    margin: 0;
    font-weight: 500;
}

/* 页面标题 */
.page-header {
    margin-bottom: 40px;
}

.page-subtitle {
    color: #666;
    font-size: 18px;
}

/* 相关文章 */
.related-articles {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--light-gray);
}

/* 订阅表单 */
.subscribe-form {
    margin-top: 20px;
}

.subscribe-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 10px;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 文章分享社交媒体图标 */
.article-share .social-links a {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray);
    color: var(--text-color);
}

.article-share .social-links a:hover {
    background-color: var(--primary-color);
    color: white;
}