/* 文章中心样式 */

/* 文章Hero区域 */
.articles-hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 40px;
}

.articles-hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.articles-hero p {
    font-size: 18px;
    opacity: 0.9;
}

/* 文章布局 */
.articles-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* 侧边栏 */
.articles-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.sidebar-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* 分类列表 */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 6px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background: var(--primary-color);
    color: white;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
}

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

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

.hot-articles li {
    margin-bottom: 12px;
}

.hot-articles a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s;
}

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

/* 文章网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* 文章卡片 */
.article-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-category {
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.article-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.article-badge.hot {
    background: #fee2e2;
    color: #dc2626;
}

.article-badge.featured {
    background: #fef3c7;
    color: #d97706;
}

.article-card h2 {
    font-size: 18px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-card h2 a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

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

.article-excerpt {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.article-footer {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-light);
}

/* 文章详情页 */
.article-detail {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

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

.article-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 14px;
}

.meta-category {
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
}

.article-keywords {
    margin-top: 15px;
    padding: 12px;
    background: #fef3c7;
    border-left: 4px solid #d97706;
    border-radius: 4px;
    font-size: 14px;
}

.article-cover-large {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.article-cover-large img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

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

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

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

.article-body ul,
.article-body ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

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

.article-body strong {
    font-weight: 600;
    color: var(--text-color);
}

.article-body code {
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.article-tags {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
}

.article-tags strong {
    display: inline-block;
    margin-bottom: 10px;
}

.article-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 20px;
    margin: 0 8px 8px 0;
    transition: all 0.3s;
}

.article-tags .tag:hover {
    background: var(--primary-color);
    color: white;
}

.article-share {
    margin-top: 25px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
}

.article-share span {
    font-weight: 500;
    margin-right: 15px;
}

.article-share button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 10px;
}

.article-share button:hover {
    background: var(--primary-hover);
}

.article-source {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-light);
}

/* 相关文章 */
.related-articles {
    margin-top: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.related-articles h2 {
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
}

.articles-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.related-article-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.related-article-cover {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
}

.related-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-article-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.related-article-card h3 a {
    text-decoration: none;
    color: var(--text-color);
}

.related-article-card h3 a:hover {
    color: var(--primary-color);
}

.related-article-meta {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    gap: 15px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .articles-layout {
        grid-template-columns: 1fr;
    }

    .articles-sidebar {
        position: static;
    }

    .sidebar-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .articles-hero h1 {
        font-size: 28px;
    }

    .article-detail {
        padding: 20px;
    }

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

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

    .article-share {
        text-align: center;
    }

    .article-share button {
        width: 100%;
        margin: 5px 0;
    }
}
