/**
 * news-front.css - 新闻列表页样式
 * 包含：幻灯片、分类筛选、新闻网格、侧边栏、分页、深色模式
 */

/* ============================================================
   1. 幻灯片样式
   ============================================================ */
.news-slider {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    position: relative;
    background: #f5f7fa;
}
.slider-container {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-radius: 12px;
}
.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
}
.slider-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
}
.slider-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.slide-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.3s;
}
.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}
.slide-overlay h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.slide-overlay .slide-date {
    font-size: 14px;
    opacity: 0.8;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}
.slider-container:hover .slider-btn {
    opacity: 1;
}
.slider-btn:hover {
    background: rgba(255,255,255,0.5);
    color: #4a6cf7;
}
.slider-prev { left: 12px; }
.slider-next { right: 12px; }
.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.slider-dot.active {
    background: #fff;
    transform: scale(1.2);
}
.slider-dot:hover {
    background: #fff;
}

/* ============================================================
   2. 新闻列表头部
   ============================================================ */
.news-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #f0f2f5;
    flex-wrap: wrap;
    gap: 8px;
}
.news-list-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 10px;
}
.news-list-header h1 i {
    color: #4a6cf7;
}
.news-list-header .news-count {
    font-size: 13px;
    color: #a0aec0;
    background: #f0f2f5;
    padding: 4px 16px;
    border-radius: 30px;
}

/* ============================================================
   3. 分类筛选标签
   ============================================================ */
.news-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.news-category-tab {
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: #f1f4f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.news-category-tab:hover {
    background: #e2e8f0;
    color: #2d3748;
}
.news-category-tab.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 4px 12px rgba(74,108,247,0.25);
}

/* ============================================================
   4. 新闻网格
   ============================================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.news-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.news-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 8px 28px rgba(74,108,247,0.08);
    transform: translateY(-4px);
}
.news-card .news-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f5f7fa;
}
.news-card .news-cover-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f0f4f8, #e8ecf1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e0;
    font-size: 48px;
}
.news-card .news-body {
    padding: 14px 16px 16px;
}
.news-card .news-body .news-category {
    font-size: 12px;
    color: #4a6cf7;
    background: #f0f5ff;
    padding: 2px 12px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 8px;
}
.news-card .news-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .news-body h3 a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s;
}
.news-card .news-body h3 a:hover {
    color: #4a6cf7;
}
.news-card .news-body p {
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card .news-body .news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #a0aec0;
    border-top: 1px solid #f0f2f5;
    padding-top: 10px;
}
.news-card .news-body .news-meta .news-date i {
    margin-right: 4px;
}
.news-card .news-body .news-meta .news-views i {
    margin-right: 4px;
}
.news-card.is-recommend {
    border-color: #f6e05e;
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
}
.news-card.is-recommend .news-category {
    background: #fef3c7;
    color: #b7791f;
}

/* ============================================================
   5. 侧边栏
   ============================================================ */
.news-sidebar {
    flex: 0 0 280px;
    width: 280px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}
.news-sidebar .sidebar-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.news-sidebar .sidebar-card .sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 6px;
}
.news-sidebar .sidebar-card .sidebar-title i {
    color: #f6ad55;
}
.news-sidebar .recommend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f7fa;
}
.news-sidebar .recommend-item:last-child {
    border-bottom: none;
}
.news-sidebar .recommend-item img {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f5f7fa;
}
.news-sidebar .recommend-item .rec-title {
    font-size: 13px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.news-sidebar .recommend-item .rec-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
.news-sidebar .recommend-item .rec-title a:hover {
    color: #4a6cf7;
}
.news-sidebar .recommend-item .rec-date {
    font-size: 11px;
    color: #a0aec0;
    flex-shrink: 0;
}

/* ============================================================
   6. 布局
   ============================================================ */
.news-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.news-main {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   7. 分页
   ============================================================ */
.news-pagination {
    margin-top: 24px;
}

/* ============================================================
   8. 响应式
   ============================================================ */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .slider-container {
        height: 260px;
    }
    .slide-overlay {
        padding: 16px 20px;
    }
    .slide-overlay h2 {
        font-size: 18px;
    }
    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
        opacity: 0.6;
    }
    .slider-container:hover .slider-btn {
        opacity: 0.6;
    }
    .news-layout {
        flex-direction: column;
    }
    .news-sidebar {
        width: 100%;
        flex: 1;
        position: static;
    }
    .news-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .news-card .news-cover {
        height: 160px;
    }
    .news-list-header h1 {
        font-size: 20px;
    }
}
@media (max-width: 480px) {
    .slider-container {
        height: 200px;
    }
    .slide-overlay h2 {
        font-size: 16px;
    }
}

