:root {
    --primary-color: #6e8efb;
    --secondary-color: #a777e3;
    --bg-light: #f0f2f5;
    --bg-dark: #0f0f13;
    --card-dark: #1a1a1f;
    --text-dark: #e4e4e7;
    --sidebar-bg-light: #ffffff;
    --sidebar-bg-dark: #16161a;
    --transition: all 0.3s ease;
    --btn-light-start: #6e8efb;
    --btn-light-end: #a777e3;
    --btn-dark-start: #3b82f6;
    --btn-dark-end: #2563eb;
    --gba-primary: #00c853;
    --gba-secondary: #64dd17;
}

body, html { cursor: url('/cur/arrow.cur'), auto !important; }
img { cursor: url('/cur/lsxy.cur'), auto !important; }
a:hover { cursor: url('/cur/liuying.cur'), auto; }
input:hover { cursor: url('/cur/input.cur'), auto; }
button:hover { cursor: url('/cur/btn.cur'), auto; }
i:hover { cursor: url('/cur/link.cur'), auto; }

.back-to-top, .theme-switch {
    position: fixed;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: var(--transition);
    background: var(--bg-light);
    border: none;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
}

.back-to-top { bottom: 160px; transform: rotate(-45deg); }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: scale(1.1) rotate(-45deg); }
.theme-switch:hover { transform: scale(1.1); }

.theme-switch { bottom: 100px; opacity: 1; visibility: visible; }
.theme-switch i { font-size: 1.5rem; }

.mobile-menu-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--btn-light-start), var(--btn-light-end)) !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.mobile-menu-btn:hover { transform: scale(1.1); }
.mobile-menu-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    pointer-events: none;
}

/* ============================================
   白天模式 - 页码按钮（紫色渐变）
   ============================================ */
.pagination .page-link { 
    background: #fff; 
    color: var(--btn-light-start); 
    border-color: #dee2e6; 
}

.pagination .page-link:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: var(--btn-light-start);
}

.pagination .active .page-link {
    background: linear-gradient(135deg, var(--btn-light-start), var(--btn-light-end)) !important;
    border-color: var(--btn-light-start) !important;
    color: #fff !important;
}

/* ============================================
   GBA白天模式 - 页码按钮（绿色渐变）
   ============================================ */
.gba-mode .pagination .page-link { 
    color: var(--gba-primary); 
}

.gba-mode .pagination .page-link:hover {
    color: var(--gba-primary);
}

.gba-mode .pagination .active .page-link {
    background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
    border-color: var(--gba-primary) !important;
    color: #fff !important;
}

/* ============================================
   暗色模式 - 基础样式
   ============================================ */
body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

.dark-mode .card { 
    background: var(--card-dark); 
    color: var(--text-dark); 
    border-color: #2a2a30;
}

.dark-mode .sidebar { 
    background: var(--sidebar-bg-dark); 
    border-color: #2a2a30; 
}

.dark-mode .list-group-item { 
    background: #1f1f24; 
    color: var(--text-dark); 
    border-color: #2a2a30;
}

.dark-mode .list-group-item:hover { 
    background: #2a2a35; 
}

.dark-mode .list-group-item.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
    border-left-color: #60a5fa !important;
}

.dark-mode .form-control { 
    background: #1f1f24; 
    border-color: #2a2a30; 
    color: var(--text-dark); 
}

.dark-mode .form-control:focus {
    background: #1f1f24;
    border-color: var(--primary-color);
    color: var(--text-dark);
    box-shadow: 0 0 0 0.25rem rgba(110, 142, 251, 0.25);
}

.dark-mode .form-control::placeholder {
    color: #888;
    opacity: 1;
}

/* ============================================
   暗色模式 - 页码按钮（统一蓝色）
   ============================================ */
.dark-mode .pagination .page-link { 
    background: #1f1f24; 
    color: var(--btn-dark-start); 
    border-color: #2a2a30; 
}

.dark-mode .pagination .page-link:hover {
    background: #2a2a35;
    border-color: #3a3a45;
    color: var(--btn-dark-start);
}

.dark-mode .pagination .active .page-link {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    border-color: var(--btn-dark-start) !important;
    color: #fff !important;
}

/* ============================================
   GBA暗色模式 - 页码按钮（统一蓝色，不特殊处理）
   ============================================ */
