﻿
/* ============================================
   CSS 变量系统
   ============================================ */
:root {
    --primary: #4f6ef7;
    --primary-dark: #3b5de5;
    --primary-light: #6b85f9;
    --primary-bg: rgba(79, 110, 247, 0.06);
    --primary-glow: rgba(79, 110, 247, 0.25);

    --accent: #f59e0b;
    --accent-dark: #d97706;

    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-surface: #f8f9fc;
    --bg-hover: #f0f2f7;

    --text-primary: #1a1d26;
    --text-secondary: #5f6577;
    --text-muted: #9ca3b4;
    --text-white: #ffffff;

    --border: #e5e8ef;
    --border-light: #eef0f5;
    --border-active: rgba(79, 110, 247, 0.3);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.09);
    --shadow-hover: 0 8px 30px rgba(79, 110, 247, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   重置样式
   ============================================ */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body); color: var(--text-primary);
    line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   头部导航 — 白色毛玻璃 · 固定定位
   ============================================ */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.header .container {
    display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 50px; width: auto; }

.nav {
    display: flex; align-items: center; gap: 4px;
}
.nav a {
    padding: 8px 18px; font-size: 15px; font-weight: 500;
    color: var(--text-secondary); border-radius: 9999px; transition: var(--transition);
}
.nav a:hover { color: var(--primary); background: rgba(79, 110, 247, 0.06); }
.nav a.active { color: var(--primary); font-weight: 600; background: rgba(79, 110, 247, 0.06); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* 移动端汉堡菜单 */
.menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle span {
    width: 24px; height: 2px; background: var(--text-primary);
    border-radius: 2px; transition: var(--transition);
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   主内容区
   ============================================ */
.site-main { flex: 1; padding: 104px 0 48px; }

/* ============================================
   首页 Hero 区域
   ============================================ */
.hero-section {
    background: linear-gradient(135deg,#1a1d26 0%, #6b85f9 50%, #4f6ef7 100%);
    background-size: 200% 200%;
    animation: heroGradient 8s ease infinite;
    color: #fff; text-align: center; padding: 52px 40px; margin-bottom: 32px;
    border-radius: var(--radius-xl); position: relative; overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: heroGlow 6s ease-in-out infinite alternate;
}
@keyframes heroGlow { 0% { transform: translate(0, 0); } 100% { transform: translate(20%, 20%); } }
@keyframes heroGradient {
    0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}
.hero-section h1 { font-size: 34px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; position: relative; }
.hero-section p { font-size: 15px; opacity: 0.9; position: relative; }

.hero-tags { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; position: relative; }
.hero-tag {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px; font-size: 13px; font-weight: 500;
    transition: var(--transition);
}
.hero-tag:hover { background: rgba(255,255,255,0.28); }

/* ============================================
   分类导航 — 胶囊标签
   ============================================ */
.category-nav {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px;
    padding: 16px 20px; background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); align-items: center;
}
.cat-item {
    padding: 8px 20px; border-radius: 8px; background: transparent; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; transition: var(--transition); border: 1px solid transparent;
    white-space: nowrap; cursor: pointer;
}
.cat-item:hover { color: var(--primary); background: var(--primary-bg); }
.cat-item.active {
    background: var(--primary); color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ============================================
   产品网格 — 卡片
   ============================================ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.product-card {
    background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--border); position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-hover);
}

.product-image { position: relative; height: 220px; overflow: hidden; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; }
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; transition: transform 0.4s ease; padding: 16px; }
.product-card:hover .product-image img { transform: scale(1.05); }

.no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: var(--bg-surface); }
.no-image .no-img-icon { font-size: 48px; opacity: 0.15; }
.no-image .no-img-text { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; }

.discount-badge {
    position: absolute; top: 12px; left: 12px;
    background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; padding: 4px 10px;
    border-radius: 6px; font-size: 11px; font-weight: 700; z-index: 2;
}

.hot-badge { position: absolute; top: 12px; right: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 700; z-index: 2; }

.product-info { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.product-name { font-size: 14px; margin-bottom: 8px; line-height: 1.5; }
.product-name a { color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; transition: color 0.2s; }
.product-name a:hover { color: var(--primary); }

.product-desc { color: var(--text-muted); font-size: 12px; margin-bottom: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.product-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-light); }

.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .current-price { font-size: 22px; color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; }
.price .original-price { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }

.btn-buy {
    display: block; width: 100%; padding: 11px; margin-top: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; text-align: center; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700;
    transition: var(--transition); border: none; cursor: pointer; letter-spacing: 0.5px;
}
.btn-buy:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); color: #fff; }

/* ============================================
   服务保障横幅
   ============================================ */
.service-banner { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 32px; margin-bottom: 12px; }
.service-item {
    display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--bg-card);
    border-radius: var(--radius-md); border: 1px solid var(--border); transition: var(--transition);
}
.service-item:hover { box-shadow: var(--shadow-md); }
.service-icon { font-size: 28px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--primary-bg); border-radius: var(--radius-md); flex-shrink: 0; }
.service-text h4 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.service-text p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ============================================
   空状态
   ============================================ */
.empty-state { grid-column: 1 / -1; text-align: center; padding: 80px 24px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px dashed var(--border); }
.empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ============================================
   分页
   ============================================ */
