:root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --line: #262d38;
    --text: #e6edf3;
    --muted: #8b949e;
    --primary: #4f8cff;
    --ok: #3fb950;
    --danger: #f85149;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    /* 关键：html/body 锁住不滚动，滚动交给 .container */
    height: 100%;
    overflow: hidden;
}

body {
    background: radial-gradient(1200px 600px at 50% -10%, #1b2a44 0%, var(--bg) 60%);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    /* 列式 flex：topbar 固定高度在上，.container 占满剩余高度并自己滚动 */
    display: flex;
    flex-direction: column;
}

/* 让 .container 成为视口内唯一的滚动容器（占满 topbar 之外的剩余高度） */
.container {
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 60px;
    flex: 1 1 auto;
    min-height: 0; /* flex 子项需要 min-height:0 才能正确收缩并溢出滚动 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== 顶部导航 ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(13, 17, 23, .85);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    /* body 改为 flex 列布局、不滚动，原 sticky 失效；改为相对定位即可，flex 保证 topbar 始终在最顶部 */
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
}

.brand-logo { font-size: 22px; }

.nav { display: flex; gap: 16px; }

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 8px;
}

.nav a:hover { color: var(--text); background: var(--bg-soft); }

.nav-user {
    color: var(--text);
    font-size: 14px;
    padding: 6px 4px;
    opacity: .9;
}

/* ===== 首页 ===== */
.hero { text-align: center; margin: 24px 0 30px; }
.hero h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: 2px; }
.hero p { margin: 0; color: var(--muted); }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 26px rgba(79, 140, 255, .18);
}

.game-icon {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, #22304d, #16202f);
    font-size: 40px;
    overflow: hidden;
}

.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-name { font-weight: 600; font-size: 16px; }
.game-desc { color: var(--muted); font-size: 12px; text-align: center; min-height: 16px; }

.empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 14px;
}

.empty a { color: var(--primary); }

/* ===== 后台 ===== */
.admin-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.admin-head h1 { margin: 0; font-size: 24px; }
.admin-user { color: var(--muted); font-size: 13px; }

