/* 主题颜色变量 - 修改这里即可改变整个网站颜色 */
:root {
    --bg-primary: #e8f5e9;         /* 主背景色 - 淡绿色 */
    --bg-header: #388e3c;          /* 头部背景色 - 深绿色 */
    --bg-nav: #2e7d32;             /* 导航栏背景色 - 更深绿色 */
    --bg-footer: #6cbd84;          /* 页脚背景色 - 绿色 */
    --bg-card: #fff;               /* 卡片背景色 */
    --text-primary: #333;          /* 主文字颜色 */
    --text-light: #fff;            /* 浅色文字 */
    --text-accent: #1b5e20;        /* 强调文字颜色 */
    --accent-orange: #4caf50;      /* 绿色点缀 */
    --accent-gold: #66bb6a;        /* 绿色点缀 */
    --accent-cyan: #6cbd84;        /* 绿色点缀 */
}

/* 全局重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    font-family: "Open Sans", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* 页面容器 */
.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部头部 */
.site-header {
    background: var(--bg-header);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 26px;
    font-weight: 900;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo span {
    color: var(--accent-orange);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--accent-cyan);
    border-radius: 30px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    transition: box-shadow 0.2s;
}

.search-box:focus-within {
    box-shadow: 0 0 0 3px rgba(108, 189, 132, 0.25);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: 15px;
    color: #555;
    background: transparent;
}

.search-box input::placeholder {
    color: #aaa;
}

.search-box button {
    border: none;
    background: var(--accent-gold);
    color: var(--text-light);
    width: 44px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--accent-orange);
}

/* 主导航 */
.main-nav {
    background: var(--bg-nav);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 10px;
}

.main-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 15px;
    text-transform: capitalize;
    border-radius: 4px 4px 0 0;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--bg-header);
    color: var(--accent-cyan);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-btn svg {
    width: 28px;
    height: 28px;
    fill: var(--accent-cyan);
}

/* 内容区域 */
.site-main {
    padding: 25px 0 50px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 5px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-accent);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    font-size: 28px;
}

.view-all {
    color: var(--accent-orange);
    font-weight: 700;
    font-size: 14px;
}

.view-all:hover {
    text-decoration: underline;
}

/* 游戏卡片网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
}

.game-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.game-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card .game-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s;
}

.game-card:hover .game-title {
    opacity: 1;
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    margin-top: 35px;
}

.load-more button {
    background: var(--accent-orange);
    color: var(--text-light);
    border: none;
    padding: 12px 45px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.load-more button:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

.load-more button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 页脚 */
.site-footer {
    background: var(--bg-footer);
    color: var(--text-light);
    padding: 30px 0;
    text-align: center;
}

.site-footer p {
    margin: 6px 0;
    font-size: 14px;
}

.site-footer a {
    color: var(--text-light);
    text-decoration: underline;
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.site-footer .footer-links a {
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.site-footer .footer-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 25px;
    width: 48px;
    height: 48px;
    background: var(--accent-orange);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.2s;
    z-index: 90;
}

.back-to-top:hover {
    background: #f57c00;
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* Loading 动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 3, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition: opacity 0.2s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-dot {
    width: 18px;
    height: 18px;
    margin: 0 3px;
    border-radius: 50%;
    background: #fff;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 响应式 */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    .main-nav a {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }
    .search-box {
        order: 3;
        max-width: 100%;
        margin-top: 5px;
    }
    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .main-nav::-webkit-scrollbar {
        display: none;
    }
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .game-card {
        border-radius: 12px;
    }
    .section-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .logo {
        font-size: 20px;
    }
    .logo img {
        height: 32px;
    }
    .game-card .game-title {
        font-size: 12px;
        opacity: 1;
        padding: 6px 8px;
    }
}

/* 分类页面标题 */
.category-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-accent);
    margin-bottom: 20px;
    text-transform: uppercase;
    text-align: center;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-accent);
    font-size: 18px;
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

/* ==================== 详情页样式（参考图：居中深色预览 + 横向相似游戏） ==================== */

/* 游戏详情整体容器 */
.game {
    max-width: 1000px;
    margin: 0 auto;
    padding: 25px 15px 50px;
}

/* 游戏预览区：居中深色盒子 */
.game-preview {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 0;
    aspect-ratio: 4 / 3;
    background: #1a1a2e;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.game-preview-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 20px;
    text-align: center;
    z-index: 2;
}

.game-preview-icon img {
    width: 130px;
    height: 130px;
    border-radius: 22px;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.game-preview-title {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    max-width: 90%;
    line-height: 1.2;
}

.play-game-btn {
    border: none;
    background: linear-gradient(135deg, var(--accent-orange), #f57c00);
    color: var(--text-light);
    font-size: 16px;
    font-weight: 800;
    padding: 12px 45px;
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 18px rgba(255, 152, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.55);
}

/* 游戏 iframe 容器 */
.game-iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
}

.game-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: background 0.2s, transform 0.2s;
}

