/* ==========================================
   爆发富论坛 - 论坛页面样式
   ========================================== */

/* 论坛头部 */
.forum-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 48px 0;
    text-align: center;
}

.forum-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.forum-header p {
    font-size: 1rem;
    opacity: 0.9;
}

/* 论坛容器 */
.forum-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 32px 20px;
}

/* 侧边栏 */
.forum-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.btn-new-topic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.btn-new-topic:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* 分类列表 */
.category-list li {
    margin-bottom: 4px;
}

.category-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.category-list a:hover,
.category-list a.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.category-list a i {
    width: 20px;
    text-align: center;
}

.category-list .count {
    margin-left: auto;
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.category-list a.active .count {
    background: var(--primary-color);
    color: #fff;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.tag-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 在线用户 */
.user-avatars {
    display: flex;
    align-items: center;
    gap: -8px;
    margin-bottom: 12px;
}

.user-avatars img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    margin-left: -8px;
    object-fit: cover;
}

.user-avatars img:first-child {
    margin-left: 0;
}

.more-users {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: -8px;
    border: 2px solid var(--bg-primary);
}

.online-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-count i {
    color: var(--secondary-color);
    font-size: 0.625rem;
}

/* 论坛工具栏 */
.forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.filter-tabs button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-tabs button:hover {
    color: var(--primary-color);
}

.filter-tabs button.active {
    background: var(--primary-color);
    color: #fff;
}

.sort-options select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-options select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 帖子列表 - 论坛页专用样式 */
.forum-main .topic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.forum-main .topic-item {
    display: grid;
    grid-template-columns: 48px 1fr 120px;
    gap: 16px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
    align-items: start;
}

.forum-main .topic-item:hover {
    box-shadow: var(--shadow-md);
}

.forum-main .topic-item.pinned {
    border-left: 4px solid var(--primary-color);
}

.forum-main .topic-item.hot {
    border-left: 4px solid var(--danger-color);
}

.topic-status {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.topic-item.pinned .topic-status {
    background: var(--primary-light);
    color: var(--primary-color);
}

.topic-item.hot .topic-status {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger-color);
}

.topic-content {
    min-width: 0;
}

.topic-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-official {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-hot {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger-color);
}

.badge-normal {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.topic-header h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.topic-header h3 a {
    color: var(--text-primary);
}

.topic-header h3 a:hover {
    color: var(--primary-color);
}

.topic-content p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-content .topic-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.topic-content .topic-meta i {
    margin-right: 4px;
}

.topic-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.stat-box {
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stat-num {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.pagination a.active {
    background: var(--primary-color);
    color: #fff;
}

.pagination a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-ellipsis {
    color: var(--text-muted);
}

/* 响应式 */
@media screen and (max-width: 991px) {
    .forum-container {
        grid-template-columns: 1fr;
    }
    
    .forum-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .sidebar-section {
        margin-bottom: 0;
    }
    
    .online-users {
        display: none;
    }
}

@media screen and (max-width: 767px) {
    .forum-header h1 {
        font-size: 1.5rem;
    }
    
    .forum-sidebar {
        grid-template-columns: 1fr;
    }
    
    .forum-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .forum-main .topic-item {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }
    
    .topic-stats {
        display: none;
    }
    
    .topic-status {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .topic-header h3 {
        font-size: 1rem;
    }
    
    .topic-content p {
        font-size: 0.875rem;
    }
    
    .topic-content .topic-meta {
        gap: 12px;
        font-size: 0.75rem;
    }
}

@media screen and (max-width: 479px) {
    .forum-header {
        padding: 32px 0;
    }
    
    .forum-header h1 {
        font-size: 1.25rem;
    }
    
    .forum-container {
        padding: 20px 16px;
    }
    
    .sidebar-section {
        padding: 16px;
    }
    
    .filter-tabs button {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
    
    .forum-main .topic-item {
        padding: 16px;
    }
}
