/* 论坛首页样式 - 支持主题切换 */
.forum-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.banner-content {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.banner-content i {
    margin-right: 10px;
    font-size: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 16px;
    color: var(--text-color-dark, var(--text-color));
    display: flex;
    align-items: center;
}

.section-header h2 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.view-more {
    color: var(--link-color, var(--primary-color));
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.view-more i {
    margin-left: 4px;
    font-size: 10px;
}

/* 分类网格 */
.forum-categories {
    margin-bottom: 25px;
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.category-card {
    background: var(--card-background-color, white);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--card-shadow, 0 2px 8px rgba(0,0,0,0.06));
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, #f0f0f0);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.category-icon i {
    color: white;
    font-size: 20px;
}

.category-info {
    flex: 1;
}

.category-info h3 {
    font-size: 15px;
    color: var(--text-color-dark, var(--text-color));
    margin-bottom: 4px;
    font-weight: 600;
}

.category-info p {
    font-size: 12px;
    color: var(--text-color-light, var(--secondary-text-color));
    margin-bottom: 6px;
    line-height: 1.4;
}

.category-stats {
    font-size: 11px;
    color: var(--secondary-text-color);
    display: flex;
    align-items: center;
}

.category-stats i {
    margin-right: 4px;
}

.category-arrow {
    color: var(--secondary-text-color);
    font-size: 14px;
}

/* 帖子列表 */
.forum-threads {
    margin-bottom: 25px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thread-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px;
    background: var(--card-background-color, white);
    border-radius: 18px;
    box-shadow: var(--card-shadow, 0 4px 16px rgba(0, 0, 0, 0.08));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color, #e8eaed);
    position: relative;
    margin-bottom: 16px;
    overflow: hidden;
}

.thread-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color, #007bff), var(--primary-hover-color, #0056b3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thread-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow, 0 12px 32px rgba(0, 123, 255, 0.15));
    border-color: var(--primary-color, #007bff);
}

.thread-item:hover::before {
    opacity: 1;
}

.thread-main {
    display: flex;
    align-items: flex-start;
    flex: 1;
    gap: 18px;
}

.thread-avatar {
    flex-shrink: 0;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color, #e8eaed);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thread-item:hover .avatar {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.2);
}

.thread-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.thread-title {
    display: block;
    font-size: 18px;
    color: #1a365d;
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    word-wrap: break-word;
    max-width: 100%;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.thread-title:hover {
    color: #2b77e4;
    text-shadow: 0 2px 4px rgba(43, 119, 228, 0.15);
    transform: translateY(-1px);
}

.thread-meta {
    display: flex;
    gap: 14px;
    color: #64748b;
    font-size: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-weight: 500;
}

.thread-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    border: 1px solid transparent;
    font-size: 13px;
    color: #475569;
}

.thread-meta span:hover {
    background: #e0f2fe;
    color: #0369a1;
    transform: translateY(-2px);
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.thread-meta i {
    font-size: 12px;
    opacity: 0.9;
    color: #0ea5e9;
}

.thread-status {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.hot-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.hot-badge i {
    font-size: 8px;
}

.new-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.new-badge i {
    font-size: 8px;
}

.pinned-badge {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.pinned-badge i {
    font-size: 8px;
}

.pinned-icon {
    color: #ff9800;
    margin-right: 6px;
    font-size: 14px;
    transform: rotate(45deg);
    display: inline-block;
    transition: all 0.3s ease;
}

.thread-title:hover .pinned-icon {
    color: #f57c00;
    transform: rotate(45deg) scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .thread-item {
        padding: 15px; /* 减少内边距 */
        margin-bottom: 10px; /* 减少项目间距 */
    }
    
    .thread-main {
        gap: 12px;
    }
    
    .avatar {
        width: 36px; /* 稍微减小头像 */
        height: 36px;
    }
    
    .thread-title {
        font-size: 15px; /* 稍微减小标题字体 */
        margin-bottom: 8px;
        line-height: 1.4; /* 更紧凑的行高 */
        font-weight: 700;
    }
    
    .thread-meta {
        gap: 8px;
        font-size: 12px;
        margin-top: 8px;
    }
    
    .thread-meta span {
        padding: 4px 8px; /* 减少内边距 */
        font-size: 11px;
        border-radius: 14px;
    }
    
    .hot-badge, .new-badge, .pinned-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .pinned-icon {
        font-size: 12px;
        margin-right: 4px;
    }
    
    .thread-status {
        top: 10px;
        right: 10px;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .thread-item {
        padding: 10px 12px; /* 更紧凑的内边距 */
        margin-bottom: 6px; /* 更小的间距，显示更多帖子 */
        border-radius: 8px;
    }
    
    .thread-main {
        gap: 10px;
        align-items: flex-start;
    }
    
    .avatar {
        width: 28px; /* 手机端更小的头像 */
        height: 28px;
        flex-shrink: 0;
    }
    
    .thread-title {
        font-size: 14px; /* 手机端标题字体 */
        margin-bottom: 6px;
        line-height: 1.3;
        /* 确保标题最多显示2行 */
        -webkit-line-clamp: 2;
    }
    
    .thread-meta {
        gap: 6px;
        font-size: 11px;
        margin-top: 6px;
        flex-wrap: wrap;
    }
    
    .thread-meta span {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 10px;
        background: rgba(37, 117, 252, 0.1);
        color: var(--primary-color);
        border: none;
    }
    
    .thread-meta span:hover {
        background: rgba(37, 117, 252, 0.15);
        transform: none; /* 移除hover动画，节省性能 */
    }
    
    .thread-status {
        position: absolute;
        top: 6px;
        right: 6px;
        flex-direction: column;
        gap: 3px;
    }
    
    .hot-badge, .new-badge {
        font-size: 8px;
        padding: 2px 5px;
        border-radius: 6px;
    }
    
    /* 优化分类网格 */
    .category-grid {
        gap: 8px; /* 减少分类卡片间距 */
    }
    
    .category-card {
        padding: 12px; /* 减少分类卡片内边距 */
        border-radius: 8px;
    }
    
    .category-icon {
        width: 36px; /* 减小分类图标 */
        height: 36px;
        margin-right: 10px;
    }
    
    .category-icon i {
        font-size: 16px;
    }
}

/* 快速操作 */
.quick-actions {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 100;
}

.create-thread-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.create-thread-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
    color: white;
    background: linear-gradient(135deg, var(--primary-color-dark, var(--primary-color)), var(--primary-hover-color));
}

.create-thread-btn i {
    margin-right: 6px;
    font-size: 12px;
}

/* 分类头部样式 */
.category-header {
    background: linear-gradient(135deg, var(--primary-color, #007bff), var(--primary-hover-color, #0056b3));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.category-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.category-icon-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.category-icon-large i {
    font-size: 32px;
    color: white;
}

.category-header-info {
    flex: 1;
    min-width: 0;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-description {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.category-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.stat-item i {
    font-size: 12px;
}

/* 响应式设计 - 分类头部 */
@media (max-width: 768px) {
    .category-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .category-header-content {
        gap: 15px;
    }
    
    .category-icon-large {
        width: 60px;
        height: 60px;
    }
    
    .category-icon-large i {
        font-size: 24px;
    }
    
    .category-title {
        font-size: 22px;
    }
    
    .category-description {
        font-size: 14px;
    }
    
    .category-stats {
        gap: 10px;
    }
    
    .stat-item {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .category-header {
        padding: 16px;
    }
    
    .category-header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .category-description {
        font-size: 13px;
    }
    
    .category-stats {
        justify-content: center;
        gap: 8px;
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color-light, #666);
}

.empty-state i {
    font-size: 48px;
    color: var(--primary-color, #007bff);
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
    color: var(--text-color-light, #666);
}

.empty-state .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.empty-state .button:hover {
    background: var(--primary-hover-color, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* 夜间模式特殊优化 */
html[data-theme="dark"] .thread-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .category-card:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .avatar {
    border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .create-thread-btn {
    box-shadow: 0 4px 16px rgba(139, 69, 173, 0.4);
}

html[data-theme="dark"] .create-thread-btn:hover {
    box-shadow: 0 6px 20px rgba(139, 69, 173, 0.6);
}

/* 响应式设计 */
@media (max-width: 767px) {
     .thread-item {
         padding: 12px;
         display: block;
         position: relative;
     }
     
     .thread-main {
         display: flex;
         gap: 10px;
         width: 100%;
         align-items: flex-start;
     }
     
     .thread-content {
         min-width: 0;
         flex: 1;
         width: 100%;
         overflow: hidden;
     }
    
    .thread-title {
          font-size: 15px;
          line-height: 1.5;
          max-width: 100%;
          overflow: hidden;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          word-break: break-word;
          hyphens: auto;
          font-weight: 700;
          letter-spacing: 0.2px;
      }
    
    .thread-meta {
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 8px;
    }
    
    .thread-meta span {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 14px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .thread-status {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-end;
    }
    
    .hot-badge, .new-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        position: static;
        margin-top: 20px;
        text-align: center;
    }
    
    .create-thread-btn {
        display: inline-flex;
        position: relative;
        bottom: auto;
        right: auto;
    }
    
    /* 大屏幕下帖子列表优化 */
    .thread-item {
        padding: 20px;
    }
    
    .thread-main {
        gap: 16px;
    }
    
    .avatar {
        width: 50px;
        height: 50px;
    }
    
    .thread-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .thread-meta {
        gap: 20px;
        margin-top: 10px;
    }
    
    .thread-meta span {
        padding: 4px 10px;
        font-size: 13px;
    }
}

@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 超大屏幕下的优化 */
    .thread-item {
        padding: 24px;
    }
    
    .thread-main {
        gap: 20px;
    }
    
    .avatar {
        width: 56px;
        height: 56px;
    }
    
    .thread-title {
        font-size: 17px;
        margin-bottom: 12px;
    }
    
    .thread-meta {
        gap: 24px;
        margin-top: 12px;
    }
    
    .thread-meta span {
        padding: 5px 12px;
        font-size: 14px;
    }
    
    .hot-badge, .new-badge {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .thread-status {
        top: 16px;
        right: 16px;
        gap: 8px;
    }
}