.game-close-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

/* 右上角安装 + 按钮（默认仅在手机端显示） */
.install-btn {
    display: none;
}

/* 全屏游戏界面 */
.app-module {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
}

.app-module iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.app-module .game-close-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.2s, transform 0.2s;
}

.app-module .game-close-btn:hover {
    background: #fff;
    transform: scale(1.1);
}




/* 操作按钮区：Add to Desktop / Share */
.game-actions-bar {
    max-width: 700px;
    margin: 16px auto 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 5px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--text-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 189, 132, 0.15);
}

.action-btn .icon {
    font-size: 16px;
}

/* 游戏简介 */
.game-intro {
    max-width: 700px;
    margin: 25px auto 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.game-intro h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-accent);
    margin-bottom: 10px;
}

.game-intro p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* 相似游戏 - 横向滚动 */
.similar-games-section {
    max-width: 1000px;
    margin: 35px auto 0;
    padding: 0 5px;
}

.similar-games-section .section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-accent);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.similar-games-section .section-title .icon {
    font-size: 26px;
}

.similar-games-scroll-wrap {
    position: relative;
}

.similar-games-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 4px 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) #e0f7f7;
}

.similar-games-scroll::-webkit-scrollbar {
    height: 8px;
}

.similar-games-scroll::-webkit-scrollbar-track {
    background: #e0f7f7;
    border-radius: 10px;
}

.similar-games-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
}

.similar-game-card {
    flex: 0 0 auto;
    width: 170px;
    height: 170px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.similar-game-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.similar-game-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.similar-game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-game-card .game-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式 - 详情页 */
@media (max-width: 768px) {
    .game {
        padding: 18px 12px 40px;
    }

    .game-preview {
        border-radius: 14px;
        aspect-ratio: 1 / 1;
    }

    .game-preview-icon img {
        width: 100px;
        height: 100px;
        border-radius: 18px;
    }

    .game-preview-title {
        font-size: 20px;
    }

    .play-game-btn {
        font-size: 14px;
        padding: 10px 35px;
    }

    .game-actions-bar {
        max-width: 100%;
        margin-top: 20px;
        padding: 0 10px;
    }

    .action-btn {
        font-size: 14px;
        padding: 12px 14px;
    }

    .game-intro {
        max-width: 100%;
        margin-top: 18px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.35);
        border-radius: 12px;
    }

    .game-intro h2 {
        font-size: 16px;
    }

    .game-intro p {
        font-size: 13px;
    }

    .similar-game-card {
        width: 140px;
        height: 140px;
        border-radius: 14px;
    }

    .similar-games-section .section-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .game {
        padding: 12px 12px 35px;
    }

    .game-preview {
        max-width: 100%;
        aspect-ratio: auto;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
    }

    .game-preview-inner {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 10px 0 0;
    }

    .game-preview-icon {
        position: relative;
        display: inline-block;
    }

    .install-btn {
        position: absolute;
        top: -8px;
        right: -8px;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
        color: var(--text-light);
        font-size: 26px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
        transition: transform 0.2s, box-shadow 0.2s;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .install-btn:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 18px rgba(255, 152, 0, 0.55);
    }


    .game-preview-icon {
        position: relative;
        display: inline-block;
    }

    .game-preview-icon img {
        width: 150px;
        height: 150px;
        border-radius: 28px;
        border: 4px solid rgba(255, 255, 255, 0.45);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .play-game-btn {
        position: absolute;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%);
        font-size: 13px;
        padding: 8px 22px;
        border-radius: 20px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    }

    .game-preview-title {
        color: #fff;
        font-size: 20px;
        font-weight: 800;
        margin-top: 6px;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    }

    .game-actions-bar {
        margin-top: 0;
        padding: 0 5px;
    }

    .action-btn {
        font-size: 12px;
        padding: 8px 8px;
    }

    .game-intro {
        margin-top: 14px;
        padding: 12px;
        background: rgba(255, 255, 255, 0.3);
    }

    .game-intro h2 {
        font-size: 15px;
        color: #fff;
    }

    .game-intro p {
        color: rgba(255, 255, 255, 0.95);
        font-size: 12px;
    }

    .similar-games-section {
        margin-top: 25px;
    }

    .similar-games-section .section-title {
        font-size: 16px;
        color: #fff;
    }

    .similar-games-section .section-title .icon {
        font-size: 22px;
    }

    .similar-games-scroll {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        overflow-x: visible;
        padding: 0;
    }

    .similar-game-card {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 14px;
    }

    .similar-game-card .game-title {
        font-size: 11px;
        padding: 5px 6px;
    }
}