.dark-mode.gba-mode .pagination .page-link { 
    color: var(--btn-dark-start); 
}

.dark-mode.gba-mode .pagination .page-link:hover {
    color: var(--btn-dark-start);
}

.dark-mode.gba-mode .pagination .active .page-link {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    border-color: var(--btn-dark-start) !important;
    color: #fff !important;
}

.dark-mode .back-to-top,
.dark-mode .theme-switch { 
    background: var(--card-dark); 
    color: var(--text-dark); 
    border: 1px solid #2a2a30;
}

/* ============================================
   侧边栏 - 桌面端（移除底部黑线）
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 210px;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg-light);
    border-right: 1px solid #e5e7eb;
    z-index: 1000;
    padding-top: 20px;
    transition: var(--transition);
}

/* 移除菜单栏底部黑线 */
.sidebar .list-group {
    border-bottom: none !important;
}

.sidebar .list-group-item:last-child {
    border-bottom: none !important;
}

.list-group-item {
    border: none;
    border-radius: 5px !important;
    margin-bottom: 5px;
    transition: var(--transition);
    border-left: 3px solid transparent !important;
}

.list-group-item:hover {
    background: #f3f4f6;
    border-left-color: var(--primary-color) !important;
}

.list-group-item.active {
    background: linear-gradient(135deg, #e9f0ff, #dbe4ff) !important;
    color: #2c5bff !important;
    border-left-color: #2c5bff !important;
}

.list-group-item.active-gba {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9) !important;
    color: #2e7d32 !important;
    border-left-color: #4caf50 !important;
}

/* ============================================
   移动端侧边栏
   ============================================ */
.mobile-offcanvas {
    width: 280px !important;
    background: var(--sidebar-bg-light);
    border-right: 1px solid #e5e7eb;
}

.dark-mode .mobile-offcanvas {
    background: var(--sidebar-bg-dark);
    border-right-color: #2a2a30;
}

.mobile-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
}

.dark-mode .mobile-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, #1e3a8a, #3730a3);
}

.mobile-offcanvas.gba-mode .offcanvas-header {
    background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
}

.dark-mode .mobile-offcanvas.gba-mode .offcanvas-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32) !important;
}

.mobile-offcanvas .offcanvas-title {
    font-weight: bold;
    font-size: 1.25rem;
}

.mobile-offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.mobile-offcanvas .list-group {
    padding: 10px;
    border-bottom: none !important;
}

.mobile-offcanvas .list-group-item {
    margin-bottom: 8px;
    border-radius: 8px !important;
}

.mobile-offcanvas .list-group-item:last-child {
    border-bottom: none !important;
}

/* ============================================
   标题区样式
   ============================================ */