.card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.card h2 { margin: 0 0 14px; font-size: 16px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.field input, .field select {
    width: 100%;
    padding: 9px 11px;
    background: #0d1117;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    font-size: 14px;
}

.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.tip { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.btn {
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #20283a;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-mini { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table td.url { color: var(--muted); font-size: 12px; word-break: break-all; }
.ops { white-space: nowrap; }
.row-icon { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.row-icon-text { font-size: 24px; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.badge-on { background: rgba(63, 185, 80, .16); color: var(--ok); }
.badge-off { background: rgba(139, 148, 158, .16); color: var(--muted); }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(248, 81, 73, .12); color: var(--danger); border: 1px solid rgba(248, 81, 73, .3); }
.alert-ok { background: rgba(63, 185, 80, .12); color: var(--ok); border: 1px solid rgba(63, 185, 80, .3); }
.alert-warn { background: rgba(255, 178, 71, .12); color: #ffb247; border: 1px solid rgba(255, 178, 71, .35); }
.alert code { background: rgba(0, 0, 0, .25); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ===== 登录 ===== */
.login-box {
    max-width: 360px;
    margin: 50px auto;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px;
}

.login-box h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 18px 0 30px;
}

/* ============================================================
   游戏大厅（首页）
   ============================================================ */
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(94, 142, 255, .12), rgba(177, 75, 255, .08));
    border: 1px solid rgba(94, 142, 255, .22);
    border-radius: 14px;
    font-size: 14px;
    color: #d6e2ff;
}

.welcome strong { color: #fff; margin: 0 4px; }

.welcome-admin {
    color: #9bb8ff;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid rgba(94, 142, 255, .35);
    border-radius: 999px;
    font-size: 13px;
    transition: color .2s ease, border-color .2s ease;
}
.welcome-admin:hover { color: #fff; border-color: var(--primary); }
.hall {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
    /* 之前用 min-height:calc(100vh - 130px) 会强制撑高，导致页面级滚动条出现。
       现在由 .container 自身负责滚动，.hall 不再强制高度；窄屏下侧栏是横向分类条时也合理。 */
    min-height: 0;
}

.hall-side {
    background: rgba(22, 27, 34, .78);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 14px;
    backdrop-filter: blur(10px);
    align-self: start;
    /* 限制最大高度：内容过多时仅在侧栏内部滚动，避免整体撑高外层 */
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 12px;
}

.side-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5e8eff, #b14bff);
    font-size: 18px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-item {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.side-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(94, 142, 255, .25), rgba(177, 75, 255, .12));
    box-shadow: inset 2px 0 0 #6f9bff;
}

.side-tip {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.hall-main { min-width: 0; }

.hero-banner {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    min-height: 230px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    background: linear-gradient(120deg, #1b2a44 0%, #3b1d63 50%, #1d3c72 100%);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 36px;
}

.hero-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(94, 142, 255, .25);
}

/* 装饰光晕：只负责背景灯效，不再叠加 emoji */
.hero-cover {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 30%, rgba(255, 195, 87, .35), transparent 35%),
        radial-gradient(circle at 20% 80%, rgba(94, 142, 255, .35), transparent 40%),
        radial-gradient(circle at 70% 90%, rgba(177, 75, 255, .35), transparent 45%);
    z-index: 0;
}

/* 右侧装饰 emoji 区：独立容器，可控可堆叠 */
.hero-decor {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-shrink: 0;
    pointer-events: none;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45));
}
.hero-decor span {
    font-size: 70px;
    line-height: 1;
    transition: transform .35s ease;
}
.hero-decor span:nth-child(1) { transform: translateY(-6px); }
.hero-decor span:nth-child(2) { transform: translateY(4px); }
.hero-decor span:nth-child(3) { transform: translateY(-2px); }
.hero-decor span:nth-child(4) { transform: translateY(6px); }
.hero-banner:hover .hero-decor span { transform: translateY(-2px); }

.hero-info {
    position: relative;
    z-index: 1;
    color: #fff;
    flex: 1 1 auto;
    min-width: 0;
}

.hero-eyebrow {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 195, 87, .25);
    color: #ffd089;
    font-size: 12px;
    border-radius: 999px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 195, 87, .35);
}

.hero-title { margin: 0 0 8px; font-size: 30px; letter-spacing: 1px; text-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.hero-sub { margin: 0 0 18px; color: #d6e2ff; font-size: 14px; }

.hero-cta {
    display: inline-block;
    padding: 10px 22px;
    background: linear-gradient(135deg, #ffb14a, #ff7e2a);
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(255, 145, 50, .35);
    transition: transform .15s ease;
}

.hero-cta:hover { transform: translateY(-2px); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 4px 14px; }
.sec-head h2 { margin: 0; font-size: 18px; }
.sec-count { color: var(--muted); font-size: 12px; }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(22, 27, 34, .65);
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 12px 26px rgba(79, 140, 255, .25);
    z-index: 2;
}

.game-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e60, #4d2a78);
    font-size: 50px;
    position: relative;
}

.game-thumb img { width: 100%; height: 100%; object-fit: cover; }

.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, .55);
    opacity: 0;
    transition: opacity .2s ease;
}

.game-card:hover .game-overlay { opacity: 1; }

.play-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #ffb14a, #ff7e2a);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(255, 145, 50, .35);
}

.game-name {
 font-size: 13px;
    text-align: center;
    color: var(--text);
}

@media (max-width: 900px) {
    .hall { grid-template-columns: 1fr; }
    .hall-side {
        position: relative;
        top: 0;
        /* 窄屏侧栏改为横向分类条，去掉竖向滚动限制 */
        max-height: none;
        overflow: visible;
    }
    .hero-banner { padding: 24px 26px; }
    .hero-decor span { font-size: 56px; }
}

/* ============================================================
   协议文档（用户协议 / 隐私政策）
   ============================================================ */
.doc-body {
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -10%, #1b2a44 0%, #050816 60%);
    margin: 0;
}

.doc-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 70px;
}

.doc-card {
    background: rgba(22, 27, 34, .8);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 30px 32px 34px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.doc-back {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: color .2s ease, border-color .2s ease;
}
.doc-back:hover { color: var(--text); border-color: var(--primary); }

.doc-title {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: 1px;
}

.doc-meta { margin: 0 0 18px; color: var(--muted); font-size: 12px; }

.doc-lead {
    padding: 14px 16px;
    background: rgba(79, 140, 255, .08);
    border: 1px solid rgba(79, 140, 255, .22);
    border-radius: 12px;
    color: #cfe0ff;
    font-size: 14px;
    line-height: 1.9;
    margin: 0 0 22px;
}

.doc-card h2 {
    margin: 26px 0 10px;
    font-size: 17px;
    padding-left: 11px;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}

.doc-card p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 2;
    color: #cfd8e3;
}

.doc-card ul { margin: 0 0 12px; padding-left: 22px; }
.doc-card li { font-size: 14px; line-height: 2; color: #cfd8e3; margin-bottom: 4px; }
.doc-card strong { color: #fff; }

.doc-end {
    margin-top: 30px !important;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .doc-card { padding: 22px 18px 26px; }
    .doc-title { font-size: 22px; }
}
.auth-body {
    min-height: 100vh;
    background: #050816;
}

.auth-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 20px;
    margin: 0;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 20%, #2c1c5a 0%, #0b0f1d 45%),
                radial-gradient(ellipse at 80% 80%, #1c3a78 0%, #0b0f1d 45%);
    z-index: -1;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
}

.bg-glow-1 {
    width: 380px; height: 380px;
    background: #7b6cff;
    top: -100px; left: -80px;
    animation: float 14s ease-in-out infinite;
}
.bg-glow-2 {
    width: 320px; height: 320px;
    background: #ff77c1;
    bottom: -80px; right: -60px;
    animation: float 18s ease-in-out infinite reverse;
}
.bg-glow-3 {
    width: 260px; height: 260px;
    background: #5ec8ff;
    top: 35%; right: 18%;
    animation: float 22s ease-in-out infinite;
}

.bg-star {
    position: absolute;
    width: 4px; height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff, 0 0 14px rgba(255, 255, 255, .6);
    opacity: .85;
    animation: twinkle 3s ease-in-out infinite;
}
.s1 { top: 12%; left: 8%; }
.s2 { top: 22%; right: 14%; animation-delay: 1s; }
.s3 { top: 65%; left: 14%; animation-delay: 1.5s; }
.s4 { top: 78%; right: 9%; animation-delay: .6s; }
.s5 { top: 40%; left: 4%; animation-delay: 2.2s; }
.s6 { top: 55%; right: 4%; animation-delay: .9s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}
@keyframes twinkle {
    0%, 100% { opacity: .3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 28px;
    background: rgba(20, 25, 45, .55);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45),
                inset 0 1px 0 rgba(255, 255, 255, .08);
    position: relative;
    z-index: 1;
}

.auth-card::before {
    content: "👁";
    position: absolute;
    top: 14px;
    right: 16px;
    opacity: .35;
    font-size: 16px;
    cursor: pointer;
}

.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo {
    width: 56px; height: 56px;
    margin: 0 auto 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, #6f9bff, #b14bff);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 24px rgba(111, 155, 255, .35);
}
.auth-title { margin: 0; font-size: 22px; letter-spacing: 1px; }
.auth-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 4px; }

.auth-form .alert { margin-bottom: 14px; }

/* 前端实时校验：字段级错误提示 + 输入非法态高亮（手机号格式 / 两次密码一致等均由前端即时校验） */
.auth-err {
    display: none;
    margin: -6px 0 10px 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--danger);
}
.auth-err.show { display: block; }

/* 实名认证提示：强调「绑定后不可修改」 */
.auth-hint {
    margin: -4px 0 12px 6px;
    font-size: 11px;
    line-height: 1.6;
    color: #ffb247;
}
.auth-hint b { color: #ff8f3c; font-weight: 800; }
.auth-field.invalid {
    border-color: rgba(248, 81, 73, .65);
    background: rgba(248, 81, 73, .06);
}
.auth-field.invalid:focus-within {
    border-color: rgba(248, 81, 73, .85);
    box-shadow: 0 0 0 3px rgba(248, 81, 73, .18);
}
.auth-field.valid { border-color: rgba(63, 185, 80, .45); }

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    /* 不透明深色背景：彻底盖掉浏览器 input 默认白底 */
    background: #13182b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    margin-bottom: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-field:hover {
    border-color: rgba(255, 255, 255, .18);
    background: #161e35;
}
.auth-field:focus-within {
    border-color: #6f9bff;
    background: #182143;
    box-shadow: 0 0 0 3px rgba(111, 155, 255, .22),
                0 6px 18px rgba(79, 140, 255, .25);
}

.auth-icon-box {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(94, 142, 255, .25), rgba(177, 75, 255, .22));
    color: #9bb8ff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-field:focus-within .auth-icon-box {
    background: linear-gradient(135deg, #4f8cff, #b14bff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(94, 142, 255, .35);
}

.auth-field input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 6px;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-size: 14px;
    letter-spacing: .5px;
}
.auth-field input::placeholder {
    color: rgba(255, 255, 255, .4);
    letter-spacing: 1px;
}

/* 防止浏览器「自动填充」把输入框变成黄色块 */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #13182b inset;
    box-shadow: 0 0 0 1000px #13182b inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #fff;
}

