/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding-bottom: 70px;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    color: #333;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e5e5e5;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: #e4393c;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.search-btn, .cart-btn {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.search-btn:hover, .cart-btn:hover {
    background-color: #f5f5f5;
    color: #e4393c;
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e4393c;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    font-weight: 500;
}

/* 轮播图 */
.banner {
    margin-top: 56px;
    position: relative;
    overflow: hidden;
    height: 160px;
}

.banner-slider {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.banner-slide {
    min-width: 100%;
    position: relative;
    display: none;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: white;
    padding: 16px;
    text-align: center;
}

.banner-content h2 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 600;
}

.banner-content p {
    font-size: 12px;
    opacity: 0.9;
}

.banner-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background: white;
}

/* 分类导航 */
.categories {
    background: white;
    padding: 16px;
    margin: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.category-item:hover {
    background: #fff;
    border-color: #e4393c;
    transform: translateY(-1px);
}

.category-item i {
    font-size: 20px;
    margin-bottom: 6px;
    color: #e4393c;
}

.category-item span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* 商品列表 */
.products {
    margin: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.more-link {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

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

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

.discount {
    background: #e4393c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.current-price {
    font-size: 15px;
    font-weight: 600;
    color: #e4393c;
}

.original-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}

.product-meta {
    margin-bottom: 8px;
}

.sales {
    font-size: 11px;
    color: #999;
}

.add-to-cart-form {
    margin: 0;
}

.add-to-cart-btn {
    width: 100%;
    background: #e4393c;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.add-to-cart-btn:hover {
    background: #d43333;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top: 1px solid #e5e5e5;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 10px;
    transition: color 0.2s;
    padding: 4px;
}

.nav-item.active {
    color: #e4393c;
}

.nav-item i {
    font-size: 16px;
    margin-bottom: 2px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .banner {
        height: 140px;
    }
    
    .banner-content h2 {
        font-size: 16px;
    }
    
    .banner-content p {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.4s ease-out;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e4393c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 