/* =====================================================================
 * [PBCS PATCH] channel-download.html 专用现代样式 — channel-download-modern.css
 * ---------------------------------------------------------------------
 * 背景：channel-download.html 之前是「头条横滑 + 主列表 8/4 + 侧栏 widget」
 *       用 Bootstrap 4 默认 .badge / .btn 风格，视觉陈旧。
 *       改成与 show-news.html / show-download.html 一致的现代杂志/科技门户风。
 *
 * 设计：
 *   - 复用 home-modern.css 通用组件（.pbcs-home-wrap / .pbcs-section）
 *   - 复用 show-news-modern.css 通用组件（.pbcs-news-banner / .pbcs-news-breadcrumb /
 *     .pbcs-news-layout / .pbcs-sidebar / .pbcs-widget / .pbcs-tagcloud / layout-toggle）
 *   - 本文件新增：headline 横滑 carousel / tabs pill 导航 / list item 卡片 /
 *     rank 排行 / rec 推荐 / layout-toggle 主列表工具栏
 *   - 命名空间：所有 class 加 .pbcs-dl 前缀，避免污染其他页
 *
 * 引用：channel-download.html 自己在 head 之后 <link> 引入
 * ===================================================================== */

/* ---------- 主题变量（与 show-news / show-download 一致） ---------- */
.pbcs-dl-page {
    --pbcs-primary: #667eea;
    --pbcs-primary-dark: #5568d3;
    --pbcs-accent: #ff6b35;
    --pbcs-text: #212529;
    --pbcs-muted: #6c757d;
    --pbcs-border: #e9ecef;
    --pbcs-radius: 12px;
    --pbcs-radius-lg: 16px;
    --pbcs-shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --pbcs-shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
}

/* =====================================================================
 * 头条横排 carousel（10 条 istop=1，左右箭头切换）
 * ===================================================================== */
.pbcs-dl-section-head {
    display: flex;
    align-items: center;
    margin: 32px 0 14px;
}
.pbcs-dl-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pbcs-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pbcs-dl-section-title i {
    color: #ffb020;
    font-size: 20px;
}
.pbcs-dl-headline-nav {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.pbcs-dl-headline-nav button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--pbcs-border);
    color: var(--pbcs-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    font-size: 14px;
}
.pbcs-dl-headline-nav button:hover {
    background: var(--pbcs-primary);
    color: #fff;
    border-color: var(--pbcs-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, .25);
}

.pbcs-dl-headline-track {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge legacy */
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}
.pbcs-dl-headline-track::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.pbcs-dl-headline-card {
    flex-shrink: 0;
    width: 200px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .2s ease;
}
.pbcs-dl-headline-card:hover {
    transform: translateY(-4px);
    color: inherit;
    text-decoration: none;
}
.pbcs-dl-headline-card:hover .pbcs-dl-headline-img {
    box-shadow: 0 12px 28px rgba(102, 126, 234, .2);
}
.pbcs-dl-headline-thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--pbcs-radius);
}
.pbcs-dl-headline-img {
    width: 200px;
    height: 130px;
    object-fit: contain;
    display: block;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--pbcs-radius);
    transition: box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.pbcs-dl-headline-img-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .7);
    font-family: 'FontAwesome';
    font-size: 36px;
}
.pbcs-dl-headline-img-default::after {
    content: '\f1c6';  /* fa-file-archive-o (归档) */
}
.pbcs-dl-headline-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(255, 107, 53, .4);
    line-height: 1.4;
}
.pbcs-dl-headline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pbcs-text);
    line-height: 1.45;
    margin: 8px 0 0;
    width: 200px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* =====================================================================
 * tab 导航条（最新 + 子分类 + 分页统计 + 面包屑）
 * ===================================================================== */
.pbcs-dl-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--pbcs-border);
    margin-bottom: 28px;
}
.pbcs-dl-tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: #f8f9fa;
    color: var(--pbcs-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pbcs-dl-tab:hover {
    background: rgba(102, 126, 234, .1);
    color: var(--pbcs-primary);
    text-decoration: none;
}
.pbcs-dl-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .3);
}
.pbcs-dl-tab-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--pbcs-muted);
}
.pbcs-dl-tab-meta strong {
    color: var(--pbcs-text);
    font-weight: 600;
}
@media (max-width: 768px) {
    .pbcs-dl-tab-meta { display: none; }
}

/* =====================================================================
 * 主列表工具栏（含 layout-toggle — 复用 show-news-modern.css 样式）
 * ===================================================================== */
.pbcs-dl-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
    margin-bottom: 4px;
}
.pbcs-dl-list-toolbar .pbcs-layout-toggle {
    /* 复用 show-news-modern.css 的 .pbcs-news-eyebrow .pbcs-layout-toggle 样式
       （移动端隐藏 + 桌面端显示 + is-single 高亮 + 圆角胶囊） */
    margin-left: 0;        /* 覆盖 eyebrow 的 margin-left: auto */
}
.pbcs-dl-list-info {
    font-size: 13px;
    color: var(--pbcs-muted);
}
.pbcs-dl-list-info strong {
    color: var(--pbcs-text);
    font-weight: 600;
}

