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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ── 头部导航 ─────────────────────────────────────────── */
.header {
    background: linear-gradient(135deg, #E4393C 0%, #FF6B6B 100%);
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.logo span {
    font-size: 12px;
    opacity: 0.9;
    display: block;
    font-weight: normal;
}

/* 搜索框 */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #E4393C;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* 头部内的平台标签 — 白色风格 */
.header .platform-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    justify-content: flex-end;
}

.header .platform-tab {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    font-weight: normal;
}

.header .platform-tab:hover,
.header .platform-tab.active {
    background: white;
    color: #E4393C;
}

/* ── 主体内容区的平台标签 — 灰色风格 ──────────────────── */
.platform-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.platform-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-tab:hover,
.platform-tab.active {
    color: #fff;
    background: #FF5000;
    border-color: #FF5000;
}

/* Banner轮播 */
.banner-section {
    margin: 15px 0;
}

.banner-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: white;
}

.banner-slider img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

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

/* 分类导航 */
.category-section {
    margin: 15px 0;
}

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

.category-item {
    background: white;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.category-name {
    font-size: 13px;
    color: #666;
}

/* 优惠券专区 */
.coupon-section {
    margin: 15px 0;
    background: white;
    border-radius: 12px;
    padding: 15px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #E4393C, #FF6B6B);
    border-radius: 2px;
}

.coupon-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.coupon-list::-webkit-scrollbar {
    display: none;
}

.coupon-card {
    min-width: 200px;
    background: linear-gradient(135deg, #FF6B6B 0%, #E4393C 100%);
    color: white;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.coupon-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.coupon-amount {
    font-size: 24px;
    font-weight: bold;
}

.coupon-amount small {
    font-size: 14px;
}

.coupon-condition {
    font-size: 12px;
    opacity: 0.9;
    margin: 5px 0;
}

.coupon-btn {
    display: inline-block;
    background: white;
    color: #E4393C;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 8px;
}

/* ── 商品卡片 ─────────────────────────────────────────── */
.goods-section {
    margin: 15px 0;
}

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

.goods-card {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.goods-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.goods-card .goods-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.goods-card .goods-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.goods-card:hover .goods-image img {
    transform: scale(1.05);
}

.goods-card .goods-content {
    padding: 10px 12px 6px;
}

.goods-card .goods-title {
    font-size: 13px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
    color: #333;
}

.goods-card .shop-name {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.goods-card .coupon-tag {
    display: inline-block;
    font-size: 11px;
    color: #fff;
    background: #FF5000;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.goods-card .price {
    font-size: 18px;
    color: #E4393C;
    font-weight: 700;
}

.goods-card .price .symbol {
    font-size: 12px;
}

.goods-card .original-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    margin-left: 4px;
}

.goods-card .goods-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px 10px;
    font-size: 11px;
    color: #999;
}

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

.goods-card .commission {
    color: #FF5000;
    font-weight: 600;
}

/* 筛选栏 */
.filter-bar {
    background: white;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    overflow-x: auto;
}

.filter-item {
    white-space: nowrap;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 5px 0;
}

.filter-item.active {
    color: #E4393C;
    font-weight: bold;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 15px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: #E4393C;
    color: white;
}

/* 商品详情页 */
.detail-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin: 15px 0;
}

.detail-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.detail-info {
    padding: 20px;
}

.detail-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.5;
}

.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-price {
    font-size: 28px;
    color: #E4393C;
    font-weight: bold;
}

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

.detail-coupon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFF5F5;
    border: 1px dashed #FF6B6B;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.detail-coupon-amount {
    font-size: 20px;
    color: #E4393C;
    font-weight: bold;
}

.detail-coupon-info {
    font-size: 13px;
    color: #666;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #E4393C 0%, #FF6B6B 100%);
    color: white;
    text-align: center;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.detail-btn:hover {
    opacity: 0.9;
}

/* 底部 */
.footer {
    background: white;
    padding: 20px 0;
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    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); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 14px;
}

/* 平台颜色 */
.platform-tb {
    color: #FF5000;
}

.platform-jd {
    color: #E4393C;
}

/* 活动卡片 */
.activity-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.activity-banner {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.activity-info {
    padding: 15px;
}

.activity-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.activity-time {
    font-size: 12px;
    color: #999;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .category-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .banner-slider img {
        height: 300px;
    }

    .header-inner {
        padding: 0 20px;
    }

    .search-box input {
        padding: 12px 45px 12px 20px;
    }

    .detail-img {
        max-height: 500px;
    }
}

@media (min-width: 1024px) {
    .goods-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .banner-slider img {
        height: 350px;
    }

    .main-layout {
        display: flex;
        gap: 20px;
    }

    .sidebar {
        width: 250px;
        flex-shrink: 0;
    }

    .main-content {
        flex: 1;
    }
}

@media (max-width: 767px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 10px;
    }

    .header .platform-tabs {
        order: 2;
    }

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

    .goods-grid {
        gap: 8px;
    }

    .goods-card .goods-content {
        padding: 8px 10px 4px;
    }

    .goods-card .goods-title {
        font-size: 12px;
    }

    .goods-card .price {
        font-size: 16px;
    }

    .detail-price {
        font-size: 24px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}
