/* =====================================================================
   小游戏商店 · 移动优先 + iOS 玻璃拟态
   支持 RTL（维吾尔语）
   ---------------------------------------------------------------------
   设计原则：
     1. 手机优先：先按 320~430px 布局，再逐级放大
     2. 玻璃要「浮起来」：背景压暗、卡片提亮，拉开对比
     3. 层级清晰：一屏内只留一个视觉焦点
   ===================================================================== */

/* =====================================================================
   一、维吾尔语字体：UKIJ Tuz Tom
   ---------------------------------------------------------------------
   维吾尔语计算机协会（UKIJ）发布的经典维语字体，维语圈最通用。
   内嵌后不依赖访问者系统字体，任何设备上字形都一致。
   164 KB TTF → 66 KB WOFF2。
   详见 assets/fonts/NOTICE.txt
   ---------------------------------------------------------------------
   只声明 400 一个字重：UKIJ Tuz Tom 本身只有一个字重，
   若把同一个文件同时声明成 400 和 700，浏览器会认为「粗体已存在」，
   反而不做加粗，标题与正文就失去层次。
   只声明 400 时，浏览器会对 font-weight:700 的文字自动合成粗体。
   ===================================================================== */
@font-face {
    font-family: "UKIJ Tuz Tom";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/UKIJTuzTom.woff2") format("woff2"),
    url("../fonts/UKIJTuzTom.ttf") format("truetype");
}

/* =====================================================================
   二、设计令牌
   ===================================================================== */
:root {
    /* 背景层（压暗，让玻璃浮起来） */
    --bg: #04060d;
    --bg-2: #070b16;

    /* 玻璃层 */
    --glass: rgba(255, 255, 255, .055);
    --glass-2: rgba(255, 255, 255, .085);
    --glass-3: rgba(255, 255, 255, .12);
    --brd: rgba(255, 255, 255, .09);
    --brd-2: rgba(255, 255, 255, .16);
    --brd-3: rgba(255, 255, 255, .26);

    /* 文字 */
    --txt: #f2f4fb;
    --txt-2: rgba(242, 244, 251, .62);
    --txt-3: rgba(242, 244, 251, .38);

    /* 品牌色 */
    --brand: #6d7cff;
    --brand-2: #a86bff;
    --grad: linear-gradient(135deg, #6d7cff 0%, #a86bff 100%);
    --ok: #34d399;
    --bad: #ff6b81;
    --warn: #fbbf24;

    /* 圆角 */
    --r-xl: 24px;
    --r-lg: 20px;
    --r-md: 15px;
    --r-sm: 11px;

    /* 阴影 */
    --sh: 0 16px 44px rgba(0, 0, 0, .5);
    --sh-sm: 0 6px 20px rgba(0, 0, 0, .32);
    --sh-glow: 0 10px 30px rgba(109, 124, 255, .35);

    /* 字体 */
    /* 全站统一 UKIJ Tuz Tom；万一加载失败，逐级回退到系统维语字体 */
    --font: "UKIJ Tuz Tom", "UKIJ Tuz", "UKIJ Ekran", "Alkatip",
    "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Roboto,
    Helvetica, Arial, sans-serif;
    /* 长文也用同一套，保持全站字形统一 */
    --font-reading: "UKIJ Tuz Tom", "UKIJ Tuz", "Noto Naskh Arabic",
    "Segoe UI", serif;

    /* 头部与底部导航高度 */
    --top-h: 56px;
    --tab-h: 66px;

    color-scheme: dark;
}

/* =====================================================================
   三、基础
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.8;
    color: var(--txt);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- 背景：极光光斑 + 细颗粒（压暗、低饱和，保证玻璃对比） --- */
.bg-orbs, .aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(120% 70% at 100% 0%, rgba(80, 70, 190, .28) 0%, transparent 55%),
        radial-gradient(110% 60% at 0% 100%, rgba(120, 60, 180, .22) 0%, transparent 55%),
        linear-gradient(175deg, var(--bg-2) 0%, var(--bg) 45%, #05070f 100%);
}
.bg-orbs i, .aurora i {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .3;
    animation: float 22s ease-in-out infinite;
}
.bg-orbs i:nth-child(1), .aurora i:nth-child(1) {
    width: 300px; height: 300px; background: #4b56ff; top: -70px; inset-inline-end: -80px;
}
.bg-orbs i:nth-child(2), .aurora i:nth-child(2) {
    width: 260px; height: 260px; background: #8b3ce8; bottom: -80px; inset-inline-start: -90px;
    animation-delay: -8s; opacity: .24;
}
.bg-orbs i:nth-child(3), .aurora i:nth-child(3) {
    width: 220px; height: 220px; background: #1e9fd8; top: 38%; inset-inline-start: 45%;
    animation-delay: -14s; opacity: .14;
}
@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-24px, 30px, 0) scale(1.14); }
}
/* 细颗粒：让纯色渐变不那么「塑料」 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; line-height: 1.5; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15.5px; }
p { margin: 0 0 10px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86em;
    background: rgba(255, 255, 255, .09);
    padding: 2px 7px;
    border-radius: 7px;
    direction: ltr;
    display: inline-block;
    word-break: break-all;
}

.muted { color: var(--txt-2); }
.center { text-align: center; }
.center-x { justify-content: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.big-ico { font-size: 44px; line-height: 1; margin-bottom: 8px; }

/* =====================================================================
   四、布局
   ===================================================================== */
.wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 14px;
}
.wrap.narrow { max-width: 640px; padding-top: 26px; padding-bottom: 50px; }
main.wrap { padding-bottom: 26px; }

/* 手机端给底部悬浮导航留位置 */
@media (max-width: 880px) {
    body { padding-bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px)); }
}

/* =====================================================================
   五、顶部栏
   ===================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 8px 0;
    background: linear-gradient(180deg, rgba(4, 6, 13, .92) 0%, rgba(4, 6, 13, .62) 70%, transparent 100%);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transition: padding .22s ease;
}
/* 滚动后顶栏收窄，把空间让给内容 */
.site-header.scrolled { padding: 4px 0; }
.site-header.scrolled .topbar { height: 48px; box-shadow: 0 8px 26px rgba(0, 0, 0, .45); }
.topbar { transition: height .22s ease, box-shadow .22s ease; }
.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--top-h);
    padding: 0 10px 0 12px;
    border-radius: var(--r-lg);
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--brd);
    box-shadow: var(--sh-sm);
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 16px;
    color: var(--txt);
    flex: 0 0 auto;
    min-width: 0;
}
.brand-logo {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 11px;
    font-size: 17px;
    background: var(--grad);
    box-shadow: var(--sh-glow);
    flex: 0 0 auto;
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 桌面导航 */
.topnav { display: flex; gap: 2px; margin-inline-start: 8px; }
.topnav-link {
    padding: 8px 13px;
    border-radius: 12px;
    font-size: 14.5px;
    color: var(--txt-2);
    white-space: nowrap;
    transition: background .18s, color .18s;
}
.topnav-link:hover { color: var(--txt); background: var(--glass-2); }
.topnav-link.active { color: #fff; background: var(--glass-3); font-weight: 700; }

.topbar-actions { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; }

.icon-btn {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--glass-2);
    border: 1px solid var(--brd);
    color: var(--txt);
    font-size: 15px;
    flex: 0 0 auto;
    transition: background .18s;
}
.icon-btn:hover { background: var(--glass-3); }

.user-chip {
    display: flex; align-items: center; gap: 7px;
    padding: 4px 11px 4px 5px;
    border-radius: 30px;
    background: var(--glass-2);
    border: 1px solid var(--brd);
    max-width: 150px;
}
.user-chip img {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
    background: #2a3350;
}
.user-chip span {
    font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* =====================================================================
   六、底部悬浮标签栏（手机端）
   ===================================================================== */
.tabbar {
    display: none;
    position: fixed;
    z-index: 70;
    inset-inline: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    border-radius: var(--r-xl);
    background: rgba(10, 14, 28, .74);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--brd-2);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
}
.tabbar-inner { display: flex; gap: 3px; }
.tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 2px 7px;
    border-radius: 17px;
    color: var(--txt-3);
    font-size: 10.5px;
    line-height: 1.4;
    transition: color .2s, background .2s;
    position: relative;
}
.tab-ico { font-size: 19px; line-height: 1; transition: transform .2s; }
.tab.active { color: #fff; background: var(--glass-3); font-weight: 700; }
.tab.active .tab-ico { transform: translateY(-2px); }
.tab-badge {
    position: absolute; top: 5px; inset-inline-end: 50%;
    margin-inline-end: -22px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #ff4d6d; color: #fff;
    font-size: 10px; font-weight: 700; display: grid; place-items: center;
}

/* =====================================================================
   七、玻璃卡片
   ===================================================================== */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    backdrop-filter: blur(22px) saturate(165%);
    border: 1px solid var(--brd);
    border-radius: var(--r-lg);
    box-shadow: var(--sh);
    position: relative;
}
.glass::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
    pointer-events: none;
}
.card { padding: 16px; margin: 12px 0; }

