/* 博客页面样式 */
.blog-main {
    padding: 120px 0 40px;
}

/* 博客头部 */
.blog-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-top: -80px;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.blog-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 分类导航 */
.category-nav {
    background-color: var(--light-background);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-list {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.category-list a {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.category-list a:hover {
    background-color: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

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

/* 文章列表 */
.blog-posts {
    margin-top: 30px;
}

/* 文章卡片网格布局 */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* 文章卡片样式 */
.post-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 文章图片容器 */
.post-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

/* 文章内容区域 */
.post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 文章元信息 */
.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #666;
}

.post-category {
    background: #f0f4ff;
    color: #4a6cf7;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.post-date {
    color: #888;
}

/* 文章标题 */
.post-content h2 {
    font-size: 24px;
    line-height: 1.4;
    margin: 0;
}

.post-content h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content h2 a:hover {
    color: #4a6cf7;
}

/* 文章描述 */
.post-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--secondary-color);
}

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

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: white;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

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

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

/* 订阅区域 */
.subscribe-section {
    background-color: var(--light-background);
    padding: 60px 0;
    text-align: center;
}

.subscribe-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.subscribe-section p {
    color: var(--light-text);
    margin-bottom: 30px;
}

.subscribe-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.subscribe-form input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
}

.subscribe-form button {
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.subscribe-form button:hover {
    background-color: var(--secondary-color);
}

.subscribe-message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
}

.subscribe-message.success {
    background-color: var(--success-color);
    color: white;
}

.subscribe-message.error {
    background-color: var(--error-color);
    color: white;
}

/* RTL支持 */
[dir="rtl"] .category-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .post-meta {
    flex-direction: row-reverse;
}

[dir="rtl"] .subscribe-form {
    flex-direction: row-reverse;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .blog-header {
        padding: 40px 0;
    }

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

    .category-list {
        flex-wrap: wrap;
    }

    .post-image {
        height: 240px;
    }

    .post-content {
        padding: 20px;
    }

    .post-content h2 {
        font-size: 20px;
    }

    .post-content p {
        font-size: 15px;
    }

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

    .subscribe-form input,
    .subscribe-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .post-image {
        height: 200px;
    }

    .post-content {
        padding: 16px;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 打印样式 */
@media print {
    .category-nav,
    .subscribe-section {
        display: none;
    }

    .post-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .post-image {
        display: none;
    }
}

.component-error {
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    color: #d32f2f;
    text-align: center;
}
