/* ===== 植物大战僵尸 - 全局样式 ===== */

/* 字体一律用系统自带的中文字体，**不要**引在线字体。
   这里原来是一句 @import Google Fonts 的 Noto Sans SC，国内根本连不上，
   后果有三层，而且第三层最像"bug"：
     1) @import 会阻塞它后面所有规则生效，css 得等这次请求超时才应用，页面先白一下；
     2) 字体拿不到就回退，而 font-display:swap 会"先用回退字体画、拿到再换" ——
        数字和文字会在渲染途中换一副字形，看上去就是"文字渲染有问题"；
     3) 每个访客的 IP 都会送到 Google —— 一个儿童平台不该这么干。
   苹方 / 微软雅黑 / 思源黑体本来就是为中文设计的，秒开、不联网、不外泄。
   （mario.css 一直就是这么写的，所以马里奥那边从来没出过这个问题。） */

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

:root {
    --green-dark: #1a3a1a;
    --green-mid: #2d5a2d;
    --green-light: #4a8c4a;
    --brown: #8B4513;
    --brown-light: #A0522D;
    --gold: #FFD700;
    --gold-light: #FFE44D;
    --red: #DC143C;
    --red-dark: #8B0000;
    --blue: #4169E1;
    --white: #F0FFF0;
    --gray: #666;
    --dark: #1a1a2e;
    --card-bg: rgba(0,0,0,0.6);
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

body {
    /* 顺序有讲究：先苹果的苹方、再 Windows 的微软雅黑、再安卓/Linux 的思源黑体，
       最后兜底 sans-serif。都是系统自带，不用下载。 */
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei',
                 'Hiragino Sans GB', 'Source Han Sans SC', 'Noto Sans CJK SC',
                 'WenQuanYi Micro Hei', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a3a1a 50%, #0a0a1a 100%);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
}

/* ===== 游戏封面页 ===== */
.cover-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0a0a1a 0%, #1a2a0a 40%, #2d1a0a 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}
.cover-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,215,0,0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(220,20,60,0.08) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(74,140,74,0.05) 0%, transparent 40%);
    animation: bgMove 25s ease-in-out infinite;
}
.cover-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    pointer-events: none;
}
.cover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 640px;
    width: 100%;
}
.cover-floating {
    position: relative;
    z-index: 1;
    font-size: 90px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
    animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.cover-title {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FFE44D, #FF9800, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    margin-bottom: 8px;
    animation: shimmer 3s linear infinite;
    letter-spacing: 2px;
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.cover-subtitle {
    font-size: 16px;
    color: rgba(240,255,240,0.6);
    margin-bottom: 40px;
    letter-spacing: 3px;
}
.cover-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.cover-btn {
    padding: 20px 44px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.4);
    color: var(--white);
    min-width: 200px;
}
.cover-btn .btn-icon { font-size: 36px; }
.cover-btn .btn-sub {
    font-size: 12px;
    color: rgba(240,255,240,0.5);
    font-weight: 400;
}
.cover-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.cover-btn.mobile-btn {
    border-color: rgba(255,215,0,0.3);
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,140,0,0.08));
}
.cover-btn.mobile-btn:hover {
    border-color: var(--gold);
    box-shadow: 0 12px 40px rgba(255,215,0,0.15);
}
.cover-btn.pc-btn {
    border-color: rgba(74,140,74,0.3);
    background: linear-gradient(135deg, rgba(74,140,74,0.08), rgba(0,120,200,0.08));
}
.cover-btn.pc-btn:hover {
    border-color: var(--green-light);
    box-shadow: 0 12px 40px rgba(74,140,74,0.2);
}
.cover-team {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: rgba(240,255,240,0.4);
    letter-spacing: 2px;
    z-index: 3;
}
.cover-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.2);
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
}

/* ===== 系统维护页 ===== */
.maintenance-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0a0a1a, #1a0a0a, #0a0a1a);
    padding: 20px;
    text-align: center;
}
.maintenance-page .m-icon { font-size: 72px; margin-bottom: 16px; }
.maintenance-page h1 { font-size: 32px; font-weight: 900; margin-bottom: 12px; color: #FFD700; }
.maintenance-page p { color: rgba(240,255,240,0.6); margin-bottom: 8px; line-height: 1.8; }
.maintenance-page .m-time { font-size: 28px; font-weight: 700; color: var(--white); margin: 12px 0; font-variant-numeric: tabular-nums; }

/* ===== 设备白名单：被保护时段挡住时的「登记本机」入口 ===== */
.device-box { margin-top: 26px; max-width: 420px; width: 100%; }
.device-toggle {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(240,255,240,0.75);
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.device-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }
.device-panel {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.12);
    text-align: center;
}
.device-panel p { font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; }
.device-code {
    display: block;
    padding: 9px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    color: #9fe89f;
    font-size: 12px;
    word-break: break-all;
    font-family: Consolas, Monaco, monospace;
    user-select: all;
}
.device-copy {
    background: linear-gradient(135deg, #4A8C4A, #2E6B2E);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
}
.device-copy:hover { filter: brightness(1.12); }
.device-msg { color: #9fe89f !important; font-size: 12px !important; margin-top: 8px; margin-bottom: 0 !important; }

/* ===== 通知栏（后台发布的通知） ===== */
.notice-bar {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(120, 255, 150, 0.22);
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
}
.notice-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
}
.notice-head:hover { background: rgba(255, 255, 255, 0.04); }
.notice-icon { font-size: 16px; flex: 0 0 auto; }
.notice-roll { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.notice-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: #eaffea;
    animation: notice-in 0.45s ease;
}
@keyframes notice-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.notice-dot {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.notice-toggle {
    flex: 0 0 auto;
    font-size: 12px;
    color: rgba(160, 240, 170, 0.85);
    white-space: nowrap;
}
.notice-list {
    border-top: 1px solid rgba(120, 255, 150, 0.16);
    max-height: 260px;
    overflow-y: auto;
}
.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.notice-item:last-child { border-bottom: none; }
.notice-item-icon { flex: 0 0 auto; }
.notice-item-text { flex: 1 1 auto; color: #eaffea; word-break: break-word; }
.notice-item-ts { flex: 0 0 auto; font-size: 11px; color: rgba(240, 255, 240, 0.4); white-space: nowrap; }
.notice-item.nk-warn { background: rgba(231, 76, 60, 0.08); }
.notice-item.nk-update { background: rgba(255, 193, 7, 0.07); }

/* 后台的历史通知行 */
.admin-notice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}
.admin-notice-row:last-child { border-bottom: none; }
.admin-notice-text { flex: 1 1 auto; color: #eaffea; word-break: break-word; }
.admin-notice-meta { flex: 0 0 auto; font-size: 11px; color: rgba(240, 255, 240, 0.45); }

/* ===== 后台「指令助手」聊天界面 ===== */
.cmd-chat {
    max-height: 380px;
    overflow-y: auto;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(74, 140, 74, 0.18);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cmd-msg { display: flex; }
.cmd-msg.from-me { justify-content: flex-end; }
.cmd-msg.from-bot { justify-content: flex-start; }
.cmd-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.55;
    background: rgba(74, 140, 74, 0.22);
    border: 1px solid rgba(120, 255, 150, 0.18);
    color: #eaffea;
}
.cmd-msg.from-me .cmd-bubble { background: rgba(80, 140, 220, 0.22); border-color: rgba(130, 190, 255, 0.22); }
.cmd-bubble.kind-warn { background: rgba(231, 76, 60, 0.16); border-color: rgba(231, 76, 60, 0.35); }
.cmd-bubble.kind-ok { background: rgba(46, 204, 113, 0.18); border-color: rgba(46, 204, 113, 0.38); }
.cmd-text { word-break: break-word; }
.cmd-plan {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
}
.cmd-plan-row { display: flex; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.cmd-plan-row span { flex: 0 0 42px; color: rgba(240, 255, 240, 0.55); }
.cmd-plan-row b { flex: 1 1 auto; color: #fff; font-weight: 600; word-break: break-word; }
.cmd-plan-actions { display: flex; gap: 8px; margin-top: 10px; }
.cmd-examples { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.cmd-example {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 12px;
    cursor: pointer;
    color: #d8ffd8;
}
.cmd-example:hover { background: rgba(120, 255, 150, 0.16); }
.cmd-input-row { display: flex; gap: 10px; }
.cmd-input { flex: 1 1 auto; min-width: 0; }
.cmd-btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(120, 255, 150, 0.3);
    background: rgba(74, 140, 74, 0.3);
    color: #eaffea;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.cmd-btn:hover:not(:disabled) { background: rgba(74, 140, 74, 0.5); }
.cmd-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cmd-btn.send { background: rgba(46, 204, 113, 0.32); font-weight: 600; }
.cmd-btn.ok { background: rgba(46, 204, 113, 0.35); }
.cmd-btn.no { background: rgba(231, 76, 60, 0.28); border-color: rgba(231, 76, 60, 0.4); }

@media (max-width: 640px) {
    .cmd-bubble { max-width: 92%; }
    .admin-notice-meta { display: none; }
}

/* ===== 横屏提示 =====
   原来的 .rotate-overlay 是一整层黑色遮罩，竖屏时完全挡住游戏不让玩。
   现在改成游戏页顶部一行可关闭的轻提示（样式见文件末尾 .rotate-hint），不再拦截游玩。 */

/* ===== 护眼模式覆盖层 ===== */
.eye-protection-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    background: rgba(255, 200, 100, 0.18);
    box-shadow: inset 0 0 120px 40px rgba(255, 180, 60, 0.12);
    mix-blend-mode: multiply;
}
.eye-protection-banner {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9100;
    padding: 6px 18px;
    border-radius: 20px;
    background: rgba(255,180,60,0.15);
    border: 1px solid rgba(255,180,60,0.3);
    color: #FFC76A;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ===== 护眼强制休息锁定层 ===== */
.eye-rest-lock {
    position: fixed;
    inset: 0;
    z-index: 9600;
    background: rgba(5, 15, 10, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.eye-rest-card {
    text-align: center;
    padding: 40px 44px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(20,45,30,0.95), rgba(10,25,18,0.95));
    border: 1px solid rgba(80,200,130,0.35);
    box-shadow: 0 0 60px rgba(40,180,110,0.15);
    max-width: 90vw;
}
.eye-rest-icon { font-size: 56px; margin-bottom: 10px; }
.eye-rest-card h2 {
    color: var(--gold);
    font-size: 26px;
    margin: 0 0 14px;
    letter-spacing: 2px;
}
.eye-rest-card p {
    color: rgba(235,255,240,0.75);
    font-size: 15px;
    line-height: 1.9;
    margin: 0 0 16px;
}
.eye-rest-card p b { color: var(--gold); }
.eye-rest-countdown {
    font-size: 64px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #7CFFB0;
    text-shadow: 0 0 24px rgba(60,255,160,0.35);
    margin: 6px 0 18px;
    animation: restPulse 1.2s ease-in-out infinite;
}
.eye-rest-tip {
    font-size: 13px !important;
    color: rgba(200,240,215,0.5) !important;
    margin: 0 !important;
}
@keyframes restPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* ===== 北京时间显示 ===== */
.beijing-time {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.2);
    padding: 6px 14px;
    border-radius: 20px;
}
.beijing-time .time-date {
    font-size: 11px;
    color: rgba(240,255,240,0.5);
    font-weight: 400;
    margin-left: 8px;
}

/* ===== 音乐开关 ===== */
.music-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(74,140,74,0.3);
    border-radius: 50%;
    background: rgba(74,140,74,0.1);
    color: var(--white);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s;
    font-family: inherit;
}
.music-btn:hover { background: rgba(74,140,74,0.2); }
.music-btn.muted { opacity: 0.5; }

/* ===== 登录/注册页 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a, #1a3a1a, #0a0a1a);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(74,140,74,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255,215,0,0.05) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}
@keyframes bgMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 20px) rotate(5deg); }
}

.auth-box {
    position: relative;
    z-index: 1;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(74,140,74,0.3);
    border-radius: 24px;
    padding: 40px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(74,140,74,0.1);
}

.game-logo {
    font-size: 56px;
    margin-bottom: 8px;
    display: block;
}
.game-title {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    margin-bottom: 4px;
}
.game-subtitle {
    font-size: 13px;
    color: rgba(240,255,240,0.5);
    margin-bottom: 28px;
}
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 3px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(240,255,240,0.5);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}
.auth-tab.active {
    background: rgba(74,140,74,0.3);
    color: var(--white);
}
.auth-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(74,140,74,0.2);
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    font-size: 16px;
    color: var(--white);
    font-family: inherit;
    outline: none;
    transition: all .3s;
    margin-bottom: 12px;
}
.auth-input:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 20px rgba(74,140,74,0.15);
}
.auth-input::placeholder { color: rgba(240,255,240,0.3); }
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--green-mid), var(--green-light));
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    margin-top: 4px;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74,140,74,0.3);
}
.auth-btn:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.auth-msg {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
    padding: 8px;
    border-radius: 8px;
}
.auth-msg.success { color: #4CAF50; background: rgba(76,175,80,0.1); }
.auth-msg.error { color: #f44336; background: rgba(244,67,54,0.1); }
.auth-msg.info { color: #FFD700; background: rgba(255,215,0,0.1); }
.auth-hint {
    margin-top: 12px;
    font-size: 11px;
    color: rgba(240,255,240,0.3);
    line-height: 1.6;
}

.forgot-pwd-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #4CAF50;
    cursor: pointer;
    text-decoration: underline;
}
.forgot-pwd-link:hover {
    color: #FFD700;
}

/* ===== 游戏大厅 ===== */
.lobby {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.lobby-header {
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(74,140,74,0.2);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.lobby-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.lobby-header .brand span {
    font-size: 20px;
}
.lobby-header .brand h1 {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-info .gold-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--gold);
    font-size: 14px;
}
.user-info .username {
    color: rgba(240,255,240,0.7);
    font-size: 14px;
}
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.25);
    transition: transform .2s;
}
.avatar-circle:hover {
    transform: scale(1.1);
    border-color: var(--gold);
}
.avatar-lg {
    width: 54px;
    height: 54px;
    font-size: 28px;
    border-width: 3px;
}
.admin-tab-btn {
    padding: 8px 16px;
    border: 2px solid rgba(74,140,74,0.25);
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    color: rgba(240,255,240,0.7);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}
.admin-tab-btn:hover {
    border-color: rgba(74,140,74,0.5);
}
.admin-tab-btn.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(255,215,0,0.1);
}
.lvl-badge {
    font-size: 12px;
    color: var(--gold);
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.25);
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.unread-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    background: #F44336;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
    margin-left: 2px;
    text-align: center;
}
.friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(74,140,74,0.15);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .2s;
}
.friend-row:hover {
    border-color: rgba(74,140,74,0.5);
    background: rgba(74,140,74,0.1);
}
.chat-box {
    flex: 1;
    overflow-y: auto;
    min-height: 160px;
    max-height: 300px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(74,140,74,0.15);
    padding: 10px;
}
.user-info .vip-badge {
    background: linear-gradient(135deg, #FFD700, #FF8C00);
    color: #000;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
}
.user-info .vip-badge.svip {
    background: linear-gradient(135deg, #7C4DFF, #448AFF);
    color: #fff;
    box-shadow: 0 0 10px rgba(124,77,255,0.4);
}

/* ===== 签到按钮 ===== */
.checkin-btn {
    padding: 6px 16px;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,140,0,0.15));
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    white-space: nowrap;
}
.checkin-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255,215,0,0.3), rgba(255,140,0,0.3));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,215,0,0.2);
}
.checkin-btn.done {
    border-color: rgba(76,175,80,0.3);
    background: rgba(76,175,80,0.15);
    color: #4CAF50;
    cursor: default;
}
.checkin-btn:disabled { opacity: 0.7; cursor: default; }

.user-info .logout-btn {
    padding: 6px 16px;
    border: 1px solid rgba(244,67,54,0.3);
    border-radius: 10px;
    background: rgba(244,67,54,0.1);
    color: #f44336;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}
.user-info .logout-btn:hover {
    background: rgba(244,67,54,0.2);
}

.lobby-body {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== 世界地图 ===== */
.world-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 12px;
}
.world-card {
    background: var(--card-bg);
    border: 2px solid rgba(74,140,74,0.2);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all .3s;
    position: relative;
    overflow: hidden;
}
.world-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74,140,74,0.5);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.world-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.world-card.locked:hover {
    transform: none;
    border-color: rgba(74,140,74,0.2);
}
.world-card .world-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.world-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.world-card .world-desc {
    font-size: 12px;
    color: rgba(240,255,240,0.5);
    margin-bottom: 12px;
}
.world-card .progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.world-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-light), var(--gold));
    border-radius: 3px;
    transition: width .5s;
}
.world-card .progress-text {
    font-size: 11px;
    color: rgba(240,255,240,0.4);
    margin-top: 4px;
}
.world-card .lock-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 32px;
    opacity: 0.5;
}

/* ===== 关卡选择弹窗 ===== */
.level-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.level-modal-content {
    background: rgba(20,40,20,0.95);
    border: 2px solid rgba(74,140,74,0.3);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}