.section-head { display: flex; align-items: center; gap: 10px; margin: 24px 0 13px; }
.section-head h2 {
    margin: 0; font-size: 17px;
    display: flex; align-items: center; gap: 9px;
}
/* 标题前的小色条，增强区块辨识度 */
.section-head h2::before {
    content: "";
    width: 4px; height: 17px; flex: 0 0 auto;
    border-radius: 3px;
    background: var(--grad);
    box-shadow: 0 0 12px rgba(109, 124, 255, .5);
}
.section-head .line { display: none; }
.section-head .more {
    font-size: 12.5px; color: var(--txt-2);
    margin-inline-start: auto; white-space: nowrap;
    padding: 5px 11px; border-radius: 30px;
    background: var(--glass-2); border: 1px solid var(--brd);
    transition: background .18s, color .18s;
}
.section-head .more:hover { background: var(--glass-3); color: var(--txt); }

/* =====================================================================
   八、按钮
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--brd-2);
    background: var(--glass-2);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--txt);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .14s, background .18s, box-shadow .18s, opacity .18s;
    text-decoration: none;
}
.btn:hover { background: var(--glass-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn.primary {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--sh-glow);
}
.btn.primary:hover { box-shadow: 0 14px 36px rgba(109, 124, 255, .5); }
.btn.ok { background: linear-gradient(135deg, #34d399, #0ea472); border-color: transparent; color: #04220f; }
.btn.danger { background: rgba(255, 107, 129, .14); border-color: rgba(255, 107, 129, .38); color: #ffc0c9; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 26px; font-size: 16px; border-radius: 17px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.xs { padding: 5px 9px; font-size: 12px; border-radius: 9px; }

.btn.wechat {
    background: linear-gradient(135deg, #1aad19, #0e8f4a);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 26px rgba(26, 173, 25, .34);
}
.btn.wechat .wico { font-size: 19px; }

/* =====================================================================
   九、表单
   ===================================================================== */
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; font-size: 13.5px; color: var(--txt-2); margin-bottom: 6px; font-weight: 600; }
.field input[type=text],
.field input[type=password],
.field input[type=number],
.field input[type=url],
.field input[type=search],
.field input[type=file],
.field select,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--brd-2);
    background: rgba(255, 255, 255, .05);
    color: var(--txt);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    transition: border .18s, background .18s, box-shadow .18s;
    -webkit-appearance: none;
    appearance: none;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.9; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: rgba(109, 124, 255, .75);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 3px rgba(109, 124, 255, .16);
}
.field input::placeholder, .field textarea::placeholder { color: var(--txt-3); }
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' fill-opacity='.45' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-inline-start: 34px;
}
.field select option { background: #121a30; color: #fff; }
.field small { display: block; margin-top: 5px; font-size: 12px; }
.text-warn { color: var(--warn) !important; }
.text-ok { color: var(--ok) !important; }
.field input[type=file] { padding: 8px 11px; }
.field input[type=file]::file-selector-button {
    font-family: inherit; font-size: 13.5px; padding: 6px 12px; margin-inline-end: 10px;
    border-radius: 9px; border: 1px solid var(--brd-2);
    background: var(--glass-2); color: var(--txt); cursor: pointer;
}

.grid2, .grid3 { display: grid; grid-template-columns: 1fr; gap: 0; }
/* 分段切换（登录方式 / 标签页） */
.seg {
    display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--brd);
    border-radius: 15px;
}
.seg a {
    flex: 1; text-align: center; padding: 10px 8px;
    border-radius: 11px; font-size: 14px; color: var(--txt-2);
    transition: background .18s, color .18s;
}
.seg a:hover { background: var(--glass-2); color: var(--txt); text-decoration: none; }
.seg a.on { background: var(--grad); color: #fff; font-weight: 700; }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-bottom: 10px; cursor: pointer; }
.checkline input { width: 17px; height: 17px; accent-color: var(--brand); }
.actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* =====================================================================
   十、提示 / 徽章 / 表格
   ===================================================================== */
.alert { border-radius: var(--r-md); padding: 12px 15px; margin: 12px 0; font-size: 14px; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-inline-start: 18px; }
.alert.error   { background: rgba(255, 107, 129, .11); border-color: rgba(255, 107, 129, .4); color: #ffd4da; }
.alert.success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .38); color: #c8f7d8; }
.alert.warn    { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .38); color: #fde9b5; }
.alert.info    { background: rgba(109, 124, 255, .1); border-color: rgba(109, 124, 255, .38); color: #d3e4ff; }

.dbresult {
    margin: 10px 0; padding: 11px 14px; border-radius: var(--r-md);
    font-size: 14px; border: 1px solid var(--brd-2); background: var(--glass);
}
.dbresult.ok  { background: rgba(52, 211, 153, .11); border-color: rgba(52, 211, 153, .42); color: #c8f7d8; }
.dbresult.bad { background: rgba(255, 107, 129, .11); border-color: rgba(255, 107, 129, .42); color: #ffd4da; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 30px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid var(--brd-2);
    background: var(--glass-2);
    color: var(--txt-2);
    white-space: nowrap;
    line-height: 1.7;
}
.badge.ok    { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .38); color: #a7f3c4; }
.badge.bad   { background: rgba(255, 107, 129, .14); border-color: rgba(255, 107, 129, .38); color: #ffc0c9; }
.badge.warn  { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .38); color: #fde68a; }
.badge.brand { background: rgba(109, 124, 255, .16); border-color: rgba(109, 124, 255, .42); color: #cfe0ff; }
.badge.free  { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .42); color: #b9f6ce; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th, .table td { padding: 10px 11px; text-align: start; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.table th { font-size: 11.5px; color: var(--txt-3); font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.table tbody tr:hover { background: rgba(255, 255, 255, .04); }
.table td.actions-cell { white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }

/* =====================================================================
   十一、首页 Hero（移动端紧凑化）
   ===================================================================== */
.hero {
    padding: 22px 18px;
    margin: 6px 0 14px;
    text-align: center;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -60px; inset-inline-start: 50%;
    transform: translateX(50%);
    width: 260px; height: 200px;
    background: radial-gradient(circle, rgba(109, 124, 255, .45), transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}
[dir=ltr] .hero-glow { transform: translateX(-50%); }
.hero h1 {
    position: relative;
    font-size: 25px;
    margin-bottom: 6px;
    letter-spacing: -.3px;
    background: linear-gradient(135deg, #ffffff 20%, #c3caff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    position: relative;
    font-size: 14px;
    color: var(--txt-2);
    margin: 0 auto 16px;
    max-width: 480px;
}
/* 按钮等宽排列，避免两个按钮一长一短 */
.hero .hero-cta {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    max-width: 300px;
    margin: 0 auto;
}
.hero-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--brd);
}
.hero-stats .hs { text-align: center; min-width: 0; }
.hero-stats .hs b { display: block; font-size: 19px; line-height: 1.4; font-weight: 700; }
.hero-stats .hs span {
    display: block; font-size: 11px; color: var(--txt-3); line-height: 1.45;
    word-break: break-word;
}

/* 兼容旧结构 .hero .stat */
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hero .stat {
    padding: 10px 6px; border-radius: var(--r-md);
    background: var(--glass-2); border: 1px solid var(--brd);
    text-align: center; min-width: 0;
}
.hero .stat b { display: block; font-size: 19px; line-height: 1.4; }
.hero .stat span { font-size: 11px; color: var(--txt-3); }

/* =====================================================================
   十二、游戏卡片网格（手机固定 2 列）
   ===================================================================== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.game-card {
    display: flex;
    flex-direction: column;
    border-radius: 17px;
    overflow: hidden;
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid var(--brd);
    box-shadow: var(--sh-sm);
    color: inherit;
    position: relative;
    transition: transform .22s cubic-bezier(.2, .8, .3, 1), border-color .22s, box-shadow .22s;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--brd-3); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
/* 入场动画：轻微上浮 + 逐个错开，观感更精致 */
.game-card {
    animation: cardIn .42s cubic-bezier(.2, .8, .3, 1) both;
}
.game-grid .game-card:nth-child(1) { animation-delay: .02s; }
.game-grid .game-card:nth-child(2) { animation-delay: .06s; }
.game-grid .game-card:nth-child(3) { animation-delay: .10s; }
.game-grid .game-card:nth-child(4) { animation-delay: .14s; }
.game-grid .game-card:nth-child(5) { animation-delay: .18s; }
.game-grid .game-card:nth-child(6) { animation-delay: .22s; }
.game-grid .game-card:nth-child(n+7) { animation-delay: .26s; }
/* 注意：这里刻意用独立的 translate 属性而不是 transform。
   动画的 fill-mode 优先级高于普通声明，若用 transform 会永久盖住
   .game-card:hover 的上浮效果。translate 与 transform 互不冲突。 */
@keyframes cardIn {
    from { opacity: 0; translate: 0 12px; }
    to   { opacity: 1; translate: 0 0; }
}
.game-card .cover {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #1d2547, #2c1c47);
}
.game-card .cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s;
}
.game-card:hover .cover img { transform: scale(1.05); }
.game-card .cover .ph {
    width: 100%; height: 100%; display: grid; place-items: center;
    font-size: 32px; color: rgba(255, 255, 255, .3);
}
.game-card .tags {
    position: absolute;
    top: 7px; inset-inline-start: 7px;
    display: flex; gap: 4px; flex-wrap: wrap;
}
.game-card .tags .badge {
    padding: 2px 7px; font-size: 10.5px;
    background: rgba(6, 9, 18, .68);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.game-card .tags .badge.free { background: rgba(16, 110, 70, .8); color: #d6ffe6; }
.game-card .tags .badge.bad  { background: rgba(150, 30, 55, .8); color: #ffd9e0; }
.game-card .tags .badge.brand{ background: rgba(90, 70, 200, .8); color: #e2dcff; }
.game-card .body {
    padding: 10px 11px 11px;
    display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.game-card .ttl {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card .desc {
    font-size: 11.5px; color: var(--txt-3); line-height: 1.7; margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.game-card .foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; margin-top: 2px;
}
.price { font-size: 14.5px; font-weight: 700; color: #a9bcff; }
.price.free { color: #6ee7a8; }
.price small { font-size: 10.5px; font-weight: 600; opacity: .75; }
.price .old { font-size: 11px; color: var(--txt-3); text-decoration: line-through; font-weight: 500; margin-inline-start: 4px; }
.card-sub {
    font-size: 11px; color: var(--txt-3);
    display: inline-flex; align-items: center; gap: 4px;
    flex: 0 0 auto;
}
/* 内联图标对齐 */
svg.ic { vertical-align: -.14em; flex: 0 0 auto; }
.btn svg.ic { vertical-align: -.16em; }
.card-sub svg.ic { opacity: .75; }

/* =====================================================================
   十三、筛选工具条（搜索 + 分类胶囊）
   ===================================================================== */
.filterbar { padding: 12px; margin: 12px 0 14px; }
.search-row { display: flex; gap: 8px; }
.search-row input[type=search] {
    flex: 1; min-width: 0;
    padding: 11px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--brd-2);
    background: rgba(255, 255, 255, .05);
    color: var(--txt);
    font-family: inherit;
    font-size: 14.5px;
    outline: none;
}
.search-row input[type=search]:focus { border-color: rgba(109, 124, 255, .7); }
.search-row input[type=search]::placeholder { color: var(--txt-3); }
.search-row .btn { flex: 0 0 auto; padding: 11px 15px; }

.chips {
    display: flex;
    gap: 7px;
    margin-top: 11px;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 6px 13px;
    border-radius: 30px;
    font-size: 13px;
    color: var(--txt-2);
    background: var(--glass-2);
    border: 1px solid var(--brd);
    white-space: nowrap;
    transition: all .18s;
}
.chip:hover { color: var(--txt); background: var(--glass-3); }
.chip.active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(109, 124, 255, .35);
}
.filter-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: 11px; padding-top: 10px;
    border-top: 1px solid var(--brd);
    font-size: 12.5px; color: var(--txt-3);
}
.sort-select {
    padding: 6px 30px 6px 11px;
    border-radius: 10px;
    border: 1px solid var(--brd-2);
    background-color: rgba(255, 255, 255, .05);
    color: var(--txt);
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' fill-opacity='.45' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
}
.sort-select option { background: #121a30; color: #fff; }

/* 旧 .toolbar 保持可用（后台也在用） */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 14px; }
.toolbar input[type=text], .toolbar input[type=search], .toolbar select {
    padding: 9px 13px; border-radius: var(--r-sm); border: 1px solid var(--brd-2);
    background: rgba(255, 255, 255, .05); color: var(--txt);
    font-family: inherit; font-size: 14px; outline: none;
}
.toolbar input[type=text], .toolbar input[type=search] { min-width: 0; flex: 1 1 140px; }
.toolbar select option { background: #121a30; color: #fff; }

/* =====================================================================
   十四、游戏详情
   ===================================================================== */
.detail-hero { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 14px; }
.detail-hero .cover {
    border-radius: var(--r-md); overflow: hidden;
    aspect-ratio: 16 / 10; background: linear-gradient(135deg, #1d2547, #2c1c47);
}
.detail-hero .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-hero h1 { font-size: 20px; margin-bottom: 6px; }
.detail-hero .summary { font-size: 14px; color: var(--txt-2); margin-bottom: 10px; }

.meta-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; font-size: 13.5px; }
.meta-list div { color: var(--txt-2); }
.meta-list b { color: var(--txt); font-weight: 700; }

/* RTL 页面里的拉丁值（版本号 / 平台 / 文件大小）必须做双向隔离，
   否则 "375 B" 会被双向算法渲染成 "B 375" */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.price-big { font-size: 27px; font-weight: 800; color: #a9bcff; line-height: 1.3; }
.price-big.free { color: #6ee7a8; }
.price-big .old { font-size: 14px; color: var(--txt-3); text-decoration: line-through; font-weight: 500; margin-inline-start: 8px; }

.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.shots img { width: 100%; border-radius: 12px; border: 1px solid var(--brd); display: block; }

.prose {
    font-family: var(--font-reading);
    font-size: 15.5px;
    line-height: 2.1;
    color: var(--txt-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.download-box {
    border-radius: var(--r-md); padding: 16px; margin-top: 14px;
    border: 1px dashed var(--brd-3);
    background: rgba(255, 255, 255, .04);
    text-align: center;
}
.download-box.locked { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .06); }
.download-box.ready  { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .06); }
.download-box .ico { font-size: 28px; line-height: 1; margin-bottom: 5px; }
.download-box .file-meta { font-size: 12px; color: var(--txt-3); margin-top: 7px; direction: ltr; }

/* =====================================================================
   十五、分页 / 我的 / 订单
   ===================================================================== */
.pager { display: flex; gap: 6px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 36px; text-align: center;
    padding: 7px 11px; border-radius: var(--r-sm); font-size: 13.5px;
    border: 1px solid var(--brd); background: var(--glass-2); color: var(--txt-2);
}
.pager a:hover { background: var(--glass-3); color: var(--txt); }
.pager .cur { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }
.pager .dis { opacity: .35; }

.profile-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.profile-av {
    width: 56px; height: 56px; border-radius: 18px; overflow: hidden; flex: 0 0 auto;
    border: 1px solid var(--brd-2);
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =====================================================================
   十六、页脚（紧凑的玻璃卡片，与全站风格统一）
   ===================================================================== */
.site-footer { margin-top: 20px; padding-bottom: 6px; }

.footer-card { padding: 14px 16px; }

/* 品牌与链接同一区域，wrap 时自然换行，只用一条分隔线 */
.footer-top {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--brd);
}
.footer-brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.footer-brand .fb-logo {
    width: 32px; height: 32px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 10px; font-size: 16px;
    background: var(--grad);
    box-shadow: var(--sh-glow);
}
.footer-brand b { font-size: 14px; font-weight: 700; line-height: 1.4; }

.footer-links {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-inline-start: auto;
}
.footer-links a {
    font-size: 12px; color: var(--txt-2);
    padding: 5px 11px; border-radius: 30px;
    background: var(--glass-2); border: 1px solid var(--brd);
    white-space: nowrap;
    transition: background .18s, color .18s;
}
.footer-links a:hover { background: var(--glass-3); color: var(--txt); }

.footer-meta {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    padding-top: 11px;
    font-size: 11.5px; color: var(--txt-3);
}
.footer-meta .sp { flex: 1; }

/* 极简页脚：只有一行版权 */
.footer-mini {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 6px;
    padding: 11px 16px;
    font-size: 12px;
    color: var(--txt-3);
    text-align: center;
}
.footer-mini a { color: var(--txt-2); }
.footer-mini .dot { opacity: .45; }

/* =====================================================================
   十七、提示条
   ===================================================================== */
.flash { margin: 10px 0; }
.toast {
    position: fixed;
    top: 16px; inset-inline-start: 50%;
    transform: translateX(50%);
    z-index: 999;
    max-width: calc(100vw - 32px);
    padding: 11px 20px;
    border-radius: var(--r-md);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    box-shadow: var(--sh);
    font-size: 14px; font-weight: 600;
    animation: toastIn .28s ease;
}
[dir=ltr] .toast { transform: translateX(-50%); }
.toast.success { background: rgba(52, 211, 153, .2); border: 1px solid rgba(52, 211, 153, .45); color: #d6ffe4; }
.toast.error   { background: rgba(255, 107, 129, .2); border: 1px solid rgba(255, 107, 129, .45); color: #ffdde3; }
@keyframes toastIn { from { opacity: 0; transform: translate(50%, -16px); } to { opacity: 1; transform: translate(50%, 0); } }
[dir=ltr] .toast { animation: toastInLtr .28s ease; }
@keyframes toastInLtr { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* =====================================================================
   十七之二、公告弹窗
   ===================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 4, 10, .74);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    animation: gsFade .22s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes gsFade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 380px;
    padding: 22px 20px 18px;
    text-align: center;
    border-radius: 22px;
    animation: gsPop .3s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes gsPop {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-ico {
    width: 54px; height: 54px; margin: 0 auto 12px;
    display: grid; place-items: center;
    border-radius: 18px; font-size: 26px;
    background: var(--grad);
    box-shadow: var(--sh-glow);
}
.modal-title { margin: 0 0 10px; font-size: 17.5px; }
.modal-body {
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--txt-2);
    text-align: start;
    max-height: 46vh;
    overflow-y: auto;
    margin-bottom: 16px;
    word-break: break-word;
}
.modal-actions { display: grid; gap: 8px; }

/* =====================================================================
   十八、空状态
   ===================================================================== */
.empty-state { text-align: center; padding: 34px 18px; }
.empty-state .ico { font-size: 44px; margin-bottom: 8px; line-height: 1; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { color: var(--txt-2); font-size: 14px; margin-bottom: 14px; }

/* =====================================================================
   十九、后台布局
   ===================================================================== */
.admin-shell { display: grid; grid-template-columns: 1fr; gap: 14px; padding-bottom: 40px; align-items: start; }
.sidebar {
    padding: 12px;
    border-radius: var(--r-lg);
    background: var(--glass);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    backdrop-filter: blur(22px) saturate(165%);
    border: 1px solid var(--brd);
    box-shadow: var(--sh-sm);
    position: static;
}
.sidebar .who {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 11px; margin-bottom: 9px;
    border-bottom: 1px solid var(--brd);
}
.sidebar .who .av {
    width: 40px; height: 40px; border-radius: 13px;
    display: grid; place-items: center; font-size: 18px;
    background: var(--grad); flex: 0 0 auto;
}
.sidebar .who .nm { font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.sidebar .who .rl { font-size: 11.5px; color: var(--txt-3); }
.sidebar nav { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.sidebar nav a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 13px; border-radius: var(--r-sm);
    color: var(--txt-2); font-size: 14px; white-space: nowrap;
    transition: all .18s;
}
.sidebar nav a:hover { background: var(--glass-2); color: var(--txt); }
.sidebar nav a.active {
    background: linear-gradient(135deg, rgba(109, 124, 255, .3), rgba(168, 107, 255, .3));
    color: #fff; border: 1px solid var(--brd-3); font-weight: 700;
}
.sidebar nav a .ic { font-size: 16px; width: 18px; text-align: center; }
.admin-main { min-width: 0; }

.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.page-head h1 { margin: 0; font-size: 19px; }
.page-head .spacer { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card {
    padding: 14px 15px; border-radius: var(--r-md);
    background: var(--glass); border: 1px solid var(--brd);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: var(--sh-sm);
    min-width: 0;
}
.stat-card .k { font-size: 12.5px; color: var(--txt-3); margin-bottom: 3px; }
.stat-card .v { font-size: 21px; font-weight: 800; line-height: 1.35; word-break: break-all; }
.stat-card .v small { font-size: 12px; font-weight: 600; opacity: .7; }

.thumb { width: 62px; height: 40px; border-radius: 9px; object-fit: cover; display: block; background: #202a4a; }
.thumb-ph {
    width: 62px; height: 40px; border-radius: 9px; display: grid; place-items: center;
    background: var(--glass-2); color: var(--txt-3); font-size: 15px;
}
.form-section { padding: 16px 15px; margin-bottom: 14px; }
.form-section > h3 { margin-top: 0; padding-bottom: 9px; border-bottom: 1px solid var(--brd); }
.cur-file { display: flex; align-items: center; gap: 9px; margin-top: 7px; font-size: 12.5px; color: var(--txt-3); flex-wrap: wrap; }
.cur-file img { width: 80px; border-radius: 9px; border: 1px solid var(--brd); }

/* =====================================================================
   二十、安装向导
   ===================================================================== */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 20px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 7px; flex: 1 1 44%; font-size: 12.5px; opacity: .45; }
.steps li.active { opacity: 1; font-weight: 700; }
.steps li.done { opacity: .8; }
.steps .dot {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: 12.5px; flex: 0 0 auto;
    background: var(--glass-2); border: 1px solid var(--brd);
}
.steps li.active .dot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-glow); }
.steps li.done .dot { background: rgba(52, 211, 153, .22); border-color: rgba(52, 211, 153, .45); color: #b9f6ce; }
.steps .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-lockup { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.brand-lockup .logo {
    width: 52px; height: 52px; border-radius: 17px;
    display: grid; place-items: center; font-size: 26px; flex: 0 0 auto;
    background: var(--grad); box-shadow: var(--sh-glow);
}
.brand-lockup h1 { margin: 0; font-size: 19px; }
.brand-lockup p { margin: 1px 0 0; font-size: 13.5px; }

/* =====================================================================
   二十一、桌面端增强
   ===================================================================== */
@media (min-width: 560px) {
    .wrap { padding: 0 18px; }
    .card { padding: 20px; }
    .game-grid { gap: 14px; }
    .game-card .ttl { font-size: 15px; }
    .price { font-size: 16px; }
    .hero { padding: 32px 26px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 15.5px; }
    .hero .hero-cta { grid-template-columns: 1fr 1fr; max-width: 470px; }
    .hero-stats .hs b { font-size: 23px; }
    .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
    .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* 桌面端页脚：整体一行，版权紧随其下 */
    .footer-card { padding: 16px 22px; }
    .footer-links a { padding: 5px 13px; font-size: 12.5px; }
    .shots { grid-template-columns: repeat(3, 1fr); }
    .detail-hero { padding: 18px; }
    .detail-hero h1 { font-size: 25px; }
}

@media (min-width: 880px) {
    body { padding-bottom: 0; }
    .tabbar { display: none !important; }
    .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
    .admin-shell { grid-template-columns: 236px 1fr; gap: 20px; }
    .sidebar { position: sticky; top: 76px; padding: 15px; }
    .sidebar nav { flex-direction: column; overflow: visible; }
    .sidebar nav a { padding: 10px 13px; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-hero { grid-template-columns: 330px 1fr; gap: 22px; }
    .detail-hero h1 { font-size: 28px; }
    .wrap.narrow { padding-top: 36px; }
    .card { margin: 16px 0; }
    .steps li { flex: 1 1 auto; }
}

@media (min-width: 1120px) {
    .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 手机端隐藏桌面导航，显示底部标签栏 */
@media (max-width: 879px) {
    .topnav { display: none; }
    .tabbar { display: block; }
    .brand-name { max-width: 130px; }
}

/* =====================================================================
   二十二、无障碍 / 动效偏好
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
