/* ===========================================
   麦兜账号商城 · 引导页样式
   重构 2026-06-10：商品分类卡 + 主/副站点 + 悬浮滚动客服条
   移动优先 · 纯 HTML/CSS · 无外部依赖
   =========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    word-wrap: break-word;
}

:root {
    --c-bg-from: #ff7e5f;
    --c-bg-to: #feb47b;
    --c-card: #ffffff;
    --c-text: #2c2c2c;
    --c-muted: #707070;
    --c-accent: #ff6b35;
    --c-accent-dark: #e2522a;
    --c-tip: #fff8f1;
    --c-border: #f0e9e2;

    /* 商品主题色 */
    --g-match: #f59f00;
    --g-rank: #e8590c;
    --g-forever: #7048e8;
    --g-delta: #0ca678;
    --g-naraka: #e03131;
    --g-unlock: #1c7ed6;
    --g-pubg-tech: #f43f5e;
    --g-delta-tech: #7c3aed;

    --radius-card: 24px;
    --radius-btn: 16px;
    --kf-h: 46px;
    --shadow-card: 0 14px 44px rgba(255, 107, 53, 0.20), 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.08);
}

html, body {
    width: 100%;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
                 "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--c-text);
    background: transparent; /* 背景由 #bg-layer 负责 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* 底部预留悬浮客服条空间 */
    padding: 24px 16px calc(var(--kf-h) + 24px + env(safe-area-inset-bottom));
}

/* ===========================================
   全屏背景层（渐变 + 可选背景图）
   =========================================== */
#bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    /* 游戏主题背景图（移动端轻量版 bg-m.jpg）+ 品牌橙→暗色遮罩，
       遮罩保证白卡内容与白色粒子清晰可读 */
    background-image:
        linear-gradient(135deg, rgba(226, 82, 42, 0.42) 0%, rgba(18, 10, 4, 0.62) 100%),
        url("img/bg-m.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* PC端：高清背景图 bg.jpg + 略轻遮罩 */
@media (min-width: 840px) {
    #bg-layer {
        background-image:
            linear-gradient(135deg, rgba(226, 82, 42, 0.34) 0%, rgba(18, 10, 4, 0.55) 100%),
            url("img/bg.jpg");
    }
}

/* 粒子动画画布 */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.65; /* 手机端略低透明度 */
}

@media (min-width: 840px) {
    #bg-canvas { opacity: 1; }
}

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

a:focus-visible {
    outline: 3px solid rgba(255, 107, 53, 0.55);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ----- 主卡片 ----- */
.page {
    width: 100%;
    max-width: 600px;
}

.card {
    position: relative;
    background: var(--c-card);
    border-radius: var(--radius-card);
    padding: 64px 22px 26px;
    margin-top: 52px;
    box-shadow: var(--shadow-card);
}

/* ----- 头像 ----- */
.avatar {
    position: absolute;
    top: -52px;
    left: 50%;
    transform: translateX(-50%);
}

.avatar img {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 8px 22px rgba(255, 107, 53, 0.28);
    display: block;
}

/* ----- 标题区 ----- */
.hero {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 27px;
    font-weight: 800;
    color: #2b2b2b;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero .subtitle {
    font-size: 16px;
    color: #6a6a6a;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.badges li {
    font-size: 12px;
    color: var(--c-accent-dark);
    background: var(--c-tip);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    padding: 5px 11px;
    white-space: nowrap;
}

.hero .hotline {
    display: inline-block;
    padding: 6px 16px;
    background: var(--c-tip);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--c-muted);
}

.hero .hotline b {
    color: var(--c-accent);
    margin-left: 4px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ----- 站点入口（主/副站） ----- */
.sites {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.site {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 14px;
    border-radius: var(--radius-btn);
    color: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    will-change: transform;
}

.site-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.22);
}

.site-icon svg { width: 21px; height: 21px; }

.site-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.site-name { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.site-sub { font-size: 11.5px; opacity: 0.92; margin-top: 2px; }
.site-go { font-size: 22px; font-weight: 700; opacity: 0.85; }

.site-main { background: linear-gradient(135deg, #f8922d 0%, #ff2f00 100%); }
.site-sub2 { background: linear-gradient(135deg, #4dabf7 0%, #1971c2 100%); }

.site:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); }
.site:active { transform: translateY(0); filter: brightness(0.96); }

/* ----- 商品专区 ----- */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #333;
    margin: 4px 2px 14px;
    position: relative;
    padding-left: 13px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--c-accent), var(--c-accent-dark));
}

.section-title small {
    font-size: 12px;
    font-weight: 500;
    color: var(--c-muted);
}

.products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.product {
    --g: var(--c-accent);
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-left: 5px solid var(--g);
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    will-change: transform;
}

.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--g);
}

.product:active { transform: translateY(0); }

.p-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--g);
    background: color-mix(in srgb, var(--g) 14%, #fff);
}

.p-icon svg { width: 25px; height: 25px; }

/* 游戏海报图标：铺满圆角方块 */
.p-icon { overflow: hidden; }
.p-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.p-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.p-game {
    font-size: 11px;
    font-weight: 700;
    color: var(--g);
    letter-spacing: 0.5px;
    text-transform: none;
}

.p-name {
    font-size: 15.5px;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1.3;
}

.p-desc {
    font-size: 12px;
    color: var(--c-muted);
    line-height: 1.4;
}

.p-go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--g);
    background: color-mix(in srgb, var(--g) 12%, #fff);
    border-radius: 999px;
    padding: 7px 11px;
    white-space: nowrap;
    transition: background 0.18s ease, gap 0.18s ease;
}

.p-go i { font-style: normal; font-size: 15px; line-height: 1; }

.product:hover .p-go { gap: 5px; background: color-mix(in srgb, var(--g) 20%, #fff); }

/* 商品主题色 */
.p-match      { --g: var(--g-match); }
.p-rank       { --g: var(--g-rank); }
.p-forever    { --g: var(--g-forever); }
.p-delta      { --g: var(--g-delta); }
.p-naraka     { --g: var(--g-naraka); }
.p-unlock     { --g: var(--g-unlock); }
.p-pubg-tech  { --g: var(--g-pubg-tech); }
.p-delta-tech { --g: var(--g-delta-tech); }

/* 不支持 color-mix 的浏览器兜底 */
@supports not (color: color-mix(in srgb, red 10%, white)) {
    .p-icon { background: var(--c-tip); }
    .p-go { background: var(--c-tip); }
}

/* ----- 公告 ----- */
.notice {
    background: var(--c-tip);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.notice p { font-size: 13.5px; color: #594030; line-height: 1.7; }
.notice p + p { margin-top: 6px; }
.notice b { color: var(--c-accent-dark); font-weight: 800; }

/* ----- 收藏提示 ----- */
.tips { text-align: center; padding: 2px 0; }

.tips p { font-size: 13px; color: var(--c-muted); line-height: 1.9; }

.tips p b {
    display: inline-block;
    padding: 2px 9px;
    margin: 3px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 7px;
    color: #333;
    font-weight: 600;
}

.tips .muted { font-size: 12px; color: #999; margin-top: 4px; }

/* ----- 底部 ----- */
.footer {
    text-align: center;
    margin: 20px 0 0;
    padding: 18px 16px;
    background: #fff3cd;
    border: 1px solid #ffd966;
    border-radius: 18px;
    color: #856404;
}

.footer p { font-size: 13.5px; letter-spacing: 0.5px; line-height: 1.7; }

.footer .brand-line {
    font-size: 18px;
    font-weight: 800;
    color: var(--c-accent-dark);
    margin-bottom: 4px;
}

.footer .icp a {
    color: #856404;
    border-bottom: 1px dashed #b88e2b;
    padding-bottom: 1px;
}

.footer .icp a:hover { color: var(--c-accent-dark); }

/* ===========================================
   悬浮滚动客服售后条（固定底部）
   =========================================== */
.kf-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    height: calc(var(--kf-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    color: #fff;
    background: linear-gradient(90deg, #e2522a 0%, #ff6b35 50%, #f8922d 100%);
    box-shadow: 0 -6px 20px rgba(226, 82, 42, 0.35);
    overflow: hidden;
}

.kf-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

.kf-tag svg { width: 18px; height: 18px; }

.kf-marquee {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.kf-track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: kf-scroll 26s linear infinite;
}

.kf-seg {
    font-size: 13.5px;
    line-height: var(--kf-h);
    padding-right: 1.5rem;
}

.kf-go {
    flex: 0 0 auto;
    margin-right: 12px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 800;
    background: #fff;
    color: var(--c-accent-dark);
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kf-bar:hover .kf-track { animation-play-state: paused; }
.kf-bar:active { filter: brightness(0.96); }

@keyframes kf-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ===========================================
   响应式
   =========================================== */
/* ≥ 600px：商品两列、站点入口更舒展 */
@media (min-width: 600px) {
    .products { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 64px 28px 30px; }
}

/* 小屏微调 */
@media (max-width: 360px) {
    .card { padding: 60px 15px 22px; }
    .hero h1 { font-size: 23px; }
    .hero .subtitle { font-size: 14px; }
    .p-name { font-size: 14.5px; }
    .p-go { padding: 6px 9px; }
    .kf-tag span { display: none; }
}

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .site, .product, .p-go, .kf-track { transition: none; animation: none; }
    .site:hover, .product:hover { transform: none; }
    .kf-track { animation: none; }
}

/* ===========================================
   选号图鉴入口卡（首页 products 下方）
   =========================================== */
.catalog-entry {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 16px;
    background: linear-gradient(135deg, #fff9f5 0%, #fff5ec 100%);
    border: 1.5px dashed var(--c-accent);
    border-radius: 14px;
    margin-bottom: 18px;
    color: var(--c-accent-dark);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    will-change: transform;
}

.catalog-entry:hover {
    background: linear-gradient(135deg, #fff3e8 0%, #ffead6 100%);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.18);
    transform: translateY(-1px);
}

.catalog-entry:active { transform: translateY(0); }

.catalog-entry-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: var(--c-accent);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
}

.catalog-entry-icon svg { width: 22px; height: 22px; }

.catalog-entry-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.catalog-entry-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--c-accent-dark);
    line-height: 1.3;
}

.catalog-entry-sub {
    font-size: 12px;
    color: var(--c-muted);
}

.catalog-entry-go {
    font-size: 24px;
    font-weight: 700;
    color: var(--c-accent);
    line-height: 1;
}

/* ===========================================
   PC 大屏专属布局（≥ 840px）
   =========================================== */
@media (min-width: 840px) {
    body {
        padding: 40px 40px 48px;
    }

    .page {
        max-width: 920px;
    }

    .card {
        padding: 80px 52px 42px;
        margin-top: 66px;
    }

    .avatar {
        top: -66px;
    }

    .avatar img {
        width: 120px;
        height: 120px;
    }

    .hero h1 { font-size: 36px; }
    .hero .subtitle { font-size: 18px; letter-spacing: 3px; }
    .badges li { font-size: 13px; padding: 6px 14px; }
    .hero .hotline { font-size: 14px; }

    .sites {
        gap: 18px;
        margin-bottom: 28px;
    }

    .site { padding: 18px 20px; gap: 14px; }
    .site-name { font-size: 18px; }
    .site-sub { font-size: 13px; }

    .section-title { font-size: 20px; }

    .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
        margin-bottom: 26px;
    }

    .notice { padding: 16px 20px; margin-bottom: 20px; }
    .notice p { font-size: 14.5px; }

    .footer { padding: 20px 24px; }
    .footer .brand-line { font-size: 20px; }

    /* PC 使用漂浮客服小窗，隐藏底部横幅 */
    .kf-bar { display: none; }
}

/* ===========================================
   PC 漂浮客服小窗
   =========================================== */
.kf-float {
    display: none;
    position: fixed;
    z-index: 300;
    width: 82px;
    will-change: left, top;
}

.kf-float a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px 12px;
    background: linear-gradient(145deg, #ff6b35 0%, #e2522a 100%);
    border-radius: 18px;
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(226, 82, 42, 0.45);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.kf-float a:hover {
    box-shadow: 0 14px 32px rgba(226, 82, 42, 0.65);
    transform: scale(1.08);
}

.kf-float-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.kf-float-icon svg { width: 26px; height: 26px; }

.kf-float-label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.kf-float-sub {
    display: block;
    font-size: 10px;
    opacity: 0.85;
    line-height: 1.3;
}

@media (min-width: 840px) {
    .kf-float { display: block; }
}

/* ===========================================
   暗色模式
   =========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --c-bg-from: #1a0d00;
        --c-bg-to: #2d1a06;
        --c-card: #1e1e1e;
        --c-text: #e8e0d8;
        --c-muted: #9a8e84;
        --c-tip: #2a1e14;
        --c-border: #3a2e24;
    }

    #bg-layer { background: linear-gradient(135deg, #1a0d00 0%, #2d1a06 100%); }

    .card { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5); }

    .hero h1 { color: #f0e8e0; }
    .hero .subtitle { color: #b0a09a; }
    .badges li { color: #ffb080; background: #2a1e14; border-color: #4a3020; }
    .hero .hotline { background: #2a1e14; border-color: #3a2e24; }

    .section-title { color: #f0e0d0; }
    .section-title small { color: #9a8e84; }

    .product {
        background: #252525;
        border-color: #3a2e24;
    }

    .p-icon { background: #2a2a2a; }
    .p-name { color: #f0e0d0; }
    .p-desc { color: #9a8e84; }

    .notice {
        background: #2a1e14;
        border-color: #3a2e24;
    }
    .notice p { color: #c0a080; }

    .tips p { color: #9a8e84; }
    .tips p b { background: #252525; border-color: #3a2e24; color: #d0c0b0; }
    .tips .muted { color: #6a5e54; }

    .footer {
        background: #2a2000;
        border-color: #4a3a00;
        color: #c0a840;
    }
    .footer .brand-line { color: #ffb060; }
    .footer .icp a { color: #c0a840; border-bottom-color: #806820; }

    .catalog-entry {
        background: linear-gradient(135deg, #2a1e14, #241808);
        border-color: #c05020;
    }
    .catalog-entry:hover { background: linear-gradient(135deg, #301e10, #281c0a); }
    .catalog-entry-title { color: #ff8040; }
    .catalog-entry-sub { color: #9a8e84; }
}
