/* ==========================================================
   锋火电竞 - 前台样式（移动端优先 / 简约高级）
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: #f5f6f8;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { border: 0; vertical-align: middle; }

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ---------- 首页：分类区块 ---------- */
.category-section { margin-bottom: 34px; }

.category-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .5px;
    margin: 0 4px 16px;
    color: #17181a;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.product-card {
    display: block;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(20, 24, 32, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.product-card:active { transform: scale(.97); }

.product-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef0f3;
}

.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 无封面占位 */
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f2f4f7, #e6e9ee);
}

.cover-placeholder svg { width: 34px; height: 34px; stroke: #b6bcc6; }

.product-name {
    padding: 10px 6px;
    text-align: center;
    font-size: 14px;
    color: #33363b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-tip {
    padding: 26px 0;
    text-align: center;
    color: #9aa0a8;
    font-size: 13px;
}

/* ---------- 二级页：顶栏 ---------- */
.page-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 50px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

.page-header .back-btn {
    position: absolute;
    left: 10px;
    top: 0;
    height: 50px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.page-header .back-btn svg { width: 22px; height: 22px; stroke: #17181a; }

.page-header .page-title {
    font-size: 17px;
    font-weight: 600;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 二级页：规格分栏 ---------- */
.spec-tabs {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    margin-top: 12px;
    padding: 0 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: 0 2px 10px rgba(20, 24, 32, .05);
}

.spec-tabs::-webkit-scrollbar { display: none; }

.spec-tab {
    flex: 0 0 auto;
    padding: 14px 20px 11px;
    font-size: 15px;
    color: #60656d;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease;
}

.spec-tab.active {
    color: #1e9fff;
    font-weight: 600;
    border-bottom-color: #1e9fff;
}

/* ---------- 二级页：规格图片流 ---------- */
.spec-images {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: 0 2px 10px rgba(20, 24, 32, .05);
}

.spec-images img {
    width: 100%;
    display: block;
}

.spec-loading {
    padding: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-loading svg {
    width: 26px;
    height: 26px;
    stroke: #1e9fff;
    animation: fh-spin .9s linear infinite;
}

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

/* ---------- 桌面端微调 ---------- */
@media (min-width: 768px) {
    .container { padding-top: 32px; }
    .product-grid { gap: 16px; }
    .category-title { font-size: 26px; }
}
