/* ================= 基础全局变量 ================= */
:root { 
    --bg-color: #fafafa; 
    --primary-red: #ff4d4f; 
    --primary-blue: #3b82f6; 
    --text-main: #2c3e50; 
    --text-sub: #8c939d; 
    --border-color: #f0f2f5;
}

body { 
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    -webkit-font-smoothing: antialiased; 
}
a { 
    text-decoration: none; 
    color: inherit; 
}

/* ================= 辅助类 ================= */
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}

/* ================= 头部导航区域 ================= */
.sticky-header { 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    background-color: rgba(250, 250, 250, 0.95); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); 
    padding-bottom: 4px; 
}

.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 40px; 
    gap: 24px; 
    flex-wrap: nowrap; 
}

.search-box { 
    flex: 1; 
    position: relative; 
    min-width: 250px; 
}

.search-box input { 
    width: 100%; 
    padding: 12px 20px 12px 40px; 
    border-radius: 12px; 
    border: none; 
    background: #ffffff;
    outline: none; 
    font-size: 14px; 
    box-sizing: border-box; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); 
    transition: all 0.3s ease; 
}
.search-box input:focus { 
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.12); 
}
.search-icon { 
    position: absolute; 
    left: 14px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-sub); 
}

.action-buttons { 
    display: flex; 
    gap: 12px; 
    flex-shrink: 0; 
    align-items: center;
}

.btn { 
    width: 240px;
    height: 44px;
    padding: 6px 12px; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 14px; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    cursor: pointer; 
    box-sizing: border-box;
    text-align: center;
    line-height: 1.2;
}
.btn:hover { 
    transform: translateY(-2px); 
}

.btn-invite { 
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%); 
    color: white; 
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.25); 
    border: none; 
}
.btn-tutorial { 
    background: #ffffff; 
    color: var(--primary-blue); 
    border: none; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
}

/* ================= 一级过滤器 ================= */
.filter-container {
    display: flex;
    gap: 8px;
    padding: 5px 40px 10px; 
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; 
}
.filter-container::-webkit-scrollbar { display: none; }

.filter-btn { 
    padding: 6px 16px; 
    border-radius: 12px; 
    background: transparent; 
    border: none; 
    color: #64748b; 
    font-weight: 600; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 13px; 
    text-transform: uppercase; 
}
.filter-btn:hover { 
    background: #ffffff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
}
.filter-btn.active { 
    background: #ffffff; 
    color: #1a1a1a; 
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); 
}

/* ================= 图文二级类目区域 ================= */
.sub-category-image-grid {
    display: flex;
    gap: 10px;
    padding: 0px 40px 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    align-items: center; 
}
.sub-category-image-grid::-webkit-scrollbar { display: none; }

.sub-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: auto; 
}

.sub-cat-img-wrapper {
    width: 38px; 
    height: 38px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.sub-cat-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.all-icon {
    font-size: 10px; 
    font-weight: 800;
    color: #64748b;
}

.sub-cat-card:hover .sub-cat-img-wrapper {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}
.sub-cat-card.active .sub-cat-img-wrapper {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.sub-cat-name { display: none !important; }

/* ================= 商品网格 ================= */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px; 
    padding: 10px 40px 40px; 
}

.product-card { 
    background: white; 
    border-radius: 16px; 
    overflow: hidden; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    border: none; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.02); 
    height: 100%; 
}
.product-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 30px rgba(0,0,0,0.06); 
}
.product-card > a { 
    display: flex; flex-direction: column; flex: 1; 
}
.image-box { 
    width: 100%; padding-top: 100%; position: relative; background-color: #fafafa; 
}
.product-img { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; 
}
.info-box { 
    padding: 12px 14px 10px; 
    flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; 
}
.product-title { 
    font-size: 14px; 
    color: #334155; 
    margin: 0; 
    font-weight: 500; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    line-height: 1.4; 
}

/* ================= 悬浮角标区域 (主题红 & 鉴定绿) ================= */
.product-price { 
    font-size: 17px; 
    font-weight: 800; 
    color: var(--primary-red); 
    margin-top: 4px; 
    white-space: nowrap; 
    letter-spacing: -0.5px;
}

.version-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px; /* 更加硬朗的微直角，偏向街头风 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
}

/* TOP：采用与网站主题一致的专属红色 */
.version-badge.top {
    background-color: var(--primary-red); 
    color: #ffffff;
    border: none;
}

/* STANDARD：标准品质，采用沉稳的深黑灰色（百搭不抢戏） */
.version-badge.standard {
    background-color: #334155; 
    color: #ffffff; 
    border: none;
}

/* BUDGET：性价比，采用醒目的高级深翠绿（类似潮牌平台的鉴定通过标签） */
.version-badge.budget {
    background-color: #059669; 
    color: #ffffff; 
    border: none; 
}

