:root {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --bg-color: #f4f7fc;
    --card-bg: #ffffff;
    --text-color: #1a1a2e;
    --text-secondary: #555;
    --border-color: #e0e6ef;
    --shadow-color: rgba(0,0,0,0.08);
    --hero-bg: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    --input-bg: #ffffff;
    --navbar-bg: rgba(255,255,255,0.98);
    --footer-bg: #1a1a2e;
    --footer-text: #ccc;
    --badge-bg: #e8f0fe;
    --badge-color: #1a73e8;
    --tag-bg: #f0f4ff;
    --tag-color: #1a73e8;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4a9eff;
    --primary-hover: #3a7fdb;
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-color: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --shadow-color: rgba(0,0,0,0.3);
    --hero-bg: linear-gradient(135deg, #0d47a1 0%, #001529 100%);
    --input-bg: #21262d;
    --navbar-bg: rgba(13,17,23,0.98);
    --footer-bg: #0d1117;
    --footer-text: #8b949e;
    --badge-bg: #0d47a1;
    --badge-color: #4a9eff;
    --tag-bg: #1a2332;
    --tag-color: #4a9eff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo i { font-size: 1.8rem; }

.nav-menu { display: flex; align-items: center; gap: 20px; }

.nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-list a {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-list a:hover, .nav-list a.active {
    background: var(--primary-color);
    color: white;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle, .template-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: var(--transition);
}

.theme-toggle:hover, .template-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.user-greeting { font-weight: 600; color: var(--primary-color); }

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-sm { padding: 6px 16px; font-size: 0.9rem; }

.btn-lg { padding: 14px 36px; font-size: 1.1rem; }

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26,115,232,0.3);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.7);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: var(--transition);
}

/* 英雄区 */
.hero {
    background: var(--hero-bg);
    padding: 140px 0 80px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* 搜索区 */
.search-section {
    padding: 40px 0;
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow-color);
    flex-wrap: wrap;
}

.search-bar .search-icon {
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
}

.search-bar select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

/* 产品网格 */
.products-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    margin: 12px auto 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--shadow-color);
}

.card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .card-image img {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--badge-bg);
    color: var(--badge-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    background: var(--tag-bg);
    color: var(--tag-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rating {
    color: #f39c12;
    font-weight: 600;
}

/* 统计区 */
.stats-section {
    padding: 60px 0;
    background: var(--card-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
}

.heatmap-container {
    margin-top: 40px;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 4px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    transition: var(--transition);
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 2;
}

/* 页脚 */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--footer-text);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    padding-left: 6px;
}

.footer-col p { margin-bottom: 8px; }
.footer-col p i { margin-right: 8px; color: var(--primary-color); }

.social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 响应式 */
@media (max-width: 992px) {
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--navbar-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        display: none;
    }

    .nav-menu.active { display: flex; }

    .nav-list {
        flex-direction: column;
        width: 100%;
    }

    .nav-list a {
        display: block;
        padding: 12px;
        text-align: center;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        margin-top: 16px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar input[type="text"] { min-width: unset; }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .hero { padding: 120px 0 60px; }
    .hero h1 { font-size: 1.8rem; }

    .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .btn-lg { width: 100%; text-align: center; }
}

/* 动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }