/* ===== 全局 CSS 变量（支持深色模式） ===== */
@import url('effects.css');
:root {
    --bg-gradient: linear-gradient(145deg, #f0f4f9 0%, #e8ecf5 100%);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(148, 163, 184, 0.15);
    --modal-bg: rgba(255, 255, 255, 0.95);
    --modal-border: rgba(148, 163, 184, 0.2);
    --primary: #4f46e5;
    --accent: #0071e3;
    --ui-scale: 1;
    --font-display: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', sans-serif;
    --primary-hover: #4338ca;
    --danger: #ef4444;
}

html.dark-mode {
    --accent: #2997ff;
    --bg-gradient: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --modal-bg: rgba(30, 41, 59, 0.95);
    --modal-border: rgba(255, 255, 255, 0.15);
}

/* 全局深色模式基础适配 */
html.dark-mode body {
    background: var(--bg-gradient) !important;
    color: var(--text-main) !important;
}

/* ==================== 活动主题通用样式 ==================== */
.activity-banner-container {
    width: 100%;
    max-width: 1100px;
    margin: 16px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.6s ease-out;
}
.activity-banner-container img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s;
}
.activity-banner-container img:hover {
    transform: translateY(-4px);
}

.activity-sticker {
    position: fixed;
    bottom: 20px;
    z-index: 9995;
    pointer-events: none;
    transition: transform 0.3s ease;
    width: 130px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}
.activity-sticker.snowman { left: 20px; }
.activity-sticker.tree { right: 20px; bottom: 90px; }

#snowfall-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
}

@media (max-width: 600px) {
    .activity-banner-container img { max-height: 110px; border-radius: 16px; }
    .activity-sticker { width: 90px; }
    .activity-sticker.tree { bottom: 80px; }
}

/* ==================== 滑动提示浮窗 ==================== */
.common-slide-hint {
    position: fixed;
    top: -100px; /* 初始隐藏在顶部 */
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.common-slide-hint.show {
    top: 80px; /* 滑下来，避开导航栏 */
}
.common-slide-hint button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
}
.common-slide-hint button:hover {
    background: var(--primary-hover);
}

/* ===== 悬浮工具组件 ===== */
.common-float-tools {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9990;
}
.common-float-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    position: relative; /* 确保伪元素绝对定位生效 */
}
.common-float-btn.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.common-float-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

/* 悬浮气泡提示 */
.common-float-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 120%; /* 放在左侧 */
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
}
.common-float-btn[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
/* 气泡小三角 */
.common-float-btn[data-tooltip]::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}
.common-float-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ===== 全局弹窗基础 ===== */
.common-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    z-index: 10000; display: none; justify-content: center; align-items: center;
    padding: 16px; backdrop-filter: blur(4px); overscroll-behavior: contain;
}
.common-modal-overlay.active { display: flex; }
.common-modal {
    background: var(--modal-bg); backdrop-filter: blur(20px);
    border-radius: 1.5rem; width: 100%; max-width: 600px; max-height: 92vh;
    overflow-y: auto; box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--modal-border); padding: 1.8rem 2rem;
    position: relative; color: var(--text-main);
}
.common-modal-close {
    position: absolute; top: 1rem; right: 1rem; background: var(--card-border);
    border: none; border-radius: 50%; width: 32px; height: 32px;
    font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.common-modal-close:hover { background: var(--danger); color: #fff; }

/* ===== 公告卡片核心样式补全 ===== */
.announce-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 16px 20px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    color: var(--text-main);
    margin-bottom: 12px;
}
.announce-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 8px; 
    gap: 16px; 
}
.announce-name { 
    font-weight: 700; 
    font-size: 1rem; 
    color: var(--text-main); 
}
.announce-date { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    white-space: nowrap; 
}
.announce-content { 
    font-size: 0.92rem; 
    color: var(--text-main); 
    line-height: 1.7; 
    white-space: pre-wrap; 
    opacity: 0.9;
}

.empty-announce-box {
    text-align: center;
    padding: 20px;
    background: rgba(148, 163, 184, 0.05);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 12px;
    transition: background 0.3s;
}
html.dark-mode .empty-announce-box {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

.announce-close {
    position: absolute; top: 12px; right: 12px; background: none; border: none;
    font-size: 1.2rem; color: var(--text-muted); cursor: pointer; line-height: 1;
    transition: color 0.2s; z-index: 10;
}
.announce-close:hover { color: var(--danger); }
.common-btn-view-all {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 12px; background: none; border: none; color: var(--primary);
    font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 0;
}
.common-btn-view-all:hover { text-decoration: underline; }

/* ===== 全部公告弹窗 ===== */
.common-announce-all-box {
    display: flex; height: 450px; background: var(--card-bg);
    border-radius: 16px; border: 1px solid var(--card-border);
    overflow: hidden; margin-top: 1rem;
}
.common-announce-sidebar {
    width: 220px; background: rgba(148, 163, 184, 0.05);
    border-right: 1px solid var(--card-border); overflow-y: auto; flex-shrink: 0;
}
.common-announce-menu-item {
    padding: 16px; cursor: pointer;
    border-left: 4px solid transparent; border-bottom: 1px solid var(--card-border);
    transition: all 0.2s;
}
.common-announce-menu-item:hover { background: rgba(148, 163, 184, 0.1); }
.common-announce-menu-item.active {
    background: var(--modal-bg); border-left-color: var(--primary);
}
.common-announce-menu-title { font-weight: 700; font-size: 0.9rem; color: var(--text-main); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.common-announce-menu-date { font-size: 0.75rem; color: var(--text-muted); }
.common-announce-detail-area { flex: 1; padding: 24px; overflow-y: auto; }
.common-announce-detail-area h3 { margin-bottom: 16px; font-size: 1.2rem; color: var(--text-main); }
.common-announce-detail-area p, .common-announce-detail-content { white-space: pre-wrap; line-height: 1.8; color: var(--text-main); font-size: 0.95rem; }

/* ===== 未读提醒弹窗 ===== */
.common-unread-modal {
    text-align: center; max-width: 420px !important;
    animation: slideUp 0.4s ease;
}
.common-unread-modal .icon { font-size: 3.5rem; margin-bottom: 1rem; }
.common-unread-modal h2 { margin-bottom: 0.5rem; color: var(--text-main); font-size: 1.4rem; }
.common-unread-modal p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; line-height: 1.6; }
.common-unread-modal .common-btn { width: 100%; padding: 12px; border-radius: 30px; background: var(--primary); color: #fff; border: none; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.common-unread-modal .common-btn:hover { background: var(--primary-hover); }

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

/* ===== 全局 Footer ===== */
.common-footer {
    width: 100%; text-align: center; padding: 24px 20px; color: var(--text-muted);
    font-size: 13px; border-top: 1px solid var(--card-border); margin-top: auto;
}
.common-footer a { color: var(--primary); text-decoration: none; margin: 0 6px; }
.common-footer a:hover { text-decoration: underline; }

/* 【核心修复】游戏页面的底部栏强制悬浮，不再占位 */
body.is-game-page .common-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    z-index: 9999;
    padding: 12px 20px;
    font-size: 12px;
    margin-top: 0;
}
body.is-game-page .common-footer a { color: #818cf8; }

/* ===== 深色模式兼容原有组件 ===== */
html.dark-mode .game-card, 
html.dark-mode .fav-item {
    background: var(--card-bg) !important;
    border-color: var(--card-border) !important;
    color: var(--text-main) !important;
}
html.dark-mode .game-name {
    color: var(--text-main) !important;
}
html.dark-mode .search-wrapper,
html.dark-mode .top-bar {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: var(--card-border) !important;
}
html.dark-mode .search-wrapper input {
    color: var(--text-main) !important;
}
html.dark-mode .game-title {
    background: linear-gradient(135deg, #f8fafc 0%, #818cf8 80%) !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html.dark-mode .modal {
    background: var(--modal-bg) !important;
    border-color: var(--modal-border) !important;
    color: var(--text-main) !important;
}

@media (max-width: 600px) {
    .common-announce-all-box { flex-direction: column; height: 500px; }
    .common-announce-sidebar { width: 100%; height: 120px; display: flex; overflow-x: auto; overflow-y: hidden; border-right: none; border-bottom: 1px solid var(--card-border); }
    .common-announce-menu-item { min-width: 140px; border-left: none; border-bottom: 4px solid transparent; }
    .common-announce-menu-item.active { border-left-color: transparent; border-bottom: var(--primary); }
}

/* ===== 灵动岛导航（紧凑版，仅首页 .top-bar，4.0.1） ===== */
/* 保持 sticky 占位，通过宽高/圆角过渡实现平滑 morph，绝不遮挡内容 */
.top-bar.island-mode {
    top: 10px;
    width: min(760px, calc(100% - 24px));
    margin: 0 auto;
    height: 52px;
    min-height: 52px;
    padding: 0 14px;
    flex-direction: row;
    align-items: center;
    gap: 0;
    background: rgba(15, 23, 42, 0.82);
    border-radius: 26px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    will-change: width, height, background, border-radius;
    transition: width 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
                height 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.18s ease, border-radius 0.18s ease,
                top 0.18s ease, padding 0.18s ease, box-shadow 0.18s ease;
}
/* 岛内只保留第一行：搜索行与分类行平滑收起（保留占位过渡，避免内容跳动） */
.top-bar.island-mode .nav-search-row,
.top-bar.island-mode .category-nav-wrapper {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease;
}
.top-bar.island-mode .top-bar-row { flex-wrap: nowrap; width: 100%; height: 100%; min-height: 0; align-items: center; gap: 8px; }
.top-bar.island-mode .title-group { gap: 8px; flex: 0 1 auto; min-width: 0; }
.top-bar.island-mode .site-logo { height: 26px; flex: 0 0 auto; }
.top-bar.island-mode .title-text-group { flex-direction: row; align-items: center; gap: 8px; }
.top-bar.island-mode .right-actions { flex-wrap: nowrap; }
.top-bar.island-mode .action-btn,
.top-bar.island-mode .lang-btn { white-space: nowrap; }
.top-bar.island-mode .title-text-group { min-width: 0; }
.top-bar.island-mode .game-title { font-size: 15px; color: #fff; -webkit-text-fill-color: #fff; background: none; white-space: nowrap; line-height: 1.2; }
.top-bar.island-mode .refresh-hint { display: none; }
/* 三级分级：次级按钮隐藏，保留 语言/头像/开发者面板/投稿/搜索聚焦 */
.top-bar.island-mode .btn-about,
.top-bar.island-mode .btn-docs,
.top-bar.island-mode .btn-support,
.top-bar.island-mode .recommend-btn,
.top-bar.island-mode .studio-link,
.top-bar.island-mode .random-play-btn,
.top-bar.island-mode .btn-settings { display: none !important; }
.top-bar.island-mode .right-actions { gap: 6px; margin-left: auto; flex-wrap: nowrap; }
.top-bar.island-mode .lang-switch {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 3px;
}
.top-bar.island-mode .lang-btn { color: rgba(255, 255, 255, 0.78); font-size: 0.75rem; padding: 3px 10px; }
.top-bar.island-mode .lang-btn.active { background: #fff; color: #1e293b; box-shadow: none; }
.top-bar.island-mode .action-btn { background: rgba(255, 255, 255, 0.12); color: #fff; padding: 6px 12px; font-size: 12px; }
.top-bar.island-mode .search-wrapper input { color: #fff; }
.island-search-btn { display: none; }
.top-bar.island-mode .island-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.top-bar.island-mode .island-search-btn:hover { background: rgba(255, 255, 255, 0.24); }
html.dark-mode .top-bar.island-mode { background: rgba(15, 23, 42, 0.92) !important; }
@media (prefers-reduced-motion: reduce) {
    .top-bar.island-mode,
    .top-bar.island-mode .nav-search-row,
    .top-bar.island-mode .category-nav-wrapper { transition: none; }
}
@media (max-width: 768px) {
    .top-bar.island-mode { width: calc(100% - 20px); height: 48px; min-height: 48px; top: 8px; padding: 0 10px; }
    .top-bar.island-mode .game-title { display: none; }
    .top-bar.island-mode .lang-btn { padding: 3px 8px; font-size: 0.7rem; }
    /* 移动端岛模式：隐藏次要按钮，避免溢出变形 */
    .top-bar.island-mode .random-play-btn,
    .top-bar.island-mode .btn-settings,
    .top-bar.island-mode .studio-link { display: none !important; }
}

/* ===== 灵动岛 · 搜索岛模式（点击岛内搜索按钮就地展开，不跳回顶部） ===== */
.top-bar.island-mode.island-search-mode {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    height: auto;
    min-height: 52px;
    width: min(820px, calc(100% - 24px));
    padding: 8px 12px;
    gap: 8px;
}
.top-bar.island-mode.island-search-mode .top-bar-row {
    height: auto;
    min-height: 0;
    flex-wrap: nowrap;
}
/* 搜索岛内只保留最核心的按钮（投稿 + 搜索按钮），其余隐藏 */
.top-bar.island-mode.island-search-mode .right-actions .action-btn,
.top-bar.island-mode.island-search-mode .right-actions .lang-switch { display: none !important; }
.top-bar.island-mode.island-search-mode .right-actions .submit-btn,
.top-bar.island-mode.island-search-mode .right-actions .island-search-btn { display: inline-flex !important; }
.top-bar.island-mode.island-search-mode .nav-search-row {
    max-height: 64px;
    opacity: 1;
    margin: 0;
    padding: 0;
    border: none;
    overflow: visible;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-bar.island-mode.island-search-mode .type-nav,
.top-bar.island-mode.island-search-mode .btn-fav-list { display: none !important; }
.top-bar.island-mode.island-search-mode .search-wrapper {
    flex: 1 1 auto;
    max-width: none;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 0 14px;
}
.top-bar.island-mode.island-search-mode .search-wrapper input { color: #fff; }
.top-bar.island-mode.island-search-mode .search-wrapper input::placeholder { color: rgba(255, 255, 255, 0.6); }
.top-bar.island-mode.island-search-mode .island-search-btn { width: 38px; height: 38px; flex: 0 0 auto; }

/* 移动端搜索岛：整条变为「搜索岛」，隐藏第一行其余内容，搜索框占满 */
@media (max-width: 768px) {
    .top-bar.island-mode.island-search-mode { width: calc(100% - 16px); top: 8px; padding: 6px 10px; }
    .top-bar.island-mode.island-search-mode .top-bar-row { display: none; }
    .top-bar.island-mode.island-search-mode .nav-search-row { max-height: 52px; }
}

/* 尊重「减少动态效果」系统偏好（无障碍） */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== 搜索范围筛选 + 分页 + 作者卡片（4.0.1） ===== */
.search-scope-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.scope-btn { padding: 6px 16px; border-radius: 30px; border: 1px solid var(--card-border, rgba(148,163,184,0.3)); background: var(--card-bg); color: var(--text-muted); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.scope-btn:hover { border-color: var(--accent); color: var(--accent); }
.scope-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.scope-count { font-size: 0.85rem; color: var(--text-muted); margin-left: 4px; }
.game-author { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; line-height: 1.3; }
.author-card { background: var(--card-bg); backdrop-filter: blur(8px); border-radius: 24px; padding: 24px 20px; text-align: center; color: var(--text-main); box-shadow: 0 4px 12px rgba(0,0,0,0.04); border: 1px solid var(--card-border, rgba(148,163,184,0.1)); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform 0.25s ease, box-shadow 0.25s ease; min-height: 140px; justify-content: center; }
.author-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.1); }
.author-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: rgba(148,163,184,0.15); }
.author-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 30px; }
.author-name { font-size: 1.05rem; font-weight: 700; font-family: var(--font-display); }
.author-count { font-size: 0.8rem; color: var(--text-muted); }
.search-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 26px 0 8px; flex-wrap: wrap; }
.page-btn { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--card-border, rgba(148,163,184,0.3)); background: var(--card-bg); color: var(--text-main); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; }

/* ===== 设置面板 / Toast / 自定义排版（4.0.1） ===== */
.lelele-toast {
    position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 16px);
    background: rgba(15, 23, 42, 0.9); color: #fff; padding: 12px 22px;
    border-radius: 30px; font-size: 0.9rem; font-weight: 600; z-index: 10005;
    opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25); max-width: 88%; text-align: center;
}
.lelele-toast.active { opacity: 1; transform: translate(-50%, 0); }
#customBgLayer { z-index: -2; }
.lelele-settings-panel { position: fixed; inset: 0; z-index: 10002; display: none; }
.lelele-settings-panel.active { display: block; }
.lelele-settings-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: leleleFadeIn 0.25s ease; }
.lelele-settings-card {
    position: absolute; top: 0; right: 0; height: 100%; width: min(380px, 92vw);
    background: var(--card-bg, rgba(255,255,255,0.92));
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--card-border, rgba(148,163,184,0.2));
    box-shadow: -20px 0 60px rgba(0,0,0,0.18); padding: 28px 24px;
    animation: leleleSlideInRight 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto; box-sizing: border-box;
}
html.dark-mode .lelele-settings-card { background: rgba(30,41,59,0.92); }
@keyframes leleleSlideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes leleleFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lelele-settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.lelele-settings-head h3 { font-size: 1.3rem; font-weight: 700; color: var(--text-main); }
.lelele-settings-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--card-border, rgba(148,163,184,0.15)); color: var(--text-main); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.lelele-settings-close:hover { background: rgba(148,163,184,0.3); }
.lelele-settings-section { padding: 16px 0; border-top: 1px solid var(--card-border, rgba(148,163,184,0.18)); }
.lelele-settings-section:first-of-type { border-top: none; }
.lelele-settings-label { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); }
.lelele-settings-hint { font-size: 0.78rem; color: var(--text-muted); margin: -6px 0 12px; line-height: 1.5; }
.lelele-accent-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lelele-accent-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.lelele-accent-dot:hover { transform: scale(1.12); }
.lelele-accent-dot.active { border-color: var(--text-main); box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0,0,0,0.2); }
.lelele-font-row { display: flex; align-items: center; gap: 12px; }
.lelele-font-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--card-border, rgba(148,163,184,0.25)); background: var(--card-bg); color: var(--text-main); font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.lelele-font-btn:hover { background: var(--accent); color: #fff; border-color: transparent; }
.lelele-font-range { flex: 1; accent-color: var(--accent); }
.lelele-font-val { font-size: 0.85rem; color: var(--text-muted); min-width: 42px; text-align: right; }
.lelele-bg-row { display: flex; gap: 10px; }
.lelele-bg-upload, .lelele-bg-clear {
    flex: 1; text-align: center; padding: 12px; border-radius: 14px; font-size: 0.9rem; font-weight: 600;
    border: 1px solid var(--card-border, rgba(148,163,184,0.25)); background: var(--card-bg); color: var(--text-main); cursor: pointer;
    transition: background 0.2s, border-color 0.2s; box-sizing: border-box; font-family: inherit;
}
.lelele-bg-upload:hover, .lelele-bg-clear:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 作者认证徽章体系（新增） ===== */
.lelele-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
}
.lelele-badge-level {
    color: var(--badge-color, #64748b);
    background: var(--badge-bg, #f1f5f9);
    border: 1px solid var(--badge-color, #64748b);
}
.lelele-badge-official {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.3);
}
.lelele-badge-special {
    color: #3b2f00;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    box-shadow: 0 1px 6px rgba(245, 158, 11, 0.4);
}
/* 游戏详情 / 作者页的作者行徽章 */
.author-badges { display: inline-flex; align-items: center; flex-wrap: wrap; }
/* 徽标可点击：跳转等级说明 / 认证文档 */
.lelele-badge-link { text-decoration: none; color: inherit; outline: none; }
.lelele-badge-link:hover { opacity: 0.85; }
/* ===== 设置面板：板块大小（仅游戏方块） ===== */
.lelele-size-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 0.85rem; color: var(--text-main); }
.lelele-size-row > span:first-child { width: 72px; flex: none; }
.lelele-size-range { flex: 1; accent-color: var(--accent); }
.lelele-size-val { width: 42px; text-align: right; flex: none; color: var(--text-muted); }

/* 游戏方块大小由 index.html 的 .games-grid { zoom: var(--sz-card, 1); } 控制 */


/* ===== 以下原 index.html 内联样式，已外置至此（行为保持，级联优先级不变） ===== */

/* --- index.html inline style block 1 --- */
/* ===== 多语言控制 ===== */
        .zh-text, .en-text { display: none; }
        html[data-lang="zh"] .zh-text { display: block; }
        html[data-lang="zh"] .zh-inline { display: inline; }
        html[data-lang="en"] .en-text { display: block; }
        html[data-lang="en"] .en-inline { display: inline; }
        html[data-lang="zh"] .en-text, html[data-lang="zh"] .en-inline { display: none; }
        html[data-lang="en"] .zh-text, html[data-lang="en"] .zh-inline { display: none; }

        /* ===== 全局重置 ===== */
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            background: linear-gradient(145deg, #f0f4f9 0%, #e8ecf5 100%);
            font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
            color: #1e293b;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* ===== 顶部导航栏 ===== */
        .top-bar {
            width: 100%;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
            padding: 12px 28px;
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .top-bar-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 10px;
        }
        .title-group { display: flex; align-items: center; gap: 12px; }
        .site-logo { height: 40px; width: auto; cursor: pointer; transition: transform 0.2s; }
        .site-logo:hover { transform: scale(1.05); }
        .title-text-group { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

        .game-title {
            font-size: 26px;
            font-weight: 800;
            background: linear-gradient(90deg, #4f46e5, #a855f7, #06b6d4, #4f46e5);
            background-size: 220% auto;
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: fxGradientText 7s linear infinite;
            cursor: pointer;
            user-select: none;
            line-height: 1.2;
            border: none;
            background-color: transparent;
            text-align: left;
            font-family: inherit;
        }
        .game-title:hover { opacity: 0.8; }

        .refresh-hint {
            font-size: 12px;
            color: #64748b;
            cursor: pointer;
            user-select: none;
            background: none;
            border: none;
            text-align: left;
            padding: 0;
            font-family: inherit;
            transition: color 0.2s;
        }
        .refresh-hint:hover { color: #4f46e5; text-decoration: underline; }

        .right-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

        .lang-switch {
            display: flex; gap: 2px; background: rgba(148, 163, 184, 0.12);
            border-radius: 30px; padding: 3px; margin-right: 6px;
        }
        .lang-btn {
            padding: 4px 12px; border: none; border-radius: 24px; background: transparent;
            font-size: 0.8rem; font-weight: 600; color: #64748b; cursor: pointer;
            transition: all 0.2s; font-family: inherit;
        }
        .lang-btn.active { background: #4f46e5; color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25); }
        .lang-btn:hover:not(.active) { color: #1e293b; }

        .action-btn {
            border-radius: 30px; padding: 10px 20px; font-size: 14px; font-weight: 600;
            cursor: pointer; transition: all 0.25s; display: inline-flex; align-items: center;
            gap: 0.4rem; font-family: inherit; text-decoration: none; border: none;
        }
        .btn-support { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
        .btn-support:hover { background: rgba(16, 185, 129, 0.2); transform: translateY(-1px); }
        .submit-btn { background: #f59e0b; color: #1e293b; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35); }
        .submit-btn:hover { background: #d97706; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(245, 158, 11, 0.45); }
        .studio-link { background: #4f46e5; color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
        .studio-link:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79, 70, 229, 0.4); }

        .btn-about {
            background: transparent; color: #64748b; border: 1px solid rgba(148, 163, 184, 0.3);
        }
        .btn-about:hover { background: rgba(148, 163, 184, 0.1); color: #1e293b; }

        .btn-docs { background: rgba(79, 70, 229, 0.08); color: var(--primary); border: 1px solid rgba(79, 70, 229, 0.2); }
        .btn-docs:hover { background: rgba(79, 70, 229, 0.16); transform: translateY(-1px); }

        /* ===== 第二行导航与搜索 ===== */
        .nav-search-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 16px;
            width: 100%;
        }
        
        .type-nav {
            display: flex; gap: 4px; background: rgba(148, 163, 184, 0.12);
            border-radius: 40px; padding: 4px; flex-shrink: 0;
        }
        .type-btn {
            padding: 7px 22px; border: none; border-radius: 30px; background: transparent;
            font-size: 14px; font-weight: 600; color: #64748b; cursor: pointer;
            transition: all 0.25s ease; white-space: nowrap; user-select: none; font-family: inherit;
        }
        .type-btn.active { background: #4f46e5; color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.30); }
        .type-btn:hover:not(.active) { color: #1e293b; background: rgba(255, 255, 255, 0.5); }

        /* 搜索与收藏 */
        .controls-inline {
            display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; justify-content: flex-end;
        }
        .search-wrapper {
            display: flex; align-items: center; background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(8px); border-radius: 30px; padding: 8px 18px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); border: 1px solid rgba(148, 163, 184, 0.15);
            transition: border-color 0.2s, box-shadow 0.2s;
            position: relative; width: 100%; max-width: 320px;
        }
        .search-wrapper:focus-within { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
        .search-wrapper input {
            border: none; outline: none; background: transparent;
            font-size: 14px; padding: 4px 8px; width: 100%; color: #1e293b; font-family: inherit;
        }
        .search-icon { font-size: 16px; margin-right: 4px; color: #4f46e5; }
        .search-clear {
            display: none; cursor: pointer; color: #94a3b8; font-size: 16px;
            padding: 4px; transition: color 0.2s;
        }
        .search-clear:hover { color: #ef4444; }
        .search-clear.show { display: block; }

        .btn-fav-list {
            background: rgba(255, 255, 255, 0.8); color: #1e293b; border: 1px solid rgba(148,163,184,0.2);
            border-radius: 30px; padding: 8px 20px; font-weight: 600; font-size: 14px; cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.03); transition: all 0.2s; white-space: nowrap;
        }
        .btn-fav-list:hover { background: #fff; color: #4f46e5; border-color: #4f46e5; }

        /* 分类筛选 (动态生成) */
        .category-nav-wrapper {
            width: 100%; overflow-x: auto; scrollbar-width: none; display: none;
        }
        .category-nav-wrapper::-webkit-scrollbar { display: none; }
        .category-nav {
            display: flex; gap: 4px; background: rgba(148, 163, 184, 0.08);
            border-radius: 40px; padding: 4px; flex-shrink: 0; width: fit-content;
        }
        .category-btn {
            font-size: 13px; padding: 5px 16px; border: none; border-radius: 30px; background: transparent;
            font-weight: 600; color: #64748b; cursor: pointer; transition: all 0.25s ease; white-space: nowrap; font-family: inherit;
        }
        .category-btn.active { background: #1e293b; color: #fff; box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2); }
        .category-btn:hover:not(.active) { color: #1e293b; background: rgba(255, 255, 255, 0.8); }

        /* ===== 主内容区 ===== */
        .main-content {
            width: 100%; max-width: 1100px; margin: 20px auto 0; padding: 0 20px; flex: 1;
            display: flex; flex-direction: column; gap: 20px;
        }

        /* 首页双栏布局：游戏主区 + 侧边栏（排行榜/公告） */
        .home-layout { display: flex; gap: 20px; align-items: flex-start; width: 100%; }
        .home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
        .home-side {
            width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px;
            position: sticky; top: 84px;
        }

        /* 侧边栏内的排行榜紧凑化 */
        .home-side .rank-showcase { padding: 22px 18px 18px; border-radius: 24px; }
        .home-side .rank-header { margin-bottom: 16px; }
        .home-side .rank-header h3 { font-size: 1.1rem; }
        .home-side .rank-grid { flex-direction: column; align-items: stretch; gap: 12px; }
        .home-side .rank-card { padding: 14px 14px; }
        .home-side .rank-card.rank-1, .home-side .rank-card.rank-2, .home-side .rank-card.rank-3 { width: 100%; min-width: unset; min-height: unset; transform: none; }
        .home-side .rank-card.rank-1:hover { transform: translateY(-4px) scale(1.01); }
        .home-side .rank-main { gap: 12px; margin-top: 10px; }
        .home-side .rank-icon { width: 44px; height: 44px; font-size: 1.6rem; border-radius: 14px; }
        .home-side .rank-card.rank-1 .rank-icon { width: 54px; height: 54px; font-size: 2rem; }
        .home-side .rank-card.rank-1 .rank-name { font-size: 1.1rem; }
        .home-side .rank-card.rank-2 .rank-name { font-size: 1rem; }
        .home-side .rank-card.rank-3 .rank-name { font-size: 0.95rem; }
        .home-side .rank-meta { margin-top: 10px; }

        /* 侧边栏公告：仅标题 + 查看详情 */
        .home-side .announcements-title { font-size: 1rem; margin-bottom: 10px; }
        .home-side .announcements-list { gap: 8px; }
        .announce-detail-btn {
            appearance: none; border: none; cursor: pointer; font-family: inherit;
            margin-top: 8px; padding: 6px 12px; border-radius: 999px;
            background: rgba(79, 70, 229, 0.1); color: #4f46e5;
            font-size: 0.78rem; font-weight: 700; transition: all 0.2s;
        }
        .announce-detail-btn:hover { background: rgba(79, 70, 229, 0.2); transform: translateY(-1px); }

        @media (max-width: 1024px) {
            .home-layout { flex-direction: column; }
            .home-side { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
            .home-side .rank-showcase { flex: 1 1 100%; }
            .home-side .announcements-container { flex: 1 1 100%; }
            .home-side .rank-grid { flex-direction: row; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
        }

        /* 板块大小：游戏方块缩放 */
        .games-grid { zoom: var(--sz-card, 1); }
        @media (max-width: 640px) {
            .home-side .rank-grid { flex-direction: column; align-items: stretch; }
            .home-side .rank-card.rank-1, .home-side .rank-card.rank-2, .home-side .rank-card.rank-3 { transform: none; }
        }

        /* 新布局引导（2026-11-05 前限时显示）：全屏变黑 + 聚光灯高亮 + 中央提示卡 */
        .guide-blocker { position: fixed; inset: 0; z-index: 99997; background: transparent; }
        .guide-spot {
            position: fixed; z-index: 99998; pointer-events: none;
            border-radius: 22px; box-shadow: 0 0 0 100000px rgba(2, 6, 23, 0.78);
            outline: 2px solid rgba(129, 140, 248, 0.95); outline-offset: 3px;
            transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1), left 0.45s cubic-bezier(0.4, 0, 0.2, 1), width 0.45s cubic-bezier(0.4, 0, 0.2, 1), height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .guide-card {
            position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
            z-index: 99999; width: min(400px, calc(100vw - 48px));
            background: #fff; border-radius: 20px; padding: 26px 26px 20px;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); text-align: center; font-family: inherit;
            animation: guidePop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.4);
        }
        @keyframes guidePop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
        html.dark-mode .guide-card { background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.1); }
        .guide-card h4 { margin: 0 0 10px; font-size: 1.12rem; font-weight: 800; color: #1e293b; }
        html.dark-mode .guide-card h4 { color: #e2e8f0; }
        .guide-card p { margin: 0 0 18px; font-size: 0.88rem; line-height: 1.75; color: #64748b; }
        html.dark-mode .guide-card p { color: #94a3b8; }
        .guide-card .guide-btn {
            appearance: none; border: none; cursor: pointer; font-family: inherit;
            background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
            padding: 11px 34px; border-radius: 999px; font-size: 0.92rem; font-weight: 700;
            box-shadow: 0 8px 18px rgba(79, 70, 229, 0.3); transition: transform 0.2s, box-shadow 0.2s;
        }
        .guide-card .guide-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(79, 70, 229, 0.42); }
        .guide-dots { display: flex; gap: 7px; justify-content: center; margin-top: 14px; }
        .guide-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(148, 163, 184, 0.4); transition: all 0.25s; }
        .guide-dots span.active { background: #4f46e5; width: 22px; border-radius: 999px; }

        /* 公告板块 */
        .announcements-container { width: 100%; display: none; }
        .announcements-title { font-size: 1.1rem; font-weight: 800; color: #1e293b; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
        .announcements-list { display: flex; flex-direction: column; gap: 12px; }

        /* 游戏排行榜 (移到公告上方) */
        .rank-showcase {
            width: 100%; margin: 0; padding: 32px 28px 28px; background: rgba(255, 255, 255, 0.45);
            backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
            border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(79, 70, 229, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.02);
            position: relative; overflow: visible; z-index: 10; transition: transform 0.4s ease, box-shadow 0.4s ease;
        }
        .rank-showcase::before {
            content: ''; position: absolute; inset: 0; border-radius: 28px; padding: 1px;
            background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(79,70,229,0.15), rgba(255,255,255,0.5));
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; z-index: -1;
        }
        html.dark-mode .rank-showcase { background: rgba(30, 41, 59, 0.4); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(79, 70, 229, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.15); }
        .rank-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
        .rank-header h3 { margin: 0; font-size: 1.3rem; font-weight: 800; color: #1e293b; letter-spacing: 0.5px; }
        .rank-header .rank-subtitle { display: block; font-size: 0.82rem; color: #64748b; margin-top: 4px; }
        .rank-more-btn { appearance: none; border: none; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; border-radius: 999px; padding: 0.7rem 1.4rem; cursor: pointer; font-size: 0.88rem; font-weight: 700; box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22); transition: transform 0.2s ease, box-shadow 0.2s ease; }
        .rank-more-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 20px rgba(79, 70, 229, 0.35); }
        .rank-grid { display: flex; align-items: flex-end; justify-content: center; gap: 20px; flex-wrap: wrap; }
        .rank-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 20px; border-radius: 22px; cursor: pointer; color: #1e293b; border: 1px solid rgba(255, 255, 255, 0.6); transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease; text-align: left; overflow: hidden; }
        .rank-card.rank-1 { background: linear-gradient(135deg, rgba(255, 235, 170, 0.9), rgba(255,255,255,0.95)); min-width: 280px; min-height: 210px; transform: translateY(-16px); box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.25), inset 0 2px 4px rgba(255,255,255,0.9); z-index: 3; }
        .rank-card.rank-2 { background: linear-gradient(135deg, rgba(226, 232, 240, 0.9), rgba(255,255,255,0.95)); min-width: 240px; min-height: 175px; box-shadow: 0 15px 30px -10px rgba(148, 163, 184, 0.35), inset 0 2px 4px rgba(255,255,255,0.9); z-index: 2; }
        .rank-card.rank-3 { background: linear-gradient(135deg, rgba(254, 215, 170, 0.85), rgba(255,255,255,0.95)); min-width: 220px; min-height: 155px; box-shadow: 0 15px 30px -10px rgba(217, 119, 6, 0.2), inset 0 2px 4px rgba(255,255,255,0.9); z-index: 1; }
        .rank-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 24px 48px -10px rgba(15, 23, 42, 0.15); }
        .rank-card.rank-1:hover { transform: translateY(-24px) scale(1.02); }
        .rank-card-header { display: flex; align-items: center; justify-content: space-between; }
        .rank-medal { font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
        .rank-card.rank-1 .rank-medal { font-size: 2.6rem; }
        .rank-tag { background: rgba(79, 70, 229, 0.12); color: #4f46e5; border-radius: 999px; padding: 0.35rem 0.8rem; font-weight: 800; font-size: 0.75rem; box-shadow: inset 0 1px 2px rgba(255,255,255,0.5); }
        .rank-main { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
        .rank-icon { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 18px; font-size: 2rem; background: rgba(255,255,255,0.8); box-shadow: 0 8px 16px -4px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,1); flex-shrink: 0; }
        .rank-card.rank-1 .rank-icon { width: 72px; height: 72px; font-size: 2.6rem; box-shadow: 0 12px 20px -6px rgba(245, 158, 11, 0.3), inset 0 1px 1px rgba(255,255,255,1); }
        @keyframes floatText { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
        .rank-name { font-weight: 800; line-height: 1.35; word-break: break-word; color: #0f172a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; animation: floatText 3s ease-in-out infinite; text-shadow: 0 2px 4px rgba(255,255,255,0.6); }
        .rank-card.rank-1 .rank-name { font-size: 1.5rem; animation-duration: 2.5s; }
        .rank-card.rank-2 .rank-name { font-size: 1.2rem; animation-duration: 3s; animation-delay: 0.5s; }
        .rank-card.rank-3 .rank-name { font-size: 1.05rem; animation-duration: 3.5s; animation-delay: 1s; }
        .rank-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
        .rank-count { font-size: 0.95rem; color: #475569; font-weight: 700; }
        .rank-card.rank-1 .rank-count { font-size: 1.1rem; color: #b45309; }
        .rank-count small { font-size: 0.75rem; color: #64748b; font-weight: 600; }
        .rank-link { color: #4f46e5; text-decoration: none; font-weight: 800; font-size: 0.85rem; padding: 4px 10px; background: rgba(79, 70, 229, 0.1); border-radius: 12px; transition: all 0.2s; }
        .rank-link:hover { background: rgba(79, 70, 229, 0.2); }
        .rank-empty { width: 100%; min-height: 120px; display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(148,163,184,0.45); border-radius: 18px; color: #64748b; background: rgba(255,255,255,0.45); font-size: 0.95rem; }
        .rank-modal-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
        .rank-modal-row { display: grid; grid-template-columns: 52px 1.5fr 86px 84px; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(148,163,184,0.14); background: rgba(248,250,252,0.9); }
        .rank-modal-index { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef2ff, #e2e8f0); color: #4f46e5; font-weight: 800; }
        .rank-modal-name { font-weight: 700; color: #1e293b; word-break: break-word; }
        .rank-modal-count { color: #475569; font-weight: 700; text-align: right; }
        .rank-modal-link { color: #4f46e5; text-decoration: none; font-weight: 700; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; width: 100%; }

        /* 游戏列表 */
        .games-container { width: 100%; flex: 1; margin-bottom: 20px; }
        .games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 36px; }
        .game-card { background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(8px); border-radius: 24px; padding: 32px 16px; text-align: center; color: #1e293b; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); border: 1px solid rgba(148, 163, 184, 0.1); transition: all 0.25s ease; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; cursor: pointer; min-height: 160px; font-family: inherit; }
        .game-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, #4f46e5, #7c3aed); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
        .game-card:hover::before { transform: scaleX(1); }
        .game-card:hover { transform: translateY(-6px); box-shadow: 0 20px 32px rgba(0, 0, 0, 0.1); }
        .game-card:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
        .game-icon { font-size: 64px; margin-bottom: 16px; transition: transform 0.3s; line-height: 1; }
        .game-card:hover .game-icon { transform: scale(1.15); }
        .game-name { font-size: 15px; font-weight: 600; line-height: 1.3; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #1e293b; }

        /* 搜索高亮 */
        mark.search-highlight {
            background: rgba(245, 158, 11, 0.3); color: #b45309;
            font-weight: 700; border-radius: 4px; padding: 0 2px;
        }

        /* 骨架屏 */
        @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
        .skeleton-card { background: rgba(255, 255, 255, 0.6); border-radius: 24px; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; border: 1px solid rgba(148, 163, 184, 0.1); }
        .skeleton-icon { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(90deg, #e8ecf5 25%, #f4f7fc 50%, #e8ecf5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
        .skeleton-line { width: 70%; height: 14px; border-radius: 8px; background: linear-gradient(90deg, #e8ecf5 25%, #f4f7fc 50%, #e8ecf5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

        .status-message { text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 14px; }

        /* 主内容底部小徽章（不受 common.js 页脚覆盖影响） */
        .site-badge {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 8px 0 4px;
            margin-bottom: 8px;
        }
        .site-badge img {
            height: 28px;
            width: auto;
            display: block;
            opacity: 0.7;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        .site-badge img:hover {
            opacity: 1;
            transform: translateY(-1px);
        }

        /* 弹窗和按钮（保持不变） */
        .modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 200; display: none; justify-content: center; align-items: center; padding: 16px; backdrop-filter: blur(4px); overscroll-behavior: contain; }
        .modal-overlay.active { display: flex; }
        .modal { background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(20px); border-radius: 1.5rem; width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.15); border: 1px solid rgba(148, 163, 184, 0.2); padding: 1.8rem 2rem; position: relative; }
        .modal.modal-wide { max-width: 800px; }
        .modal-close { position: absolute; top: 1rem; right: 1rem; background: rgba(148, 163, 184, 0.1); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 1.2rem; cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
        .modal-close:hover { color: #1e293b; background: rgba(148, 163, 184, 0.2); }
        .modal-header { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; padding-right: 2rem; display: flex; align-items: center; gap: 0.6rem; }

        .preview-icon { font-size: 5rem; text-align: center; margin-bottom: 0.5rem; }
        .preview-name { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; word-break: break-word; }
        .preview-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem; }
        .preview-tag { font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.9rem; border-radius: 20px; background: rgba(79, 70, 229, 0.08); color: #4f46e5; }
        .preview-tag.age { background: rgba(16, 185, 129, 0.1); color: #059669; }
        .btn-group { display: flex; flex-direction: column; gap: 12px; }
        .btn-group-row { display: flex; gap: 12px; flex-wrap: wrap; }
        .btn-group-row .btn { flex: 1; min-width: 120px; }

        .btn { background: #4f46e5; color: white; border: none; border-radius: 2rem; padding: 0.7rem 1.8rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); font-family: inherit; }
        .btn:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79, 70, 229, 0.4); }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
        .btn-block { width: 100%; }
        .btn.warning { background: #f59e0b; color: #1e293b; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
        .btn.warning:hover { background: #d97706; }
        .btn.secondary { background: #f1f5f9; color: #1e293b; box-shadow: none; }
        .btn.secondary:hover { background: #e2e8f0; }
        .btn.fav-active { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; box-shadow: none; }
        .btn.fav-active:hover { background: #fde68a; }

        .fav-list { display: flex; flex-direction: column; gap: 12px; margin-top: 1rem; }
        .fav-item { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: #f8fafc; border-radius: 16px; border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.2s; }
        .fav-item:hover { border-color: #4f46e5; background: #fff; box-shadow: 0 4px 12px rgba(79,70,229,0.08); }
        .fav-item-icon { font-size: 2rem; }
        .fav-item-info { flex: 1; }
        .fav-item-name { font-weight: 700; color: #1e293b; }
        .fav-item-cat { font-size: 0.8rem; color: #64748b; }
        .fav-item-remove { background: none; border: none; font-size: 1.5rem; color: #cbd5e1; cursor: pointer; padding: 4px 8px; border-radius: 8px; line-height: 1; }
        .fav-item-remove:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

        .agree-row { display: flex; align-items: flex-start; gap: 0.6rem; background: rgba(79, 70, 229, 0.04); padding: 1rem; border-radius: 0.75rem; margin: 1rem 0; font-size: 0.9rem; border-left: 4px solid #4f46e5; color: #475569; cursor: pointer; }
        .agree-row input { margin-top: 0.2rem; cursor: pointer; }

        .tally-wrapper { width: 100%; height: 100%; min-height: 60vh; margin-top: 1rem; }
        .tally-wrapper iframe { width: 100%; border: none; min-height: 600px; }

        @media (max-width: 900px) {
            .nav-search-row { flex-direction: column; align-items: stretch; gap: 10px; }
            .controls-inline { justify-content: space-between; }
            .search-wrapper { max-width: 100%; flex: 1; }
        }
        @media (max-width: 768px) {
            .rank-grid { flex-direction: column; align-items: center; gap: 16px; }
            .rank-card.rank-1, .rank-card.rank-2, .rank-card.rank-3 { width: 100%; min-width: unset; transform: none; }
            .rank-card.rank-1:hover { transform: translateY(-6px) scale(1.02); }
            .rank-showcase { padding: 24px 16px; }
        }
        @media (max-width: 600px) {
            .top-bar { padding: 10px 16px; }
            .site-logo { height: 32px; }
            .game-title { font-size: 22px; }
            .refresh-hint { font-size: 11px; }
            .right-actions { gap: 6px; }
            .action-btn { padding: 6px 12px; font-size: 12px; }
            .games-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 24px; }
            .game-card { padding: 24px 8px; border-radius: 20px; min-height: 130px; }
            .game-icon { font-size: 48px; margin-bottom: 12px; }
            .game-name { font-size: 13px; }
            .modal { padding: 1.2rem; max-width: 100%; border-radius: 1.2rem; }
            .modal-header { font-size: 1.2rem; }
            .btn-fav-list { padding: 8px 12px; font-size: 13px; }
            .rank-modal-row { grid-template-columns: 42px 1fr 72px 72px; }
        }

/* --- index.html inline style block 2 --- */
.recommend-btn { background: #10b981; color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
        .recommend-btn:hover { background: #059669; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(16, 185, 129, 0.4); }
        .recommend-modal {
            width: min(1100px, 90vw); max-width: 1100px;
            height: 85vh; max-height: 85vh;
            padding: 1rem; display: flex; flex-direction: column;
            overflow: hidden;
        }
        .recommend-head {
            font-size: 1.1rem; font-weight: 700; margin: 0.1rem 0 0.7rem;
            padding-right: 2rem; flex: 0 0 auto;
        }
        .recommend-terms {
            flex: 0 0 auto; font-size: 0.78rem; color: #94a3b8;
            margin: 0 0 0.6rem; line-height: 1.5;
        }
        .recommend-terms a { color: #4f46e5; }
        .recommend-frame-wrap {
            flex: 1 1 auto; min-height: 0; overflow: auto;
            border-radius: 1rem; background: rgba(148, 163, 184, 0.06);
        }
        .recommend-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
        .recommend-loading {
            display: flex; align-items: center; justify-content: center;
            height: 100%; min-height: 200px;
            color: #94a3b8; font-size: 0.95rem;
        }
        @media (max-width: 768px) {
            .recommend-modal { width: 100%; height: 90vh; max-height: 90vh; padding: 0.7rem; }
            .recommend-head { font-size: 1rem; }
        }
