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

:root {
    --pdd-red: #e4393c;
    --pdd-red-dark: #c81623;
    --pdd-orange: #ff9500;
    --pdd-yellow: #ffb74d;
    --pdd-pink: #ff6b6b;
    --bg: #f5f5f5;
    --bg-white: #ffffff;
    --border: #e8e8e8;
    --text: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --price-color: #e4393c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 20px rgba(228, 57, 60, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { cursor: pointer; text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }

/* ===== 顶部搜索栏 ===== */
.header {
    background: linear-gradient(180deg, #e4393c 0%, #f23030 100%);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(228, 57, 60, 0.2);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo { flex-shrink: 0; }

.logo-text {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.search-box {
    flex: 1;
    max-width: 600px;
    background: #fff;
    border-radius: 24px;
    padding: 6px 6px 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* SVG 搜索图标 */
.search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    font-family: inherit;
}

.search-btn {
    background: var(--pdd-red);
    color: #fff;
    padding: 8px 24px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.search-btn:hover { background: var(--pdd-red-dark); }

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

.header-link {
    color: #fff;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.header-link:hover { background: rgba(255, 255, 255, 0.2); }

/* ===== 主导航 ===== */
.main-nav {
    background: #fff;
    border-bottom: 2px solid var(--pdd-red);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-list { display: flex; gap: 4px; }

.nav-item { position: relative; }

.nav-item a {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover a,
.nav-item.active a { color: var(--pdd-red); }

.nav-item.active a { font-weight: 700; }

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--pdd-red);
    border-radius: 2px;
}

/* ===== 主体内容 ===== */
.main-content {
    max-width: 1200px;
    margin: 16px auto;
    padding: 0 20px;
}

/* ===== 顶部区域 ===== */
.top-section {
    display: grid;
    grid-template-columns: 200px 1fr 230px;
    gap: 12px;
    height: 400px;
    margin-bottom: 16px;
}

/* 左侧分类菜单 */
.category-menu {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.category-menu ul { padding: 8px 0; }

.category-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
}

.category-menu li a:hover {
    background: var(--pdd-red);
    color: #fff;
    padding-left: 20px;
}

.category-menu .arrow {
    color: var(--text-tertiary);
    font-size: 18px;
}

.category-menu li a:hover .arrow { color: #fff; }

/* 中间 Banner */
.banner-wrapper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    color: #fff;
}

.banner-slide.active { opacity: 1; }

/* Banner 渐变背景 */
.slide-red { background: linear-gradient(135deg, #e4393c 0%, #ff6b6b 100%); }
.slide-orange { background: linear-gradient(135deg, #ff9500 0%, #ffb74d 100%); }
.slide-purple { background: linear-gradient(135deg, #6a11cb 0%, #8e2de2 100%); }

.banner-content {
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.banner-content h2 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.banner-content p {
    font-size: 20px;
    margin-bottom: 20px;
    opacity: 0.95;
}

.banner-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 10px 28px;
    border-radius: 24px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.banner-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    width: 40px;
    height: 60px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 4px;
}

.banner-btn:hover { background: rgba(0, 0, 0, 0.6); }
.banner-btn.prev { left: 10px; }
.banner-btn.next { right: 10px; }

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.dot.active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* 右侧用户面板 */
.user-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-info {
    text-align: center;
    margin-bottom: 16px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pdd-red) 0%, var(--pdd-pink) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.user-greet {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
}

.btn-login, .btn-register {
    flex: 1;
    padding: 8px 0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-login {
    background: var(--pdd-red);
    color: #fff;
}

.btn-login:hover { background: var(--pdd-red-dark); }

.btn-register {
    background: #fff;
    color: var(--pdd-red);
    border: 1px solid var(--pdd-red);
}

.btn-register:hover { background: #fff5f5; }

.user-perks {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.perk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff5f5;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.perk-item:hover {
    background: #ffe8e8;
    transform: translateX(2px);
}

/* SVG 权益图标 */
.perk-icon {
    color: var(--pdd-red);
    flex-shrink: 0;
}

/* ===== 金刚位 ===== */
.quick-entry {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

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

.entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.entry-item:hover { transform: translateY(-4px); }

.entry-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 金刚位背景色 */
.bg-red { background: linear-gradient(135deg, #ff6b6b, #e4393c); }
.bg-deepred { background: linear-gradient(135deg, #e4393c, #c81623); }
.bg-orange { background: linear-gradient(135deg, #ff9500, #ffb74d); }
.bg-purple { background: linear-gradient(135deg, #8e2de2, #6a11cb); }
.bg-green { background: linear-gradient(135deg, #11998e, #38ef7d); }
.bg-blue { background: linear-gradient(135deg, #2196f3, #1976d2); }
.bg-cyan { background: linear-gradient(135deg, #00bcd4, #0097a7); }
.bg-purple2 { background: linear-gradient(135deg, #9c27b0, #6a1b9a); }
.bg-green2 { background: linear-gradient(135deg, #4caf50, #2e7d32); }
.bg-orange2 { background: linear-gradient(135deg, #ff9800, #f57c00); }

.entry-item span {
    font-size: 12px;
    color: var(--text);
}

/* ===== 通用区块标题 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

/* SVG 闪电图标 */
.icon-flash {
    color: var(--pdd-red);
}

/* SVG 补贴图标 */
.icon-subsidy {
    color: var(--pdd-orange);
}

.section-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.more-link {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.more-link:hover { color: var(--pdd-red); }

/* ===== 限时秒杀 ===== */
.seckill {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #ffe8e8;
}

.seckill-time {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
}

.time-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 4px;
}

.time-box {
    background: #333;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    min-width: 28px;
    text-align: center;
}

.seckill-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.seckill-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}

.seckill-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--pdd-red);
}

.item-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    position: relative;
    text-align: center;
    padding: 8px;
}

.item-image .product-label {
    display: inline-block;
    background: #fff;
    color: var(--pdd-red);
    border: 2px solid var(--pdd-red);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    max-width: 90%;
    word-break: break-all;
    line-height: 1.3;
}

.item-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--pdd-red);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}

.item-info { padding: 10px; }

.item-price {
    color: var(--pdd-red);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.item-price .yen { font-size: 13px; }

.item-price .original {
    color: var(--text-tertiary);
    font-size: 12px;
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 4px;
}

.item-title {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}

.item-progress {
    background: #ffe8e8;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pdd-red) 0%, var(--pdd-pink) 100%);
    border-radius: 7px;
    transition: width 0.5s;
}

.item-progress-text {
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 10px;
    text-align: center;
    line-height: 14px;
    font-weight: 700;
}

/* ===== 百亿补贴 ===== */
.subsidy {
    background: linear-gradient(135deg, #fff8e1 0%, #fff 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #ffe0b2;
}

.subsidy-tag {
    background: var(--pdd-orange);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.subsidy-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.subsidy-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}

.subsidy-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.15);
    border-color: var(--pdd-orange);
}

.subsidy-item .item-image {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
}

.subsidy-item .item-image .product-label {
    color: var(--pdd-orange);
    border-color: var(--pdd-orange);
}

.subsidy-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(90deg, #ff9500 0%, #ffb74d 100%);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
}

/* ===== 为你推荐 ===== */
.recommend { margin-top: 24px; }

.recommend-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.recommend-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pdd-red), transparent);
}

.recommend-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--pdd-red);
    letter-spacing: 2px;
}

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

.goods-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.goods-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.goods-card .item-image {
    aspect-ratio: 1;
}

.goods-card .item-image .product-label {
    font-size: 13px;
    padding: 6px 10px;
}

.goods-card .item-info { padding: 12px; }

.goods-title {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
}

.goods-tags {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.goods-tag {
    background: #fff0f0;
    color: var(--pdd-red);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid #ffd6d6;
}

.goods-tag.subsidy-tag-item {
    background: #fff5e6;
    color: var(--pdd-orange);
    border-color: #ffd699;
}

.goods-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.goods-sales {
    font-size: 11px;
    color: var(--text-tertiary);
}

.buy-btn {
    background: var(--pdd-red);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.buy-btn:hover { background: var(--pdd-red-dark); }

/* 加载更多 */
.load-more {
    text-align: center;
    margin-top: 24px;
}

.load-more-btn {
    background: #fff;
    color: var(--pdd-red);
    border: 2px solid var(--pdd-red);
    padding: 10px 40px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--pdd-red);
    color: #fff;
}

/* ===== 侧边悬浮工具栏 ===== */
.sidebar-tools {
    position: fixed;
    right: 20px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.tool-item {
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid #f0f0f0;
}

.tool-item:hover {
    background: var(--pdd-red);
    color: #fff;
    transform: translateX(-4px);
}

.tool-icon {
    color: currentColor;
    flex-shrink: 0;
}

.tool-text {
    font-size: 11px;
    margin-top: 2px;
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--pdd-red);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
    border: 2px solid #fff;
}

/* ===== 页脚 ===== */
.footer {
    background: #fff;
    margin-top: 40px;
    padding: 40px 0 20px;
    border-top: 3px solid var(--pdd-red);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.footer-col h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 14px;
    font-weight: 700;
}

.footer-col a {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--pdd-red); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.copyright {
    font-size: 12px !important;
    color: var(--text-tertiary);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.goods-card, .seckill-item, .subsidy-item {
    animation: fadeInUp 0.4s ease backwards;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 180px 1fr 200px;
    }

    .entry-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .seckill-list {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 12px;
    }

    .logo-text { font-size: 22px; }

    .search-box {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .nav-list {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .nav-item a {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .main-content { padding: 0 12px; }

    .top-section {
        grid-template-columns: 1fr;
        height: auto;
    }

    .category-menu, .user-panel { display: none; }

    .banner-wrapper { height: 180px; }

    .banner-content h2 { font-size: 28px; }
    .banner-content p { font-size: 14px; }
    .banner-tag {
        font-size: 14px;
        padding: 6px 16px;
    }

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

    .entry-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .entry-item span { font-size: 11px; }

    .seckill-list, .subsidy-list, .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .section-title h2 { font-size: 18px; }

    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .sidebar-tools {
        right: 8px;
        bottom: 80px;
    }

    .tool-item {
        width: 44px;
        height: 44px;
    }
}
