/**
 * 博客中心样式
 */

/* 页面标题 */
.page-header {
    text-align: center;
    padding: 60px 0 40px;
}

.page-header h1 {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* 分类筛选 */
.categories-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-bottom: 48px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.category-item {
    padding: 8px 20px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

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

/* 文章列表 */
.articles {
    margin-bottom: 80px;
}

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

.article-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s ease;
}

.article-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
    transform: translateY(-4px);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.article-category {
    padding: 4px 12px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
}

.article-date {
    color: var(--text-tertiary);
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

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

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

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 15px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.read-more:hover {
    opacity: 0.7;
}

.article-views {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.article-views svg {
    opacity: 0.7;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    color: var(--text-tertiary);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
    padding: 0;
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
}

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

.breadcrumb a:hover {
    color: var(--accent-color);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文章页面容器 */
.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文章布局 */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
    margin: 0;
}

.article-main {
    min-width: 0; /* 防止内容溢出 */
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 0;
}

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

.article-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 14px;
}

.article-date,
.article-views {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-header-meta svg {
    opacity: 0.7;
}

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

/* 右侧边栏 */
.article-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.latest-articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-article-item {
    display: block;
    padding: 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s;
}

.latest-article-item:hover {
    background-color: var(--bg-secondary);
}

.latest-article-item h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-article-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 响应式设计 - 文章详情页 */
@media (max-width: 1024px) {
    .article-container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .article-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: auto;
    }
    
    .article-sidebar {
        position: static;
        order: 2; /* 将侧边栏移到底部 */
        width: 100%;
        margin: 0;
    }
    
    .article-main {
        order: 1; /* 确保主内容在上面 */
        padding: 20px;
        margin: 0;
        border: none;
        border-radius: 0;
    }
    
    .sidebar-section {
        padding: 20px;
        background: var(--bg-primary);
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        margin: 0;
        width: 100%;
    }
    
    .latest-articles-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .breadcrumb {
        font-size: 13px;
        gap: 6px;
        margin: 16px 0;
    }
    
    .breadcrumb-current {
        max-width: 200px; /* 移动端更小的宽度 */
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .article-content {
        padding: 24px;
        font-size: 15px;
    }
    
    .latest-articles-list {
        grid-template-columns: 1fr;
    }
}

.article-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px;
}

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

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

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

.article-content code {
    background: rgba(37, 99, 235, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-color);
}

.article-content pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 20px;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-style: italic;
}

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

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--primary-color);
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 24px;
    transition: opacity 0.3s ease;
}

.back-to-blog:hover {
    opacity: 0.7;
}

/* 响应式 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 32px;
    }
    
    .page-header p {
        font-size: 16px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-card {
        padding: 24px;
    }
    
    .article-header h1 {
        font-size: 20px;
    }
    
    .article-content {
        padding: 0;
    }
    
    .article-content h2 {
        font-size: 24px;
    }
    
    .article-content h3 {
        font-size: 20px;
    }
}

/* 项目卡片特殊样式 - 与首页一致 */
.project-card .project-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.project-card .project-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card .project-info {
    flex: 1;
    min-width: 0;
}

.project-card .project-info .article-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

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

.project-card .article-title a:hover {
    color: var(--accent-color);
}

.project-card .project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.project-card .project-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.project-card .project-tag:hover {
    background: var(--accent-color);
    color: white;
}

.project-card .article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card .github-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.project-card .github-link:hover {
    color: var(--accent-color);
}

