/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f8f8f8;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* 主题色 */
.theme-primary {
    color: #4CAF50;
}

.theme-bg-primary {
    background-color: #4CAF50;
}

/* 顶部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 15px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.logo span {
    margin-left: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
}

.search-box i {
    margin-right: 5px;
}

.cart-icon {
    position: relative;
    margin-left: 15px;
    color: #fff;
    font-size: 20px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    background-color: #FF5722;
    color: #fff;
    font-size: 10px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* 底部导航 */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 12px;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: #4CAF50;
}

/* 区块头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.section-more {
    color: #999;
    font-size: 12px;
}

/* 商品卡片 */
.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.product-image {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    display: flex;
    align-items: baseline;
    margin-top: 8px;
}

.current-price {
    font-size: 16px;
    font-weight: bold;
    color: #FF5722;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

.product-unit {
    font-size: 12px;
    color: #999;
}

.product-sales {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 6px;
    background-color: #FFEBEE;
    color: #FF5722;
    font-size: 10px;
    border-radius: 2px;
    margin-right: 5px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #4CAF50;
    color: #fff;
}

.btn-outline {
    background-color: #fff;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.btn-disabled {
    background-color: #ccc;
    color: #fff;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示框 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    border-radius: 5px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
}

/* 空状态 */
.empty-state {
    padding: 50px 20px;
    text-align: center;
}

.empty-state img {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.empty-state p {
    color: #999;
    font-size: 14px;
}

/* 加载更多 */
.load-more {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

.load-more.loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

/* 图标字体 */
.icon-home:before { content: "🏠"; }
.icon-category:before { content: "📂"; }
.icon-cart:before { content: "🛒"; }
.icon-user:before { content: "👤"; }
.icon-search:before { content: "🔍"; }
.icon-arrow-right:before { content: "→"; }
.icon-plus:before { content: "+"; }
.icon-minus:before { content: "-"; }
.icon-close:before { content: "×"; }
.icon-check:before { content: "✓"; }

/* 响应式适配 */
@media screen and (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}