/* ============================================================
   9. 深色模式
   ============================================================ */
body.dark-mode .news-slider {
    background: #16213e;
}
body.dark-mode .slider-btn {
    background: rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode .slider-btn:hover {
    background: rgba(255,255,255,0.3);
}
body.dark-mode .slide-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
body.dark-mode .news-list-header {
    border-bottom-color: #2a2a4a;
}
body.dark-mode .news-list-header h1 {
    color: #e2e8f0;
}
body.dark-mode .news-list-header .news-count {
    background: #2a2a4a;
    color: #888;
}
body.dark-mode .news-card {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .news-card:hover {
    border-color: #4a6cf7;
    background: #1a2a4a;
}
body.dark-mode .news-card .news-body h3 {
    color: #e2e8f0;
}
body.dark-mode .news-card .news-body h3 a {
    color: #e2e8f0;
}
body.dark-mode .news-card .news-body h3 a:hover {
    color: #6a8cff;
}
body.dark-mode .news-card .news-body p {
    color: #a0aec0;
}
body.dark-mode .news-card .news-body .news-meta {
    border-top-color: #2a2a4a;
    color: #888;
}
body.dark-mode .news-card.is-recommend {
    background: #1a2a2a;
    border-color: #3a3a2a;
}
body.dark-mode .news-category-tab {
    color: #999;
    background: #2a2a4a;
}
body.dark-mode .news-category-tab:hover {
    background: #3a3a5a;
    color: #d0d0d0;
}
body.dark-mode .news-category-tab.active {
    background: #4a6cf7;
    color: #fff;
}
body.dark-mode .news-sidebar .sidebar-card {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .news-sidebar .sidebar-card .sidebar-title {
    color: #e2e8f0;
    border-bottom-color: #2a2a4a;
}
body.dark-mode .news-sidebar .recommend-item {
    border-bottom-color: #2a2a4a;
}
body.dark-mode .news-sidebar .recommend-item .rec-title a {
    color: #d0d0d0;
}
body.dark-mode .news-sidebar .recommend-item .rec-title a:hover {
    color: #6a8cff;
}
body.dark-mode .news-sidebar .recommend-item .rec-date {
    color: #888;
}
/* ============================================================
   分类筛选标签
   ============================================================ */
.news-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.news-category-tabs::-webkit-scrollbar {
    display: none;
}

.news-category-tab {
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: #f1f4f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.news-category-tab:hover {
    background: #e2e8f0;
    color: #2d3748;
}
.news-category-tab.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
    box-shadow: 0 4px 12px rgba(74,108,247,0.25);
}

/* ===== 移动端强制一行横向滚动 ===== */
@media (max-width: 768px) {
    .news-category-tabs {
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding-bottom: 4px;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .news-category-tab {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 4px 14px !important;
    }
}
/* ============================================================
   推荐阅读 - 列表下方横排
   ============================================================ */
.recommend-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f2f5;
}

.recommend-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.recommend-section-title i {
    color: #f6ad55;
}
.recommend-section-title .recommend-count {
    font-size: 13px;
    font-weight: 400;
    color: #a0aec0;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.recommend-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    transition: all 0.3s ease;
}
.recommend-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.08);
    transform: translateY(-3px);
}

.recommend-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.recommend-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recommend-cover {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #f5f7fa;
    flex-shrink: 0;
}
.recommend-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommend-info {
    padding: 12px 16px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.recommend-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recommend-info p {
    font-size: 13px;
    color: #718096;
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.recommend-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #a0aec0;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}
.recommend-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 992px) {
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .recommend-cover {
        height: 120px;
    }
}

@media (max-width: 768px) {
    .recommend-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .recommend-cover {
        height: 100px;
    }
    .recommend-info h4 {
        font-size: 14px;
    }
    .recommend-info p {
        font-size: 12px;
    }
    .recommend-section-title {
        font-size: 16px;
    }
}

/* ============================================================
   深色模式适配
   ============================================================ */
body.dark-mode .recommend-section {
    border-top-color: #2a2a4a;
}
body.dark-mode .recommend-section-title {
    color: #e2e8f0;
}
body.dark-mode .recommend-card {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .recommend-card:hover {
    border-color: #4a6cf7;
}
body.dark-mode .recommend-info h4 {
    color: #e2e8f0;
}
body.dark-mode .recommend-info p {
    color: #a0aec0;
}
body.dark-mode .recommend-meta {
    border-top-color: #2a2a4a;
    color: #718096;
}
body.dark-mode .recommend-cover {
    background: #1a2a4a;
}