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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-box button:hover {
    transform: translateY(-2px);
}

/* 分类筛选 */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 排序选项 */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options select {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 统计信息 */
.stats-section {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-left: 5px;
}

/* 文章容器 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 文章卡片 */
.article-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.article-header {
    margin-bottom: 15px;
}

.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
}

.article-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #666;
}

.stat-icon {
    margin-right: 5px;
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    margin: 40px 0;
}

.load-more button {
    padding: 12px 40px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more button:hover {
    background: #667eea;
    color: white;
}

/* 文章详情页样式 */
.back-nav {
    margin-bottom: 20px;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #f8f9ff;
    transform: translateX(-5px);
}

.article-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.article-detail .article-title {
    font-size: 2rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-detail .article-meta {
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.article-detail .article-tags {
    margin-bottom: 25px;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.article-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background: #f4f4f4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

.article-content ul,
.article-content ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.article-content li {
    margin-bottom: 8px;
}

/* 文章操作按钮 */
.article-actions {
    display: flex;
    gap: 15px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9ff;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.action-btn.liked {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

/* 评论区样式 */
.comments-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #1a1a1a;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.form-actions input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.form-actions button {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.form-actions button:hover {
    transform: translateY(-2px);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

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

.comment-author {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #666;
}

.comment-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.comment-like-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-like-btn:hover {
    color: #667eea;
}

/* 相关文章 */
.related-articles {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.related-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-item {
    padding: 15px 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.related-item:hover {
    background: #e8ebff;
    transform: translateX(5px);
}

.related-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #1a1a1a;
}

.related-item p {
    font-size: 0.9rem;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

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

    .search-section {
        padding: 20px;
    }

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

    .category-filter {
        justify-content: center;
    }

    .stats-section {
        flex-direction: column;
        gap: 15px;
    }

    .articles-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-detail {
        padding: 25px;
    }

    .article-detail .article-title {
        font-size: 1.5rem;
    }

    .article-actions {
        flex-direction: column;
    }

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.2rem;
    color: #999;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    text-align: center;
    padding: 40px;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}