.auth-eye {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: color .2s ease, background .2s ease;
}
.auth-eye:hover { color: #9bb8ff; background: rgba(255, 255, 255, .04); }
.auth-eye.on { color: #6f9bff; }
.auth-eye .eye-close { display: none; }
.auth-eye.on .eye-open { display: none; }
.auth-eye.on .eye-close { display: block; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 4px 18px;
    font-size: 12px;
    color: var(--muted);
}
.auth-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.auth-check input { accent-color: #6f9bff; }
.auth-link { color: #9bb8ff; text-decoration: none; }
.auth-link:hover { color: #fff; }

.auth-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f8cff, #5e6cff);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 6px;
    box-shadow: 0 12px 24px rgba(79, 140, 255, .45);
    transition: transform .15s ease, box-shadow .15s ease;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(79, 140, 255, .55);
}
.auth-submit:disabled,
.auth-submit.loading {
    opacity: .7;
    cursor: progress;
    transform: none;
    letter-spacing: 2px;
}

.auth-actions {
    display: flex;
    gap: 12px;
    margin: 16px 0 12px;
}
.auth-pill {
    flex: 1;
    text-align: center;
    padding: 9px 0;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid transparent;
    transition: transform .15s ease;
}
.auth-pill:hover { transform: translateY(-1px); }
.auth-pill-register {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
}

.auth-agree {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    margin-top: 6px;
    line-height: 1.6;
    text-align: center;
}
.auth-agree input { accent-color: #6f9bff; margin-top: 3px; }
.auth-agree a { color: #9bb8ff; text-decoration: none; }
.auth-agree a:hover { color: #fff; }

/* ===== 注册页协议勾选区（默认不勾选，读完两份协议才可勾选） ===== */
.reg-agree {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .10);
}
.reg-agree-text {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 9px;
}
.reg-agree-text a { color: #9bb8ff; text-decoration: none; }
.reg-agree-text a:hover { color: #fff; text-decoration: underline; }

.reg-agree-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.5;
}
.reg-agree-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.reg-agree-box {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .06);
    position: relative;
    transition: all .15s;
}
.reg-agree-check input:checked + .reg-agree-box {
    background: linear-gradient(135deg, #4f8cff 0%, #6f9bff 100%);
    border-color: #6f9bff;
}
.reg-agree-check input:checked + .reg-agree-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.reg-agree-label { color: #dbe4f7; }

/* 未读完两份协议：整行置灰、不可勾选 */
.reg-agree-check.locked { cursor: not-allowed; }
.reg-agree-check.locked .reg-agree-box {
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .03);
}
.reg-agree-check.locked .reg-agree-label { color: #7f8db0; }

/* 协议同意状态行：未同意提示 / 已同意回显 + 撤回 */
.auth-agree.acc-state { flex-wrap: wrap; }
.auth-agree .acc-ok { color: #3fb950; }
.auth-agree .acc-ok a { color: #7fd18f; margin-left: 4px; }
.auth-agree .acc-ok a:hover { color: #fff; }

/* 撤回同意：以按钮呈现，确保点击区域足够、可正常响应 */
.auth-agree .acc-revoke {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    color: #b6c2dd;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    pointer-events: auto;
}
.auth-agree .acc-revoke:hover {
    background: rgba(248, 81, 73, .14);
    border-color: rgba(248, 81, 73, .5);
    color: #ff8b84;
}
.auth-agree .acc-revoke:active { transform: scale(.96); }

/* ==================== 隐私政策 / 用户协议 同意弹窗 ==================== */
.pd-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(6, 10, 20, .78);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pd-mask.hidden { display: none; }

.pd-box {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #1b2440 0%, #151c31 100%);
    border: 1px solid rgba(111, 155, 255, .28);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    overflow: hidden;
    animation: pdPop .18s ease-out;
}
@keyframes pdPop {
    from { transform: translateY(14px) scale(.97); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.pd-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.pd-icon { font-size: 22px; }
.pd-title { font-size: 17px; font-weight: 700; color: #fff; margin: 0; }

.pd-body { padding: 16px 20px 6px; }
.pd-lead { color: #c9d4ea; font-size: 13px; line-height: 1.7; margin: 0 0 10px; }

/* 两份协议的阅读入口：未读 / 已读 状态区分 */
.pd-doclist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pd-doc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    background: rgba(111, 155, 255, .10);
    border: 1px solid rgba(111, 155, 255, .22);
    color: #9bb8ff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.pd-doc:hover { background: rgba(111, 155, 255, .18); color: #fff; }
.pd-doc .pd-doc-state { font-size: 12px; font-weight: 500; color: #7f8db0; flex: 0 0 auto; }
.pd-doc.read {
    background: rgba(63, 185, 80, .10);
    border-color: rgba(63, 185, 80, .3);
    color: #d8f5dd;
}
.pd-doc.read .pd-doc-state { color: #3fb950; }

.pd-note { color: #7f8db0; font-size: 12px; line-height: 1.6; margin: 0 0 12px; }

.pd-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #dbe4f7;
    font-size: 13px;
    line-height: 1.55;
    cursor: pointer;
}
.pd-check input { accent-color: #6f9bff; margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; }
/* 未读完两份协议前：整行置灰、不可勾选 */
.pd-check.pd-check-locked { opacity: .5; cursor: not-allowed; }
.pd-err { color: #f85149; font-size: 12px; margin-top: 8px; }
.pd-err.hidden { display: none; }

/* ===== 协议正文阅读层 ===== */
.pd-box-doc { max-width: 640px; height: 82vh; display: flex; flex-direction: column; }
.pd-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .07);
    color: #b6c2dd;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.pd-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.pd-docbody { flex: 1; min-height: 0; padding: 12px 14px 0; }
.pd-docbody iframe {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: #fff;
}

.pd-foot {
    display: flex;
    gap: 10px;
    padding: 14px 20px 20px;
}
.pd-btn {
    flex: 1;
    padding: 12px;
    border-radius: 11px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.pd-btn-ghost {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #b6c2dd;
}
.pd-btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.pd-btn-main {
    background: linear-gradient(135deg, #4f8cff 0%, #6f9bff 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(79, 140, 255, .4);
}
.pd-btn-main:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}
.pd-btn-main:not(:disabled):hover { transform: translateY(-1px); }

/* ============================================================
   移动端适配（手机 ≤ 600px）：登录页 + 游戏大厅
   ============================================================ */
@media (max-width: 600px) {
    /* 容器与顶栏 */
    .container { padding: 16px 14px 48px; }
    .topbar { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .brand { font-size: 16px; }
    .nav { gap: 10px; flex-wrap: wrap; }
    .nav a { font-size: 13px; padding: 5px 8px; }
    .nav-user {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 游戏大厅：欢迎条竖向堆叠 */
    .welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }
    .welcome-admin { align-self: flex-start; }

    /* 侧栏导航改为横向滚动的分类条（避免竖排占满首屏） */
    .hall-side {
        padding: 12px 10px;
    }
    .side-brand {
        font-size: 15px;
        padding-bottom: 10px;
        margin-bottom: 8px;
    }
    .side-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .side-nav::-webkit-scrollbar { display: none; }
    .side-item {
        white-space: nowrap;
        padding: 8px 14px;
        background: rgba(255, 255, 255, .04);
        border: 1px solid var(--line);
    }
    .side-item.active { box-shadow: none; }
    .side-tip { display: none; }

    /* Hero Banner 在手机端垂直堆叠：文案在上，装饰 emoji 在底部一行 */
    .hero-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px 18px;
        min-height: 0;
        margin-bottom: 18px;
    }
    .hero-info { width: 100%; }
    .hero-decor {
        align-self: center;
        gap: 14px;
    }
    .hero-decor span { font-size: 40px; }
    .hero-title { font-size: 22px; }
    .hero-sub { font-size: 13px; margin-bottom: 14px; }
    .hero-cta { padding: 9px 18px; }

    /* 游戏卡片自适应列数：容器够宽时自然两列，单卡片或极窄时自动占满整行，避免右侧大量空白 */
    .sec-head { margin: 4px 2px 12px; }
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
    }
    .game-card { padding: 8px; }
    .game-thumb { font-size: 42px; border-radius: 9px; }
    .game-name { font-size: 12px; }

    /* 登录页：收窄留白与字号，按钮字距收敛防溢出 */
    .auth-page { padding: 24px 14px; }
    .auth-card { padding: 28px 20px 24px; border-radius: 18px; }
    .auth-title { font-size: 20px; }
    .auth-sub { letter-spacing: 3px; }
    .auth-submit { letter-spacing: 4px; }
    .auth-actions { gap: 10px; }
    .auth-agree { font-size: 11px; }

    /* 背景光晕在窄屏收敛，避免溢出抖动 */
    .bg-glow-1 { width: 260px; height: 260px; }
    .bg-glow-2 { width: 220px; height: 220px; }
    .bg-glow-3 { width: 180px; height: 180px; }
}

/* ============================================================
   超小屏适配（≤400px）：进一步收敛字号/留白/用户名长度
   ============================================================ */
@media (max-width: 400px) {
    .container { padding: 12px 10px 36px; }
    .topbar { padding: 10px 10px; }
    .brand { font-size: 15px; gap: 6px; }
    .brand-logo { font-size: 18px; }
    .nav { gap: 6px; }
    .nav a { font-size: 12px; padding: 4px 6px; }
    .nav-user { max-width: 80px; padding: 4px 2px; font-size: 12px; }

    .welcome { padding: 10px 12px; gap: 8px; font-size: 13px; }

    .hero-banner { padding: 16px 14px; gap: 12px; }
    .hero-title { font-size: 20px; }
    .hero-sub { font-size: 12px; margin-bottom: 12px; }
    .hero-cta { padding: 8px 16px; font-size: 13px; }
    .hero-decor { gap: 10px; }
    .hero-decor span { font-size: 32px; }

    .side-item { padding: 6px 10px; font-size: 12px; }

    .game-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
    .game-card { padding: 6px; }
    .game-thumb { font-size: 36px; }
    .game-name { font-size: 12px; }
}