.level-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(240,255,240,0.5);
    font-size: 24px;
    cursor: pointer;
    font-family: inherit;
}
.level-modal-close:hover { color: var(--white); }
.level-modal h2 {
    font-size: 22px;
    margin-bottom: 4px;
}
.level-modal .world-subtitle {
    font-size: 13px;
    color: rgba(240,255,240,0.5);
    margin-bottom: 20px;
}
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.level-btn {
    aspect-ratio: 1;
    border: 2px solid rgba(74,140,74,0.3);
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
}
.level-btn .level-star {
    font-size: 10px;
}
.level-btn:hover:not(.locked):not(.current) {
    border-color: var(--gold);
    transform: scale(1.05);
}
.level-btn.completed {
    border-color: var(--gold);
    background: rgba(255,215,0,0.1);
}
.level-btn.current {
    border-color: var(--green-light);
    background: rgba(74,140,74,0.2);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,140,74,0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(74,140,74,0.2); }
}
.level-btn.locked {
    opacity: 0.3;
    cursor: not-allowed;
}
.level-btn .reward-tag {
    font-size: 9px;
    color: var(--gold);
    position: absolute;
    bottom: 4px;
}

/* ===== 游戏界面 (Canvas 容器) ===== */
.game-page {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    display: flex;
    flex-direction: column;
}
.game-toolbar {
    background: rgba(0,0,0,0.9);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}
.game-toolbar .game-left, .game-toolbar .game-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.game-toolbar .game-left {
    gap: 16px;
}
.game-toolbar .sun-counter, .game-toolbar .coin-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 16px;
}
.game-toolbar .sun-counter { color: var(--gold); }
.game-toolbar .coin-counter { color: var(--gold); }
.game-toolbar .wave-info {
    color: rgba(240,255,240,0.6);
    font-size: 13px;
}
.game-toolbar .back-btn {
    padding: 6px 16px;
    border: 1px solid rgba(244,67,54,0.3);
    border-radius: 8px;
    background: rgba(244,67,54,0.1);
    color: #f44336;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}
.game-toolbar .back-btn:hover { background: rgba(244,67,54,0.2); }

.game-canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a3a1a, #2d5a2d);
    position: relative;
    overflow: hidden;
}
.game-canvas-container canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
}

/* ===== 植物选择栏 ===== */
.plant-selector {
    background: rgba(0,0,0,0.85);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    z-index: 10;
    justify-content: center;
}
.plant-selector::-webkit-scrollbar { height: 3px; }
.plant-selector::-webkit-scrollbar-thumb { background: rgba(74,140,74,0.3); border-radius: 2px; }

.shovel-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 2px solid rgba(255,152,0,0.35);
    border-radius: 10px;
    background: rgba(0,0,0,0.35);
    color: #FFB74D;
    font-size: 18px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.shovel-btn:hover {
    border-color: var(--gold);
    background: rgba(255,152,0,0.15);
}
.shovel-btn.active {
    border-color: var(--gold);
    background: rgba(255,152,0,0.25);
    box-shadow: 0 0 12px rgba(255,152,0,0.3);
}
.shovel-btn .shovel-stock {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
}
.plant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border: 2px solid rgba(74,140,74,0.2);
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all .2s;
    min-width: 64px;
    position: relative;
}
.plant-card:hover {
    border-color: rgba(74,140,74,0.5);
}
.plant-card.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.1);
    box-shadow: 0 0 12px rgba(255,215,0,0.2);
}
.plant-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.plant-card .plant-icon {
    font-size: 24px;
}
.plant-card .plant-cost {
    font-size: 11px;
    color: var(--gold);
    font-weight: 700;
}
.plant-card .plant-name {
    font-size: 10px;
    color: rgba(240,255,240,0.6);
}
.plant-card .plant-lv {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
    padding: 0 4px;
    line-height: 14px;
}
.plant-card .plant-cooldown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}

