/* 清新极简商城样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00c896;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 70px;
}

/* 头部样式 */
.header {
    background: #fff;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
}

.header-back {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
}

/* 搜索框 */
.search-box {
    background: #fff;
    padding: 15px 20px;
    margin-bottom: 10px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    background: var(--secondary-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 轮播图 */
.banner {
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* 分类网格 */
.category-grid {
    background: #fff;
    padding: 20px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
}

.category-icon {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 8px;
}

.category-name {
    font-size: 12px;
    color: var(--text-light);
}

/* 商品列表 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
}

.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
}

.product-original-price {
    color: var(--text-light);
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 100;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

/* 购物车样式 */
.cart-item {
    background: #fff;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
}

.cart-checkbox {
    margin-right: 15px;
}

.cart-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-info {
    flex: 1;
}

.cart-name {
    font-size: 14px;
    margin-bottom: 8px;
}

.cart-price {
    color: var(--primary-color);
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    margin: 0 10px;
}

/* 结算栏 */
.checkout-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.total-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.checkout-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn:hover {
    background: #00b085;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-color);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 8px;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}