/* Category Page Styles */

/* First module styles */
.category-header {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff; /* 添加白色背景 */
    border-radius: 8px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* 添加轻微阴影以增强视觉效果 */
}

.category-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

.category-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

/* Add statistics number styles */
.category-count {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
}

.category-hero {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b9d 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.category-hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.category-hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.9;
}

.category-filter {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

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

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.filter-btn:hover,
.filter-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 新增文章列表样式 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 添加文章网格样式，每行一篇文章，文章之间有30px间距 */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 30px; /* 30px间距 */
}

.post-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    flex: 1 1 auto;
}

.post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.post-thumbnail {
    flex: 0 0 250px; /* 调整宽度为250px */
    height: 160px; /* 保持高度为160px */
    overflow: hidden;
    margin: 15px; /* 添加间距 */
    border-radius: 8px; /* 添加圆角 */
}

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

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

.post-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 2rem;
    color: #6c757d;
}

.post-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.post-title {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    flex: 0 0 auto;
}

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

.post-title a:hover {
    color: #007bff;
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
}

.pagination .page-numbers:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .page-numbers.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-title {
        font-size: 2rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .category-hero-title {
        font-size: 2rem;
    }
    
    .category-hero {
        padding: 2rem 1rem;
    }
    
    /* 移动端适配统计数字 */
    .category-count {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    /* 移动端文章列表样式 */
    .post-item {
        flex-direction: column;
    }
    
    /* 为移动端创建独立的容器，不受电脑端影响 */
    .post-thumbnail {
        flex: 0 0 auto; /* 移除固定宽度 */
        height: 170px; /* 移动端独立设置高度为170px，与首页保持一致 */
        width: calc(100% - 20px); /* 确保宽度适应容器并考虑margin */
        margin: 10px; /* 移动端间距调整 */
        border-radius: 8px;
        object-fit: cover;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1.3rem;
    }
    
    /* Mobile styles for post meta - 确保日期和作者水平对齐 */
    .post-meta {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        flex-direction: row !important; /* 确保水平排列 */
    }
    
    .post-date {
        text-align: left !important;
        flex: 1 !important;
        align-self: flex-start !important; /* 左对齐 */
    }
    
    .post-author {
        text-align: right !important;
        flex: 1 !important;
        align-self: flex-end !important; /* 右对齐 */
    }
}

@media (max-width: 480px) {
    /* 为小屏幕创建独立的容器 */
    .post-thumbnail {
        flex: 0 0 auto; /* 移除固定宽度 */
        height: 170px; /* 小屏幕独立设置高度为170px，与首页保持一致 */
        width: calc(100% - 16px); /* 确保宽度适应容器并考虑margin */
        margin: 8px; /* 小屏幕间距调整 */
        border-radius: 6px;
    }
    
    .post-content {
        padding: 0.75rem;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    /* Mobile styles for post meta - 小屏幕也保持水平对齐 */
    .post-meta {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        flex-direction: row !important; /* 确保水平排列 */
    }
    
    .post-date {
        text-align: left !important;
        flex: 1 !important;
        align-self: flex-start !important; /* 左对齐 */
    }
    
    .post-author {
        text-align: right !important;
        flex: 1 !important;
        align-self: flex-end !important; /* 右对齐 */
    }
}