/* 论坛列表页面样式 - Thread List Styles */

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

/* 侧边栏样式 */
.sidebar {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 8px;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    color: #666;
    text-decoration: none;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-list a:hover,
.category-list a.active {
    background-color: #0066cc;
    color: white;
}

.category-list a .icon {
    margin-right: 8px;
}

.category-list a .count {
    float: right;
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.category-list a:hover .count,
.category-list a.active .count {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background-color: #0066cc;
    color: white;
}

.tag-item.popular {
    background-color: #e3f2fd;
    color: #1976d2;
}

.tag-item.popular:hover {
    background-color: #1976d2;
    color: white;
}

/* 热门话题 */
.trending-topics {
    list-style: none;
}

.trending-topics li {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.trending-topics li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.trending-topics a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: block;
}

.trending-topics a:hover {
    color: #0066cc;
}

.trending-meta {
    color: #999;
    font-size: 11px;
    margin-top: 4px;
}

/* 资源附件（侧边栏） */
.sidebar .resource-attachments {
    list-style: none;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar .resource-attachments li { list-style: none; }
.sidebar .resource-attachments .resource-att-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
    background: #f9fafb;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px 8px;
    text-decoration: none;
    transition: all .2s ease;
}
.sidebar .resource-attachments .resource-att-item:hover {
    background: #eef2ff;
    color: #111;
    border-color: #dbeafe;
}
.sidebar .resource-attachments .att-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280; /* 与帖子详情附件图标颜色保持一致 */
}
.sidebar .resource-attachments .att-icon-svg {
    width: 14px;
    height: 14px;
    display: block;
}
.sidebar .resource-attachments .att-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 主内容区域 */
.main-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: hidden;
}

/* 论坛标题区域 */
.forum-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.forum-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 600;
}

.forum-header p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.forum-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #0066cc;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* 帖子控制区域 */
.thread-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 15px;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
}

.tab {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.tab.active,
.tab:hover {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

.tab .count {
    margin-left: 5px;
    background-color: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.tab:not(.active) .count {
    background-color: #f0f0f0;
    color: #666;
}

/* 排序和筛选 */
.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 14px;
}

.view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.view-btn {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.view-btn.active {
    background-color: #0066cc;
    color: white;
}

/* 帖子列表 */
.thread-list {
    margin-bottom: 30px;
}

.thread-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.3s ease;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.thread-item:hover {
    background-color: #f8f9fa;
}

.thread-item:last-child {
    border-bottom: none;
}

.thread-item.sticky {
    background-color: #fff8e1;
    border-left: 4px solid #ff9800;
}

.thread-item.locked {
    opacity: 0.7;
}

/* 帖子状态 */
.thread-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 帖子内容 */
.thread-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

.thread-content h3 {
    margin-bottom: 8px;
    line-height: 1.4;
}

.thread-content h3 a {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}
/* 标题前状态图标（置顶/精华） */
.thread-content h3 .icon {
    margin-right: 6px;
    font-size: 16px;
    vertical-align: middle;
}

.thread-content h3 a:hover {
    color: #0066cc;
}

.thread-excerpt {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

.thread-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.thread-tags .tag {
    font-size: 11px;
    padding: 2px 8px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

/* 帖子元信息 */
.thread-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.thread-meta .author {
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
}

.thread-meta .author:hover {
    text-decoration: underline;
}

.thread-meta .expert-badge {
    background-color: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 4px;
}

.thread-meta .date {
    color: #999;
}

.thread-meta .stats {
    display: flex;
    gap: 10px;
}

.thread-meta .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-meta .stat-item .icon {
    font-size: 11px;
}

/* 帖子操作 */
.thread-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.thread-actions .action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 12px;
}

.thread-actions .action-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 版主工具条：与页面风格协调的轻量级按钮 */
.thread-actions.mod-toolbar {
    margin-top: 8px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}
.thread-actions.mod-toolbar .mod-action {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.thread-actions.mod-toolbar .mod-action:hover {
    background: #e9ecef;
    color: #333;
}
.thread-actions.mod-toolbar .mod-action .icon {
    font-size: 12px;
}
.thread-actions.mod-toolbar .mod-action.danger {
    border-color: #f5c6cb;
    color: #c82333;
}
.thread-actions.mod-toolbar .mod-action.danger:hover {
    background: #f8d7da;
    color: #a71d2a;
}

/* 最后回复信息 */
.last-reply {
    text-align: right;
    font-size: 12px;
    color: #666;
    min-width: 120px;
}

.last-reply .author {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.last-reply .author:hover {
    text-decoration: underline;
}

.last-reply .time {
    display: block;
    margin-top: 2px;
    color: #999;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state .icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 20px;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #e9ecef;
    border-color: #0066cc;
    color: #0066cc;
}

/* 固定操作按钮 */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background-color: #0066cc;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-btn:hover {
    background-color: #0052a3;
    transform: scale(1.1);
}

.floating-btn.secondary {
    background-color: #6c757d;
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.floating-btn.secondary:hover {
    background-color: #5a6268;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: 2;
    }
    
    .main-section {
        order: 1;
        padding: 20px;
    }
    
    .thread-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .controls-left,
    .controls-right {
        justify-content: center;
    }
    
    .tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .thread-item {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .thread-status {
        align-self: flex-start;
    }
    
    .thread-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .last-reply {
        text-align: left;
        min-width: auto;
    }
    
    .thread-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .forum-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .floating-actions {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .main-section {
        padding: 15px;
    }
    
    .forum-header h1 {
        font-size: 24px;
    }
    
    .forum-header p {
        font-size: 14px;
    }
    
    .thread-content h3 a {
        font-size: 16px;
    }
    
    .thread-excerpt {
        font-size: 13px;
    }
    
    .tabs {
        gap: 5px;
    }
    
    .tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .forum-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .sidebar-section h3 {
        font-size: 14px;
    }
    
    .category-list a {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .thread-controls,
    .floating-actions,
    .pagination {
        display: none;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .thread-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 15px;
    }
}
/* 黑白色调：仅用于列表页的管理操作入口图标 */
.mod-toolbar .action-btn .icon {
  display: inline-block;
  filter: grayscale(100%) contrast(110%);
  opacity: 0.9;
}

.mod-toolbar .action-btn:hover .icon,
.mod-toolbar .action-btn:focus .icon {
  filter: none;
  opacity: 1;
}
