/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #fff000; /* 明亮的黄色 */
    --secondary-color: #ff2a6d; /* 桃红色 */
    --dark-color: #222222; /* 近黑色 */
    --light-color: #f8f9fa;
    --success-color: #38b000;
    --warning-color: #ffbe0b;
    --danger-color: #d90429;
    --border-radius: 5px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --game-yellow: #ffdd00; /* 游戏主题黄色 */
    --header-height: 80px;
    --soft-bg: #f0f0f0; /* 更柔和的背景色 */
    --game-card-height: calc((450px - 4rem) / 3); /* 游戏卡片高度 */
}

body {
    font-family: 'Exo 2', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--soft-bg);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    z-index: -1;
}

a {
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background-color: #e01a5d;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 42, 109, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header Styles */
header {
    background-color: var(--game-yellow);
    color: var(--dark-color);
    height: var(--header-height);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    background-color: transparent;
    position: relative;
    transform: rotate(-5deg);
}

.logo-img::before,
.logo-img::after {
    content: none; /* 移除原有的伪元素 */
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px; /* 给图片添加圆角 */
}

.logo h1 {
    font-family: 'Bangers', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--dark-color);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
    margin: 0;
    transform: skew(-5deg);
}

.blog-link {
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--dark-color);
    color: var(--game-yellow);
    border-radius: var(--border-radius);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-link:hover {
    color: var(--game-yellow);
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

header nav {
    display: flex;
    align-items: center;
}

header nav ul {
    display: flex;
    gap: 1.5rem;
}

header nav ul li a {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    padding: 0.5rem 0;
    text-transform: uppercase;
}

header nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

header nav ul li a:hover {
    color: var(--dark-color);
}

header nav ul li a:hover::after {
    width: 100%;
}

/* Main Content Styles - Updated */
main {
    padding: 2rem 0;
    position: relative;
}

main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 221, 0, 0.15) 0%, transparent 60%);
    z-index: -1;
}

section {
    margin-bottom: 4rem;
    position: relative;
}

section h2 {
    margin-bottom: 2rem;
    color: var(--dark-color);
    text-align: center;
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    position: relative;
}

section h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Game Area Styles - More Updates */
.game-area {
    background-color: white;
    padding: 3rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.game-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.02) 10px, rgba(0, 0, 0, 0.02) 20px);
    z-index: 0;
}

.game-area .container {
    position: relative;
    z-index: 1;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}


/* 修改游戏缩略图容器样式 */
.game-thumb {
    height: 70%;
    background-color: transparent; /* 改为透明背景 */
    position: relative;
    overflow: hidden;
    flex: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 完全删除网格背景的伪元素 */
.game-thumb::before {
    display: none; /* 完全禁用伪元素 */
}

/* 优化游戏图片样式 */
.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px 4px 0 0; /* 上方圆角 */
}

/* 底部游戏区域特别处理 */
.bottom-games .game-thumb::before {
    display: none; /* 确保底部游戏区域也不显示网格 */
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px 4px 0 0; /* 给图片上方添加圆角 */
    transition: transform 0.3s ease;
}

.game-card:hover .game-image {
    transform: scale(1.05); /* 鼠标悬停时图片轻微放大效果 */
}


#game-canvas {
    width: 100%;
    max-width: 800px;
    height: 450px;
    background-color: var(--light-color);
    border: 4px solid var(--dark-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    padding: 1.5rem;
    background-color: var(--dark-color);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-controls button {
    margin-right: 0.8rem;
}

#start-game {
    background-color: var(--success-color);
}

#start-game:hover {
    background-color: #2a9000;
    box-shadow: 0 5px 15px rgba(56, 176, 0, 0.3);
}

#pause-game {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

#pause-game:hover {
    background-color: #e6a800;
    box-shadow: 0 5px 15px rgba(255, 190, 11, 0.3);
}

.game-stats {
    display: flex;
    gap: 2rem;
    margin-left: auto;
    color: var(--light-color);
    font-weight: 600;
}

/* SEO Content Styles - Updated */
.seo-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.seo-content::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 221, 0, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.seo-content .container {
    position: relative;
    z-index: 1;
}

.seo-content h2, .seo-content h3 {
    color: var(--dark-color);
    margin-bottom: 1.2rem;
}

.seo-content h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-top: 2rem;
    position: relative;
    padding-left: 1rem;
}

.seo-content h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 4px;
    height: 70%;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.seo-content p {
    margin-bottom: 1rem;
}

.seo-content ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.seo-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.testimonials {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    position: relative;
}

.testimonial {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s ease;
}

.testimonial:hover {
    transform: translateY(-5px);
}

.testimonial::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.1);
    font-family: Georgia, serif;
}

.testimonial p {
    position: relative;
    z-index: 1;
}

.testimonial cite {
    display: block;
    font-weight: 600;
    text-align: right;
    margin-top: 0.5rem;
}

/* Footer Styles - Updated */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--game-yellow), var(--primary-color));
    background-size: 300% 100%;
    animation: gradient-animation 5s ease infinite;
}

