/* ============================================
   产品展示H5网站 - 前台样式
   PC+H5自适应
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --header-height: 56px;
    --max-width: 1200px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --color-primary: #1a73e8;
    --color-text: #1a1a1a;
    --color-text-secondary: #666;
    --color-text-muted: #999;
    --color-bg: #f5f5f5;
    --color-white: #ffffff;
    --color-border: #e8e8e8;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-white);
    transition: box-shadow var(--transition);
}
.header.shadowed {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: var(--header-height);
}

.site-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

/* --- Category Navigation --- */
.cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

/* 文字按钮 */
.cat-btn {
    border: 1.5px solid var(--color-border);
    background: #fafafa;
    color: var(--color-text-secondary);
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    outline: none;
    font-family: inherit;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.cat-btn:hover {
    border-color: #ccc;
    background: #f0f0f0;
}
.cat-btn.active {
    background: var(--active-color, #1a1a1a);
    color: #fff;
    border-color: var(--active-color, #1a1a1a);
    transform: scale(1.03);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 图片按钮 */
.cat-btn-img {
    padding: 4px 10px;
    background: transparent;
    border: none;
    opacity: 0.55;
    transition: all var(--transition);
}
.cat-btn-img:hover { opacity: 0.8; }
.cat-btn-img.active {
    opacity: 1;
    transform: scale(1.08);
    background: transparent;
    border: none;
    box-shadow: none;
}
.cat-btn-icon {
    height: 38px;
    width: auto;
    display: block;
}

/* --- Main Content --- */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
}

/* --- Product Grid (PC) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
}

.product-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.product-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Section Title --- */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    padding: 20px 16px 8px;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 24px 16px 80px;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* --- Service Bar --- */
.service-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
}
.service-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(26,115,232,0.3);
}
.service-btn:hover {
    background: #1557b0;
    box-shadow: 0 4px 16px rgba(26,115,232,0.4);
    transform: translateY(-1px);
}
.service-btn:active { transform: scale(0.97); }

/* --- Service Modal --- */
.service-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}
.service-modal-overlay.show {
    display: flex;
}

.service-modal {
    background: var(--color-white);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}

.service-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border);
}
.service-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.service-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all var(--transition);
}
.service-modal-close svg { width: 16px; height: 16px; }
.service-modal-close:hover { background: #e0e0e0; color: #333; }
.service-modal-close:hover { background: #e0e0e0; color: #333; }

.service-modal-body { padding: 20px 24px 32px; }

.service-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}
.service-item:last-child { border-bottom: none; padding-bottom: 0; }
.service-item:first-child { padding-top: 0; }

.service-item-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #f5f7fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-item-info { flex: 1; min-width: 0; }
.service-item-label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
.service-item-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    word-break: break-all;
    margin-bottom: 8px;
}

.phone-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.phone-link:hover { text-decoration: underline; }

.service-copy-btn {
    padding: 6px 16px;
    border: 1.5px solid #07c160;
    background: #fff;
    color: #07c160;
    border-radius: var(--radius-pill);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.service-copy-btn:hover {
    background: #07c160;
    color: #fff;
}
.service-copy-btn.copied {
    background: #07c160;
    color: #fff;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--color-text-muted);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-text { font-size: 18px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; }
.empty-hint { font-size: 14px; }

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============================================
   Tablet (769px - 1024px): 2列
   ============================================ */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
}

/* ============================================
   Mobile H5 (≤ 768px): 单列无缝拼接
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px;
        min-height: auto;
    }

    .site-name {
        font-size: 16px;
    }

    .cat-nav {
        width: 100%;
        gap: 6px 8px;
    }

    .cat-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .cat-btn-icon { height: 32px; }

    /* 手机端：图片width:100%无缝拼接 */
    .product-grid {
        display: block;
        padding: 0;
        gap: 0;
    }

    .product-item {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    .product-item:hover {
        transform: none;
        box-shadow: none;
    }

    .product-item img {
        width: 100%;
        display: block;
    }

    .section-title {
        padding: 16px 12px 4px;
        font-size: 15px;
    }

    .service-bar { padding: 8px 12px; }
    .service-btn { width: 100%; justify-content: center; }
}

/* ============================================
   Small Mobile (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .cat-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
    .cat-btn-icon { height: 28px; }
}