/* =====================================================================
 * 主列表 item（缩略图 + 标题/徽章 + 描述 + meta）
 * ===================================================================== */
.pbcs-dl-list {
    display: flex;
    flex-direction: column;
}
.pbcs-dl-item {
    display: flex;
    gap: 24px;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--pbcs-border);
    transition: opacity .2s ease;
}
.pbcs-dl-item:last-child { border-bottom: 0; }
.pbcs-dl-item-thumb {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--pbcs-radius);
    overflow: hidden;
}
.pbcs-dl-item-img {
    width: 200px;
    height: 130px;
    object-fit: contain;
    display: block;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--pbcs-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.pbcs-dl-item-thumb a:hover .pbcs-dl-item-img {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(102, 126, 234, .2);
}
.pbcs-dl-item-img-default {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pbcs-dl-item-img-default::after {
    content: '\f15b';  /* fa-file */
    font-family: 'FontAwesome';
    color: rgba(102, 126, 234, .5);
    font-size: 36px;
}

.pbcs-dl-item-body {
    flex-grow: 1;
    min-width: 0;
}
.pbcs-dl-item-title-row {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pbcs-dl-item-title {
    color: var(--pbcs-text);
    text-decoration: none;
    transition: color .2s ease;
}
.pbcs-dl-item-title:hover {
    color: var(--pbcs-primary);
    text-decoration: none;
}

.pbcs-dl-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.4;
    color: #fff;
    vertical-align: middle;
}
.pbcs-dl-badge-top {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    box-shadow: 0 2px 6px rgba(255, 107, 53, .3);
}
.pbcs-dl-badge-rec {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    box-shadow: 0 2px 6px rgba(255, 193, 7, .3);
}
.pbcs-dl-badge-head {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 2px 6px rgba(23, 162, 184, .3);
}

.pbcs-dl-item-desc {
    color: var(--pbcs-muted);
    font-size: 14px;
    line-height: 1.7;
    margin: 8px 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pbcs-dl-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--pbcs-muted);
}
.pbcs-dl-item-meta i {
    color: var(--pbcs-primary);
    margin-right: 4px;
}
.pbcs-dl-item-meta .ml-auto {
    margin-left: auto;
}

/* =====================================================================
 * 侧栏：本月热门排行
 * ===================================================================== */
.pbcs-dl-rank {
    counter-reset: rank-counter;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pbcs-dl-rank-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed var(--pbcs-border);
    gap: 12px;
}
.pbcs-dl-rank-item:last-child { border-bottom: 0; }
.pbcs-dl-rank-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #e9ecef;
    color: var(--pbcs-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pbcs-dl-rank-item:nth-child(1) .pbcs-dl-rank-num {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 107, 53, .3);
}
.pbcs-dl-rank-item:nth-child(2) .pbcs-dl-rank-num {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 193, 7, .3);
}
.pbcs-dl-rank-item:nth-child(3) .pbcs-dl-rank-num {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(23, 162, 184, .3);
}
.pbcs-dl-rank-title {
    flex-grow: 1;
    color: var(--pbcs-text);
    text-decoration: none;
    line-height: 1.5;
    font-size: 14px;
    transition: color .2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pbcs-dl-rank-title:hover {
    color: var(--pbcs-primary);
    text-decoration: none;
}

/* =====================================================================
 * 侧栏：编辑推荐
 * ===================================================================== */
.pbcs-dl-rec {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pbcs-dl-rec-item {
    padding: 10px 0;
    border-bottom: 1px dashed var(--pbcs-border);
}
.pbcs-dl-rec-item:last-child { border-bottom: 0; }
.pbcs-dl-rec-item a {
    color: var(--pbcs-text);
    text-decoration: none;
    line-height: 1.5;
    font-size: 14px;
    transition: color .2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pbcs-dl-rec-item a:hover { color: var(--pbcs-primary); text-decoration: none; }
.pbcs-dl-rec-item i { color: var(--pbcs-accent); margin-right: 4px; }

/* =====================================================================
 * 布局切换（双栏 ↔ 单栏） — 复用 show-news-modern.css 的 .pbcs-news-layout
 * ===================================================================== */
@media (min-width: 992px) {
    .pbcs-dl-layout.pbcs-layout-single {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .pbcs-dl-layout.pbcs-layout-single .pbcs-sidebar {
        max-width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    .pbcs-dl-layout.pbcs-layout-single .pbcs-sidebar .pbcs-widget {
        margin-bottom: 0;
    }
}

/* =====================================================================
 * 响应式微调
 * ===================================================================== */
@media (max-width: 768px) {
    .pbcs-dl-item {
        flex-direction: column;
        gap: 12px;
    }
    .pbcs-dl-item-thumb {
        width: 100%;
    }
    .pbcs-dl-item-img {
        width: 100%;
        height: 180px;
    }
    .pbcs-dl-headline-card {
        width: 160px;
    }
    .pbcs-dl-headline-img {
        width: 160px;
        height: 100px;
    }
    .pbcs-dl-headline-title {
        width: 160px;
    }
}

/* =====================================================================
 * 分页（Element Plus 风格 — 覆盖 Bootstrap 4 .pagination 默认）
 * ---------------------------------------------------------------------
 * 目标样式：
 *   首页 上一页 [1] 2 3 4 5 … 下一页 尾页
 *   - 矩形 40px 高 + 4px 圆角 + 1px 灰边
 *   - 当前页 1：青底 #409eff 白字
 *   - 文字色：#409eff（青）
 *   - 数字/按钮紧贴无 gap（margin-left: -1px 让相邻边框重合）
 *   - hover：#66b1ff 淡青
 *   - 不可点（...）：灰 #c0c4cc
 * ===================================================================== */
.pbcs-dl-list-wrap .pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 32px 0 16px;
    border-radius: 0;
    gap: 0;
}

/* 基础按钮（首页/上一页/数字/下一页/尾页 — 都是 <a>） */
.pbcs-dl-list-wrap .pagination .page-item,
.pbcs-dl-list-wrap .pagination .page-num {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 16px;
    margin: 0;
    margin-left: -1px;          /* 相邻边框重合 */
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #409eff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border-radius: 0;
    box-sizing: border-box;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

/* 第一个 + 最后一个 圆角 */
.pbcs-dl-list-wrap .pagination > a:first-child,
.pbcs-dl-list-wrap .pagination > .page-num:first-child,
.pbcs-dl-list-wrap .pagination > .page-item:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    margin-left: 0;
}
.pbcs-dl-list-wrap .pagination > a:last-child,
.pbcs-dl-list-wrap .pagination > .page-num:last-child,
.pbcs-dl-list-wrap .pagination > .page-item:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* hover（排除当前页） */
.pbcs-dl-list-wrap .pagination .page-item:hover,
.pbcs-dl-list-wrap .pagination .page-num:hover {
    position: relative;
    z-index: 1;
    color: #66b1ff;
    border-color: #66b1ff;
}

/* 当前页（青底白字） */
.pbcs-dl-list-wrap .pagination .page-num-current {
    position: relative;
    z-index: 2;
    background: #409eff;
    color: #fff;
    border-color: #409eff;
    cursor: default;
}
.pbcs-dl-list-wrap .pagination .page-num-current:hover {
    color: #fff;
    background: #66b1ff;
    border-color: #66b1ff;
}

/* "..." 不可点击的 span */
.pbcs-dl-list-wrap .pagination .page-num:not([href]) {
    color: #c0c4cc;
    cursor: default;
    background: #f5f7fa;
}
.pbcs-dl-list-wrap .pagination .page-num:not([href]):hover {
    color: #c0c4cc;
    background: #f5f7fa;
    border-color: #d9d9d9;
}

/* 移动端压缩 */
@media (max-width: 576px) {
    .pbcs-dl-list-wrap .pagination .page-item,
    .pbcs-dl-list-wrap .pagination .page-num {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* =====================================================================
 * 分页跳转（Element Plus 风格 — "前往 X 页" + GO 按钮）
 * 放在 .pagination 容器内，跟分页按钮横排
 * ===================================================================== */
.pbcs-pagination-jump {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 24px 0 16px;
    font-size: 14px;
    color: #606266;
    vertical-align: middle;
}
.pbcs-pagination-jump .jump-label {
    color: #606266;
    margin: 0 6px;
    user-select: none;
}
.pbcs-pagination-jump .jump-input {
    width: 56px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    color: #606266;
    text-align: center;
    background: #fff;
    transition: border-color .15s ease;
    -moz-appearance: textfield;          /* Firefox */
    appearance: textfield;
    outline: none;
    font-family: inherit;
    line-height: 1;
}
.pbcs-pagination-jump .jump-input::-webkit-outer-spin-button,
.pbcs-pagination-jump .jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pbcs-pagination-jump .jump-input:focus {
    border-color: #409eff;
}
.pbcs-pagination-jump .jump-input:hover {
    border-color: #c0c4cc;
}
.pbcs-pagination-jump .jump-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #409eff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
    line-height: 1;
}
.pbcs-pagination-jump .jump-btn:hover {
    color: #66b1ff;
    border-color: #66b1ff;
    background: #ecf5ff;
}
.pbcs-pagination-jump .jump-btn:active {
    transform: scale(0.98);
}
.pbcs-pagination-jump .jump-input,
.pbcs-pagination-jump .jump-btn {
    box-sizing: border-box;
}

/* 跳转到和分页居中（Element Plus 风格 — 跳转在分页下方独立行） */
.pbcs-dl-list-wrap nav .pagination {
    margin-bottom: 0;
}
.pbcs-dl-list-wrap nav {
    text-align: center;
}
.pbcs-dl-list-wrap .pbcs-pagination-jump {
    display: flex;
    justify-content: center;
}

@media (max-width: 576px) {
    .pbcs-pagination-jump .jump-input { width: 48px; height: 32px; }
    .pbcs-pagination-jump .jump-btn { height: 32px; padding: 0 10px; font-size: 13px; }
    .pbcs-pagination-jump .jump-label { font-size: 13px; }
}