.pagination-wrapper { margin-top: 32px; text-align: center; }
.pagination { display: inline-flex; gap: 6px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 500; transition: var(--transition);
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination .dots { border: none; background: none; color: var(--text-muted); }

/* ============================================
   页脚
   ============================================ */
.site-footer {
    background: #ffffff; border-top: 1px solid var(--border);
    color: var(--text-muted); padding: 32px 0 24px; margin-top: auto;
}
.footer-inner { text-align: center; font-size: 13px; line-height: 2; }
.footer-inner p:last-child { opacity: 0.5; font-size: 12px; }

/* ============================================
   响应式 ≤768px
   ============================================ */
@media (max-width: 768px) {
    .header-inner { height: 56px; padding: 0 12px; }
    .front-hamburger { display: flex; }
    .main-nav { display: none; }
    .hero-section { padding: 32px 20px; margin-bottom: 24px; border-radius: var(--radius-lg); }
    .hero-section h1 { font-size: 24px; }
    .hero-section p { font-size: 13px; }
    .hero-tags { gap: 8px; margin-top: 16px; }
    .hero-tag { padding: 6px 14px; font-size: 12px; }
    .category-nav { gap: 6px; padding: 12px 14px; margin-bottom: 20px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .cat-item { padding: 7px 16px; font-size: 12px; flex-shrink: 0; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-info { padding: 12px; }
    .product-name { font-size: 13px; margin-bottom: 6px; }
    .product-desc { font-size: 11px; margin-bottom: 10px; }
    .product-meta { padding-top: 10px; }
    .price .current-price { font-size: 18px; }
    .btn-buy { padding: 9px; font-size: 12px; margin-top: 10px; }
    .service-banner { grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
    .service-item { padding: 14px 16px; }
    .service-icon { font-size: 24px; width: 40px; height: 40px; }
    .service-text h4 { font-size: 12px; }
    .service-text p { font-size: 11px; }
    .how-to-buy { margin-top: 32px; padding: 28px 0; }
    .section-title { font-size: 18px; margin-bottom: 20px; }
    .steps-row { flex-direction: column; gap: 0; }
    .step-card { width: 100%; padding: 20px 16px; }
    .step-arrow { display: none; }
    .faq-q { padding: 14px 16px; font-size: 13px; }
    .faq-a p { padding: 0 16px 14px; font-size: 12px; }
    .pagination-wrapper { margin-top: 20px; }
    .pagination a, .pagination span { min-width: 34px; height: 34px; font-size: 12px; padding: 0 8px; }
    .site-footer { padding: 24px 0 18px; }
}

/* ============================================
   响应式 ≤480px
   ============================================ */
@media (max-width: 480px) {
    :root { font-size: 15px; }
    .container { padding: 0 14px; }
    .hero-section { padding: 28px 16px; }
    .hero-section h1 { font-size: 20px; }
    .category-nav { padding: 10px 12px; gap: 6px; }
    .cat-item { padding: 6px 14px; font-size: 11px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card { border-radius: 10px; }
    .product-info { padding: 10px; }
    .product-image { height: 180px; }
    .price .current-price { font-size: 16px; }
    .btn-buy { padding: 8px; font-size: 11px; }
    .empty-state { padding: 48px 16px; }
    .empty-icon { font-size: 40px; }
    .empty-state p { font-size: 13px; }
}

/* ============================================
   如何购买 — 步骤条
   ============================================ */
.section-title {
    text-align: center; font-size: 22px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 28px; letter-spacing: -0.3px;
}

.how-to-buy {
    margin-top: 48px; padding: 40px 0;
}

.steps-row {
    display: flex; align-items: center; justify-content: center; gap: 0;
    max-width: 800px; margin: 0 auto;
}

.step-card {
    flex: 1; text-align: center; padding: 24px 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); transition: var(--transition);
}
.step-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.step-num {
    width: 44px; height: 44px; margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
}

.step-body h4 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.step-body p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

.step-arrow {
    font-size: 20px; color: var(--primary); font-weight: 700; padding: 0 8px; flex-shrink: 0;
}

/* ============================================
   常见问题 — 手风琴
   ============================================ */
.faq-section {
    margin-top: 16px; padding-bottom: 48px;
}

.faq-list { max-width: 720px; margin: 0 auto; }

.faq-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden;
    transition: var(--transition);
}
.faq-item:hover { border-color: var(--border-active); }

.faq-q {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; cursor: pointer; user-select: none;
    font-size: 14px; font-weight: 600; color: var(--text-primary); transition: background 0.2s;
}
.faq-q:hover { background: var(--bg-hover); }

.faq-toggle {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg); color: var(--primary); border-radius: 50%;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
    transition: transform 0.3s ease, background 0.2s;
}
.faq-item.open .faq-toggle { transform: rotate(45deg); background: var(--primary); color: #fff; }

.faq-a {
    max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.3s ease;
}
.faq-item.open .faq-a { max-height: 200px; }
.faq-a p {
    padding: 0 20px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.7;
}

/* ============================================
   入场动画
   ============================================ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }

/* ============================================
   移动端响应式
   ============================================ */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .header-actions form { display: none; }

    .nav {
        position: fixed; top: 72px; left: 0; right: 0;
        background: var(--bg-card); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 16px; gap: 4px;
        transform: translateY(-100%); opacity: 0; visibility: hidden;
        transition: var(--transition); box-shadow: var(--shadow-md); z-index: 1001;
    }
    .nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav a { padding: 12px 16px; width: 100%; text-align: left; }

    .logo img { height: 40px; }
}