/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #333333;
    color: #ffffff;
    padding: 30px 0;
    text-align: center;
}

.header-logo {
    height: 50px;
    width: auto;
    margin-right: 15px;
    vertical-align: middle;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s;
}

.logo-link:hover {
    transform: scale(1.02);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 2px;
    color: #ffffff;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 导航样式 */
.nav {
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--primary-color);
    color: white;
}

/* 主内容区域 */
.main {
    padding: 40px 0;
}

/* 分类样式 */
.category {
    margin-bottom: 60px;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title .icon {
    font-size: 1.5rem;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* 产品卡片 */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 16px;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.product-info h3:hover {
    color: var(--primary-color);
}

.product-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* 查看详情按钮 */
.detail-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.detail-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.detail-btn.disabled {
    background: #94a3b8;
    cursor: pointer;
}

.detail-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.2);
}

.modal-nav {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    align-items: center;
}

.nav-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.detail-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
}

.detail-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.modal-title {
    color: white;
    margin-top: 12px;
    font-size: 1rem;
    text-align: center;
    opacity: 0.9;
}

/* 页脚样式 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}

.company-info,
.shop-links,
.wechat-qrcode {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.footer-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.fallback-logo {
    display: none;
    font-size: 3rem;
    margin-right: 12px;
}

.company-info h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: white;
}

.address {
    display: none; /* 隐藏地址 */
}

.shop-links h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.shop-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
}

.shop-link:hover {
    color: var(--accent-color);
}

.wechat-qrcode {
    text-align: center;
}

.wechat-qrcode h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.qr-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 8px;
    margin-bottom: 8px;
}

.wechat-qrcode p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.shop-icon {
    font-size: 1.2rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 30px 0;
    }

    .logo {
        font-size: 1.8rem;
    }

    .nav-list {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .modal-nav {
        flex-direction: column;
        gap: 8px;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 180px;
    }

    .header-logo {
        height: 40px;
        margin-right: 10px;
    }

    .logo {
        font-size: 1.8rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .company-info h3 {
        font-size: 1.3rem;
    }

    .footer-logo img {
        height: 40px;
    }

    .qr-image {
        width: 100px;
        height: 100px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.3s ease forwards;
}

/* 图片加载占位 */
.product-image img[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
