* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: #FFF8F5;
    min-height: 100vh;
}

/* 顶部导航 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #FF6924;
    letter-spacing: -0.5px;
}

.location-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FFF8F5;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #FFE8DC;
    font-size: 13px;
    font-weight: 600;
    color: #FF6924;
    cursor: pointer;
    transition: all 0.2s;
    height: 36px;
}

.location-btn:active { 
    background: #FFE8DC;
}

.location-btn:focus {
    outline: none;
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #F7F8FA;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    padding: 8px 16px;
    gap: 8px;
    transition: all 0.3s;
}

.search-input-wrapper:focus-within {
    background: #FFF;
    border-color: #FF6924;
}

.search-icon { font-size: 18px; color: #999; }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    color: #333;
}

.search-input::placeholder { color: #999; }

.search-btn {
    background: #FF6924;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.search-btn:active { 
    background: #E65A1E;
}

.search-btn:focus {
    outline: none;
}

/* 热门标签 */
.tags-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.tags-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tags-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tags-title-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-link {
    background: linear-gradient(135deg, #FF8547 0%, #FF6924 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 105, 36, 0.3);
}

.coupon-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 36, 0.4);
}

.coupon-link:active {
    transform: translateY(0);
}

.coupon-link:focus {
    outline: none;
}

.coupon-link:visited {
    color: white;
    background: linear-gradient(135deg, #FF8547 0%, #FF6924 100%);
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.tag-item {
    background: #FFFFFF;
    border: 2px solid #FF6924;
    padding: 0 8px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #FF6924;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-item:hover {
    background: #FF6924;
    color: white;
}

.tag-item:active { 
    background: #E65A1E;
    border-color: #E65A1E;
}

.tag-item:focus {
    outline: none;
}

/* 商品列表 */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.3s;
    display: flex;
    height: 140px;
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-image {
    width: 140px;
    height: 140px;
    object-fit: cover;
    background: #FFE8DC;
    flex-shrink: 0;
}

.product-body {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.product-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
    margin-bottom: 4px;
}

.type-badge {
    background: #FF6924;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255, 105, 36, 0.3);
}

.type-badge.delivery {
    background: linear-gradient(135deg, #52C41A 0%, #73D13D 100%);
}

.store-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.store-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.distance {
    color: #999;
    font-weight: 500;
    flex-shrink: 0;
    font-size: 11px;
}

.product-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.price-section { flex: 1; min-width: 0; }

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-current {
    font-size: 20px;
    font-weight: 800;
    background: #FF6924;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

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

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
    flex-shrink: 0;
    min-height: 16px;
}

.buy-button {
    background: #FF6924;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 105, 36, 0.35);
    transition: all 0.3s;
}

.buy-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(255, 105, 36, 0.3);
}

.buy-button:focus {
    outline: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

.pagination button {
    background: white;
    color: #FF6924;
    border: 2px solid #FFE8DC;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

@media (hover: hover) {
    .pagination button:hover {
        background: #FF6924;
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
    }
}

.pagination button:active { 
    transform: translateY(0);
    background: #FF6924;
    color: white;
}

.pagination button:focus {
    outline: none;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pagination button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.pagination button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #FFE8DC;
    border-top-color: #FF6924;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.pagination span {
    font-size: 15px;
    color: #666;
    font-weight: 600;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-text {
    font-size: 16px;
    color: #999;
    font-weight: 500;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #FFE8DC;
    border-top-color: #FF6924;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 15px;
    color: #999;
    font-weight: 500;
}

/* 底部版权 */
.footer {
    background: white;
    padding: 24px 16px;
    text-align: center;
    border-top: 1px solid #FFE8DC;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
    color: #999;
    line-height: 2;
}

.footer-content > div {
    margin: 4px 0;
}

.wechat-link {
    color: #FF6924;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.wechat-link:hover {
    text-decoration: underline;
}

.footer-content a {
    color: #FF6924;
    text-decoration: none;
    margin: 0 4px;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
    .logo { font-size: 20px; }
    .product-card { height: 120px; }
    .product-image { width: 120px; height: 120px; }
    .product-body { padding: 12px; }
    .product-title { font-size: 13px; -webkit-line-clamp: 2; line-height: 1.3; }
    .price-current { font-size: 18px; }
    .buy-button { padding: 6px 14px; font-size: 12px; }
    .tags-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    .tag-item {
        font-size: 12px;
        height: 32px;
        padding: 0 6px;
    }
    .coupon-link {
        font-size: 12px;
        padding: 7px 14px;
    }
}

@media (max-width: 480px) {
    .tags-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    .tag-item {
        font-size: 11px;
        height: 30px;
        padding: 0 4px;
    }
    .tags-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .coupon-link {
        font-size: 11px;
        padding: 6px 12px;
    }
    .footer-content {
        font-size: 12px;
    }
}