@keyframes gradient-animation {
    0% {background-position: 0% 50%}
    50% {background-position: 100% 50%}
    100% {background-position: 0% 50%}
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-logo, .footer-links, .footer-social {
    margin-bottom: 1.5rem;
}

.footer-logo h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-links h3, .footer-social h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-links ul li, .footer-social ul li {
    margin-bottom: 0.5rem;
}

.footer-links a, .footer-social a {
    color: #ccc;
}

.footer-links a:hover, .footer-social a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #ccc;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-left {
        gap: 1rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
        height: auto;
    }
    
    header nav ul {
        margin-top: 0.5rem;
        gap: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .game-stats {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 576px) {
    .header-left {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
    
    header nav ul li a {
        font-size: 0.9rem;
    }
    
    #game-canvas {
        height: 300px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .game-stats {
        gap: 1rem;
    }
}

/* Animation Classes */
.animate-in {
    animation: fadeInUp 0.8s ease forwards;
}

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

/* Game Layout Styles - Updated */
.game-layout {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    grid-template-rows: auto auto;
    grid-template-areas:
        "left main right"
        "bottom bottom bottom";
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.game-nav {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-nav-left, .game-nav-right {
    display: flex;
    flex-direction: column;
    height: 520px; /* 设置固定高度与iframe匹配 */
}

.game-nav-left {
    grid-area: left;
}

.game-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-nav-right {
    grid-area: right;
}

.game-nav-bottom {
    grid-area: bottom;
    width: 100%;
}

.nav-title {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--game-yellow);
    text-align: center;
}

/* 调整游戏卡片容器，使其填充剩余空间 */
.game-nav-left .nav-title, .game-nav-right .nav-title {
    flex: 0 0 auto;
}

.game-nav-left > div:not(.nav-title), .game-nav-right > div:not(.nav-title) {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 左右两侧的游戏卡片高度均匀分布 */
.game-nav-left .game-card, .game-nav-right .game-card {
    height: calc((520px - 120px) / 3); /* 计算每个卡片的高度：总高度减去标题和内边距，再除以3 */
    margin-bottom: 1rem;
}

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

.game-thumb {
    height: 70%;
    background-color: var(--game-yellow);
    position: relative;
    overflow: hidden;
    flex: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 当没有图片时显示图案背景 */
.game-thumb::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    z-index: 0;
}

.game-card h3 {
    font-size: 0.9rem;
    padding: 0.7rem;
    text-align: center;
    font-weight: 600;
    color: var(--dark-color);
    flex: 0 0 auto;
}

.bottom-games {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.bottom-games .game-card {
    margin-bottom: 0;
}

/* 游戏iframe区域 */
#game-iframe {
    width: 100%;
    height: 450px;
    border: 4px solid var(--dark-color);
    border-radius: var(--border-radius);
    background-color: var(--light-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .game-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "main main"
            "left right"
            "bottom bottom";
    }
    
    .game-nav-left, .game-nav-right {
        padding: 1rem;
        height: auto;
    }
    
    .game-nav-left .game-card, .game-nav-right .game-card {
        height: 160px;
    }
    
    .bottom-games {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .game-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "left"
            "right"
            "bottom";
    }
    
    .bottom-games {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #game-iframe {
        height: 350px;
    }
}

@media (max-width: 576px) {
    .bottom-games {
        grid-template-columns: 1fr;
    }
    
    #game-iframe {
        height: 300px;
    }
}

/* 添加隐私政策页面样式 */
.legal-content {
    padding: 50px 0;
}

.back-button-container {
    margin-bottom: 30px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 15px;
    background-color: #f2f2f2;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #e0e0e0;
    transform: translateX(-5px);
}

.back-button .arrow {
    font-size: 18px;
    margin-right: 8px;
}

.page-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
    text-align: center;
}

.legal-text {
    max-width: 900px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.legal-text h2 {
    font-size: 24px;
    color: #333;
    margin: 30px 0 15px;
}

.legal-text p, .legal-text ul {
    margin-bottom: 15px;
}

.legal-text ul {
    padding-left: 20px;
}

.legal-text li {
    margin-bottom: 8px;
}

.last-updated {
    margin-top: 40px;
    font-style: italic;
    color: #666;
}

.cookie-notice {
    max-width: 900px;
    margin: 50px auto 0;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    display: none; /* Hidden by default, shown via JS */
}

.cookie-notice h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cookie-btn.accept {
    background-color: #4CAF50;
    color: white;
}

.cookie-btn.accept:hover {
    background-color: #45a049;
}

.cookie-btn.reject {
    background-color: #f44336;
    color: white;
}

.cookie-btn.reject:hover {
    background-color: #d32f2f;
}

@media (max-width: 768px) {
    .legal-text {
        padding: 0 15px;
    }
    
    .cookie-notice {
        margin: 30px 15px 0;
        padding: 20px;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 10px;
    }
}
