/* 全局样式 */
* {
    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: #f8fff8;
}

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

/* 头部样式 */
header {
    background-color: #e8f5e8;
    padding: 1rem 0;
    border-bottom: 1px solid #c8e6c9;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #2e7d32;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

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

.nav-links a:hover {
    color: #4caf50;
}

/* 主要内容样式 */
main {
    padding: 2rem 0;
}

/* 首页英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background-color: #e8f5e8;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.hero h2 {
    color: #2e7d32;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* 关于我区域 */
.about {
    background-color: #f8fff8;
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 8px;
}

.about h3 {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #555;
    text-align: center;
}

/* 文章预览区域 */
.articles-preview h3 {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.view-all {
    text-align: center;
    margin-top: 1.5rem;
}

.view-all-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.view-all-button:hover {
    background-color: #2e7d32;
}

/* 分类导航 */
.categories {
    padding: 3rem 0;
    background-color: #f8fff8;
    margin: 2rem 0;
    border-radius: 8px;
}

.categories h3 {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.category-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: #4caf50;
}

.category-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #777;
    font-size: 0.9rem;
}

.article-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    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.1);
}

.article-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.article-card h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h4 a:hover {
    color: #4caf50;
}

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

.article-excerpt {
    color: #555;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: #4caf50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #2e7d32;
    text-decoration: underline;
}

/* 文章列表页 */
.article-list {
    max-width: 800px;
    margin: 0 auto;
}

.article-list h3 {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 列表控制区 */
.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fff8;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-section, .sort-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-controls label {
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

.list-controls select {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

/* 文章列表容器 */
.article-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 文章项 */
.article-item {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.article-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 文章项头部 */
.article-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-item-header h4 {
    font-size: 1.3rem;
    margin-bottom: 0;
    flex: 1;
}

.article-item-header h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-item-header h4 a:hover {
    color: #4caf50;
}

/* 文章分类标签 */
.article-category {
    background-color: #4caf50;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    align-self: flex-start;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #777;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f8fff8;
    border-color: #4caf50;
    color: #4caf50;
}

.pagination-btn.active {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 文章内容页 */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.article-content h3 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
    line-height: 1.3;
}

/* 作者信息区 */
.author-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.author-avatar {
    margin-right: 1rem;
}

.author-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    flex: 1;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #777;
    font-size: 0.9rem;
    text-align: left;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.follow-button {
    padding: 0.5rem 1rem;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.follow-button:hover {
    background-color: #2e7d32;
}

/* 文章分类标签 */
.article-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.3rem 0.8rem;
    background-color: #f0f8f0;
    color: #4caf50;
    border: 1px solid #e0f0e0;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* 文章内容 */
.article-body {
    margin-bottom: 2rem;
}

.article-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #333;
    font-size: 1.05rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* 互动按钮区 */
.article-actions {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.action-button:hover {
    color: #4caf50;
    background-color: #f8fff8;
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-size: 0.9rem;
}

/* 留言区 */
.comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.comments-section h4 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4caf50;
}

/* 留言表单 */
.comment-form-container {
    background-color: #f8fff8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.comment-form-container h5 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.comment-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form-group label {
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
}

.comment-form-group input,
.comment-form-group textarea {
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

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

.comment-submit-button {
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

.comment-submit-button:hover {
    background-color: #2e7d32;
}

/* 留言列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8fff8;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-time {
    color: #777;
    font-size: 0.85rem;
}

.comment-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}

.comment-action-btn:hover {
    color: #4caf50;
}

/* 相关推荐 */
.related-articles {
    margin-top: 2rem;
}

.related-articles h4 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4caf50;
}

.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-article-item {
    display: flex;
    background-color: #f8fff8;
    padding: 1rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.related-article-content {
    flex: 1;
}

.related-article-content h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-article-content h5 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-article-content h5 a:hover {
    color: #4caf50;
}

.related-article-meta {
    color: #777;
    font-size: 0.85rem;
}

/* 搜索页 */
.search-page {
    max-width: 800px;
    margin: 0 auto;
}

.search-page h3 {
    color: #2e7d32;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
}

.search-button {
    padding: 0.8rem 1.5rem;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #2e7d32;
}

.search-results {
    margin-top: 2rem;
}

.search-results h4 {
    color: #555;
    margin-bottom: 1rem;
}

/* 页脚样式 */
footer {
    background-color: #e8f5e8;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid #c8e6c9;
    text-align: center;
    color: #555;
}

/* 自适应设计 */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero {
        padding: 2rem 0;
    }

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

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

    .search-form {
        flex-direction: column;
    }

    .article-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    /* 留言区响应式 */
    .comment-form-row {
        flex-direction: column;
    }
    
    .article-actions {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .action-button {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
    .comment-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

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

    .article-card {
        padding: 1rem;
    }

    .article-content h3 {
        font-size: 1.5rem;
    }
    
    /* 留言区进一步优化 */
    .comment-form-container {
        padding: 1rem;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-button {
        flex: 1 1 100%;
        flex-direction: row;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .comment-item {
        padding: 0.8rem;
    }
    
    .author-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-meta {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
}