/* ===== 游戏结束弹窗 ===== */
.game-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 50;
}
.game-result h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 8px;
}
.game-result .result-icon {
    font-size: 64px;
    margin-bottom: 12px;
}
.game-result .result-reward {
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 20px;
}
.game-result .result-btns {
    display: flex;
    gap: 12px;
}
.game-result .result-btns button {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
}
.game-result .result-btns .btn-primary {
    background: linear-gradient(135deg, var(--green-mid), var(--green-light));
    color: var(--white);
}
.game-result .result-btns .btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
}
.game-result .result-btns button:hover {
    transform: translateY(-2px);
}
.game-result .result-save {
    margin-top: 16px;
    font-size: 15px;
    font-weight: 600;
}
.game-result .result-save .save-ok {
    color: #4CAF50;
}
.game-result .result-save .save-fail {
    color: #FF9800;
}

/* ===== 商店 ===== */
.shop-page {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.shop-page h2 {
    font-size: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.shop-item {
    background: var(--card-bg);
    border: 2px solid rgba(74,140,74,0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all .3s;
}
.shop-item:hover {
    border-color: rgba(74,140,74,0.5);
    transform: translateY(-2px);
}
.shop-item .item-icon { font-size: 32px; }
.shop-item .item-name { font-size: 14px; font-weight: 700; margin: 4px 0; }
.shop-item .item-desc { font-size: 11px; color: rgba(240,255,240,0.5); margin-bottom: 6px; }
.shop-item .item-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 6px;
}
.shop-item .item-tag.vip { background: rgba(255,215,0,0.15); color: var(--gold); border: 1px solid rgba(255,215,0,0.3); }
.shop-item .item-tag.svip { background: rgba(124,77,255,0.15); color: #B388FF; border: 1px solid rgba(124,77,255,0.3); }
.shop-item .item-price {
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 8px;
}
.shop-item .item-original {
    font-size: 11px;
    color: rgba(240,255,240,0.35);
    font-weight: 400;
    margin-left: 4px;
}
.shop-item .item-stock {
    font-size: 11px;
    font-weight: 700;
    color: #4CAF50;
    background: rgba(76,175,80,0.12);
    border: 1px solid rgba(76,175,80,0.3);
    border-radius: 10px;
    padding: 2px 10px;
    display: inline-block;
    margin-bottom: 8px;
}
.shop-item .buy-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .3s;
    background: linear-gradient(135deg, var(--green-mid), var(--green-light));
    color: var(--white);
}
.shop-item .buy-btn:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(240,255,240,0.3);
    cursor: not-allowed;
}
.shop-item .buy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74,140,74,0.3);
}
.shop-item.owned {
    border-color: var(--gold);
}
.shop-item.owned .owned-badge {
    font-size: 11px;
    color: var(--gold);
    margin-top: 6px;
}

