/* ================= 基础全局变量 ================= */
:root { 
    --bg-color: #f5f6f8; 
    --primary-red: #ff4d4f; 
    --primary-blue: #3b82f6; 
    --primary-green: #67c23a;
    --text-main: #333333; 
    --text-sub: #888888; 
    --border-color: #ebeef5;
}
body { margin: 0; font-family: 'Helvetica Neue', Arial, sans-serif; background-color: var(--bg-color); color: var(--text-main); }
a { text-decoration: none; color: inherit; }

/* ================= 头部导航区域 (PC端/全局) ================= */
.sticky-header { 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    background-color: var(--bg-color); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
    padding-bottom: 5px; 
}
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; gap: 20px; flex-wrap: wrap;}

.search-box { flex: 1; min-width: 250px; position: relative; }
.search-box input { width: 100%; padding: 12px 20px 12px 40px; border-radius: 25px; border: 1px solid #e5e7eb; outline: none; font-size: 14px; box-sizing: border-box; transition: box-shadow 0.3s; }
.search-box input:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); border-color: #93c5fd; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }

.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { padding: 12px 24px; border-radius: 25px; font-weight: bold; font-size: 14px; text-align: center; transition: transform 0.2s, opacity 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;}
.btn:hover { transform: translateY(-2px); opacity: 0.9; }
.btn-invite { flex: 1; background: linear-gradient(135deg, #ff6b6b, #ff4d4f); color: white; box-shadow: 0 4px 10px rgba(255, 77, 79, 0.3); }
.btn-tutorial { background: white; color: var(--primary-blue); border: 2px solid var(--primary-blue); }

/* ================= 一级分类过滤器 ================= */
.filter-container { padding: 10px 40px 10px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.filter-container::-webkit-scrollbar { display: none; }
.filter-btn { padding: 10px 24px; border-radius: 25px; background: white; border: 1px solid #e5e7eb; color: var(--text-main); font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.3s ease; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); font-size: 14px; text-transform: uppercase; }
.filter-btn:hover { border-color: var(--primary-blue); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.12); }
.filter-btn.active { background: #1a1a1a; color: white; border-color: #1a1a1a; box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.cat-icon { font-size: 16px; line-height: 1; }

/* ================= 二级子分类过滤器 ================= */
.sub-filter-container { padding: 0 40px 15px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.sub-filter-container::-webkit-scrollbar { display: none; }
.sub-filter-btn { padding: 6px 16px; border-radius: 20px; background: #f0f2f5; border: 1px solid transparent; color: #606266; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; font-size: 12px; }
.sub-filter-btn:hover { background: #ffffff; border-color: #1a1a1a; color: #1a1a1a; }
.sub-filter-btn.active { background: #1a1a1a; color: white; border-color: #1a1a1a; font-weight: bold; }

/* ================= A-Z 侧边索引栏 ================= */
.az-indexer {
    position: fixed !important;
    right: 4px !important;
    top: 55% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    z-index: 9999 !important;
    background: rgba(244, 245, 248, 0.85) !important;
    backdrop-filter: blur(4px) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 2px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}
.az-letter {
    font-size: 10px !important;
    font-weight: bold !important;
    color: #888 !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 2px 0 !important;
    border-radius: 50% !important;
    transition: all 0.2s !important;
}
.az-letter:hover {
    background: var(--primary-blue) !important;
    color: white !important;
}
/* 新增：当前字母激活高亮状态 */
.az-letter.active {
    background: var(--primary-blue) !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4) !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: 12px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent; height: 100%; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--border-color); }
.product-card > a { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.product-content { display: flex; flex-direction: column; flex: 1; }
.image-box { width: 100%; padding-top: 100%; position: relative; background-color: #f9fafb; }
.product-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.info-box { padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; }
.product-title { font-size: 14px; color: var(--text-main); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.product-price { font-size: 16px; font-weight: bold; color: var(--primary-red); margin: 0; white-space: nowrap; }

/* ================= QC 按钮 ================= */
.qc-btn-container { padding: 10px 15px 15px; text-align: center; }
.btn-check-more { width: 100%; padding: 9px 0; background: #f4f5f8; color: #4b5563; border: 1px solid transparent; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-flex; justify-content: center; align-items: center; gap: 6px; box-sizing: border-box; text-decoration: none; }
.btn-check-more:hover { background: #ffffff; color: var(--primary-blue); border-color: rgba(59, 130, 246, 0.3); box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12); transform: translateY(-2px); }
.btn-check-more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= 质检图相册 (qc.html) ================= */
.qc-header { position: sticky; top: 0; padding: 12px 15px; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; z-index: 100; min-height: 54px; box-sizing: border-box; }
.qc-header h1 { margin: 0 10px; font-size: 16px; font-weight: 600; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: center; }
.back-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #4b5563; text-decoration: none; background: #f4f5f8; padding: 8px 14px; border-radius: 20px; font-size: 14px; font-weight: bold; border: 1px solid transparent; transition: all 0.2s; white-space: nowrap; }
.back-btn svg { width: 16px; height: 16px; margin-right: 4px; }
.back-btn:hover { background: white; border-color: rgba(59, 130, 246, 0.3); color: #3b82f6; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1); }
.header-spacer { width: 75px; flex-shrink: 0; }
.gallery { padding: 30px 20px; display: flex; flex-direction: column; align-items: center; gap: 30px; max-width: 800px; margin: 0 auto; }
.qc-item { width: 100%; background: white; padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); box-sizing: border-box; }
.qc-img { width: 100%; height: auto; border-radius: 8px; display: block; }
.loader { margin-top: 100px; font-size: 16px; color: #888; text-align: center;}

/* ================= 响应式调整 (手机端) ================= */
@media (max-width: 768px) {
    .sticky-header, .header-container { 
        display: contents; 
    }
    
    #app {
        display: flex;
        flex-direction: column;
    }

    .search-box {
        order: 1;
        position: sticky;
        top: 0;
        z-index: 1002;
        background-color: var(--bg-color);
        padding: 15px 15px 10px 15px;
        height: 69px; 
        box-sizing: border-box;
    }
    .search-box input {
        height: 44px;
        padding: 0 20px 0 40px; 
    }

    .action-buttons {
        order: 2;
        position: static; 
        padding: 5px 15px 15px; 
        display: flex;
        gap: 12px;
        background-color: var(--bg-color);
    }

    .filter-container {
        order: 3;
        position: sticky;
        top: 69px; 
        z-index: 1001;
        background-color: var(--bg-color);
        padding: 10px 15px;
        height: 60px;
        box-sizing: border-box;
    }
    .filter-btn {
        height: 40px;
        padding: 0 24px;
        display: inline-flex;
        align-items: center;
    }

    .sub-filter-container {
        order: 4;
        position: sticky;
        top: 129px; 
        z-index: 1000;
        background-color: var(--bg-color);
        padding: 0 15px 15px;
        height: 45px;
        box-sizing: border-box;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
    }
    .sub-filter-btn {
        height: 30px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
    }

    .grid-container {
        order: 5;
        padding: 5px 35px 30px 15px !important;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .product-title { font-size: 12px; -webkit-line-clamp: 1; }
    .product-price { font-size: 14px; }
}