/**
 * Forum Category Template Styles
 * 论坛分类页面专用样式
 */

/* ========================================
   动画效果
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.3s ease-out forwards;
}

/* ========================================
   面包屑导航
   ======================================== */

.Community-category-article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.Community-breadcrumb {
    display: flex;
    align-items: center;
    padding: 16px 0;
    font-size: 14px;
    color: #6b7280;
    background: transparent;
}

.Community-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
}

.Community-breadcrumb a:hover {
    color: #FF6A00;
    background: #fff5f0;
}

/* 添加首页图标 */
.Community-breadcrumb a:first-child::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 4px;
}

.Community-breadcrumb a:first-child:hover::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23FF6A00" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>');
}

.Community-breadcrumb .separator {
    margin: 0 8px;
    color: #d1d5db;
    font-weight: 300;
    user-select: none;
}

.Community-breadcrumb .current {
    color: #1f2937;
    font-weight: 600;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fff5f0, #ffe8db);
    border-radius: 6px;
    border: 1px solid #ffd4b3;
}

/* ========================================
   页面容器
   ======================================== */

.forum-category-page {
    min-height: 100vh;
    background: #f5f7fa;
}

/* ========================================
   板块信息横幅
   ======================================== */

.forum-category-banner {
    background: linear-gradient(135deg, #FF6A00 0%, #FF8533 100%);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 20px 30px;
    box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.banner-icon {
    font-size: 24px;
}

.banner-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
}

.banner-highlight {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
}

/* ========================================
   分类介绍板块
   ======================================== */

.forum-category-intro {
    background: #ffffff;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 24px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.intro-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

/* 左侧区域 */
.intro-left {
    display: flex;
    gap: 20px;
    flex: 1;
}

.category-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #FF6A00 0%, #FF8533 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.category-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.btn-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-subscribe:hover {
    background: #fff5ed;
    border-color: #FF6A00;
    color: #FF6A00;
}

.btn-subscribe svg {
    color: #94a3b8;
}

.category-description {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

.category-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #64748b;
}

.stat-item svg {
    color: #94a3b8;
}

.stat-separator {
    color: #e2e8f0;
}

/* 右侧区域 */
.intro-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-help {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-help:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.btn-new-post {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF6A00, #FF8533);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new-post:hover {
    background: linear-gradient(135deg, #E65F00, #FF6A00);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

.last-update {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #94a3b8;
    text-align: right;
}

.update-time {
    color: #FF6A00;
    font-weight: 500;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 768px) {
    .Community-category-article-container {
        padding: 0 15px;
    }
    
    .Community-breadcrumb {
        padding: 12px 0;
        font-size: 13px;
    }
    
    .Community-breadcrumb .current {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .forum-category-banner {
        margin: 15px;
        padding: 15px 20px;
    }
    
    .banner-text,
    .banner-highlight {
        font-size: 16px;
    }
    
    .banner-icon {
        font-size: 20px;
    }
    
    .forum-category-intro {
        margin: 15px;
        padding: 20px;
    }
    
    .intro-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .intro-right {
        width: 100%;
        align-items: stretch;
    }
    
    .action-buttons {
        width: 100%;
    }
    
    .btn-help,
    .btn-new-post {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .forum-category-banner {
        padding: 12px 15px;
    }
    
    .banner-content {
        gap: 6px;
    }
    
    .banner-text,
    .banner-highlight {
        font-size: 14px;
    }
    
    .banner-icon {
        font-size: 18px;
    }
    
    .forum-category-intro {
        padding: 16px;
    }
    
    .intro-left {
        gap: 12px;
    }
    
    .category-icon {
        width: 48px;
        height: 48px;
    }
    
    .category-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* ========================================
   主内容区：帖子列表 + 侧边栏
   ======================================== */

.forum-main-content {
    max-width: 1200px;
    margin: 20px auto;
    /* padding: 0 15px; */
}

.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.posts-area {
    /* background: #ffffff; */
    border-radius: 12px;
    padding: 0;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
    min-height: 400px;
    overflow: hidden;
}

/* ========================================
   分类标签导航
   ======================================== */

.category-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab-item {
    position: relative;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 6px;
}

.tab-item:hover {
    color: #FF6A00;
    background: #fff5ed;
}

.tab-item.active {
    color: #FF6A00;
    border-bottom-color: #FF6A00;
    background: #ffffff;
}

.tab-item .tab-text {
    display: inline-block;
}

/* ========================================
   帖子列表
   ======================================== */

/* .posts-list {
    padding: 16px;
    background: #f8fafc;
} */

.post-item {
    position: relative;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.post-item:hover {
    background: #fafbfc;
}

.post-item:last-child {
    margin-bottom: 0;
}

/* 帖子标签 */
.post-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-right: 8px;
    vertical-align: middle;
    line-height: 1.2;
}

.badge-recommend {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

/* 帖子内容 */
.post-content {
    padding-left: 0;
}

.post-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: #FF6A00;
}

.post-excerpt {
    margin: 8px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

/* 帖子图片 */
.post-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.post-image-item {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 宽高比 */
    overflow: hidden;
    border-radius: 6px;
    background: #f1f5f9;
}

.post-image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image-item:hover img {
    transform: scale(1.05);
}

/* 帖子元信息 */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-left,
.meta-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-author,
.meta-tag,
.meta-date,
.meta-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #94a3b8;
}

.meta-author svg,
.meta-tag svg,
.meta-stat svg {
    flex-shrink: 0;
}

.meta-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.meta-author .author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 无帖子提示 */
.no-posts {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

/* ========================================
   分页
   ======================================== */

.posts-pagination {
    padding: 20px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
}

.posts-pagination a,
.posts-pagination span {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.posts-pagination a:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    color: #475569;
}

.posts-pagination .current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

/* ========================================
   响应式设计：帖子列表
   ======================================== */

@media (max-width: 768px) {
    .category-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-item {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .post-item {
        padding: 16px 20px;
    }
    
    .post-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .meta-left,
    .meta-right {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tab-item {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .post-item {
        padding: 14px 16px;
    }
    
    .post-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-title {
        font-size: 15px;
    }
    
    .post-excerpt {
        font-size: 13px;
    }
    
    .meta-author,
    .meta-tag,
    .meta-date,
    .meta-stat {
        font-size: 12px;
    }
}

/* 响应式：主内容区 */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .forum-main-content {
        padding: 0 15px;
    }
}

/* ========================================
   加载动画
   ======================================== */

.Community-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 106, 0, 0.2);
    border-top-color: #FF6A00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
