/* ===== 基础变量 ===== */
:root {
    --bg-dark: #0a0e1a;
    --bg-card: #131826;
    --bg-card-hover: #1a2138;
    --bg-input: #1c2333;
    --border: #2a3450;
    --border-hover: #3d4f7a;
    --text: #e8ecf4;
    --text-dim: #8b95a8;
    --text-mute: #5a6478;
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-glow: rgba(108, 92, 231, 0.4);
    --accent: #00d2ff;
    --accent-glow: rgba(0, 210, 255, 0.3);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --danger: #e74c3c;
    --success: #00b894;
    --warning: #fdcb6e;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 背景动画粒子 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.08), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 210, 255, 0.06), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== 视图切换 ===== */
.view {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.view.active { display: block; }

/* ===== 登录/注册 ===== */
#auth-view {
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e1a 0%, #131826 50%, #0a0e1a 100%);
}
#auth-view.active { display: flex; }

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.logo-img {
    display: block;
    max-width: 280px;
    height: auto;
    margin: 0 auto 8px;
    filter: drop-shadow(0 4px 20px rgba(108,92,231,0.35));
}
.logo-text {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
}
.logo-sub {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    letter-spacing: 8px;
    margin-top: 4px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow), 0 0 40px rgba(108, 92, 231, 0.1);
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}
.auth-tab.active {
    background: var(--primary);
    color: #fff;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: var(--transition);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #5a4bd1);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:active { transform: translateY(0); }

.auth-hint {
    text-align: center;
    color: var(--text-mute);
    font-size: 13px;
    margin-top: 16px;
}

/* ===== 导航栏 ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-left { display: flex; align-items: center; gap: 32px; }
.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.nav-menu { display: flex; gap: 4px; }
.nav-item {
    padding: 8px 16px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}
.nav-item:hover { color: var(--text); background: var(--bg-card); }
.nav-item.active {
    color: var(--accent);
    background: rgba(0, 210, 255, 0.1);
}

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
}
.stat-icon { font-size: 16px; }
.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--gold);
}
.nav-stat:last-of-type .stat-value { color: var(--accent); }

.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}
.btn-icon:hover { color: var(--danger); border-color: var(--danger); }
.nav-sound { font-size: 17px; color: #00d2ff; border-color: rgba(0,210,255,0.4); }
.nav-sound:hover { color: #00d2ff; border-color: #00d2ff; }
.nav-sound.muted { color: var(--text-dim); border-color: var(--border); }
.nav-sound.muted:hover { color: var(--text-dim); border-color: var(--border); }

/* ===== 主内容区 ===== */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
}
.page-sub {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 4px;
}
.highlight { color: var(--accent); font-weight: 700; }

/* ===== 签到 ===== */
.btn-checkin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2d3561, var(--primary));
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-checkin:hover { box-shadow: 0 0 20px var(--primary-glow); }
.btn-checkin.checked {
    background: var(--bg-card);
    border-color: var(--success);
    color: var(--success);
    cursor: default;
}
.checkin-icon { font-size: 18px; }

/* ===== Banner ===== */
.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(108, 92, 231, 0.15) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}
.banner::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    pointer-events: none;
}
.banner-content { position: relative; z-index: 1; }
.banner-content h2 {
    font-size: 22px;
    margin-bottom: 8px;
}
.banner-content p { color: var(--text-dim); font-size: 14px; }
.banner-stats {
    display: flex;
    gap: 32px;
    position: relative;
    z-index: 1;
}
.banner-stat {
    text-align: center;
}
.banner-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.banner-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

/* ===== 游戏卡片网格 ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(108, 92, 231, 0.15);
}

.game-card-banner {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    position: relative;
    overflow: hidden;
}
.game-card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5));
}
.game-card-body {
    padding: 16px 20px;
}
.game-card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}
.game-card-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    line-height: 1.5;
}
.game-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.game-card-tag {
    padding: 3px 10px;
    background: var(--bg-input);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-dim);
}
.game-card-reward {
    font-size: 13px;
    color: var(--gold);
    font-weight: 600;
}

/* ===== 排行榜 ===== */
.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.lb-tab {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.lb-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }

.lb-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.lb-row:hover { border-color: var(--border-hover); }
.lb-row.me {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.lb-rank {
    width: 40px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
}
.lb-rank.r1 { color: var(--gold); }
.lb-rank.r2 { color: #c0c0c0; }
.lb-rank.r3 { color: #cd7f32; }

.lb-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid var(--border);
}

.lb-info { flex: 1; }
.lb-name { font-size: 15px; font-weight: 600; }
.lb-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.lb-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

/* ===== 商店 ===== */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}
.shop-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.shop-icon { font-size: 40px; margin-bottom: 12px; }
.shop-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.shop-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.shop-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}
.btn-buy {
    width: 100%;
    padding: 8px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-buy:hover { background: #5a4bd1; }
.btn-buy:disabled { background: var(--bg-input); color: var(--text-mute); cursor: not-allowed; }
.btn-buy.owned { background: var(--success); }

/* ===== 成就 ===== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.ach-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}
.ach-card.unlocked {
    border-color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}
.ach-card.locked { opacity: 0.5; }
.ach-icon { font-size: 36px; margin-bottom: 8px; }
.ach-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ach-desc { font-size: 12px; color: var(--text-dim); }
.ach-status {
    margin-top: 8px;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
}
.ach-status.unlocked { background: rgba(0, 184, 148, 0.2); color: var(--success); }
.ach-status.locked { background: var(--bg-input); color: var(--text-mute); }

/* ===== 个人中心 ===== */
/* --- 资料 Hero --- */
.profile-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, rgba(108,92,231,.18), rgba(0,210,255,.10) 60%, rgba(19,24,38,.6));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 22px;
    overflow: hidden;
}
.profile-hero-glow {
    position: absolute;
    top: -60%; right: -10%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(0,210,255,.28), transparent 70%);
    pointer-events: none;
    filter: blur(10px);
}
.profile-hero-main { display: flex; align-items: center; gap: 22px; position: relative; z-index: 1; }
.avatar-circle {
    width: 92px; height: 92px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    border: 3px solid rgba(255,255,255,.14);
    box-shadow: 0 8px 28px rgba(108,92,231,.45);
}
.profile-hero-info h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.profile-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(0,0,0,.28); border: 1px solid var(--border);
    font-size: 12.5px; color: var(--text-dim);
}
.profile-badge b { color: var(--text); font-family: 'Orbitron', sans-serif; }
.profile-badge.rank { background: rgba(255,215,0,.12); border-color: rgba(255,215,0,.35); color: var(--gold); }
.profile-badge.rank b { color: var(--gold); }
.pb-ico { font-size: 13px; }
.profile-hero-side {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
    padding-left: 24px;
}
.phs-label { font-size: 12px; color: var(--text-mute); }
.phs-value { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 32px; color: var(--accent); line-height: 1; }

/* --- 统计卡片网格 --- */
.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.pstat-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    transition: transform .18s ease, border-color .18s ease;
}
.pstat-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.pstat-ico { font-size: 26px; }
.pstat-val { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 24px; }
.pstat-lbl { font-size: 12.5px; color: var(--text-mute); }
.pstat-gold .pstat-val { color: var(--gold); }
.pstat-power .pstat-val { color: var(--accent); }

/* --- NEX 资产入口卡片 --- */
.nex-entry-card {
    display: flex; align-items: center; gap: 20px;
    background: linear-gradient(120deg, rgba(54,211,153,.14), rgba(19,24,38,.7) 70%);
    border: 1px solid rgba(54,211,153,.4);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 22px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.nex-entry-card:hover, .nex-entry-card:focus-visible {
    transform: translateY(-3px);
    border-color: #36d399;
    box-shadow: 0 10px 32px rgba(54,211,153,.28);
    outline: none;
}
.nex-entry-left { flex-shrink: 0; }
.nex-entry-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: #36d399; font-weight: 600; margin-bottom: 6px;
}
.nex-dot { width: 8px; height: 8px; border-radius: 50%; background: #36d399; box-shadow: 0 0 8px #36d399; }
.nex-entry-balance { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 32px; color: #36d399; line-height: 1; }
.nex-entry-sub { font-size: 12.5px; color: var(--text-mute); margin-top: 6px; }
.nex-entry-sub b { color: #ffd166; font-family: 'Orbitron', sans-serif; }
.nex-entry-spark { flex: 1; min-width: 0; height: 56px; }
.nex-entry-spark canvas { width: 100%; height: 100%; display: block; }
.nex-entry-go {
    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
    font-size: 13.5px; color: #36d399; font-weight: 600; white-space: nowrap;
}
.go-arrow { font-size: 20px; transition: transform .18s ease; }
.nex-entry-card:hover .go-arrow { transform: translateX(4px); }

/* --- NEX 二级页 head + overview --- */
.subpage-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.subpage-head h1 { font-size: 26px; }
.subpage-back {
    display: inline-flex; align-items: center;
    padding: 8px 16px; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; font-size: 14px;
    transition: border-color .18s ease, color .18s ease;
}
.subpage-back:hover { border-color: var(--accent); color: var(--accent); }
.nex-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.nex-ov-card {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
}
.nex-ov-balance { background: linear-gradient(120deg, rgba(54,211,153,.14), rgba(19,24,38,.7)); border-color: rgba(54,211,153,.4); }
.nex-ov-lbl { font-size: 12.5px; color: var(--text-mute); }
.nex-ov-val { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 28px; color: #36d399; line-height: 1.1; }
.nex-ov-val.price, .nex-ov-val.est { color: #ffd166; }
.nex-ov-unit { font-size: 11.5px; color: var(--text-mute); }

.profile-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}
.invite-section { background: linear-gradient(135deg, rgba(255,176,32,.10), rgba(255,82,82,.06)); border-color: rgba(255,176,32,.35); }
.invite-desc { color: var(--text-mute); font-size: 13px; margin-bottom: 14px; }
.invite-desc b { color: #ffb020; }
.invite-code-box { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.invite-code {
    flex: 1; text-align: center; font-family: 'Orbitron', monospace; font-weight: 700; font-size: 26px;
    letter-spacing: 6px; padding: 12px; border-radius: 10px;
    background: var(--bg-input); border: 1px dashed var(--border-hover); color: #ffb020;
}
.btn-sm {
    padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.invite-stats { display: flex; gap: 12px; margin-bottom: 16px; }
.invite-stat {
    flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
}
.invite-stat span { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 22px; color: var(--accent); }
.invite-stat small { color: var(--text-mute); font-size: 12px; margin-top: 4px; }
.invite-share-btn { width: 100%; }
.optional-tip { color: var(--text-mute); font-size: 12px; font-weight: 400; }
.game-records {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.record-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}
.record-icon { font-size: 28px; margin-bottom: 8px; }
.record-name { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.record-value { font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; }

/* ===== 模态框 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.active { display: flex; animation: fadeIn 0.2s ease; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-modal-content {
    max-width: 600px;
}

.game-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.game-modal-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
}
.game-modal-stats {
    display: flex;
    gap: 16px;
}
.game-stat {
    font-size: 14px;
    color: var(--text-dim);
}
.modal-close {
    width: 32px; height: 32px;
    background: var(--bg-input);
    border: none;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }

/* 移动端悬浮「返回大厅」按钮（桌面隐藏） */
.fab-back {
    display: none;
    position: fixed;
    top: 10px; left: 10px;
    z-index: 60;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.fab-back:active { background: var(--primary); color: #fff; }

.game-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.game-modal-footer {
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ===== 游戏内通用 ===== */
.game-canvas-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.game-info-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.game-info-item {
    text-align: center;
}
.game-info-label { font-size: 12px; color: var(--text-dim); }
.game-info-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
}
.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-game {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-game.primary {
    background: var(--primary);
    color: #fff;
}
.btn-game.primary:hover { background: #5a4bd1; box-shadow: 0 0 16px var(--primary-glow); }
.btn-game.secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-game.secondary:hover { border-color: var(--border-hover); }

.game-result {
    text-align: center;
    padding: 20px;
}
.game-result-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}
.game-result-title.win { color: var(--success); }
.game-result-title.lose { color: var(--danger); }
.game-result-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}
.game-result-stat {
    text-align: center;
}
.game-result-stat-label { font-size: 12px; color: var(--text-dim); }
.game-result-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}

/* 游戏说明 */
.game-instruction {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 210, 255, 0.05)), var(--bg-input);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 4px 14px rgba(0, 0, 0, 0.25);
}
.game-instruction strong { color: var(--text); }

/* 触屏控制 */
.touch-controls {
    display: none;
    grid-template-columns: repeat(3, 60px);
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}
.touch-btn {
    width: 60px; height: 60px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
}
.touch-btn:active { background: var(--primary); }
.touch-btn.empty { visibility: hidden; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 24px;
    color: var(--text);
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: 0.3s ease;
    pointer-events: none;
    box-shadow: var(--shadow);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .navbar { padding: 0 12px; }
    .nav-right { gap: 8px; }
    .nav-stat { padding: 4px 10px; font-size: 12px; }
    .banner { flex-direction: column; gap: 20px; text-align: center; }
    .banner-stats { gap: 20px; }
    .profile-hero { flex-direction: column; align-items: stretch; text-align: center; padding: 24px 20px; gap: 18px; }
    .profile-hero-main { flex-direction: column; text-align: center; }
    .profile-hero-side { align-items: center; padding-left: 0; }
    .profile-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .nex-entry-card { flex-wrap: wrap; }
    .nex-entry-spark { flex-basis: 100%; order: 3; height: 48px; }
    .nex-overview { grid-template-columns: 1fr; }
    .main-content { padding: 16px; }
    .page-header h1 { font-size: 22px; }
    .touch-controls { display: grid; }
}

/* ===== 实时在线 / 战况 ===== */
.realtime-panel {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 16px;
    margin-bottom: 24px;
}
.realtime-col {
    background: var(--bg-card);
    border: 1px solid rgba(108, 92, 231, 0.18);
    border-radius: 14px;
    padding: 16px;
}
.realtime-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.online-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
.online-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    max-height: 120px; overflow-y: auto;
}
.online-chip {
    background: rgba(46, 204, 113, 0.12);
    color: #6ee7a8;
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
}
.online-chip.muted { background: transparent; color: var(--text-mute); border-color: transparent; }
.live-feed {
    max-height: 120px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    font-size: 12.5px;
}
.feed-item {
    display: flex; gap: 6px; align-items: baseline;
    padding: 4px 8px; border-radius: 8px;
    background: rgba(255,255,255,0.03);
}
.feed-user { color: var(--accent); font-weight: 600; white-space: nowrap; }
.feed-text { color: var(--text-dim); flex: 1; }
.feed-time { color: var(--text-mute); font-size: 11px; white-space: nowrap; }
.feed-empty { color: var(--text-mute); text-align: center; padding: 20px; }

/* ===== 后台管理 ===== */
.admin-tabs {
    display: flex; gap: 8px; margin-bottom: 18px;
}
.admin-tab {
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid rgba(108, 92, 231, 0.2);
    padding: 8px 18px; border-radius: 10px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: all .2s;
}
.admin-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-stat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px;
}
.admin-stat-box {
    background: var(--bg-card); border: 1px solid rgba(108, 92, 231, 0.18);
    border-radius: 12px; padding: 18px; text-align: center;
}
.as-value { font-size: 28px; font-weight: 800; color: var(--accent); }
.as-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.admin-table {
    width: 100%; border-collapse: collapse; background: var(--bg-card);
    border-radius: 12px; overflow: hidden; font-size: 13.5px;
}
.admin-table th, .admin-table td {
    padding: 11px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-table th { color: var(--text-dim); font-weight: 600; background: rgba(108, 92, 231, 0.08); }
.admin-table tr.banned { opacity: 0.6; }
.admin-table tr:hover td { background: rgba(255,255,255,0.03); }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-actions button, .game-toggle {
    background: var(--bg-input); color: var(--text); border: 1px solid rgba(108,92,231,0.25);
    padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: all .15s;
}
.admin-actions button:hover, .game-toggle:hover { background: var(--accent); color: #fff; }
.admin-actions button.danger { border-color: rgba(255,71,87,0.4); color: #ff6b6b; }
.admin-actions button.danger:hover { background: var(--danger); color: #fff; }
.admin-tip { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.admin-panel h3 { color: var(--text); margin: 20px 0 10px; }

/* ===== 响应式补充 ===== */
@media (max-width: 768px) {
    .realtime-panel { grid-template-columns: 1fr; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 9px; }
}

/* ===== 模式选择（单人 / 联机）===== */
.mode-select { text-align: center; padding: 18px 0; }
.mode-title { font-family: 'Orbitron', sans-serif; font-size: 18px; margin-bottom: 22px; }
.mode-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-game.battle {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: 1px solid #e74c3c;
}
.btn-game.battle:hover { box-shadow: 0 0 18px rgba(231, 76, 60, 0.45); transform: translateY(-1px); }
.mode-hint { margin-top: 18px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }

/* ===== 联机对战界面 ===== */
.battle-entry { text-align: center; padding: 10px 0; }
.battle-title { font-size: 20px; margin-bottom: 10px; }
.battle-tip { color: var(--text-dim); font-size: 13px; margin-bottom: 22px; line-height: 1.5; padding: 0 8px; }
.battle-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.battle-join-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.battle-input {
    width: 170px; padding: 10px 14px; text-transform: uppercase;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 15px;
    text-align: center; letter-spacing: 3px; font-family: 'Orbitron', sans-serif;
}
.battle-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.battle-match-status { color: var(--accent); font-size: 13px; margin-bottom: 8px; }

.btn-battle {
    padding: 11px 24px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.btn-battle:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.btn-battle.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-battle.primary:hover { box-shadow: 0 0 16px var(--primary-glow); }
.btn-battle.ghost { background: transparent; color: var(--text-dim); }
.btn-battle.ghost:hover { color: var(--text); }
.btn-battle.sm { padding: 6px 14px; font-size: 12px; }
.btn-battle:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 房间 */
.battle-room-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.battle-room-head h3 { font-size: 17px; font-weight: 600; }
.room-code {
    font-family: 'Orbitron', sans-serif; color: var(--accent); letter-spacing: 3px;
    background: rgba(0, 210, 255, 0.1); padding: 3px 12px; border-radius: 8px;
    border: 1px solid rgba(0, 210, 255, 0.3);
}
.battle-players { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.battle-player {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.battle-player.me { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
.bp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-mute); flex-shrink: 0; }
.bp-dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.bp-name { flex: 1; font-size: 15px; font-weight: 500; }
.bp-ready { font-size: 12px; color: var(--text-dim); }
.battle-room-actions { text-align: center; margin-top: 6px; }

/* 倒计时 / 等待遮罩（覆盖在 modal body 上） */
.game-modal-body { position: relative; }
.battle-overlay {
    position: absolute; inset: 0; background: rgba(10, 14, 26, 0.88);
    display: flex; align-items: center; justify-content: center; z-index: 60;
    backdrop-filter: blur(3px); border-radius: var(--radius-lg);
}
.countdown-num {
    font-family: 'Orbitron', sans-serif; font-size: 100px; font-weight: 900;
    color: var(--accent); text-shadow: 0 0 34px var(--accent-glow);
    animation: count-pop 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
@keyframes count-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wait-text { font-size: 18px; color: var(--text); }

/* 对战 HUD */
.battle-hud {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 14px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 10px;
}
.battle-hud-left { display: flex; align-items: center; gap: 12px; }
.battle-clock {
    font-family: 'Orbitron', sans-serif; font-size: 20px; font-weight: 700; color: var(--gold);
    min-width: 46px; text-align: center;
}
.battle-me { font-size: 13px; color: var(--text-dim); }
.battle-opponents { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.opp-card {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; font-size: 13px;
}
.opp-name { color: var(--text-dim); }
.opp-score { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--accent); }
.opp-done { color: var(--success); }
.battle-game-area { display: flex; flex-direction: column; align-items: center; }
/* versus（回合制 1v1 共享棋盘）专属 HUD */
.battle-hud.versus { justify-content: center; border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
.battle-vs-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.battle-vs-sep { font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.battle-opp { font-size: 13px; color: var(--text-dim); }
.battle-me.c1 { color: #ff6b6b; font-weight: 700; }
.battle-me.c2 { color: #4aa3ff; font-weight: 700; }
@media (max-width: 520px) {
    .battle-vs-info { gap: 8px; font-size: 12px; }
    .battle-game-area { width: 100%; align-items: stretch; }
    .battle-game-area > * { width: 100%; }
}

/* 结算 */
.battle-result { text-align: center; padding: 8px 0; }
.result-title { font-size: 24px; font-weight: 700; margin-bottom: 18px; }
.result-title.win { color: var(--success); }
.result-title.lose { color: var(--text); }
.result-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.result-row {
    display: flex; align-items: center; gap: 16px; padding: 12px 20px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.result-row.me { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
.result-row.win { background: rgba(0, 184, 148, 0.08); }
.rr-rank { width: 40px; text-align: center; font-size: 18px; }
.rr-name { flex: 1; text-align: left; font-weight: 600; }
.rr-score { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--accent); }
.result-rewards { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; flex-wrap: wrap; }
.rr-stat { text-align: center; }
.rr-stat span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.rr-stat b { font-family: 'Orbitron', sans-serif; font-size: 18px; color: var(--gold); }
.battle-result-actions { display: flex; gap: 12px; justify-content: center; }

/* 联机对战使用更大的弹窗 */
.modal-content.battle-modal { max-width: 760px; max-height: 96vh; }

/* ============================================================
   移动端自适应（手机）
   ============================================================ */

/* 移动端底部导航（桌面隐藏，手机显示） */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    align-items: stretch;
}
.bottom-nav-item {
    flex: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text-dim);
    border-radius: 0;
    font-size: 11px;
    background: transparent;
}
.bottom-nav-item:hover { background: transparent; color: var(--accent); }
.bottom-nav-item.active { color: var(--accent); background: rgba(0, 210, 255, 0.10); }
.bn-icon { font-size: 20px; line-height: 1; }
.bn-label { font-size: 11px; }

/* 平板及以下 */
@media (max-width: 768px) {
    .bottom-nav { display: flex; }

    /* 顶栏精简 */
    .navbar { padding: 0 12px; height: 56px; }
    .nav-logo { font-size: 18px; letter-spacing: 1px; }
    .nav-left { gap: 12px; }
    .nav-stat { padding: 4px 10px; font-size: 12px; gap: 4px; }
    .nav-username { display: none; }
    .nav-right { gap: 10px; }

    /* 主内容给底部导航留位 */
    .main-content { padding: 14px 12px 76px; max-width: 100%; }

    /* 页头 */
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header h1 { font-size: 22px; }

    /* Banner 堆叠 */
    .banner { flex-direction: column; gap: 18px; text-align: center; padding: 20px; }
    .banner-stats { gap: 18px; justify-content: center; }

    /* 个人中心堆叠 */
    .profile-hero { flex-direction: column; align-items: stretch; text-align: center; padding: 22px 18px; }
    .profile-hero-main { flex-direction: column; }
    .profile-hero-side { align-items: center; padding-left: 0; }
    .profile-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .subpage-head h1 { font-size: 20px; }

    /* 网格：大厅/商店/成就/战绩 两列 */
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .game-card-banner { height: 92px; font-size: 38px; }
    .game-card-body { padding: 12px 14px; }
    .shop-grid, .achievement-grid, .game-records { grid-template-columns: repeat(2, 1fr); }

    /* 实时面板堆叠 */
    .realtime-panel { grid-template-columns: 1fr; }

    /* 弹窗全屏 */
    .modal { padding: 0; align-items: stretch; }
    .modal-content { max-width: 100% !important; max-height: 100vh; height: 100vh; height: 100dvh; border-radius: 0; border: none; }
    .modal-content.battle-modal { max-height: 100vh; max-height: 100dvh; }
    .game-modal-body { padding: 12px; }
    .game-modal-header { padding: 14px 16px; }
    .game-modal-header h2 { font-size: 18px; }
    .modal-close { width: 40px; height: 40px; font-size: 18px; }
    .fab-back { display: block; }
    .game-modal-header { padding-left: 84px; }

    /* 画布自适应（蛇/俄罗斯方块/打砖块/五子棋） */
    .game-canvas-wrap canvas { max-width: 100%; height: auto; touch-action: manipulation; }
    /* 棋盘类游戏：容器占满剩余高度并垂直居中，让棋盘尽量大 */
    .game-canvas-wrap { flex: 1 1 auto; min-height: 0; align-items: center; margin-bottom: 10px; }

    /* DOM 网格类游戏自适应（列数由 JS 按难度设置，这里只调间距与方块策略） */
    #mem-board { gap: 6px; }
    #mem-board .mem-card { width: 100%; aspect-ratio: 1 / 1; }
    #whack-board { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
    #whack-board > div { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1; font-size: 9vw; }
    /* 扫雷列数由 JS 按难度设置（inline repeat(COLS)），移动端不再强制 9 列，否则 16/30 列棋盘会错位 */

    /* 对战 HUD 重排 */
    .battle-hud { flex-wrap: wrap; }
    .battle-opponents { width: 100%; justify-content: flex-start; }
    .battle-join-row { flex-wrap: wrap; }
    .battle-input { width: 100%; max-width: 220px; }
    .mode-buttons, .battle-actions, .battle-result-actions { flex-direction: column; }
    .mode-buttons .btn-game, .battle-actions .btn-battle, .battle-result-actions .btn-battle { width: 100%; }

    /* 榜单行紧凑 */
    .lb-row { padding: 12px 14px; gap: 10px; }
    .lb-avatar { width: 36px; height: 36px; font-size: 18px; }

    /* 后台表格横向滚动 */
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .admin-table th, .admin-table td { white-space: nowrap; }

    /* Toast 上移避免被底部导航遮挡 */
    .toast { bottom: 72px; }
}

/* 横屏手机：底部导航让位、画布按高度收敛、方向键悬浮右下角 */
@media (max-width: 920px) and (orientation: landscape) {
    .bottom-nav { display: none; }
    .main-content { padding: 10px 12px 16px; }
    .modal { padding: 0; align-items: stretch; }
    .modal-content { max-width: 100% !important; height: 100vh; height: 100dvh; border-radius: 0; border: none; }
    .game-modal-body { padding: 10px 14px; overflow-y: auto; }
    .game-modal-header { padding: 10px 14px; padding-left: 84px; }
    /* 画布按高度收敛并保持比例，避免横屏上下溢出 */
    .game-canvas-wrap canvas { max-width: 100%; max-height: 64vh; width: auto; height: auto; touch-action: manipulation; }
    /* 方向键悬浮右下角，不挤压画面 */
    .touch-controls { display: grid; position: fixed; right: 14px; bottom: 14px; margin-top: 0; z-index: 50; opacity: 0.92; }
    .touch-btn { width: 52px; height: 52px; font-size: 20px; }
    .fab-back { display: block; }
    .toast { bottom: 20px; }
}

/* ===== 独立后台管理页面（admin.html）===== */
.admin-body { min-height: 100vh; }
.admin-login-view {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box;
}
.admin-login-card {
    width: 100%; max-width: 380px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); text-align: center;
}
.admin-login-card .auth-logo { margin-bottom: 24px; }
.admin-login-card .auth-form { display: block; text-align: left; }
.admin-back-link {
    display: inline-block; margin-top: 18px; color: var(--text-dim);
    font-size: 13px; text-decoration: none;
}
.admin-back-link:hover { color: var(--accent); }

.admin-panel-view { display: flex; flex-direction: column; min-height: 100vh; }
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; border-bottom: 1px solid var(--border);
    background: var(--bg-card); position: sticky; top: 0; z-index: 10;
}
.admin-header-left { display: flex; align-items: baseline; gap: 10px; }
.admin-header-title { color: var(--text-dim); font-size: 14px; }
.admin-header-right { display: flex; align-items: center; gap: 12px; }
.admin-who { color: var(--text); font-size: 14px; font-weight: 600; }
.admin-link {
    color: var(--text-dim); text-decoration: none; font-size: 13px;
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.admin-link:hover { color: var(--text); border-color: var(--border-hover); }
.btn-small {
    background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.btn-small:hover { border-color: var(--border-hover); }
.admin-body-main {
    flex: 1; padding: 18px; max-width: 1100px; width: 100%;
    margin: 0 auto; box-sizing: border-box; overflow-x: auto;
}
/* 个人中心 -> 后台入口链接 */
.profile-admin-link {
    display: block; margin-top: 16px; text-align: center; text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-weight: 700; padding: 14px; border-radius: 12px;
    box-shadow: 0 4px 18px var(--primary-glow);
}
.profile-admin-link:hover { filter: brightness(1.08); }

/* 小屏：后台顶栏紧凑、主体留白减小 */
@media (max-width: 600px) {
    .admin-header { padding: 10px 12px; }
    .admin-header-title { display: none; }
    .admin-who { font-size: 13px; }
    .admin-body-main { padding: 12px 10px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .auth-logo { margin-bottom: 20px; }
    .logo-text { font-size: 38px; }
    .auth-card { padding: 22px; }
    .game-grid { gap: 10px; }
    .banner-stat-value { font-size: 20px; }
    .game-modal-body { padding: 12px; }
    .page-header h1 { font-size: 20px; }
    .nav-stat .stat-icon { display: none; }
}

/* ===== 每日任务 ===== */
.tasks-shortcut { position: relative; }
.task-badge {
    position: absolute; top: -6px; right: -8px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--danger); color: #fff; border-radius: 10px;
    font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}
.tasks-summary {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 18px; margin-bottom: 18px;
}
.ts-card { display: flex; flex-direction: column; gap: 4px; }
.ts-label { font-size: 12px; color: var(--text-mute); }
.ts-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.btn-claim-all {
    margin-left: auto; padding: 10px 20px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #ffd54a, #ff9d2f); color: #1a1a2e;
    font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .15s;
}
.btn-claim-all:hover { transform: translateY(-1px); }
.btn-claim-all.disabled, .btn-claim-all:disabled { opacity: .5; cursor: not-allowed; }

.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px; transition: border-color .2s;
}
.task-card.task-ready { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.task-card.task-done { opacity: .6; }
.task-icon { font-size: 30px; width: 46px; text-align: center; flex-shrink: 0; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.task-reward { font-size: 13px; color: #ffcf5c; font-weight: 700; }
.task-desc { font-size: 12px; color: var(--text-mute); margin: 4px 0 8px; }
.task-progress { display: flex; align-items: center; gap: 10px; }
.task-bar { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 5px; overflow: hidden; }
.task-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 5px; transition: width .3s; }
.task-count { font-size: 12px; color: var(--text-mute); flex-shrink: 0; min-width: 42px; text-align: right; }
.task-action { flex-shrink: 0; }
.task-claim {
    padding: 9px 16px; border: 1px solid var(--border); border-radius: 10px;
    background: rgba(255,255,255,.04); color: var(--text-mute);
    font-size: 13px; font-weight: 700; cursor: not-allowed; white-space: nowrap;
}
.task-claim.ready {
    border: none; background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; cursor: pointer;
}
.task-claim.ready:hover { transform: translateY(-1px); }
.task-claim.claimed { color: #5fd17a; border-color: rgba(95,209,122,.4); }

/* 底部导航角标 */
.bn-badge {
    position: absolute; top: 2px; right: 50%; transform: translateX(14px);
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--danger); color: #fff; border-radius: 9px;
    font-size: 10px; line-height: 16px; text-align: center; font-weight: 700;
}

/* 后台任务配置 */
.config-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.config-row label { font-size: 14px; font-weight: 600; }
.config-row input {
    width: 140px; padding: 9px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: rgba(255,255,255,.05);
    color: var(--text); font-size: 14px;
}
.btn-save {
    padding: 9px 18px; border: none; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer;
}
.config-note { margin-top: 16px; font-size: 12px; color: var(--text-mute); }

/* 移动端：任务卡片纵向排布 */
@media (max-width: 600px) {
    .task-card { flex-wrap: wrap; }
    .task-action { width: 100%; }
    .task-claim { width: 100%; }
    .tasks-summary { flex-direction: column; align-items: stretch; }
    .btn-claim-all { margin-left: 0; }
}

/* =====================================================================
   NEXUS 游戏升级 — 霓虹特效 / 难度选择 / 玩法增强样式
   ===================================================================== */

/* ---------- 通用特效层 (GameFX) ---------- */
.game-canvas-wrap { position: relative; }
.fx-overlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
}
.fx-float {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 12px currentColor;
    white-space: nowrap;
    pointer-events: none;
    will-change: transform, opacity;
    animation: fx-float-up 0.95s ease-out forwards;
    --fx-dx: 0px;
}
@keyframes fx-float-up {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.6); }
    15%  { opacity: 1;   transform: translate(calc(-50% + var(--fx-dx) * 0.15), -50%) scale(1.1); }
    100% { opacity: 0;   transform: translate(calc(-50% + var(--fx-dx)), -160%) scale(1); }
}
.fx-particle {
    position: absolute;
    border-radius: 2px;
    pointer-events: none;
    will-change: transform, opacity;
}
.fx-ring {
    position: absolute;
    width: 36px; height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid #ffd54f;
    border-radius: 50%;
    box-sizing: border-box;
    pointer-events: none;
    animation: fx-ring-expand 0.6s ease-out forwards;
}
@keyframes fx-ring-expand {
    0%   { opacity: 0.9; transform: scale(0.2); }
    100% { opacity: 0;   transform: scale(2.6); }
}
.fx-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    animation: fx-flash-fade 0.26s ease-out forwards;
}
@keyframes fx-flash-fade {
    0%   { opacity: 0.75; }
    100% { opacity: 0; }
}
.fx-shake { animation: fx-shake 0.5s cubic-bezier(.36,.07,.19,.97); }
@keyframes fx-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

/* 信息条数值加霓虹辉光，整体更"电竞" */
.game-info-value { text-shadow: 0 0 12px rgba(0, 210, 255, 0.25); }

/* ---------- 难度选择 ---------- */
.diff-label {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 12px;
}
.diff-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.btn-diff {
    flex: 1;
    min-width: 72px;
    max-width: 120px;
    padding: 12px 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-diff:hover:not(.active) { border-color: var(--border-hover); color: var(--text); }
.btn-diff.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 18px var(--primary-glow);
}

/* ---------- 游戏内额外操作条 (难度标签 / 撤销 / 音效) ---------- */
.game-extra-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    min-height: 34px;
}
.game-diff-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    background: rgba(0, 210, 255, 0.10);
    border: 1px solid rgba(0, 210, 255, 0.3);
}
.btn-mini {
    padding: 7px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-mini:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-mini:active { transform: scale(0.96); }
.btn-mini.active { background: rgba(255, 90, 110, 0.18); border-color: rgba(255, 90, 110, 0.55); color: #ff8a98; }

/* ---------- 记忆翻牌 (3D 翻转) ---------- */
.game-canvas-wrap #mem-board { perspective: 700px; touch-action: pan-y; }
.mem-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: clamp(16px, 4.2vw, 30px);
    cursor: pointer;
    border-radius: 12px;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.mem-card.flipped { transform: rotateY(180deg); }
.mem-card:hover { filter: brightness(1.12); }
.mem-card:hover .mem-front {
    border-color: var(--primary);
    box-shadow: inset 0 0 14px rgba(108, 92, 231, 0.3), 0 0 14px rgba(108, 92, 231, 0.25);
}
.mem-inner {
    position: relative;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
}
.mem-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-size: 1.9em;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}
.mem-front {
    background: linear-gradient(150deg, #2a3458, #161d33 60%, #121829);
    border: 1px solid var(--border);
    color: var(--text-dim);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 14px rgba(108, 92, 231, 0.18);
}
.mem-back {
    background: linear-gradient(150deg, #34286a, #1b2440 60%, #18203c);
    border: 1px solid var(--primary);
    transform: rotateY(180deg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 18px var(--primary-glow);
}
.mem-card.matched { cursor: default; }
.mem-card.matched .mem-back {
    border-color: var(--success);
    box-shadow: 0 0 22px rgba(0, 184, 148, 0.5);
    animation: mem-pulse 0.6s ease, mem-glow 2.4s ease-in-out 0.6s infinite;
}
@keyframes mem-pulse {
    0%   { transform: rotateY(180deg) scale(1); }
    50%  { transform: rotateY(180deg) scale(1.08); }
    100% { transform: rotateY(180deg) scale(1); }
}
@keyframes mem-glow {
    0%, 100% { box-shadow: 0 0 14px rgba(0, 184, 148, 0.32); }
    50%      { box-shadow: 0 0 30px rgba(0, 184, 148, 0.68); }
}

/* ---------- 打地鼠 ---------- */
#whack-board { perspective: 600px; }
.whack-hole {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
    background: radial-gradient(ellipse at 50% 28%, #33415f, #1a2238 65%, #0d1322 100%);
    border: 2px solid rgba(52, 64, 97, 0.6);
    box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.6), inset 0 -4px 8px rgba(255, 255, 255, 0.05), 0 6px 14px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.whack-hole:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.55), 0 8px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(108, 92, 231, 0.25);
}
.whack-mole {
    position: absolute;
    left: 50%;
    bottom: 6%;
    transform: translate(-50%, 120%);
    font-size: 1.9em;
    line-height: 1;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
    user-select: none;
    -webkit-user-select: none;
}
.whack-hole.up {
    box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.55), 0 0 20px rgba(108, 92, 231, 0.42), 0 0 38px rgba(108, 92, 231, 0.18);
}
.whack-hole.up .whack-mole {
    transform: translate(-50%, 0);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}
.whack-hole.golden {
    border-color: var(--gold);
    box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.45), 0 0 18px var(--gold-glow);
}
.whack-hole.bomb {
    border-color: var(--danger);
    box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.45), 0 0 18px rgba(231, 76, 60, 0.5);
}
.whack-hole.hit .whack-mole { animation: whack-hit 0.22s ease; }
@keyframes whack-hit {
    0%   { transform: translate(-50%, 0) scale(1); }
    50%  { transform: translate(-50%, 0) scale(1.25); }
    100% { transform: translate(-50%, 0) scale(1); }
}
.whack-hole.whiff { animation: fx-shake 0.4s; }

/* ---------- 俄罗斯方块 (侧栏) ---------- */
.tet-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.tet-next-label {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 2px;
}
.tet-side canvas { border-radius: 8px; }

/* ---------- 2048 (方块出现/合并动画) ---------- */
.g2048-tile {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    z-index: 1;
}
.g2048-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 48%);
    pointer-events: none;
}
.g2048-tile.tile-new { animation: tile-pop 0.18s ease-out; }
.g2048-tile.tile-merged {
    animation: tile-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), tile-glow 0.55s ease-out;
}
@keyframes tile-pop {
    0%   { transform: scale(0.2); opacity: 0.2; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes tile-glow {
    0%   { filter: brightness(1.7) drop-shadow(0 0 16px rgba(255, 255, 255, 0.75)); }
    100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
}

/* ---------- 模态霓虹描边 ---------- */
.game-modal-content {
    background:
        linear-gradient(160deg, rgba(108, 92, 231, 0.06), rgba(0, 210, 255, 0.04)),
        var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow), 0 0 60px rgba(108, 92, 231, 0.12);
}

/* ============================================================
   移动端适配 + UI 再打磨（20260716d）
   ============================================================ */

/* 全局：去掉触摸高亮；游戏交互区禁止页面滚动/缩放抢占 */
* { -webkit-tap-highlight-color: transparent; }
.game-canvas-wrap canvas,
#g2048-board, #whack-board, #mem-board, #ms-board {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 画布按视口高度自适应，保证 信息条 + 画布 + 控制 在一屏内 */
@media (max-width: 768px) {
    .game-canvas-wrap { margin-bottom: 8px; }
    .game-canvas-wrap canvas {
        display: block;
        max-width: 100%;
        max-height: 42vh;
        width: auto;
        height: auto;
        touch-action: none;
    }
    .game-info-bar { padding: 8px 10px; gap: 4px; margin-bottom: 8px; }
    .game-info-value { font-size: 16px; }
    .game-instruction { font-size: 12px; padding: 10px 12px; margin-bottom: 8px; }

    /* 触摸控制：更大、玻璃质感、按压回弹 */
    .touch-controls {
        grid-template-columns: repeat(3, 1fr);
        max-width: 250px;
        gap: 10px;
        margin: 10px auto 0;
    }
    .touch-btn {
        width: 100%;
        height: 62px;
        font-size: 26px;
        background: linear-gradient(160deg, rgba(108, 92, 231, 0.20), rgba(0, 210, 255, 0.12));
        border: 1px solid rgba(108, 92, 231, 0.42);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32), inset 0 0 12px rgba(108, 92, 231, 0.14);
        backdrop-filter: blur(4px);
    }
    .touch-btn:active {
        transform: scale(0.9);
        background: linear-gradient(160deg, var(--primary), #7b5cff);
        box-shadow: 0 0 20px var(--primary-glow, rgba(108, 92, 231, 0.55));
    }
}

/* 横屏：画布更高，控制固定右下避免遮挡 */
@media (max-width: 920px) and (orientation: landscape) {
    .game-canvas-wrap canvas { max-height: 68vh; max-width: 68vw; }
    .touch-controls {
        position: fixed;
        right: 14px;
        bottom: 14px;
        margin: 0;
        grid-template-columns: repeat(3, 58px);
        opacity: 0.95;
        z-index: 50;
    }
    .touch-btn { width: 58px; height: 58px; font-size: 22px; }
}

/* 小屏收紧 */
@media (max-width: 480px) {
    .game-canvas-wrap canvas { max-height: 38vh; }
    .touch-btn { height: 56px; font-size: 24px; }
    .game-modal-body { padding: 12px 10px; }
    .game-modal-header { padding: 10px 12px; padding-left: 70px; }
    .game-modal-header h2 { font-size: 17px; }
    .game-modal-stats { gap: 10px; }
}

/* 移动端：游戏模态全屏沉浸式，避免底部被导航/安全区遮挡 */
@media (max-width: 768px) {
    .modal { padding: 0; }
    .game-modal-content {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .game-modal-body { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* 信息条霓虹玻璃 */
.game-info-bar {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(0, 210, 255, 0.06));
    border: 1px solid rgba(108, 92, 231, 0.30);
    box-shadow: inset 0 0 18px rgba(108, 92, 231, 0.08);
}
.game-info-label { letter-spacing: 0.04em; }

/* ---------- 中国象棋画布 ---------- */
#xiangqi-canvas {
    width: 100%;
    max-width: 452px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(120, 160, 220, 0.3);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.10) inset;
    touch-action: none;
}
/* 五子棋：强制撑满容器宽度（修复移动端被基础规则 width:auto + max-height:42vh / flex min-width 限制成 321px 的问题） */
#gomoku-canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 768px) {
    #xiangqi-canvas { width: 100%; max-width: 100%; max-height: 72vh; }
    #gomoku-canvas { max-height: none; }
}

/* ---------- 万象归序 画布 ---------- */
#match3-canvas {
    width: 100%;
    max-width: 436px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(154, 106, 217, 0.5);
    box-shadow: 0 0 26px rgba(154, 106, 217, 0.20), 0 0 60px rgba(90, 164, 106, 0.06) inset;
    touch-action: none;
    background: #0a0c14;
}
@media (max-width: 768px) {
    #match3-canvas { width: auto; max-width: 100%; max-height: 58vh; }
}
.game-progress {
    height: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin: 4px 0 10px;
}
.game-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, #5ba46a, #ffd54f);
    transition: width .25s ease;
}
.game-info-value {
    color: var(--gold, #ffd166);
    text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
}

/* ---------- 万象归序 UI ---------- */
.m3-head { text-align: center; margin: 2px 0 8px; }
.m3-title { font-size: 22px; font-weight: 800; letter-spacing: 4px; color: #f4f1e8; text-shadow: 0 0 18px rgba(154, 106, 217, 0.55); }
.m3-sub { font-size: 11px; font-weight: 600; letter-spacing: 3px; color: #9a6ad9; margin-left: 8px; opacity: .85; vertical-align: middle; }
.m3-modes { display: inline-flex; gap: 6px; margin-top: 8px; }
.m3-tab { font-family: inherit; font-size: 12px; padding: 5px 14px; border-radius: 20px; cursor: pointer; color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); transition: all .18s; }
.m3-tab.active { color: #fff; background: linear-gradient(135deg, #5ba46a, #9a6ad9); border-color: transparent; box-shadow: 0 0 14px rgba(154, 106, 217, 0.4); }
.m3-bar { margin: 8px 0 6px; }
.m3-bars { margin: 6px 2px; display: flex; flex-direction: column; gap: 6px; }
.m3-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.m3-bar-tag { width: 30px; flex: none; text-align: center; padding: 2px 0; border-radius: 6px; font-weight: 700; font-size: 11px; }
.m3-bar-tag.chaos { color: #ffb4a0; background: rgba(217, 106, 74, 0.18); }
.m3-bar-tag.order { color: #bfe6ff; background: rgba(79, 143, 201, 0.18); }
.m3-bar-track { flex: 1; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.m3-bar-fill { height: 100%; width: 0; border-radius: 6px; background: #9a6ad9; transition: width .3s ease, background .3s ease; }
.m3-bar-fill.order { background: linear-gradient(90deg, #4f8fc9, #5ba46a); }
.m3-bar-row b { width: 40px; flex: none; text-align: right; color: #fff; font-size: 12px; }
.m3-score-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.75); margin: 4px 2px 6px; }
.m3-score-row b { font-size: 18px; color: #fff; text-shadow: 0 0 12px rgba(154, 106, 217, 0.45); }
.m3-prog { margin: 2px 0 10px; }
.m3-tip { font-size: 12px; color: rgba(255, 255, 255, 0.62); line-height: 1.7; margin-top: 10px; padding: 9px 12px; background: rgba(154, 106, 217, 0.08); border: 1px solid rgba(154, 106, 217, 0.2); border-radius: 10px; }
.m3-tip b { color: #ffd54f; }
.m3-undo-btn { display: block; margin: 8px auto 0; font-family: inherit; font-size: 13px; padding: 7px 18px; border-radius: 20px; cursor: pointer; color: #f4f1e8; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(154, 106, 217, 0.4); transition: all .18s; }
.m3-undo-btn:hover { background: rgba(154, 106, 217, 0.22); box-shadow: 0 0 14px rgba(154, 106, 217, 0.35); }
.m3-totem { position: relative; margin: 10px auto 0; max-width: 360px; text-align: center; padding: 14px; border-radius: 14px; background: rgba(20, 16, 30, 0.92); border: 1px solid rgba(154, 106, 217, 0.5); box-shadow: 0 0 30px rgba(154, 106, 217, 0.3); display: none; }
.m3-totem.active { display: block; animation: m3pop .25s ease; }
@keyframes m3pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.m3-totem-title { font-size: 14px; letter-spacing: 2px; color: #f4f1e8; margin-bottom: 10px; }
.m3-totem-btns { display: flex; gap: 8px; }
.m3-totem-btns button { flex: 1; font-family: inherit; cursor: pointer; padding: 12px 4px; border-radius: 10px; color: #f4f1e8; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); transition: all .18s; line-height: 1.4; }
.m3-totem-btns button small { display: block; font-size: 10px; opacity: .7; margin-top: 3px; }
.m3-totem-btns button:hover { background: rgba(154, 106, 217, 0.25); border-color: rgba(154, 106, 217, 0.6); }

/* 难度按钮增强 */
.btn-diff { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); transition: all .18s; }
.btn-diff.active {
    background: linear-gradient(135deg, var(--primary), #7b5cff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 18px var(--primary-glow, rgba(108, 92, 231, 0.5));
    transform: translateY(-1px);
}

/* 连击飘字更醒目 */
.fx-float { font-weight: 800; text-shadow: 0 0 10px currentColor, 0 2px 6px rgba(0, 0, 0, 0.6); }

/* 暂停按钮（游戏内通用） */
.btn-mini {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-mini:hover { border-color: var(--border-hover); }
.btn-mini:active { transform: scale(0.95); }
.game-extra-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* 棋盘类游戏（五子棋/象棋）移动端：信息超紧凑，把空间让给棋盘 */
@media (max-width: 768px) {
    .game-instruction {
        padding: 6px 10px;
        margin-bottom: 6px;
        font-size: 11px;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .game-info-bar {
        padding: 6px 8px;
        margin-bottom: 6px;
        gap: 6px;
    }
    .game-info-item { min-width: 0; flex: 1; }
    .game-info-label { font-size: 10px; }
    .game-info-value { font-size: 14px; }
    .game-extra-bar { margin-bottom: 6px; gap: 6px; }
    .game-diff-tag { font-size: 11px; padding: 2px 8px; }
    /* 棋盘画布：占满宽度，高度尽量大 */
    #gomoku-canvas,
    #xiangqi-canvas {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        height: auto !important;
    }
    .game-canvas-wrap:has(#gomoku-canvas),
    .game-canvas-wrap:has(#xiangqi-canvas) {
        flex: none;
        width: 100%;
    }
}

/* 打地鼠：窄屏自适应，避免横向溢出 */
@media (max-width: 480px) {
    #whack-board { grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 324px; gap: 10px; }
    .whack-hole { width: 100%; }
    .tet-side { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ===================== 熵变蛇域 · 大厅与对局 ===================== */
.sk-lobby { display:flex; flex-direction:column; gap:14px; padding:6px 2px; max-height:72vh; overflow-y:auto; }
.sk-lobby-head { text-align:center; }
.sk-title { font-size:26px; margin:0; letter-spacing:2px; background:linear-gradient(90deg,#46e0a8,#4fc3f7,#ff7eb3); -webkit-background-clip:text; background-clip:text; color:transparent; }
.sk-sub { margin:4px 0 0; font-size:13px; color:var(--muted,#8aa); letter-spacing:1px; }
.sk-section { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:14px; padding:12px; }
.sk-sec-label { font-size:13px; color:var(--accent,#46e0a8); margin-bottom:8px; letter-spacing:1px; }
.sk-modes { display:flex; gap:10px; }
.sk-mode { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:12px 6px; border-radius:12px; border:1px solid rgba(255,255,255,0.1); background:rgba(255,255,255,0.02); color:#dfe; cursor:pointer; transition:.15s; }
.sk-mode b { font-size:17px; }
.sk-mode span { font-size:12px; color:var(--muted,#8aa); }
.sk-mode i { font-size:11px; font-style:normal; color:#6f8; opacity:.7; }
.sk-mode:hover { border-color:var(--accent,#46e0a8); }
.sk-mode.active { border-color:var(--accent,#46e0a8); background:rgba(70,224,168,0.12); box-shadow:0 0 18px rgba(70,224,168,0.25); }
.sk-mode-desc { margin-top:8px; font-size:12px; color:var(--muted,#8aa); text-align:center; }
.sk-cards { display:flex; gap:10px; flex-wrap:wrap; }
.sk-card { flex:1; min-width:150px; display:flex; flex-direction:column; gap:3px; padding:10px 12px; border-radius:11px; border:1px solid rgba(255,255,255,0.1); background:rgba(255,255,255,0.02); color:#dfe; cursor:pointer; text-align:left; transition:.15s; }
.sk-card b { font-size:14px; }
.sk-card b em { font-style:normal; font-size:11px; color:#6f8; }
.sk-card span { font-size:11px; color:var(--muted,#8aa); line-height:1.4; }
.sk-card:hover { border-color:var(--accent,#46e0a8); }
.sk-card.active { border-color:var(--accent,#46e0a8); background:rgba(70,224,168,0.12); }
.sk-start { padding:13px; font-size:16px; letter-spacing:2px; margin-top:4px; }
.sk-note { font-size:11px; color:var(--muted,#8aa); text-align:center; margin:2px 0 0; }
.sk-match { display:flex; flex-direction:column; align-items:center; gap:14px; padding:50px 0; color:#dfe; }
.sk-spinner { width:42px; height:42px; border:4px solid rgba(70,224,168,0.2); border-top-color:var(--accent,#46e0a8); border-radius:50%; animation:sk-spin .8s linear infinite; }
@keyframes sk-spin { to { transform:rotate(360deg); } }
.sk-match-tip { font-size:12px; color:var(--muted,#8aa); }

.sk-game { display:flex; flex-direction:column; gap:10px; }
.sk-hud-top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.sk-hud-me { display:flex; align-items:center; gap:16px; flex:1; }
.sk-entropy { display:flex; align-items:center; gap:8px; flex:1; max-width:340px; }
.sk-entropy-label { font-size:12px; color:var(--muted,#8aa); white-space:nowrap; }
.sk-entropy-bar { position:relative; flex:1; height:14px; background:rgba(255,255,255,0.08); border-radius:8px; overflow:hidden; }
.sk-entropy-fill { height:100%; width:0; background:#46e0a8; transition:width .15s, background .2s; }
.sk-entropy-mark { position:absolute; top:-2px; bottom:-2px; left:75%; width:2px; background:rgba(255,255,255,0.4); }
.sk-entropy-val { font-size:14px; font-weight:bold; width:30px; text-align:right; }
.sk-score { text-align:right; }
.sk-score > span { font-size:22px; font-weight:bold; color:#fff; }
.sk-score-sub { font-size:10px; color:var(--muted,#8aa); }
.sk-hud-right { text-align:right; }
.sk-phase { font-size:13px; color:#ffb13b; letter-spacing:1px; }
.sk-time { font-size:22px; font-weight:bold; color:#fff; }

.sk-canvas-wrap { position:relative; display:flex; justify-content:center; }
#sk-canvas { border-radius:14px; background:#05080f; border:1px solid rgba(90,140,200,0.25); box-shadow:0 0 40px rgba(40,120,200,0.15) inset, 0 8px 30px rgba(0,0,0,0.5); max-width:100%; touch-action:none; -webkit-tap-highlight-color:transparent; }
.sk-touch-hint { display:none; font-size:11px; color:var(--muted,#8aa); text-align:center; margin-top:6px; }
/* 虚拟方向键：默认隐藏，仅触屏设备显示 */
.sk-dpad { display:none; }
@media (hover:none) and (pointer:coarse) {
    .sk-touch-hint { display:block; }
    .sk-skill-key { opacity:.55; }
    /* 触屏：画布按宽度自适应保持正方形，不被拉伸 */
    #sk-canvas { width:100%; height:auto; }
    .sk-dpad {
        display:grid; grid-template-columns:repeat(3, 54px); grid-template-rows:repeat(3, 54px);
        gap:6px; position:absolute; right:10px; bottom:10px; z-index:6; touch-action:none;
    }
    .sk-dbtn {
        display:flex; align-items:center; justify-content:center; font-size:22px; color:#dfe;
        border-radius:14px; border:1px solid rgba(255,255,255,0.18);
        background:rgba(10,16,28,0.82); box-shadow:0 2px 10px rgba(0,0,0,0.4);
        -webkit-tap-highlight-color:transparent; user-select:none;
    }
    .sk-dbtn:active { background:rgba(70,224,168,0.35); border-color:var(--accent,#46e0a8); }
    .sk-dbtn.up { grid-area:1 / 2 / 2 / 3; }
    .sk-dbtn.left { grid-area:2 / 1 / 3 / 2; }
    .sk-dbtn.right { grid-area:2 / 3 / 3 / 4; }
    .sk-dbtn.down { grid-area:3 / 2 / 4 / 3; }
}
/* 窄屏（含非触屏小窗）同样保持画布比例，避免拉伸 */
@media (max-width:600px) {
    #sk-canvas { width:100%; height:auto; }
}
.sk-countdown { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:72px; font-weight:bold; color:#46e0a8; text-shadow:0 0 30px rgba(70,224,168,0.6); background:rgba(5,8,15,0.5); border-radius:14px; }
.sk-skillbar { position:absolute; left:8px; bottom:8px; display:flex; gap:8px; }
.sk-skill { position:relative; display:flex; flex-direction:column; align-items:center; padding:6px 10px; border-radius:10px; border:1px solid rgba(255,255,255,0.12); background:rgba(10,16,28,0.85); color:#dfe; cursor:pointer; min-width:64px; }
.sk-skill .sk-skill-key { font-size:11px; color:#6f8; }
.sk-skill .sk-skill-name { font-size:11px; }
.sk-skill.dim { opacity:.4; }
.sk-skill.mine { border-color:var(--accent,#46e0a8); box-shadow:0 0 14px rgba(70,224,168,0.3); }
.sk-skill-cd { font-size:11px; color:#ffb13b; min-height:13px; }

.sk-side { display:flex; flex-direction:column; gap:6px; }
.sk-board-title { font-size:12px; color:var(--accent,#46e0a8); letter-spacing:1px; }
.sk-board { display:flex; flex-direction:column; gap:3px; max-height:200px; overflow-y:auto; }
.sk-board-row { display:flex; align-items:center; gap:6px; font-size:12px; padding:4px 8px; border-radius:8px; background:rgba(255,255,255,0.03); }
.sk-board-row.me { background:rgba(70,224,168,0.15); border:1px solid rgba(70,224,168,0.3); }
.sk-board-row.dead { opacity:.45; }
.sb-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sb-team { font-size:10px; padding:1px 5px; border-radius:6px; }
.sb-team.t0 { background:rgba(79,195,247,0.25); color:#9fe3ff; }
.sb-team.t1 { background:rgba(255,90,110,0.25); color:#ffb0bb; }
.sb-score { font-weight:bold; width:42px; text-align:right; }
.sb-ent { font-size:10px; color:#ffb13b; width:24px; text-align:right; }
.sk-legend { display:flex; flex-wrap:wrap; gap:8px; font-size:11px; color:var(--muted,#8aa); }
.sk-legend span { display:flex; align-items:center; gap:4px; }
.sk-legend i { width:10px; height:10px; border-radius:50%; display:inline-block; }
.sk-tip { font-size:11px; color:var(--muted,#8aa); }

.sk-result { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(5,8,15,0.82); border-radius:14px; backdrop-filter:blur(3px); }
.sk-result-inner { width:92%; max-width:420px; background:rgba(14,20,34,0.95); border:1px solid rgba(70,224,168,0.3); border-radius:16px; padding:18px; text-align:center; }
.sk-result-title { font-size:22px; margin:0 0 12px; }
.sk-result-title.win { color:#46e0a8; }
.sk-result-title.lose { color:#ff7e8e; }
.sk-result-rows { display:flex; flex-direction:column; gap:4px; max-height:240px; overflow-y:auto; margin-bottom:12px; }
.sk-res-row { display:flex; align-items:center; gap:6px; font-size:12px; padding:5px 8px; border-radius:8px; background:rgba(255,255,255,0.03); }
.sk-res-row.me { background:rgba(70,224,168,0.15); }
.sk-res-row.win { border:1px solid rgba(70,224,168,0.4); }
.sk-res-row.dead { opacity:.5; }
.rr-rank { width:26px; font-weight:bold; }
.rr-name { flex:1; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rr-team { font-size:10px; padding:1px 5px; border-radius:6px; }
.rr-team.t0 { background:rgba(79,195,247,0.25); color:#9fe3ff; }
.rr-team.t1 { background:rgba(255,90,110,0.25); color:#ffb0bb; }
.rr-score { width:46px; font-weight:bold; text-align:right; }
.rr-detail { font-size:10px; color:var(--muted,#8aa); width:96px; text-align:right; }
.sk-result-rewards { display:flex; justify-content:space-around; margin-bottom:14px; }
.sk-result-rewards div { display:flex; flex-direction:column; font-size:11px; color:var(--muted,#8aa); }
.sk-result-rewards b { font-size:16px; color:#fff; }
.sk-result-actions { display:flex; gap:10px; }
.sk-result-actions .btn-game { flex:1; }

/* =========================================================
   NEXUS 视觉提质 v2 —— 平台外壳统一升级层
   （极光背景 / 玻璃拟态 / 悬浮发光 / 入场动画 / 滚动条）
   ========================================================= */
@keyframes auroraShift {
    0%   { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50%  { background-position: 30% 20%, 70% 80%, 50% 50%; }
    100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sheen {
    0%   { transform: translateX(-120%) skewX(-18deg); }
    60%  { transform: translateX(220%) skewX(-18deg); }
    100% { transform: translateX(220%) skewX(-18deg); }
}
@keyframes modalPop {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes logoFlow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* 极光动态背景（叠加在原有 body::before 之上） */
body::after {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(40% 50% at 15% 20%, rgba(108,92,231,.12), transparent 60%),
        radial-gradient(45% 45% at 85% 30%, rgba(0,210,255,.10), transparent 60%),
        radial-gradient(50% 50% at 50% 90%, rgba(255,176,32,.06), transparent 60%);
    background-size: 200% 200%, 200% 200%, 200% 200%;
    animation: auroraShift 18s ease-in-out infinite;
    opacity: .9;
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--primary), var(--accent)); border-radius: 10px; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--accent), var(--primary-light)); }
::selection { background: rgba(0,210,255,.3); color: #fff; }

/* 玻璃导航栏 + 顶部流光边框 */
.navbar {
    background: rgba(12, 16, 30, 0.72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid transparent;
    box-shadow: 0 4px 30px rgba(0,0,0,.35);
    overflow: hidden;
}
.navbar::before {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    opacity: .6;
}
.nav-logo {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light), var(--primary));
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: logoFlow 6s linear infinite;
    filter: drop-shadow(0 0 10px rgba(0,210,255,.35));
}
.nav-item:hover { color: var(--text); background: var(--bg-card-hover); transform: translateY(-1px); }
.nav-item.active {
    color: #fff; background: linear-gradient(135deg, rgba(108,92,231,.25), rgba(0,210,255,.18));
    box-shadow: inset 0 0 0 1px rgba(0,210,255,.35), 0 4px 16px rgba(0,210,255,.18);
}
.nav-stat { background: rgba(28,35,51,.7); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }

/* 主按钮：渐变 + 辉光 + 流光 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-size: 180% 180%;
    box-shadow: 0 6px 22px var(--primary-glow);
    letter-spacing: .5px;
    position: relative; overflow: hidden;
}
.btn-primary::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg); transition: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    background-position: 100% 100%;
    box-shadow: 0 10px 30px var(--primary-glow), 0 0 18px var(--accent-glow);
}
.btn-primary:hover::after { animation: sheen .9s ease; }
.btn-primary:active { transform: translateY(0) scale(.99); }

/* 通用次级按钮（玻璃） */
.btn-secondary, .btn-sm, .btn-game {
    background: rgba(28,35,51,.8); border: 1px solid var(--border);
    backdrop-filter: blur(8px); transition: var(--transition);
}
.btn-secondary:hover, .btn-sm:hover, .btn-game:hover {
    border-color: var(--accent); color: var(--accent);
    box-shadow: 0 4px 18px rgba(0,210,255,.18);
}

/* 大厅卡片：玻璃 + 悬浮发光 + 入场动画 */
.game-grid { gap: 22px; }
.game-card {
    background: linear-gradient(160deg, rgba(19,24,38,.92), rgba(14,18,30,.92));
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
    animation: cardIn .5s cubic-bezier(.2,.7,.3,1) both;
}
.game-card:nth-child(2) { animation-delay: .05s; }
.game-card:nth-child(3) { animation-delay: .10s; }
.game-card:nth-child(4) { animation-delay: .15s; }
.game-card:nth-child(5) { animation-delay: .20s; }
.game-card:nth-child(6) { animation-delay: .25s; }
.game-card:nth-child(7) { animation-delay: .30s; }
.game-card:nth-child(8) { animation-delay: .35s; }
.game-card:nth-child(9) { animation-delay: .40s; }
.game-card:nth-child(10){ animation-delay: .45s; }
.game-card::before {
    content: ''; position: absolute; inset: 0; border-radius: var(--radius-lg);
    padding: 1px; background: linear-gradient(135deg, transparent, rgba(0,210,255,.5), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: var(--transition); pointer-events: none;
}
.game-card:hover {
    transform: translateY(-8px) scale(1.015);
    border-color: var(--accent);
    box-shadow: 0 18px 44px rgba(0,0,0,.45), 0 0 28px rgba(0,210,255,.22);
}
.game-card:hover::before { opacity: 1; }
.game-card-banner {
    height: 150px;
    background-size: cover, 200% 200% !important;
    box-shadow: inset 0 -30px 50px rgba(0,0,0,.45);
}
.game-card-banner::before {
    content: ''; position: absolute; top: 0; left: 0; width: 35%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
    transform: skewX(-18deg); animation: sheen 5.5s ease-in-out infinite;
}
.game-card-title {
    font-size: 18px; font-weight: 800; letter-spacing: .3px;
    background: linear-gradient(90deg, #fff, #cfe9ff);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.game-card-tag {
    background: rgba(0,210,255,.12); border: 1px solid rgba(0,210,255,.25);
    color: #9fe3ff; font-weight: 600;
}
.game-card-reward {
    color: var(--gold); font-weight: 800; text-shadow: 0 0 12px var(--gold-glow);
}

/* 弹窗：玻璃 + 弹入 */
.modal { background: rgba(4,7,15,.6); backdrop-filter: blur(8px); }
.modal.active { animation: none; }
.modal-content {
    background: linear-gradient(160deg, rgba(22,28,46,.96), rgba(14,18,30,.98));
    border: 1px solid var(--border-hover);
    box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(108,92,231,.12);
    animation: modalPop .28s cubic-bezier(.2,.8,.3,1) both;
}
.game-modal-header h2 { background: linear-gradient(90deg, var(--primary-light), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.modal-close:hover { transform: rotate(90deg); }

/* Toast：玻璃 + 图标 + 弹入 */
.toast {
    border-radius: 14px; padding: 13px 22px 13px 46px;
    background: linear-gradient(160deg, rgba(26,33,56,.96), rgba(16,20,34,.96));
    border: 1px solid var(--border-hover);
    box-shadow: 0 12px 36px rgba(0,0,0,.5);
    font-weight: 600; backdrop-filter: blur(12px);
}
.toast.show { animation: toastIn .3s cubic-bezier(.2,.8,.3,1) both; }
.toast::before {
    content: 'ℹ'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; background: var(--accent);
}
.toast.success { box-shadow: 0 12px 36px rgba(0,184,148,.3), 0 0 22px rgba(0,184,148,.2); }
.toast.success::before { content: '✓'; background: var(--success); }
.toast.error { box-shadow: 0 12px 36px rgba(231,76,60,.3), 0 0 22px rgba(231,76,60,.2); }
.toast.error::before { content: '✕'; background: var(--danger); }
.toast.info::before { content: 'ℹ'; background: var(--accent); }

/* 登录/注册：极光背景 + 漂浮光球 + 玻璃卡（重设计 v=aj） */
#auth-view {
    overflow: hidden;
    background:
        radial-gradient(50% 60% at 20% 25%, rgba(108,92,231,.22), transparent 60%),
        radial-gradient(50% 60% at 80% 75%, rgba(0,210,255,.18), transparent 60%),
        linear-gradient(135deg, #070a14 0%, #111627 50%, #070a14 100%);
    background-size: 200% 200%, 200% 200%, 100% 100%;
    animation: auroraShift 16s ease-in-out infinite;
}
/* 漂浮光球（增强极光氛围） */
#auth-view::before, #auth-view::after {
    content: ''; position: absolute; border-radius: 50%; z-index: 0; pointer-events: none;
    filter: blur(40px); opacity: .5;
}
#auth-view::before {
    width: 380px; height: 380px; top: -80px; left: -60px;
    background: radial-gradient(circle, rgba(108,92,231,.55), transparent 70%);
    animation: orbFloat 14s ease-in-out infinite alternate;
}
#auth-view::after {
    width: 320px; height: 320px; bottom: -70px; right: -50px;
    background: radial-gradient(circle, rgba(0,210,255,.5), transparent 70%);
    animation: orbFloat 17s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px,30px,0) scale(1.12); } }

.auth-container { max-width: 440px; padding: 20px; position: relative; z-index: 2; }

/* 后台登录沿用（兼容） */
.auth-logo { text-align: center; margin-bottom: 28px; }
.logo-img { display: block; max-width: 240px; height: auto; margin: 0 auto 8px; filter: drop-shadow(0 4px 20px rgba(108,92,231,.35)); }
.logo-sub { display: block; font-size: 14px; letter-spacing: 2px; color: var(--text-dim); }

/* 主平台登录：玻璃卡 + 流光描边（复用 game frame 技术） */
.auth-card {
    position: relative; z-index: 2;
    padding: 40px 36px 32px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(24,30,50,.92), rgba(13,17,28,.96));
    border: 1px solid var(--border-hover);
    box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 50px rgba(108,92,231,.10), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    animation: authCardIn .6s cubic-bezier(.2,.8,.3,1) both;
    overflow: hidden;
}
@keyframes authCardIn { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-card::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--frame-ang),
        rgba(0,210,255,0) 0deg, rgba(0,210,255,.8) 55deg, rgba(108,92,231,.8) 115deg,
        rgba(0,210,255,0) 195deg, rgba(0,210,255,0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: frameSpin 7s linear infinite;
}
/* 品牌区 */
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo-badge {
    width: 92px; height: 92px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 26px;
    background: radial-gradient(circle at 50% 38%, rgba(108,92,231,.3), rgba(0,210,255,.12) 60%, transparent 72%);
    box-shadow: 0 0 42px rgba(108,92,231,.4), inset 0 0 0 1px rgba(255,255,255,.1);
    animation: logoFloat 5s ease-in-out infinite;
}
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-logo-img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.45)); }
.auth-title {
    margin: 0; font-family: 'Orbitron', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: 3px;
    background: linear-gradient(90deg, #fff, #9fe3ff, #c4b5fd, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: logoFlow 6s linear infinite;
    filter: drop-shadow(0 0 18px rgba(0,210,255,.3));
}
.auth-tagline { margin: 8px 0 0; font-size: 12px; letter-spacing: 5px; color: var(--text-dim); }

/* 标签页：分段玻璃控件 */
.auth-tabs {
    display: flex; gap: 6px; padding: 6px; margin-bottom: 22px;
    background: rgba(12,16,28,.6); border-radius: 14px; border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.auth-tab {
    flex: 1; padding: 11px; text-align: center; border-radius: 10px; cursor: pointer;
    color: var(--text-dim); font-weight: 600; font-size: 15px; letter-spacing: 1px;
    transition: var(--transition); border: none; background: transparent;
}
.auth-tab:hover { color: #cfd8ff; }
.auth-tab.active {
    color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 18px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.25);
}

/* 表单（后台沿用玻璃卡；主平台卡内透明） */
.auth-form { display: none; background: rgba(19,24,38,.55); padding: 26px; border-radius: 18px; border: 1px solid var(--border); backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.auth-form.active { display: block; animation: formFade .35s ease both; }
@keyframes formFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-card .auth-form { background: transparent; border: none; box-shadow: none; padding: 0; backdrop-filter: none; }

.form-group { margin-bottom: 16px; }
.form-group label { font-size: 13px; color: var(--text-dim); font-weight: 600; margin-bottom: 7px; display: block; }
.form-group input {
    width: 100%; padding: 13px 14px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 12px; color: var(--text); font-size: 15px; transition: var(--transition);
}
.form-group input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,210,255,.18), 0 0 18px rgba(0,210,255,.15);
    background: #20283c;
}

/* 主平台登录：带图标输入框 */
.field { position: relative; }
.field-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; opacity: .6; pointer-events: none; transition: var(--transition);
}
.field input { padding-left: 42px; }
.field:focus-within .field-icon { opacity: 1; }

.auth-submit { width: 100%; margin-top: 6px; padding: 14px; font-size: 16px; }
.auth-hint { text-align: center; margin: 16px 0 0; font-size: 13px; color: var(--text-dim); }
.optional-tip { color: var(--text-mute); font-weight: 400; }
.auth-footer { text-align: center; margin: 22px 0 0; font-size: 12px; color: var(--text-mute); letter-spacing: .5px; }

/* 底部导航：玻璃药丸 */
.bottom-nav {
    background: rgba(12,16,30,.8); backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-top: 1px solid transparent;
    box-shadow: 0 -4px 30px rgba(0,0,0,.4);
}
.bottom-nav::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5;
}
.bottom-nav-item.active {
    background: linear-gradient(135deg, rgba(108,92,231,.25), rgba(0,210,255,.18));
    box-shadow: inset 0 0 0 1px rgba(0,210,255,.3);
    border-radius: 12px; margin: 6px 4px;
}
.bn-icon { filter: drop-shadow(0 0 6px rgba(0,210,255,.4)); }

/* 聚焦态统一 */
button:focus-visible, a:focus-visible, input:focus-visible, .game-card:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

/* 通用面板/卡片玻璃化 */
.profile-card, .profile-section, .lb-panel, .shop-grid .shop-item, .task-card, .achievement-card, .record-card, .feed-item {
    background: linear-gradient(160deg, rgba(19,24,38,.9), rgba(14,18,30,.92));
    border: 1px solid var(--border);
}
.profile-section { backdrop-filter: blur(10px); }

/* 点击涟漪感（全局轻量） */
.btn-primary:active, .nav-item:active, .game-card:active { transition: transform .08s ease; }

/* =====================================================================
   质感升级 v2 (ag) — 统一街机框 / 氛围光 / 打地鼠·记忆翻牌高级化 / 大厅卡强化
   ===================================================================== */

/* 平台氛围光球（极淡，提升空间纵深） */
body::after {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(38% 38% at 12% 18%, rgba(108,92,231,.10), transparent 60%),
        radial-gradient(34% 34% at 88% 82%, rgba(0,210,255,.08), transparent 60%);
    filter: blur(6px);
    animation: ambFloat 20s ease-in-out infinite alternate;
}
@keyframes ambFloat { from { transform: translate3d(0,0,0); } to { transform: translate3d(0,-24px,0); } }

/* 游戏内统一「街机框」：玻璃边框 + 外发光 + 内描边 */
.game-canvas-wrap, #skc-wrap {
    padding: 14px;
    background: linear-gradient(160deg, rgba(30,38,58,.5), rgba(13,17,28,.55));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 44px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 30px rgba(108,92,231,.05);
    backdrop-filter: blur(6px);
}
.game-canvas-wrap > canvas {
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 8px 26px rgba(0,0,0,.45);
}
/* 棋盘类 DOM 容器也加一层内发光 */
#g2048-board, #ms-board, #mem-board, #whack-board { box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.35); }

/* HUD 信息条：玻璃药丸 */
.game-info-bar {
    background: linear-gradient(160deg, rgba(28,35,51,.7), rgba(16,20,34,.7));
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 20px rgba(0,0,0,.25);
    backdrop-filter: blur(8px);
}
.game-info-value {
    font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 19px;
    color: #eaf2ff; text-shadow: 0 0 14px rgba(0,210,255,.25);
}

/* ---------- 打地鼠：玻璃地窝 + 高光地鼠 ---------- */
.whack-hole {
    background: radial-gradient(ellipse at 50% 28%, #2b3656, #141b30 68%, #090e1a);
    border: 2px solid rgba(86,102,150,.5);
    box-shadow: inset 0 16px 26px rgba(0,0,0,.72), inset 0 0 0 2px rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.45);
}
.whack-hole:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 14px 22px rgba(0,0,0,.6), 0 12px 24px rgba(0,0,0,.5), 0 0 22px rgba(108,92,231,.3);
}
.whack-mole {
    width: 72%; height: 72%;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 38% 30%, #c3b0ff, #6c5ce7 52%, #382c86 100%);
    box-shadow: inset 0 -7px 12px rgba(0,0,0,.4), inset 0 7px 12px rgba(255,255,255,.3), 0 6px 14px rgba(0,0,0,.45);
    font-size: 2.4em;
}
.whack-mole::after {
    content: ''; position: absolute; top: 13%; left: 24%; width: 34%; height: 26%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.9), transparent 70%);
    border-radius: 50%; pointer-events: none;
}
.whack-hole.golden .whack-mole {
    background: radial-gradient(circle at 38% 30%, #fff4c6, #ffd54f 52%, #c8931a 100%);
    box-shadow: inset 0 -7px 12px rgba(120,80,0,.35), inset 0 7px 12px rgba(255,255,255,.4), 0 0 20px rgba(255,213,0,.55);
}
.whack-hole.bomb .whack-mole {
    background: radial-gradient(circle at 38% 30%, #ffb0b0, #e74c3c 52%, #8c1c16 100%);
    box-shadow: inset 0 -7px 12px rgba(80,0,0,.4), inset 0 7px 12px rgba(255,255,255,.35), 0 0 20px rgba(231,76,60,.55);
}

/* ---------- 记忆翻牌：玻璃卡面 + 高光 ---------- */
.mem-front, .mem-back {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -8px 16px rgba(0,0,0,.25), 0 0 18px rgba(108,92,231,.12);
}
.mem-front {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.18), transparent 46%),
        linear-gradient(150deg, #2c3760, #171f38 60%, #121829);
}
.mem-front::before {
    content: '✦'; position: absolute; font-size: .9em; color: rgba(162,155,254,.55);
    filter: drop-shadow(0 0 6px rgba(108,92,231,.6));
}
.mem-back {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.2), transparent 46%),
        linear-gradient(150deg, #3a2c6e, #1b2440 60%, #18203c);
}
.mem-card:hover .mem-face {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 22px rgba(0,210,255,.3);
}

/* ---------- 大厅卡片：开始按钮 + 图标微动 ---------- */
.game-card-banner { transition: transform .45s cubic-bezier(.2,.7,.3,1); text-shadow: 0 6px 18px rgba(0,0,0,.5); }
.game-card:hover .game-card-banner { transform: scale(1.05); }
.play-pill {
    position: absolute; left: 50%; bottom: 14px; z-index: 3; transform: translate(-50%, 14px);
    padding: 8px 18px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(108,92,231,.95), rgba(0,210,255,.92));
    color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0,210,255,.4); opacity: 0; pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}
.game-card:hover .play-pill { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   质感升级 v3 (ah) — 统一「流光描边」街机框 + 氛围竞技场(arena)背景
   ===================================================================== */

/* 让街机框成为定位容器并裁剪氛围层 */
.game-canvas-wrap, #skc-wrap {
    position: relative;
    overflow: hidden;
}
/* 竞技场氛围：玻璃框内缓慢漂移的双色光晕，制造纵深与“贵气” */
.game-canvas-wrap::before, #skc-wrap::before {
    content: ''; position: absolute; inset: -22%;
    z-index: 0; pointer-events: none;
    background:
        radial-gradient(40% 40% at 22% 16%, rgba(108,92,231,.24), transparent 60%),
        radial-gradient(38% 38% at 82% 84%, rgba(0,210,255,.20), transparent 60%),
        radial-gradient(32% 32% at 50% 52%, rgba(154,106,217,.12), transparent 70%);
    filter: blur(9px);
    animation: arenaDrift 18s ease-in-out infinite alternate;
}
@keyframes arenaDrift {
    0%   { transform: translate3d(-3%, 2%, 0) scale(1.02); }
    50%  { transform: translate3d(3%, -2%, 0) scale(1.06); }
    100% { transform: translate3d(-2%, 3%, 0) scale(1.03); }
}
/* 流光描边：沿玻璃框旋转的高光环（用 @property 动画 conic 角度，避免旋转破坏圆角） */
@property --frame-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.game-canvas-wrap::after, #skc-wrap::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--frame-ang),
        rgba(0,210,255,0) 0deg,
        rgba(0,210,255,.85) 55deg,
        rgba(108,92,231,.85) 115deg,
        rgba(0,210,255,0) 195deg,
        rgba(0,210,255,0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: frameSpin 7s linear infinite;
}
@keyframes frameSpin { to { --frame-ang: 360deg; } }
/* 画布 / 棋盘置于氛围之上、描边之下 */
.game-canvas-wrap > canvas, #skc-wrap > canvas,
.game-canvas-wrap > #g2048-board, .game-canvas-wrap > #ms-board,
.game-canvas-wrap > #mem-board, .game-canvas-wrap > #whack-board {
    position: relative; z-index: 1;
}
/* 画布本身加一层“屏幕”内辉光，强化玻璃质感 */
.game-canvas-wrap > canvas, #skc-wrap > canvas {
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 26px rgba(108,92,231,.18), 0 8px 26px rgba(0,0,0,.45);
}

/* ============================================================
   UI 升级 · 第二档（v=20260718e）
   在既有「玻璃+极光+流光描边」第一档之上追加增量效果。
   全部为新增属性 / 新选择器 / 新动画，不改动 display·flex·width
   等布局属性，移动端响应式规则不受影响。
   ============================================================ */

/* ---- A. 全局氛围背景增强：更鲜明的极光 + 慢漂移 ---- */
@keyframes auroraDrift {
    0%   { background-position: 0% 0%,   100% 100%, 50% 100%, 0% 50%; }
    50%  { background-position: 100% 50%, 0% 50%,  50% 0%,   100% 100%; }
    100% { background-position: 0% 0%,   100% 100%, 50% 100%, 0% 50%; }
}
body::after {
    background:
        radial-gradient(38% 46% at 12% 18%, rgba(108,92,231,.22), transparent 60%),
        radial-gradient(42% 42% at 88% 22%, rgba(0,210,255,.18),  transparent 60%),
        radial-gradient(46% 50% at 78% 82%, rgba(255,176,32,.10), transparent 62%),
        radial-gradient(50% 54% at 22% 88%, rgba(185,103,255,.14), transparent 62%);
    background-size: 220% 220%, 220% 220%, 220% 220%, 220% 220%;
    animation: auroraDrift 26s ease-in-out infinite;
    opacity: 1;
}

/* ---- B. 页面 / 视图入场过渡 ---- */
.view { transition: opacity .3s ease; }
.page.active { animation: pageIn .35s cubic-bezier(.2,.8,.3,1) both; }
@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ---- C. 大厅卡片增强：旋转流光环 + 横幅缩放 + 开始胶囊滑入 ---- */
.game-card {
    transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s, border-color .35s;
    transform-style: preserve-3d;
}
.game-card:hover { transform: translateY(-10px) scale(1.02); }
.game-card .game-card-banner { transition: transform .5s ease; }
.game-card:hover .game-card-banner { transform: scale(1.06); }
.game-card::after {
    content: ''; position: absolute; inset: -1px; border-radius: var(--radius-lg);
    padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity .4s;
    background: conic-gradient(from var(--frame-ang),
        rgba(0,210,255,0) 0deg, rgba(0,210,255,.9) 60deg, rgba(108,92,231,.9) 120deg,
        rgba(0,210,255,0) 200deg, rgba(0,210,255,0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: frameSpin 6s linear infinite;
}
.game-card:hover::after { opacity: 1; }
.play-pill {
    display: inline-block; margin-left: 10px; padding: 4px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 800; color: #fff; letter-spacing: .5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateY(4px); opacity: .85; transition: .3s var(--transition);
}
.game-card:hover .play-pill { transform: translateY(0) scale(1.06); opacity: 1; box-shadow: 0 6px 20px var(--accent-glow); }

/* ---- D. 导航激活项：流光下划线脉冲 ---- */
.nav-item.active { position: relative; }
.nav-item.active::after {
    content: ''; position: absolute; left: 18%; right: 18%; bottom: 6px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    box-shadow: 0 0 10px var(--accent-glow);
    animation: navPulse 2.2s ease-in-out infinite;
}
@keyframes navPulse {
    0%, 100% { opacity: .55; transform: scaleX(.85); }
    50%      { opacity: 1;   transform: scaleX(1); }
}

/* ---- E. 弹窗：更深玻璃 + 顶部高光 + 圆角 ---- */
.modal-content { position: relative; border-radius: 22px; overflow: hidden; }
.modal-content::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
    background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 20%);
}

/* ---- F. Toast：底部进度条 + 彩色辉光 ---- */
.toast { position: relative; overflow: hidden; }
.toast::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    transform: scaleX(0); transform-origin: left; opacity: 0;
}
.toast.show::after { opacity: .85; animation: toastBar 3s linear forwards; }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.success::after { background: linear-gradient(90deg, var(--success), #6ff0c8); }
.toast.error::after   { background: linear-gradient(90deg, var(--danger), #ff8a7a); }

/* ---- G. 按钮按压回弹（全按钮） ---- */
.btn-primary:active, .btn-game:active, .btn-secondary:active, .btn-sm:active, .auth-submit:active {
    transform: translateY(1px) scale(.98);
}

/* ---- H. 难度分段控件：玻璃轨道 + 滑动激活态 ---- */
.diff-buttons {
    display: flex; gap: 8px; padding: 6px; margin: 6px 0 4px;
    background: rgba(10,14,26,.6); border: 1px solid var(--border); border-radius: 14px;
    backdrop-filter: blur(8px);
}
.btn-diff { flex: 1; border-radius: 10px; transition: var(--transition); }
.btn-diff.active {
    color: #fff; border-color: transparent; transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 6px 18px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.25);
}

/* ---- I. 列表类卡片：入场 + 悬浮 ---- */
.shop-card, .ach-card, .task-card, .record-card, .lb-row {
    animation: cardIn .5s cubic-bezier(.2,.7,.3,1) both;
}
.shop-card:hover, .ach-card.unlocked:hover, .task-card:hover, .record-card:hover {
    transform: translateY(-4px); border-color: var(--accent);
    box-shadow: 0 14px 34px rgba(0,0,0,.4), 0 0 22px rgba(0,210,255,.16);
}
.lb-row:hover { border-color: var(--accent); box-shadow: 0 8px 26px rgba(0,0,0,.35); }

/* ---- J. 排行榜奖牌辉光脉冲 ---- */
.lb-rank.r1, .lb-rank.r2, .lb-rank.r3 { animation: medalPulse 2.4s ease-in-out infinite; }
.lb-rank.r1 { box-shadow: 0 0 18px rgba(255,215,0,.45); }
.lb-rank.r2 { box-shadow: 0 0 16px rgba(192,192,192,.4); }
.lb-rank.r3 { box-shadow: 0 0 16px rgba(205,127,50,.4); }
@keyframes medalPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---- K. 横幅 / 个人中心玻璃 ---- */
.banner {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(108,92,231,.14), rgba(0,210,255,.08));
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(108,92,231,.12), inset 0 1px 0 rgba(255,255,255,.06);
}
.banner::before {
    content: ''; position: absolute; top: -40%; right: -8%; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(0,210,255,.18), transparent 70%); filter: blur(20px);
    pointer-events: none;
}
.profile-card {
    background: linear-gradient(160deg, rgba(22,28,46,.9), rgba(14,18,30,.95));
    border: 1px solid var(--border-hover);
    box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(12px);
}

/* ---- L. 徽标 / 奖励脉冲 ---- */
.bn-badge, .task-badge, .lobby-task-badge { animation: badgePop 1.6s ease-in-out infinite; }
@keyframes badgePop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.game-card-reward { animation: rewardGlow 2.4s ease-in-out infinite; }
@keyframes rewardGlow {
    0%, 100% { text-shadow: 0 0 12px var(--gold-glow); }
    50%      { text-shadow: 0 0 22px rgba(255,215,0,.6); }
}

/* ---- M. 结算页：胜利辉光脉冲 + 入场 ---- */
.game-result { animation: modalPop .3s cubic-bezier(.2,.8,.3,1) both; }
.game-result-title.win {
    background: linear-gradient(90deg, #ffe27a, #ffb347, #ff7eb3);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(255,200,80,.5));
    animation: winPulse 2s ease-in-out infinite;
}
@keyframes winPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---- N. 胜利彩带（由 app.js spawnConfetti 注入） ---- */
.confetti-piece {
    position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px;
    pointer-events: none; z-index: 60;
    animation: confettiFall var(--cf-dur, 1.2s) cubic-bezier(.3,.6,.5,1) forwards;
}
@keyframes confettiFall { to { transform: translateY(62vh) rotate(540deg); opacity: 0; } }

/* ---- O. 无障碍：尊重「减少动态效果」 ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ===== P. NEX 货币与价格走势 ===== */
.profile-stat-row.nex-balance-row .profile-stat-value {
    color: #36d399;
    text-shadow: 0 0 12px rgba(54,211,153,.35);
}
.nex-section {
    border: 1px solid rgba(54,211,153,.25);
    background: linear-gradient(160deg, rgba(54,211,153,.06), rgba(20,28,48,.2));
}
.nex-price-row {
    display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px;
}
.nex-price {
    font-size: 26px; font-weight: 800; color: #ffd166;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    text-shadow: 0 0 14px rgba(255,209,102,.4);
}
.nex-price-tip { font-size: 12px; color: var(--text-mute); }
.nex-kline-wrap {
    width: 100%;
    background: rgba(10,14,26,.45);
    border: 1px solid rgba(150,180,210,.12);
    border-radius: 14px;
    padding: 6px;
    overflow: hidden;
}
.nex-kline { width: 100%; height: 200px; display: block; }
.nex-kline.mini { height: 150px; }
.nex-desc { font-size: 12px; color: var(--text-dim); margin: 10px 2px 0; line-height: 1.6; }
.nex-desc code {
    font-family: ui-monospace, 'Orbitron', monospace;
    font-size: 11px; color: #36d399;
    word-break: break-all;
    background: rgba(54, 211, 153, .12);
    padding: 1px 5px; border-radius: 5px;
}

/* 后台 NEX 价格设置 */
.nex-cur-price {
    font-size: 18px; font-weight: 700; color: #ffd166; font-family: ui-monospace, monospace;
}
.nex-kline-wrap.admin { margin-top: 10px; }

/* ===== NEX 提现 ===== */
.nex-withdraw-form { margin-top: 10px; }
.nex-withdraw-form .config-row { margin-bottom: 12px; }
.nex-withdraw-form input {
    width: 100%;
    background: rgba(10,14,26,.5);
    border: 1px solid rgba(150,180,210,.2);
    border-radius: 10px;
    color: #e8eefc;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.nex-withdraw-form input:focus { border-color: #36d399; }
.nex-withdraw-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nex-withdraw-msg { font-size: 12.5px; color: var(--text-mute, #9aa); }
.nex-withdraw-msg.ok { color: #36d399; }

/* 后台 - 提现记录 */
.wx-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.wx-table th, .wx-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid rgba(150,180,210,.12); }
.wx-table th { color: var(--text-mute); font-weight: 600; }
.wx-table td.addr { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #ffd166; word-break: break-all; max-width: 240px; }
.wx-status { padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.wx-status.pending { background: rgba(255,209,102,.18); color: #ffd166; }
.wx-status.done { background: rgba(54,211,153,.18); color: #36d399; }
.wx-status.rejected { background: rgba(255,107,107,.18); color: #ff8a8a; }
.wx-actions button { margin-right: 6px; }
.wx-empty { color: var(--text-mute); padding: 14px 0; }
