/**
 * 智享咖啡模板展示系统样式
 */

/* =========== Hero区域 =========== */
.zm-hero-section {
    background: var(--primary-color, #181D27);
    padding: 60px 0 40px;
    color: #fff;
}

.zm-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.zm-hero-content {
    margin-bottom: 30px;
}

.zm-hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
}

.zm-hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.8);
}

/* 搜索框 - 与主题风格一致 */
.zm-search-box {
    max-width: 600px;
    margin: 0 auto 25px;
    position: relative;
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.zm-search-input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
    border-radius: 6px;
    color: var(--primary-color, #181D27);
}

.zm-search-input::placeholder {
    color: var(--third-color, #535862);
}

.zm-search-btn {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.zm-search-btn:hover {
    background: var(--primary-color, #181D27);
    transform: translateY(-1px);
}

.zm-search-icon {
    font-size: 16px;
}

/* 热门搜索 */
.zm-hot-tags {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.zm-hot-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.zm-hot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zm-hot-tag {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zm-hot-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* =========== 面包屑导航 =========== */
.zm-template-page .zm-breadcrumb {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 24px 0;
    width: 100%;
}

.zm-breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    color: #535862;
}

.zm-breadcrumb-inner a {
    color: #7A5AF8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.zm-breadcrumb-inner a:hover {
    color: #181D27;
}

.zm-breadcrumb-separator {
    margin: 0 12px;
    color: #adb5bd;
}

.zm-breadcrumb-inner > span {
    color: #181D27;
}

/* =========== 筛选区域 =========== */
.zm-filter-section {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.zm-filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
}

.zm-filter-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.zm-filter-row:last-child {
    margin-bottom: 0;
}

.zm-filter-label {
    min-width: 100px;
    font-weight: 600;
    color: var(--primary-color, #181D27);
    font-size: 16px;
    padding-top: 6px;
    letter-spacing: -0.32px;
}

.zm-filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.zm-filter-option {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--third-color, #535862);
    text-decoration: none;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    font-weight: 500;
}

.zm-filter-option:hover {
    background: #e9ecef;
    color: var(--primary-color, #181D27);
    border-color: var(--secondary-color, #7A5AF8);
}

.zm-filter-option.active {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    border-color: var(--secondary-color, #7A5AF8);
}

/* =========== 模板展示区域 =========== */
.zm-templates-section {
    background: #fff;
    padding: 40px 0 60px;
    min-height: 600px;
}

.zm-templates-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* 模板卡片 */
.zm-template-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    border: 1px solid #f1f3f5;
}

.zm-template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary-color, #7A5AF8);
}


.zm-template-preview {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
    background: #f8f9fa;
    overflow: hidden;
}

.zm-template-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.zm-template-card:hover .zm-template-preview img {
    transform: scale(1.05);
}

/* 标签 */
.zm-template-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.zm-template-badge.free {
    background: #28a745;
    color: #fff;
}

.zm-template-badge.hot {
    top: auto;
    bottom: 10px;
    background: #dc3545;
    color: #fff;
}

/* 悬浮操作按钮 */
.zm-template-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zm-template-card:hover .zm-template-hover {
    opacity: 1;
}

.zm-template-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.zm-template-btn.preview {
    background: #fff;
    color: var(--secondary-color, #7A5AF8);
}

.zm-template-btn.preview:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
}

.zm-template-btn.demo {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
}

.zm-template-btn.demo:hover {
    transform: translateY(-2px);
    background: var(--primary-color, #181D27);
}

.zm-template-title {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color, #181D27);
    border-top: 1px solid #f1f3f5;
}

/* 模板标签 */
.zm-template-tags {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.zm-template-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #e9ecef;
    color: #495057;
    transition: all 0.3s;
}

.zm-template-tag:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
}

/* 空状态 */
.zm-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.zm-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.zm-empty-state h3 {
    font-size: 20px;
    color: #495057;
    margin-bottom: 10px;
}

.zm-empty-state p {
    color: #6c757d;
}

/* 分页 */
.zm-pagination {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.zm-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 8px;
}

.zm-pagination li a,
.zm-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    color: var(--third-color, #535862);
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.zm-pagination li a:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    border-color: var(--secondary-color, #7A5AF8);
}

.zm-pagination li .current {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    border-color: var(--secondary-color, #7A5AF8);
}

/* =========== 预览模态框 =========== */
.zm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.zm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zm-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.zm-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.zm-modal-close:hover {
    background: #dc3545;
    color: #fff;
}

.zm-modal-body {
    padding: 20px;
}

.zm-modal-body img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

/* =========== 右侧浮动按钮 =========== */
.zm-float-buttons {
    position: fixed;
    right: 30px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9998;
}

.zm-float-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(122, 90, 248, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.zm-float-btn:hover {
    transform: translateY(-3px);
    background: var(--primary-color, #181D27);
    box-shadow: 0 6px 20px rgba(24, 29, 39, 0.3);
}

.zm-float-icon {
    font-size: 24px;
    line-height: 1;
}

.zm-float-text {
    font-size: 11px;
    margin-top: 2px;
}

/* =========== 详情页样式 =========== */
.zm-showcase-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    background: #fff;
    min-height: 100vh;
    display: block !important;
    position: relative !important;
    overflow: visible !important;
}

.zm-template-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    box-sizing: border-box;
    position: relative !important;
}

.zm-detail-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 40px;
    margin-bottom: 60px;
    width: 100%;
    box-sizing: border-box;
    position: relative !important;
}


/* 左侧在线演示区域 */
.zm-detail-demo {
    flex: 0 0 calc(50% - 20px);
    position: sticky;
    top: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.zm-demo-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.zm-demo-preview {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.zm-demo-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.zm-demo-placeholder {
    width: 100%;
    aspect-ratio: 9/19.5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
}

/* H5预览iframe */
.zm-demo-iframe {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.h5-preview-iframe {
    width: 100%;
    height: 800px;
    border: none;
    display: block;
    background: #f5f5f5;
}

.zm-demo-note {
    margin-top: 16px;
    padding: 12px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.zm-demo-note p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.6;
}

.zm-demo-note p:last-child {
    margin-bottom: 0;
}

.zm-demo-note code {
    background: rgba(255, 193, 7, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
}

.zm-demo-qrcode {
    text-align: center;
    margin-bottom: 20px;
}

.zm-demo-qrcode img {
    width: 150px;
    height: 150px;
    display: inline-block;
    margin-bottom: 10px;
}

.zm-demo-qrcode p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.zm-demo-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 右侧信息区 */
.zm-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.zm-detail-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    line-height: 1.2;
}

.zm-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.zm-detail-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f0f0;
    color: var(--third-color, #535862);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.zm-detail-tag:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    transform: translateY(-2px);
}

.zm-tag-category {
    background: #e7f3ff;
    color: var(--secondary-color, #7A5AF8);
}

.zm-tag-category:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
}

/* 操作按钮 */
.zm-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}


.zm-btn-primary {
    padding: 14px 40px;
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(122, 90, 248, 0.3);
}

.zm-btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-color, #181D27);
    box-shadow: 0 6px 20px rgba(24, 29, 39, 0.3);
}

.zm-btn-secondary {
    padding: 14px 32px;
    background: #fff;
    color: var(--secondary-color, #7A5AF8);
    border: 2px solid var(--secondary-color, #7A5AF8);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zm-btn-secondary:hover {
    background: var(--secondary-color, #7A5AF8);
    color: #fff;
}

.zm-btn-outline {
    padding: 14px 32px;
    background: #fff;
    color: var(--third-color, #535862);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zm-btn-outline:hover {
    border-color: var(--primary-color, #181D27);
    color: var(--primary-color, #181D27);
}

/* 功能特性 */
.zm-detail-features {
    margin-bottom: 30px;
}

.zm-detail-features h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #181D27);
    margin-bottom: 16px;
}

.zm-detail-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.zm-detail-features li {
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 6px;
    color: var(--third-color, #535862);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zm-detail-features li::before {
    content: "✓";
    color: var(--secondary-color, #7A5AF8);
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* 模板简介 */
.zm-detail-description {
    margin-bottom: 30px;
}

.zm-detail-description h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #181D27);
    margin-bottom: 16px;
}

.zm-description-content {
    color: var(--third-color, #535862);
    line-height: 1.8;
    font-size: 15px;
}

/* 截图展示 */
.zm-detail-screenshots {
    margin-bottom: 30px;
}

.zm-detail-screenshots h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.zm-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}


.zm-screenshot-item {
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zm-screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .zm-templates-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .zm-detail-container {
        flex-direction: column;
        gap: 30px;
    }

    .zm-detail-demo {
        flex: 0 0 100%;
        position: static;
    }

    .zm-detail-info {
        width: 100%;
    }

    .zm-detail-title {
        font-size: 28px;
    }

    .zm-detail-tags {
        justify-content: flex-start;
    }

    .zm-hero-title {
        font-size: 24px;
    }

    .zm-hot-tags {
        justify-content: flex-start;
    }

    .zm-templates-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .zm-float-buttons {
        right: 15px;
        bottom: 60px;
    }
}


@media (max-width: 480px) {
    .zm-detail-title {
        font-size: 24px;
    }

    .zm-detail-actions,
    .zm-demo-actions {
        flex-direction: column;
    }

    .zm-btn-primary,
    .zm-btn-secondary,
    .zm-btn-outline {
        width: 100%;
    }

    .zm-templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .zm-filter-row {
        flex-direction: column;
    }

    .zm-filter-label {
        min-width: auto;
        margin-bottom: 10px;
    }
}