/* ================= QC 按钮 ================= */
.qc-btn-container { 
    padding: 0 14px 14px; 
    text-align: center; 
}
.btn-check-more { 
    width: 100%; 
    padding: 8px 0; 
    background: #f8fafc; 
    color: #475569; 
    border: 1px solid #e2e8f0; 
    border-radius: 10px; 
    font-size: 13px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    gap: 6px; 
    box-sizing: border-box; 
}
.btn-check-more:hover { 
    background: #f1f5f9; 
    color: #1e293b; 
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* ================= 响应式调整 (手机端核心优化区) ================= */
@media (max-width: 768px) {
    .header-container { 
        padding: 10px 12px; 
        gap: 12px; 
        flex-direction: column; 
        display: flex;
    }
    .header-container .action-buttons { 
        order: 1; 
        width: 100%; 
        flex-wrap: nowrap; 
        justify-content: space-between; 
        gap: 8px; 
    }
    .header-container .search-box { 
        order: 2; 
        width: 100%; 
        min-width: unset; 
    }
    
    .btn { 
        flex: 1 1 0; width: auto; min-width: 0; 
        height: 40px; padding: 4px; font-size: 12px; 
    }
    
    .filter-container { padding: 4px 12px 8px; gap: 6px; }
    .filter-btn { padding: 5px 12px; font-size: 12px; }
    
    .sub-category-image-grid { 
        padding: 0px 12px 8px; 
        gap: 8px; 
    }
    .sub-cat-img-wrapper { 
        width: 32px; 
        height: 32px; 
        border-radius: 8px; 
    }
    .all-icon { 
        font-size: 9px; 
    }
    
    .grid-container { 
        padding: 4px 10px 20px; 
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 10px; 
    }
    .info-box { padding: 10px 10px 8px; } 
    .product-title { font-size: 12px; -webkit-line-clamp: 2; }
    .product-price { font-size: 16px; margin-top: 4px; }
    .qc-btn-container { padding: 0 10px 10px; }
    
    /* 手机端稍微缩小悬浮角标，避免挡住太多图片细节 */
    .version-badge {
        top: 8px;
        left: 8px;
        padding: 3px 6px;
        font-size: 9px;
    }
}

/* ================= 迎新优惠弹窗 ================= */
@keyframes popupZoom { 0% { opacity: 0; transform: scale(0.85) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes floatLogo { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-5px) rotate(3deg); } }

.promo-popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.promo-popup-wrapper { width: 310px; max-width: 88vw; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: popupZoom 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.promo-card { width: 100%; border-radius: 26px; overflow: visible; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); position: relative; }
.promo-top { background: linear-gradient(135deg, #ffffff 0%, #f4f5f7 100%); padding: 24px 22px 38px 22px; border-radius: 26px 26px 0 0; display: flex; justify-content: space-between; align-items: center; position: relative; }
.promo-welcome-info { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.promo-welcome-sub { font-size: 11px; font-weight: 800; color: #909399; letter-spacing: 1.2px; }
.promo-brand-name { font-size: 20px; font-weight: 900; color: #111; margin: 3px 0 8px 0; }
.promo-slogan { display: inline-block; background: #ffeef0; color: #ff4757; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(255, 71, 87, 0.2); }
.promo-logo-img { width: 64px; height: 64px; flex-shrink: 0; object-fit: contain; background: #fff; border-radius: 18px; padding: 6px; box-shadow: 0 8px 20px rgba(255, 71, 87, 0.18); animation: floatLogo 3s ease-in-out infinite; }
.promo-bottom { background: linear-gradient(160deg, #1e1e24 0%, #111115 100%); color: #fff; padding: 26px 22px 24px 22px; border-radius: 24px; margin-top: -22px; position: relative; z-index: 2; text-align: center; box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.promo-discount-tag { font-size: 10px; font-weight: 800; color: #ff6b81; letter-spacing: 2px; margin-bottom: 4px; }
.promo-big-title { font-size: 40px; font-weight: 900; line-height: 1.05; letter-spacing: -1px; margin-bottom: 4px; text-shadow: 0 4px 15px rgba(255, 71, 87, 0.4); }
.promo-big-title .highlight-num { background: linear-gradient(135deg, #ff4757 0%, #ff8f50 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.promo-sub-title { font-size: 18px; font-weight: 800; color: #ffffff; margin-bottom: 20px; letter-spacing: 0.5px; }
.promo-cta-btn { display: block; width: 85%; margin: 0 auto; padding: 12px 0; background: linear-gradient(90deg, #ff4757 0%, #ff6b81 100%); color: #fff; font-size: 15px; font-weight: 800; text-decoration: none; border-radius: 30px; box-shadow: 0 8px 20px rgba(255, 71, 87, 0.4); transition: transform 0.2s, box-shadow 0.2s; }
.promo-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(255, 71, 87, 0.55); }
.promo-close-circle { margin: 18px auto 0 auto !important; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); border: 1.5px solid rgba(255, 255, 255, 0.6); color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.promo-close-circle:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

@media (min-width: 768px) {
    .promo-popup-wrapper { width: 440px; }
    .promo-card { border-radius: 34px; }
    .promo-top { padding: 34px 34px 52px 34px; border-radius: 34px 34px 0 0; }
    .promo-welcome-sub { font-size: 14px; letter-spacing: 1.8px; }
    .promo-brand-name { font-size: 28px; margin: 5px 0 12px 0; }
    .promo-slogan { font-size: 15px; padding: 6px 16px; }
    .promo-logo-img { width: 88px; height: 88px; border-radius: 24px; padding: 8px; }
    .promo-bottom { padding: 36px 34px 34px 34px; border-radius: 32px; margin-top: -28px; }
    .promo-discount-tag { font-size: 13px; letter-spacing: 2.5px; margin-bottom: 6px; }
    .promo-big-title { font-size: 56px; margin-bottom: 6px; }
    .promo-sub-title { font-size: 24px; margin-bottom: 28px; }
    .promo-cta-btn { padding: 16px 0; font-size: 19px; border-radius: 40px; }
    .promo-close-circle { margin-top: 24px !important; width: 44px; height: 44px; font-size: 26px; }
}