/* ===== 管理员面板 ===== */
.admin-page {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.admin-page h2 {
    font-size: 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.admin-stat {
    background: var(--card-bg);
    border: 1px solid rgba(74,140,74,0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.admin-stat .num {
    font-size: 32px;
    font-weight: 900;
    color: var(--gold);
}
.admin-stat .label {
    font-size: 12px;
    color: rgba(240,255,240,0.5);
    margin-top: 4px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}
.admin-table th {
    background: rgba(74,140,74,0.2);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    color: rgba(240,255,240,0.7);
}
.admin-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}
.admin-table tr:hover td {
    background: rgba(255,255,255,0.03);
}
.mode-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin: 0 2px;
}
.mode-btn.normal { background: rgba(74,140,74,0.3); color: #4CAF50; }
.mode-btn.vip { background: rgba(255,215,0,0.3); color: var(--gold); }
.mode-btn.svip { background: rgba(124,77,255,0.3); color: #B388FF; }
.mode-btn:hover { transform: translateY(-1px); }
.admin-phone {
    margin-top: 16px;
    padding: 12px 20px;
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 12px;
    font-size: 16px;
    text-align: center;
}
.admin-phone strong { color: var(--gold); }

/* ===== 奖杯/成就 ===== */
.trophy-case {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.trophy-item {
    background: var(--card-bg);
    border: 1px solid rgba(74,140,74,0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.trophy-item .trophy-icon { font-size: 28px; }
.trophy-item .trophy-name { font-size: 12px; font-weight: 600; margin-top: 4px; }
.trophy-item.locked { opacity: 0.3; }

/* ===== 弹窗/Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-box {
    background: rgba(20,40,20,0.95);
    border: 2px solid rgba(74,140,74,0.3);
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}
.modal-box h2 { font-size: 22px; margin-bottom: 8px; }
.modal-box p { color: rgba(240,255,240,0.6); margin-bottom: 16px; }
.modal-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(74,140,74,0.2);
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    color: var(--white);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    margin-bottom: 12px;
}
.modal-box input:focus { border-color: var(--green-light); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .auth-box { padding: 28px 20px; }
    .game-title { font-size: 22px; }
    .lobby-header { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .lobby-body { padding: 16px; }
    .world-grid { grid-template-columns: 1fr; }
    .level-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .level-btn { font-size: 14px; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-table { font-size: 11px; }
    .admin-table th, .admin-table td { padding: 8px 10px; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(74,140,74,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74,140,74,0.4); }

/* ===== 游戏中心 hub ===== */
.hub-body { padding: 30px 20px 40px; max-width: 1100px; margin: 0 auto; width: 100%; }
.hub-title { font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 6px; color: var(--gold); letter-spacing: 1px; }
.hub-sub { text-align: center; color: rgba(240,255,240,0.55); margin-bottom: 28px; font-size: 14px; }
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
}
.hub-card {
    position: relative;
    padding: 34px 28px;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(34,74,34,0.6), rgba(16,42,20,0.75));
    border: 1px solid rgba(90,180,90,0.3);
    text-align: center;
    cursor: pointer;
    transition: transform .15s, box-shadow .25s;
    overflow: hidden;
}
.hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 36px rgba(40,160,80,0.18);
    border-color: rgba(124,255,176,0.5);
}
.hub-icon { font-size: 58px; margin-bottom: 12px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35)); }
.hub-card h3 { color: #7CFFB0; font-size: 21px; margin-bottom: 8px; }
.hub-card p { color: rgba(240,255,240,0.65); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.hub-progress { color: rgba(255,215,0,0.75); font-size: 12px; margin-bottom: 14px; }
.hub-play {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 20px;
    background: rgba(255,215,0,0.14);
    border: 1px solid rgba(255,215,0,0.45);
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
    transition: background .2s;
}
.hub-card:hover .hub-play { background: rgba(255,215,0,0.28); }

/* ===== 游乐场（第三方游戏，默认不渲染） =====
   和上面两张自制游戏卡片刻意拉开差别：自制的是大卡片，第三方的是小格子，
   一眼能看出「这些不是我们做的」。视觉上不做区分，等于把外部内容混进自家内容里。 */
.arcade-wrap { max-width: 900px; margin: 34px auto 0; }
.arcade-head { text-align: center; margin-bottom: 16px; }
.arcade-head h3 { font-size: 17px; font-weight: 800; color: rgba(240,255,240,0.9); margin-bottom: 6px; }
.arcade-count {
    font-size: 12px; font-weight: 600; color: rgba(240,255,240,0.6);
    border: 1px solid rgba(90,180,90,0.35); border-radius: 999px; padding: 1px 9px;
    vertical-align: middle;
}
.arcade-tip { font-size: 12px; line-height: 1.7; color: rgba(240,255,240,0.45); max-width: 560px; margin: 0 auto; }
.arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.arcade-card {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(16,42,20,0.6);
    border: 1px solid rgba(90,180,90,0.22);
    cursor: pointer;
    transition: transform .16s, border-color .16s;
}
.arcade-card:hover { transform: translateY(-3px); border-color: rgba(90,180,90,0.55); }
.arcade-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
}
.arcade-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arcade-thumb-ph { font-size: 30px; opacity: 0.5; }
.arcade-meta { padding: 8px 10px; }
.arcade-name {
    display: block; font-size: 13px; font-weight: 600; color: rgba(240,255,240,0.9);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arcade-cat { display: block; font-size: 11px; color: rgba(240,255,240,0.45); margin-top: 2px; }

/* ===== 响应式 hub ===== */
@media (max-width: 768px) {
    .hub-grid { grid-template-columns: 1fr; gap: 16px; }
    .hub-card { padding: 26px 18px; }
    .hub-title { font-size: 20px; }
    .arcade-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 9px; }
    .arcade-wrap { margin-top: 26px; }
}

/* ===== 结算动效（胜利爆发 / 失败坠落 / 金币滚动 / 升级横幅） ===== */
.game-result.result-win { animation: resultFadeIn .3s ease-out both; }
.game-result.result-lose { animation: resultFadeIn .3s ease-out both, resultShake .5s .3s ease-in-out; }
@keyframes resultFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes resultShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-9px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

.game-result .result-icon { animation: resultPop .55s cubic-bezier(.18,.9,.32,1.5) both; }
@keyframes resultPop {
    0%   { transform: scale(0) rotate(-25deg); opacity: 0; }
    65%  { transform: scale(1.22) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}
.game-result h1 { animation: resultSlideUp .45s .12s cubic-bezier(.2,.9,.3,1.2) both; }
.game-result .result-reward { animation: resultSlideUp .45s .28s ease-out both; }
.game-result .result-btns { animation: resultSlideUp .45s .42s ease-out both; }
.game-result .result-save { animation: resultSlideUp .45s .5s ease-out both; }
@keyframes resultSlideUp {
    from { transform: translateY(18px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* 金币数字：滚动时微微放大 + 发光 */
.game-result .reward-num {
    display: inline-block; font-weight: 900;
    text-shadow: 0 0 14px rgba(255,215,0,.65);
    animation: rewardGlow .7s ease-out both;
}
@keyframes rewardGlow {
    0%   { transform: scale(.7); }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* 胜利时的星芒爆炸（12 个 ✨ 绕中心放射） */
.game-result .result-burst {
    position: absolute; top: 50%; left: 50%; width: 0; height: 0; pointer-events: none;
}
.game-result .result-spark {
    position: absolute; font-size: 22px;
    transform: rotate(calc(var(--i) * 30deg)) translateY(0);
    animation: sparkOut .9s cubic-bezier(.15,.8,.3,1) both;
}
@keyframes sparkOut {
    0%   { transform: rotate(calc(var(--i) * 30deg)) translateY(0)     scale(.2); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: rotate(calc(var(--i) * 30deg)) translateY(-150px) scale(1.05); opacity: 0; }
}

/* 升级横幅 */
.game-result .result-levelup {
    margin-top: 10px; padding: 8px 22px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,215,0,.22), rgba(255,170,0,.14));
    border: 1px solid rgba(255,215,0,.55);
    color: #FFD700; font-size: 16px; font-weight: 800;
    animation: resultSlideUp .4s .36s ease-out both, levelUpPulse 1.6s .8s ease-in-out infinite;
}
@keyframes levelUpPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,.42); }
    50%      { box-shadow: 0 0 0 10px rgba(255,215,0,0); }
}

/* 无障碍：用户系统设置里开了"减少动态效果"就全部关掉动画 */
@media (prefers-reduced-motion: reduce) {
    .game-result, .game-result * { animation: none !important; }
}
/* ===== 技术支持署名 ===== */
.cover-tech {
    margin-top: 8px !important;
    font-size: 13px !important;
    color: rgba(180, 230, 200, 0.62) !important;
}
.tech-support-line { color: rgba(180, 230, 200, 0.62); font-size: 12.5px; }

.auth-page .tech-support-line { margin: 4px 0 12px; font-size: 12px; }

.hub-footer {
    margin-top: 26px; padding-top: 14px;
    border-top: 1px solid rgba(120, 220, 160, 0.14);
    display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center; justify-content: center;
    font-size: 12.5px; color: rgba(200, 240, 215, 0.5);
}
.hub-footer-sep { color: rgba(200, 240, 215, 0.25); }
.hub-footer-link {
    color: rgba(140, 225, 175, 0.85); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    transition: color .2s;
}
.hub-footer-link:hover { color: #8fe0ad; }
.modal-box .about-tech { color: #b8f0c8; }
/* ===== 用户协议 / 隐私政策 ===== */
.agree-row {
    display: flex; align-items: flex-start; gap: 8px;
    text-align: left; font-size: 12.5px; line-height: 1.6;
    color: rgba(220, 245, 230, 0.78);
    margin: 10px 2px 4px; cursor: pointer; user-select: none;
}
.agree-row-sub { font-size: 11.5px; color: rgba(200, 235, 215, 0.58); margin-top: 2px; }
.agree-check {
    flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px;
    accent-color: #4CAF50; cursor: pointer;
}
.agree-link {
    color: #8fe0ad; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}
.agree-link:hover { color: #b8f0c8; }

/* 协议正文弹窗：固定高度 + 内部滚动，正文按原样保留换行 */
.legal-box { max-width: 620px; width: 92vw; display: flex; flex-direction: column; }
.legal-head {
    display: flex; justify-content: space-between; align-items: center;
    flex: 0 0 auto;
}
.legal-body {
    flex: 1 1 auto; overflow-y: auto;
    max-height: 52vh; min-height: 160px;
    margin: 12px 0; padding: 14px 16px;
    text-align: left; font-size: 13px; line-height: 1.95;
    white-space: pre-wrap; word-break: break-word;
    color: rgba(238, 252, 242, 0.86);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(120, 220, 160, 0.18);
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}
.legal-body::-webkit-scrollbar { width: 6px; }
.legal-body::-webkit-scrollbar-thumb {
    background: rgba(140, 220, 170, 0.32); border-radius: 3px;
}
.legal-foot {
    flex: 0 0 auto; display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.legal-ver { font-size: 11.5px; color: rgba(200, 235, 215, 0.45); }
.legal-btn { margin: 0 !important; flex: 0 0 auto; padding: 10px 22px !important; }

/* 竖屏窄屏：正文占更高比例 */
@media (max-width: 520px) {
    .legal-body { max-height: 58vh; font-size: 12.5px; line-height: 1.85; }
    .legal-foot { flex-direction: column-reverse; align-items: stretch; }
    .legal-btn { width: 100%; }
    .legal-ver { text-align: center; }
}
/* ===== 竖屏提示条（替代原来的强制横屏拦截层） ===== */
.rotate-hint {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px;
    background: linear-gradient(90deg, rgba(255,168,64,0.16), rgba(255,168,64,0.06));
    border-bottom: 1px solid rgba(255,168,64,0.28);
    color: rgba(255,225,190,0.92);
    font-size: 12.5px; line-height: 1.5;
    z-index: 11;
}
.rotate-hint span { flex: 1; }
.rotate-hint-close {
    flex: 0 0 auto;
    width: 22px; height: 22px; padding: 0;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: rgba(255,225,190,0.85);
    font-size: 12px; line-height: 22px; text-align: center;
    cursor: pointer; font-family: inherit;
}
.rotate-hint-close:hover { background: rgba(255,255,255,0.22); }

/* ===== 竖屏（手机不转屏也能玩） ===== */
@media (orientation: portrait) {
    /* canvas 用 auto 让浏览器按原始宽高比缩放；写死 px 会被 max-width 压扁 */
    .game-canvas-container canvas {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain;
    }
    /* 竖屏空间紧张，工具栏与植物栏压缩，把高度让给画面 */
    .game-toolbar { padding: 6px 10px; }
    .game-toolbar .game-left { gap: 10px; }
    .game-toolbar .sun-counter, .game-toolbar .coin-counter { font-size: 14px; }
    .game-toolbar .wave-info { font-size: 12px; }
    .game-toolbar .back-btn { padding: 5px 12px; font-size: 12px; }
    .plant-selector {
        padding: 6px 8px; gap: 5px;
        justify-content: flex-start;   /* 竖屏改为左对齐可横向滚动，不再居中挤压 */
    }
}

/* 屏幕很矮的横屏（手机横过来）：同样压缩，避免画面被上下挤没 */
@media (orientation: landscape) and (max-height: 480px) {
    .game-toolbar { padding: 4px 12px; }
    .plant-selector { padding: 4px 10px; }
}
/* ==================================================================
   过渡与动效（第 10 条：跳转界面好看丰富一点）
   —— 视图根节点挂了 .view-enter，v-if 重建时会自动重播入场动画
   ================================================================== */
@keyframes viewIn {
    from { opacity: 0; transform: translateY(12px) scale(0.994); }
    to   { opacity: 1; transform: none; }
}
.view-enter { animation: viewIn 0.30s cubic-bezier(0.22, 0.8, 0.36, 1) both; }

/* ===== 统一加载动画（原来是写死在标签上的内联样式） ===== */
.load-mask {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}
.load-box { text-align: center; }
.load-box p { color: rgba(240, 255, 240, 0.7); font-size: 14px; margin-top: 12px; letter-spacing: 1px; }
.game-spinner {
    width: 42px; height: 42px; margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #FFD700;
    border-right-color: rgba(255, 215, 0, 0.45);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ===== 进入游戏过场动画 ===== */
.enter-mask {
    position: fixed; inset: 0; z-index: 9900;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 45%, rgba(30, 60, 35, 0.96), rgba(8, 16, 10, 0.99));
}
.enter-box { text-align: center; padding: 24px; }
.enter-icon { font-size: 64px; animation: enterPop 0.5s cubic-bezier(0.22, 1.4, 0.4, 1) both; }
.enter-box h2 { font-size: 22px; margin: 10px 0 6px; color: #fff; letter-spacing: 1px; }
.enter-box p { font-size: 13.5px; color: rgba(240, 255, 240, 0.55); }
.enter-bar {
    width: 180px; height: 4px; margin: 18px auto 0;
    border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden;
}
.enter-bar span {
    display: block; width: 40%; height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, #4CAF50, #FFD700);
    animation: enterSlide 0.9s ease-in-out infinite;
}
@keyframes enterPop { from { opacity: 0; transform: scale(0.5) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes enterSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.enter-fade-enter-active, .enter-fade-leave-active { transition: opacity 0.26s ease; }
.enter-fade-enter-from, .enter-fade-leave-to { opacity: 0; }

/* ===== hub 游戏卡片动效（原有的 hover 只有 4px 位移） ===== */
.hub-card {
    transition: transform 0.22s cubic-bezier(0.22, 0.8, 0.36, 1),
                box-shadow 0.22s ease, border-color 0.22s ease;
}
.hub-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 36px rgba(40, 160, 80, 0.28);
}
.hub-card:active { transform: translateY(-2px) scale(0.99); }
.hub-card .hub-icon { transition: transform 0.28s cubic-bezier(0.22, 1.4, 0.4, 1); }
.hub-card:hover .hub-icon { transform: scale(1.14) rotate(-6deg); }

/* ===== 封面页入场 =====
   注意：.cover-floating / .cover-title 本身已有 floaty / shimmer 动画，
   不能在这两个元素上再写 animation（会互相覆盖），所以动效挂在 .cover-content 上。 */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cover-content { animation: riseIn 0.55s cubic-bezier(0.22, 0.8, 0.36, 1) both; }
.cover-badge { animation: riseIn 0.5s 0.10s ease both; }
.cover-team { animation: riseIn 0.5s 0.35s ease both; }

/* ===== 尊重系统「减少动态效果」设置 ===== */
@media (prefers-reduced-motion: reduce) {
    .view-enter, .cover-content, .cover-badge, .cover-team,
    .enter-icon, .enter-bar span, .game-spinner {
        animation: none !important;
    }
    .hub-card, .hub-card .hub-icon { transition: none !important; }
    .enter-fade-enter-active, .enter-fade-leave-active { transition: opacity 0.01s linear; }
}
/* ==================================================================
   忘记密码入口强化：原来是一个不起眼的文字链接，现在改成登录按钮
   正下方的整行按钮，弹窗里加了「一键拨打 / 复制号码」
   ================================================================== */
.forgot-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 215, 0, 0.45);
    background: rgba(255, 215, 0, 0.07);
    color: #FFD700;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.forgot-btn:hover { background: rgba(255, 215, 0, 0.16); border-color: rgba(255, 215, 0, 0.7); }
.forgot-btn:active { transform: scale(0.98); }

.phone-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.12s ease, background 0.2s ease;
}
.phone-btn:active { transform: scale(0.96); }
.phone-btn.call {
    background: rgba(76, 175, 80, 0.22);
    border-color: rgba(124, 255, 176, 0.5);
    color: #7CFFB0;
}
.phone-btn.call:hover { background: rgba(76, 175, 80, 0.34); }
.phone-btn.copy {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(240, 255, 240, 0.85);
}
.phone-btn.copy:hover { background: rgba(255, 255, 255, 0.16); }

@media (max-width: 420px) {
    .phone-actions { flex-direction: column; }
    .phone-btn { justify-content: center; }
}