/* ============================================
   简历模板下载 - 内容区样式
   全局布局（侧边栏/顶栏）与设计变量由模板提供，
   本文件只负责主内容区样式，适配模板设计语言。
   ============================================ */

/* 布局容器 */
.container {
    max-width: 1320px;
    margin: 0 auto;
}

/* ================= 页头 ================= */
.page-hero {
    text-align: center;
    padding: 26px 0 24px;
}
.page-hero h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: .3px;
    margin-bottom: 8px;
}
.page-hero h1 i {
    color: var(--brand);
    margin-right: 8px;
}
.page-hero p {
    font-size: 13.5px;
    color: var(--text-3);
}

/* ================= 统计条 ================= */
.stats-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 14px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 60px;
}
.stats-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-2);
}
.stats-item i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stats-item strong {
    color: var(--brand);
    font-size: 18px;
    font-weight: 800;
}

/* ================= 模板卡片网格 ================= */
.template-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.template-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.template-card:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 107, 255, .45);
    box-shadow: var(--shadow-card);
}
.template-image {
    position: relative;
    padding-top: 141.4%;
    overflow: hidden;
    background: #f6f8fc;
}
.template-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.template-card:hover .template-image img {
    transform: scale(1.05);
}
.download-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(47, 107, 255, .35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.template-info {
    padding: 12px 13px 14px;
}
.template-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 11px;
    line-height: 1.45;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.btn-group {
    display: flex;
    gap: 8px;
}
.preview-card-btn {
    flex: 1;
    background: var(--brand-light);
    color: var(--brand);
    border: none;
    padding: 9px 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.preview-card-btn:hover {
    background: rgba(47, 107, 255, .16);
}
.download-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    border: none;
    padding: 9px 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 3px 8px rgba(47, 107, 255, .25);
}
.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(47, 107, 255, .35);
}

/* ================= 分页（JS 动态生成 a / span.current / span.dots） ================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 6px;
}
.pagination a,
.pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    box-sizing: border-box;
    transition: all .15s;
}
.pagination a {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-2);
    text-decoration: none;
    cursor: pointer;
}
.pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.pagination span.current {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(47, 107, 255, .3);
}
.pagination span.dots {
    background: transparent;
    min-width: auto;
    padding: 0 4px;
    color: var(--text-3);
    font-weight: 600;
    user-select: none;
}

/* ================= 预览弹窗 ================= */
.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .82);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}
.preview-modal.active { display: flex; }
.preview-content {
    position: relative;
    max-width: 90%;
    max-height: 92vh;
    line-height: 0;
}
.preview-content img {
    max-width: 520px;
    max-height: 92vh;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.close-preview {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 15px;
    color: var(--text-2);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    z-index: 1;
}
.close-preview:hover {
    background: var(--brand);
    color: #fff;
    transform: rotate(90deg);
}

/* ================= 响应式 ================= */
@media (max-width: 900px) {
    .page-hero h1 { font-size: 21px; }
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 13px;
    }
}

@media (max-width: 640px) {
    .page-hero { padding: 16px 0 18px; }
    .stats-bar { gap: 10px 36px; padding: 13px 16px; }
    .stats-item { font-size: 13px; }
    .stats-item strong { font-size: 16px; }
    .template-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .template-info { padding: 9px 9px 11px; }
    .template-title { font-size: 11px; height: 33px; margin-bottom: 8px; }
    .btn-group { gap: 4px; }
    .preview-card-btn,
    .download-btn { padding: 7px 2px; font-size: 11px; border-radius: 8px; }
    .pagination a,
    .pagination span { min-width: 32px; height: 32px; padding: 0 10px; font-size: 12px; }
    .preview-content { max-width: 94%; }
    .preview-content img { max-width: 100%; }
    .close-preview { top: -12px; right: -8px; width: 34px; height: 34px; font-size: 14px; }
}
