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

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

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

/* ================= 搜索与分类筛选 ================= */
.search-filter-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-box input {
    flex: 1;
    min-width: 0;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
.search-box button {
    border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    padding: 11px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(47, 107, 255, .25);
}
.search-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(47, 107, 255, .35);
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 15px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s;
}
.category-tag:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.category-tag.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(47, 107, 255, .3);
}
.category-tag .count {
    background: rgba(47, 107, 255, .1);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
}
.category-tag.active .count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* ================= 模板卡片网格 ================= */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 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-preview {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f6f8fc;
}
.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.template-card:hover .template-preview img {
    transform: scale(1.05);
}
.template-info {
    padding: 13px 15px 15px;
}
.template-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 11px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.template-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.download-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    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);
    color: #fff;
    text-decoration: none;
}

/* ================= 结果信息 / 空状态 ================= */
.results-info {
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    margin-bottom: 8px;
}
.filter-info { color: var(--brand); font-weight: 600; margin: 0 6px; }
.clear-filter {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 12.5px;
}
.clear-filter:hover { text-decoration: underline; }

.empty-state {
    text-align: center;
    padding: 70px 20px;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-3);
    margin-bottom: 20px;
}
.empty-state i {
    font-size: 46px;
    margin-bottom: 16px;
    display: block;
    opacity: .55;
}
.empty-state h3 {
    font-size: 17px;
    color: var(--text-2);
    margin-bottom: 8px;
}
.empty-state p { font-size: 13px; }

/* ================= 分页 ================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 6px;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    transition: all .15s;
}
.page-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.page-btn.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(47, 107, 255, .3);
}
.page-btn i { font-size: 11px; }
.page-dots {
    padding: 0 4px;
    color: var(--text-3);
    font-weight: 600;
    user-select: none;
}

/* ================= 公众号验证弹窗 ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 36, 51, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all .25s;
    padding: 20px;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 430px;
    padding: 28px;
    position: relative;
    transform: translateY(14px) scale(.97);
    transition: transform .25s;
    box-shadow: 0 20px 60px rgba(15, 30, 70, .25);
}
.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--brand-light);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.modal-close:hover {
    background: rgba(47, 107, 255, .18);
    color: var(--brand);
}
.modal-header {
    text-align: center;
    margin-bottom: 22px;
}
.modal-header h3 {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}
.modal-header h3 i {
    color: var(--brand);
    margin-right: 6px;
}
.modal-header p {
    color: var(--text-3);
    font-size: 13px;
}
.qr-section {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 20px;
}
.qr-code {
    width: 130px;
    height: 130px;
    padding: 8px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    flex-shrink: 0;
}
.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.qr-tips { flex: 1; min-width: 0; }
.qr-tips p {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-2);
    font-size: 13.5px;
    margin-bottom: 13px;
    line-height: 1.5;
}
.qr-tips p:last-child { margin-bottom: 0; }
.qr-tips i {
    color: var(--brand);
    font-size: 15px;
    width: 18px;
    text-align: center;
}
.qr-tips strong { color: var(--brand); }
.verify-input {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.verify-input input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 14.5px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 2px;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.verify-input input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
.verify-input button {
    padding: 11px 20px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(47, 107, 255, .25);
}
.verify-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(47, 107, 255, .35);
}
.verify-status {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    display: none;
}
.verify-status.error {
    background: #fef2f2;
    color: #dc2626;
    display: block;
}
.verify-status.success {
    background: #f0fdf4;
    color: #16a34a;
    display: block;
}

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

@media (max-width: 640px) {
    .hero-section { padding: 16px 0 18px; }
    .search-filter-section { padding: 13px 14px; }
    .search-box { flex-direction: column; }
    .search-box button { justify-content: center; width: 100%; }
    /* 分类标签横向滑动，避免换行占高 */
    .category-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -14px;
        padding: 0 14px 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-tags::-webkit-scrollbar { display: none; }
    .category-tag { flex-shrink: 0; padding: 5px 13px; font-size: 12.5px; }
    .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .template-info { padding: 11px 12px 12px; }
    .template-info h4 { font-size: 13px; margin-bottom: 9px; }
    .template-footer { flex-wrap: wrap; }
    .download-btn { padding: 5px 11px; font-size: 11.5px; }
    .qr-section { flex-direction: column; }
    .qr-code { width: 118px; height: 118px; }
    .qr-tips p { font-size: 13px; }
    .modal-content { padding: 22px 18px; }
    .page-btn { min-width: 32px; height: 32px; padding: 0 10px; font-size: 12px; }
    .empty-state { padding: 46px 16px; }
    .empty-state i { font-size: 38px; }
}

@media (max-width: 420px) {
    .templates-grid { grid-template-columns: 1fr; }
    .verify-input { flex-direction: column; }
    .verify-input button { width: 100%; justify-content: center; }
}