.hero-section {
    background: linear-gradient(180deg, 
        #667eea 0%, 
        #764ba2 40%,
        #6e8efb 70%,
        #f0f2f5 100%);
    border-bottom: none;
    margin-bottom: 0;
    position: relative;
    color: white;
    padding-bottom: 2rem;
}

.hero-section.gba-mode {
    background: linear-gradient(180deg, 
        #00c853 0%, 
        #64dd17 40%,
        #76ff03 70%,
        #f0f2f5 100%) !important;
}

.dark-mode .hero-section.gba-mode {
    background: linear-gradient(180deg, 
        rgba(0, 100, 0, 0.8) 0%, 
        rgba(34, 139, 34, 0.6) 50%,
        rgba(15, 15, 19, 0) 100%) !important;
}

.hero-section h1 {
    display: inline-block;
}

.hero-section h1 a {
    text-decoration: none;
    display: inline-block;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-section .text-primary {
    color: #3b82f6 !important;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #3b82f6;
    font-weight: 700;
    text-shadow: none;
}

.hero-section.gba-mode .text-primary {
    color: #1b5e20 !important;
    -webkit-text-fill-color: #1b5e20;
}

.dark-mode .hero-section {
    background: linear-gradient(180deg, 
        rgba(30, 58, 138, 0.8) 0%, 
        rgba(55, 48, 163, 0.6) 50%,
        rgba(15, 15, 19, 0) 100%) !important;
    border-bottom: none;
}

.dark-mode .hero-section h1 {
    display: inline-block;
}

.dark-mode .hero-section h1 a {
    display: inline-block;
    background: linear-gradient(135deg, #60a5fa 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.dark-mode .hero-section .lead {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dark-mode .hero-section .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

.dark-mode .hero-section .text-primary {
    color: #60a5fa !important;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #60a5fa;
}

.dark-mode .hero-section.gba-mode .text-primary {
    color: #69f0ae !important;
    -webkit-text-fill-color: #69f0ae;
}

/* ============================================
   游戏卡片
   ============================================ */
.game-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    background: white;
}

.dark-mode .game-card {
    background: var(--card-dark);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

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

.game-title {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-clicks {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hot-game-card::before {
    content: '🔥';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    z-index: 5;
    animation: pulse 2s infinite;
}

.random-game-card::before {
    content: '🎲';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    z-index: 5;
    animation: rotate 3s infinite linear;
}

.fc-game-card::before {
    content: '🎮';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    z-index: 5;
}

.gba-game-card::before {
    content: '🚀';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    z-index: 5;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.8;transform:scale(1.1)} }
@keyframes rotate { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

.hot-rank {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: white;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hot-rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); }
.hot-rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); }
.hot-rank-3 { background: linear-gradient(135deg, #CD7F32, #B87333); }
.hot-rank-other { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); }

/* ============================================
   标签云
   ============================================ */
.game-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    margin: 0.15rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid;
    background: transparent;
}

.game-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tag-red { color: #c62828; border-color: #c62828; }
.tag-blue { color: #1565c0; border-color: #1565c0; }
.tag-green { color: #2e7d32; border-color: #2e7d32; }
.tag-yellow { color: #f9a825; border-color: #f9a825; }
.tag-purple { color: #6a1b9a; border-color: #6a1b9a; }
.tag-orange { color: #ef6c00; border-color: #ef6c00; }
.tag-pink { color: #c2185b; border-color: #c2185b; }
.tag-teal { color: #00695c; border-color: #00695c; }
.tag-cyan { color: #00838f; border-color: #00838f; }
.tag-indigo { color: #283593; border-color: #283593; }
.tag-lime { color: #9e9d24; border-color: #9e9d24; }
.tag-amber { color: #ff8f00; border-color: #ff8f00; }
.tag-brown { color: #4e342e; border-color: #4e342e; }
.tag-light-green { color: #558b2f; border-color: #558b2f; }
.tag-light-blue { color: #0277bd; border-color: #0277bd; }
.tag-grey { color: #424242; border-color: #424242; }
.tag-deep-orange { color: #d84315; border-color: #d84315; }
.tag-deep-purple { color: #4527a0; border-color: #4527a0; }

.dark-mode .tag-red { color: #ff8a80; border-color: #ff8a80; }
.dark-mode .tag-blue { color: #82b1ff; border-color: #82b1ff; }
.dark-mode .tag-green { color: #69f0ae; border-color: #69f0ae; }
.dark-mode .tag-yellow { color: #ffff8d; border-color: #ffff8d; }
.dark-mode .tag-purple { color: #ea80fc; border-color: #ea80fc; }
.dark-mode .tag-orange { color: #ffab40; border-color: #ffab40; }
.dark-mode .tag-pink { color: #ff80ab; border-color: #ff80ab; }
.dark-mode .tag-teal { color: #64ffda; border-color: #64ffda; }
.dark-mode .tag-cyan { color: #84ffff; border-color: #84ffff; }
.dark-mode .tag-indigo { color: #8c9eff; border-color: #8c9eff; }
.dark-mode .tag-lime { color: #eeff41; border-color: #eeff41; }
.dark-mode .tag-amber { color: #ffd180; border-color: #ffd180; }
.dark-mode .tag-brown { color: #bcaaa4; border-color: #bcaaa4; }
.dark-mode .tag-light-green { color: #b2ff59; border-color: #b2ff59; }
.dark-mode .tag-light-blue { color: #80d8ff; border-color: #80d8ff; }
.dark-mode .tag-grey { color: #eeeeee; border-color: #eeeeee; }
.dark-mode .tag-deep-orange { color: #ff9e80; border-color: #ff9e80; }
.dark-mode .tag-deep-purple { color: #b388ff; border-color: #b388ff; }

.tags-container {
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.5s ease;
    position: relative;
}

.tags-container.expanded { max-height: 2000px; }

.tags-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg-light));
    pointer-events: none;
}

.dark-mode .tags-fade { background: linear-gradient(to bottom, transparent, var(--bg-dark)); }
.tags-container.expanded .tags-fade { opacity: 0; }

/* ============================================
   按钮样式 - 白天模式（紫色渐变）
   ============================================ */
.refresh-btn, .tags-toggle-btn, .search-btn {
    background: linear-gradient(135deg, var(--btn-light-start), var(--btn-light-end)) !important;
    border: none !important;
    color: white !important;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(110,142,251,0.4);
}

.refresh-btn:hover, .tags-toggle-btn:hover, .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110,142,251,0.6);
}

/* GBA白天模式按钮 - 绿色渐变 */
.gba-mode .refresh-btn, .gba-mode .tags-toggle-btn, .gba-mode .search-btn {
    background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
    box-shadow: 0 2px 8px rgba(0,200,83,0.4) !important;
}

.gba-mode .refresh-btn:hover, .gba-mode .tags-toggle-btn:hover, .gba-mode .search-btn:hover {
    box-shadow: 0 4px 12px rgba(0,200,83,0.6) !important;
}

.search-btn {
    padding: 0.375rem 0.75rem !important;
}

.tags-toggle-btn {
    padding: 0.4rem 1rem !important;
    font-size: 0.85rem;
    border-radius: 1.5rem;
    cursor: pointer;
    line-height: 1.2;
}

.refresh-btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.9rem;
    border-radius: 1.5rem;
    cursor: pointer;
}

/* ============================================
   按钮样式 - 暗色模式（统一蓝色，移除GBA特殊处理）
   ============================================ */
.dark-mode .tags-toggle-btn, .dark-mode .refresh-btn, .dark-mode .search-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

.dark-mode .tags-toggle-btn:hover, .dark-mode .refresh-btn:hover, .dark-mode .search-btn:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6) !important;
}

/* 移除GBA暗色模式的特殊按钮样式，统一使用蓝色 */
.dark-mode.gba-mode .tags-toggle-btn,
.dark-mode.gba-mode .refresh-btn,
.dark-mode.gba-mode .search-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

.dark-mode.gba-mode .tags-toggle-btn:hover,
.dark-mode.gba-mode .refresh-btn:hover,
.dark-mode.gba-mode .search-btn:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6) !important;
}

/* ============================================
   响应式布局
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    .hero-section { padding-top: 60px; }
}

@media (min-width: 992px) {
    .mobile-offcanvas { display: none !important; }
    .main-content { margin-left: 210px; width: calc(100% - 210px); }
}

@media (max-width: 767.98px) {
    .col-6 { padding-left: 5px; padding-right: 5px; }
    .game-img { height: 100px; }
}

@media (max-width: 575.98px) {
    .hero-section h1 { font-size: 1.75rem; }
}

/* ============================================
   工具类
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.dark-mode .text-muted { color: #888 !important; }
.dark-mode small.text-muted { color: #666 !important; }

.main-content {
    background: var(--bg-light);
    min-height: 100vh;
    transition: background 0.3s ease;
}

.dark-mode .main-content { background: var(--bg-dark); }

.dark-mode .mobile-menu-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

/* GBA白天模式移动端菜单按钮 */
.gba-mode .mobile-menu-btn {
    background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
}

/* GBA暗色模式移动端菜单按钮 - 统一蓝色 */
.dark-mode.gba-mode .mobile-menu-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
}

.dark-mode #mobileSearchForm .form-control,
.dark-mode .sidebar .form-control { color: var(--text-dark); }

.dark-mode #mobileSearchForm .form-control::placeholder,
.dark-mode .sidebar .form-control::placeholder { color: #888; }

/* 暗色模式搜索按钮 */
.dark-mode .search-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

.dark-mode .search-btn:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6) !important;
}

/* GBA白天模式搜索按钮 */
.gba-mode .search-btn {
    background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
    box-shadow: 0 2px 8px rgba(0,200,83,0.4) !important;
}

/* GBA暗色模式搜索按钮 - 统一蓝色 */
.dark-mode.gba-mode .search-btn {
    background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

/* ============================================
   游戏详情页样式（从header.php移入）
   ============================================ */
/* ========== 嵌入游戏详情页样式 ========== */
        .game-embed-panel {
            background: #fff;
            border-radius: 16px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            margin-bottom: 24px;
            overflow: hidden;
        }
        .dark-mode .game-embed-panel {
            background: #1a1a2e;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }

        /* 播放器区域 */
        .embed-player-wrapper {
            background: #000;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            margin: 16px;
        }
        .embed-player-wrapper iframe {
            width: 100%;
            height: 520px;
            border: none;
            display: block;
        }
        @media (max-width: 768px) {
            .embed-player-wrapper iframe {
                height: 320px;
            }
        }

        /* H5游戏专用：全宽自适应高度 */
        .h5-player-wrapper {
            margin: 0;
            border-radius: 12px;
            position: relative;
            width: 100%;
            height: 85vh;
            overflow: hidden;
            background: #000;
        }
        .h5-player-wrapper iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
            display: block;
        }
        @media (max-width: 768px) {
            .h5-player-wrapper {
                height: calc(100dvh - 180px);
                border-radius: 8px;
            }
        }

        /* 游戏信息区 */
        .embed-game-info { padding: 0 16px 16px; }
        .embed-game-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 12px;
        }
        .embed-game-title {
            font-size: 20px;
            font-weight: 700;
            color: #1a1a2e;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .dark-mode .embed-game-title { color: #fff; }
        .embed-game-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 13px;
            color: #6c757d;
            margin-bottom: 12px;
        }
        .dark-mode .embed-game-meta { color: #a0aec0; }
        .embed-game-meta span { display: flex; align-items: center; gap: 5px; }

        .badge-embed-fc { background: #e3f2fd; color: #1976d2; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-embed-gba { background: #e8f5e9; color: #388e3c; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-embed-default { background: #f3e5f5; color: #7b1fa2; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-embed-arcade { background: #fff3e0; color: #e65100; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-embed-nds { background: #e0f7fa; color: #00838f; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .badge-embed-sfc { background: #fce4ec; color: #c2185b; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .dark-mode .badge-embed-fc { background: rgba(25,118,210,0.2); color: #64b5f6; }
        .dark-mode .badge-embed-gba { background: rgba(56,142,60,0.2); color: #81c784; }
        .dark-mode .badge-embed-default { background: rgba(123,31,162,0.2); color: #ce93d8; }
        .dark-mode .badge-embed-arcade { background: rgba(230,81,0,0.2); color: #ffcc80; }
        .dark-mode .badge-embed-nds { background: rgba(0,131,143,0.2); color: #80deea; }
        .dark-mode .badge-embed-sfc { background: rgba(194,24,87,0.2); color: #f48fb1; }
        .badge-embed-md { background: #fff8e1; color: #f57f17; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .dark-mode .badge-embed-md { background: rgba(245,127,23,0.2); color: #ffd54f;}
        /* 操作提示 */
        .embed-controls {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 14px;
            margin-top: 12px;
        }
        .dark-mode .embed-controls { background: #16213e; }
        .embed-controls h6 {
            font-size: 13px;
            font-weight: 700;
            margin-bottom: 10px;
            color: #1a1a2e;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .dark-mode .embed-controls h6 { color: #fff; }
        .embed-key-map {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 8px;
        }
        .embed-key-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #495057;
        }
        .dark-mode .embed-key-item { color: #a0aec0; }
        .embed-key-badge {
            min-width: 32px;
            height: 24px;
            background: #fff;
            border: 1px solid #dee2e6;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 600;
            color: #495057;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        .dark-mode .embed-key-badge {
            background: #0f0f23;
            border-color: #2d3748;
            color: #e2e8f0;
        }

        /* 推荐侧边栏 */
        .embed-sidebar { padding: 0 16px 16px; }
        .embed-sidebar h5 {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 2px solid #e9ecef;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .dark-mode .embed-sidebar h5 { border-color: #2d3748; color: #fff; }
        .embed-mini-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px;
            border-radius: 8px;
            transition: all 0.2s;
            text-decoration: none;
            color: inherit;
            margin-bottom: 8px;
        }
        .embed-mini-item:hover { background: #f8f9fa; }
        .dark-mode .embed-mini-item:hover { background: #16213e; }
        .embed-mini-item img {
            width: 48px;
            height: 48px;
            border-radius: 6px;
            object-fit: cover;
            flex-shrink: 0;
        }
        .embed-mini-item .mini-title {
            font-size: 13px;
            font-weight: 600;
            color: #1a1a2e;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }
        .dark-mode .embed-mini-item .mini-title { color: #fff; }
        .embed-mini-item .mini-clicks { font-size: 11px; color: #6c757d; }
        .dark-mode .embed-mini-item .mini-clicks { color: #a0aec0; }

        /* 全屏按钮 */
        .embed-fullscreen-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 8px;
            background: #2196f3;
            color: #fff;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.2s;
            border: none;
            cursor: pointer;
        }
        .embed-fullscreen-btn:hover { background: #1976d2; }
        .dark-mode .embed-fullscreen-btn { background: #64b5f6; color: #1a1a2e; }
        .dark-mode .embed-fullscreen-btn:hover { background: #42a5f5; }

        /* 全屏退出按钮 */
        .h5-fullscreen-exit {
            position: fixed;
            top: 10px;
            right: 10px;
            z-index: 2147483647;
            background: rgba(0,0,0,0.7);
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 10px 16px;
            font-size: 14px;
            cursor: pointer;
            display: none;
            backdrop-filter: blur(4px);
        }
        .h5-fullscreen-exit.show {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* 游戏卡片链接 */
        .game-card a.game-play-link {
            display: block;
            text-decoration: none;
            color: inherit;
        }

        /* 标签高亮 */
        .game-tag.active {
            background: var(--primary-color, #2196f3) !important;
            color: #fff !important;
            box-shadow: 0 2px 8px rgba(33,150,243,0.4);
        }
        .dark-mode .game-tag.active {
            background: var(--primary-color, #64b5f6) !important;
            box-shadow: 0 2px 8px rgba(100,181,246,0.4);
        }

        /* 简中/繁中筛选 */
        .lang-filter-group { display: flex; align-items: center; gap: 6px; }
        .lang-filter-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 3px 10px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            text-decoration: none;
            border: 1px solid #dee2e6;
            background: #fff;
            color: #6c757d;
            transition: all 0.2s;
        }
        .lang-filter-btn:hover { background: #f8f9fa; color: #495057; border-color: #adb5bd; }
        .lang-filter-btn.active { background: #2196f3; color: #fff; border-color: #2196f3; }
        .dark-mode .lang-filter-btn { background: #1a1a2e; color: #a0aec0; border-color: #2d3748; }
        .dark-mode .lang-filter-btn:hover { background: #16213e; color: #e2e8f0; border-color: #4a5568; }
        .dark-mode .lang-filter-btn.active { background: #64b5f6; color: #1a1a2e; border-color: #64b5f6; }
        .lang-filter-clear { font-size: 11px; padding: 3px 8px; }

        /* 游戏卡片语言标签 */
.lang-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}
.lang-badge-cn { background: #f5f5f5; color: #333333; border: 1px solid #e0e0e0; }
.lang-badge-tw { background: #f5f5f5; color: #333333; border: 1px solid #e0e0e0; }
.dark-mode .lang-badge-cn { background: #2a2a30; color: #b0b0b0; border-color: #3a3a40; }
.dark-mode .lang-badge-tw { background: #2a2a30; color: #b0b0b0; border-color: #3a3a40; }

        /* 最近在玩 */
        .recent-game-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px;
            border-radius: 8px;
            transition: all 0.2s;
            text-decoration: none;
            color: inherit;
            margin-bottom: 4px;
        }
        .recent-game-item:hover { background: #f8f9fa; }
        .dark-mode .recent-game-item:hover { background: #16213e; }
        .recent-game-item img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
        .recent-game-item .recent-title {
            font-size: 13px;
            font-weight: 600;
            color: #1a1a2e;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }
        .dark-mode .recent-game-item .recent-title { color: #fff; }
        .recent-game-item .recent-time { font-size: 11px; color: #6c757d; }
        .dark-mode .recent-game-item .recent-time { color: #a0aec0; }
        .recent-game-item .recent-platform { font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
        .recent-badge-fc { background: #e3f2fd; color: #1976d2; }
        .recent-badge-gba { background: #e8f5e9; color: #388e3c; }
        .recent-badge-default { background: #f3e5f5; color: #7b1fa2; }
        .dark-mode .recent-badge-fc { background: rgba(25,118,210,0.2); color: #64b5f6; }
        .dark-mode .recent-badge-gba { background: rgba(56,142,60,0.2); color: #81c784; }
        .dark-mode .recent-badge-default { background: rgba(123,31,162,0.2); color: #ce93d8; }
        .recent-badge-md { background: #fff8e1; color: #f57f17; }
        .dark-mode .recent-badge-md { background: rgba(245,127,23,0.2); color: #ffd54f; }

/* 游戏卡片分类标签 */
.cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}
.cat-badge-fc { background: #e3f2fd; color: #1976d2; }
.cat-badge-gba { background: #e8f5e9; color: #388e3c; }
.cat-badge-default { background: #f3e5f5; color: #7b1fa2; }
.dark-mode .cat-badge-fc { background: rgba(25,118,210,0.2); color: #64b5f6; }
.dark-mode .cat-badge-gba { background: rgba(56,142,60,0.2); color: #81c784; }
.dark-mode .cat-badge-default { background: rgba(123,31,162,0.2); color: #ce93d8; }
/* 新增BD金色标签 */
.cat-badge-md { background: #fff8e1; color: #f57f17; }
.dark-mode .cat-badge-md { background: rgba(245,127,23,0.2); color: #ffd54f; }
/* ============================================
   H5手机端详情页样式
   ============================================ */

/* 返回按钮 - 全局样式（桌面端+手机端共用） */
.h5-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    transition: all 0.2s;
    white-space: nowrap;
}

.h5-back-btn:hover {
    background: rgba(255,255,255,0.35);
    color: #fff;
    text-decoration: none;
}

.h5-back-btn i {
    font-size: 14px;
}

/* 右侧占位，保持标题居中 */
.h5-bar-spacer {
    width: 60px;
    flex-shrink: 0;
}

/* 游戏标题 */
.h5-game-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 手机端 (<=991px) */
@media (max-width: 991.98px) {
    /* H5详情页容器 */
    .h5-detail-page {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #000;
        display: flex;
        flex-direction: column;
        width: 100vw !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 顶部返回栏 */
    .h5-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        background: linear-gradient(135deg, var(--btn-light-start), var(--btn-light-end));
        padding: 0 12px;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    /* GBA模式导航栏 */
    .gba-mode .h5-mobile-bar {
        background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
    }

    /* 暗色模式导航栏 */
    .dark-mode .h5-mobile-bar {
        background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    }

    /* H5播放器 - 手机端全屏 */
    .h5-detail-page .h5-player-wrapper {
        flex: 1;
        position: relative;
        margin: 0 !important;
        border-radius: 0 !important;
        height: calc(100dvh - 48px) !important;
        min-height: 0;
    }

    .h5-detail-page .h5-player-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        display: block;
    }
}

/* 桌面端 (>=992px) */
@media (min-width: 992px) {
    /* H5详情页改为固定定位全屏 */
    .h5-detail-page {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #000;
        display: flex;
        flex-direction: column;
        width: 100vw !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 显示顶部返回栏 */
    .h5-mobile-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        background: linear-gradient(135deg, var(--btn-light-start), var(--btn-light-end));
        padding: 0 12px;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .gba-mode .h5-mobile-bar {
        background: linear-gradient(135deg, var(--gba-primary), var(--gba-secondary)) !important;
    }

    .dark-mode .h5-mobile-bar {
        background: linear-gradient(135deg, var(--btn-dark-start), var(--btn-dark-end)) !important;
    }

    /* H5播放器 - 桌面端全屏适配 */
    .h5-detail-page .h5-player-wrapper {
        flex: 1;
        position: relative;
        margin: 0 !important;
        border-radius: 0 !important;
        height: calc(100dvh - 48px) !important;
        min-height: 0;
        overflow: hidden;
        background: #000;
    }

    .h5-detail-page .h5-player-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        display: block;
    }
}
/* ========== Logo 与标题底部平齐 ========== */
.site-logo-link {
    display: inline-flex;
    align-items: flex-end;
    gap: 10px;
    vertical-align: bottom;
}

.site-logo-img {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    vertical-align: bottom;
    display: inline-block;
}

/* Logo 响应式适配 */
@media (max-width: 991.98px) {
    .site-logo-img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 575.98px) {
    .site-logo-img {
        width: 30px;
        height: 30px;
    }
}