/* 基础样式重置与变量定义 - 独立模块专用 */
.forum-content-module * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.forum-content-module {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #f97316;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #111827;
    --text-medium: #4b5563;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --bg-gray-200: #e5e7eb;
    --container-width: 1480px; /* 修改总宽度为1480px */
    --gutter: 20px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-gray-50);
    color: var(--text-medium);
    line-height: 1.6;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    width: 100%;
}

/* Tab选项卡样式 */
.tab-nav {
    display: flex;
    background-color: var(--bg-white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-medium);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab-item:hover {
    color: var(--primary);
    background-color: var(--bg-gray-50);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: var(--bg-white);
}

/* Tab内容容器 */
.tab-content {
    background-color: var(--bg-white);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--gutter);
    margin-bottom: var(--gutter);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 新闻网格布局 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gutter);
}

/* 新闻卡片样式 */
.news-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--border-radius);
    background-color: var(--bg-gray-50);
    transition: var(--transition);
    border: 1px solid var(--bg-gray-200);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.news-card:hover {
    background-color: var(--bg-white);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.news-card:hover::before {
    transform: scaleY(1);
}

.news-img {
    width: 140px;
    height: 90px;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img img {
    transform: scale(1.1);
}

.news-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.news-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-size: 12px;
    border-radius: 12px;
    margin-bottom: 0;
    width: fit-content;
    font-weight: 500;
    transition: var(--transition);
}

.news-tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    flex: 1;
    transition: var(--transition);
}

.news-card:hover .news-title {
    color: var(--primary);
}

.news-desc {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 10px;
    border-top: 1px solid var(--bg-gray-100);
}

.news-time {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.news-card:hover .news-time {
    color: var(--primary-light);
}

.news-hot {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 500;
    transition: var(--transition);
}

.news-card:hover .news-hot {
    transform: translateX(2px);
}

/* 美化图标 */
.news-time svg,
.news-hot svg {
    transition: var(--transition);
}

.news-card:hover .news-time svg,
.news-card:hover .news-hot svg {
    transform: scale(1.1);
}

/* 标签颜色变体 */
.news-tag.tech {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.news-tag.tech:hover {
    background-color: var(--success);
    color: white;
}

.news-tag.business {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.news-tag.business:hover {
    background-color: var(--warning);
    color: white;
}

.news-tag.hot {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.news-tag.hot:hover {
    background-color: var(--danger);
    color: white;
}

/* 侧边内容区 */
.side-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gutter);
    margin-top: var(--gutter);
}

/* 自动轮播Banner样式 */
.banner-slider {
    position: relative;
    height: 450px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
}

.banner-slide.active {
    opacity: 1;
}

.banner-img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.banner-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-text {
    position: relative;
    z-index: 2;
    padding: 0 40px;
    color: white;
    max-width: 60%;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.banner-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.banner-desc {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.banner-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.banner-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background-color: white;
    width: 24px;
    border-radius: 6px;
}

/* 热点排行 */
.hot-rank {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    padding: var(--gutter);
    box-shadow: var(--shadow-sm);
    height: 450px;
    overflow-y: auto;
}

.rank-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    position: relative;
    padding-left: 12px;
}

.rank-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 2px;
}

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

.rank-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-gray-100);
}

.rank-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rank-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-gray-100);
    color: var(--text-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-num.top1 {
    background-color: var(--danger);
    color: white;
}

.rank-num.top2 {
    background-color: var(--warning);
    color: white;
}

.rank-num.top3 {
    background-color: var(--success);
    color: white;
}

.rank-content {
    flex: 1;
}

.rank-news-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
    transition: var(--transition);
    line-height: 1.4;
}

.rank-news-title:hover {
    color: var(--primary);
}

.rank-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    align-items: center;
}

.rank-date {
    color: var(--text-light);
}

.rank-replies {
    color: var(--primary);
}

.rank-author {
    color: var(--success);
}

.rank-hot {
    font-size: 11px;
    color: var(--danger);
    font-weight: 500;
    margin-left: auto;
}

/* 响应式设计 */
@media (max-width: 1480px) {
    .forum-content-module {
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .side-content {
        grid-template-columns: 1fr;
    }
    
    .banner-slider {
        height: 250px;
    }
    
    .hot-rank {
        height: auto;
    }
}

@media (max-width: 576px) {
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-item {
        flex: 1 0 50%;
    }
    
    .news-card {
        flex-direction: column;
        gap: 12px;
    }
    
    .news-img {
        width: 100%;
        height: 140px;
    }
    
    .banner-slider {
        height: 200px;
    }
    
    .banner-text {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .banner-title {
        font-size: 20px;
    }
    
    .banner-desc {
        font-size: 14px;
        margin-bottom: 16px;
    }
}
