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

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 字体加载优化 - 使用更好的后备字体策略 */

/* 基础样式 */
body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', 'Kalam', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #ffe6f2 0%, #e6f3ff 50%, #e6ffe6 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.logo-text {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Fredoka One', cursive;
    font-size: 1.8rem;
    font-weight: 600;
    color: #ff6b9d;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ff6b9d;
}

/* 下拉菜单样式 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1001;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* 添加悬停区域，防止菜单消失 */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.95);
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

/* 添加悬停区域，防止下拉菜单消失 */
.dropdown-content::after {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.nav-dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}

.dropdown-link {
    color: #333;
    padding: 0.8rem 1rem;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.2rem;
}

.dropdown-link:hover {
    background: rgba(255, 107, 157, 0.1);
    color: #ff6b9d;
}

.language-btn {
    position: relative;
    display: inline-block;
    background: #4ecdc4;
    border: 1px solid #4ecdc4;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
}

.language-btn:hover {
    background: #3db8b0;
    border-color: #3db8b0;
}

.language-dropdown {
    display: none;
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    min-width: 200px;
    max-width: 250px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1001;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    /* 减少顶部空白，保持悬停区域 */
    padding-top: 0.8rem;
    padding-bottom: 1.5rem;
    /* 增加高度以显示所有14种语言 */
    max-height: 560px;
    overflow-y: auto;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #4ecdc4 #f0f0f0;
}

/* Webkit浏览器的自定义滚动条 */
.language-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: #4ecdc4;
    border-radius: 3px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
    background: #3db8b0;
}

.language-dropdown::after {
    content: '';
    position: absolute;
    top: -0.8rem;
    left: 0;
    right: 0;
    height: 0.8rem;
    background: transparent;
}

/* 增加左侧悬停区域 */
.language-dropdown::before {
    content: '';
    position: absolute;
    top: -0.8rem;
    left: -1rem;
    width: 1rem;
    height: calc(100% + 1.6rem);
    background: transparent;
}

.language-btn:hover .language-dropdown,
.language-dropdown:hover {
    display: block;
}

/* 增加更稳定的悬停逻辑 */
.language-btn:focus-within .language-dropdown,
.language-dropdown:focus-within {
    display: block;
}

.language-option {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    line-height: 1.3;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
}

.globe-icon {
    font-size: 1rem;
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 欢迎信息区域 */
.welcome-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px dashed #ffb3d9;
}

.welcome-text {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* 游戏区域 */
.games-section {
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Bubblegum Sans', cursive;
    font-size: 2.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    /* 确保所有卡片高度一致 */
    height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #ff6b9d;
}

.game-card.coming-soon {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    cursor: default;
}

.game-card.coming-soon:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

/* Premium Game Kingdom 样式 */
.premium-section {
    margin-top: 4rem;
}

.premium-section .section-title {
    color: #ff6b9d;
}

.premium-card {
    border-color: #ff6b9d;
    background: linear-gradient(135deg, #fff, #fff5f8);
}

.premium-card:hover {
    border-color: #ff6b9d;
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.2);
}

.premium-coming-soon {
    border-color: #ff6b9d;
    background: linear-gradient(135deg, #fff5f8, #ffe6f2);
}

.premium-note {
    text-align: center;
    color: #ff6b9d;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 107, 157, 0.1);
    border-radius: 10px;
    border: 1px dashed #ff6b9d;
}

.game-badge {
    position: absolute;
    top: -10px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.hot-badge {
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    left: -10px;
}

.new-badge {
    background: linear-gradient(45deg, #ff6b9d, #ff8fab);
    right: -10px;
}

.coming-badge {
    background: linear-gradient(45deg, #6c757d, #adb5bd);
    right: -10px;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.game-title {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Chewy', cursive;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.game-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 捐赠区域 */
.donation-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px dashed #ffb3d9;
}

.donation-container {
    max-width: 600px;
    margin: 0 auto;
}

.donation-title {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Indie Flower', cursive;
    font-size: 1.8rem;
    color: #ff6b9d;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.donation-text {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.donation-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 2rem;
}

.donate-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b9d, #ff8fab);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.donate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4);
}

/* 页脚 */
.footer {
    background: #f8fffe;
    border-top: 1px solid rgba(78, 205, 196, 0.15);
    padding: 2.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4ecdc4;
}

.footer-section:first-child h4 {
    color: #2dd4bf;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.footer-section:nth-child(2) h4 {
    color: #fb7185;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

.footer-section p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-section:first-child p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    max-width: 280px;
    min-height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-section:last-child p {
    color: #555;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.6;
    text-align: center;
    max-width: 280px;
    min-height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-section .copyright {
    color: #2dd4bf;
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    justify-content: center;
}

.footer-logo-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.tech-tags {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-direction: row;
}

.tech-tag {
    background: #2dd4bf;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .welcome-section,
    .donation-section {
        padding: 2rem 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-section {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .welcome-text {
        font-size: 1rem;
    }
    
    .donation-title {
        font-size: 1.5rem;
    }
    
    .donation-text {
        font-size: 1rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    /* 小屏幕上的语言下拉框优化 */
    .language-dropdown {
        min-width: 180px;
        max-width: 200px;
        right: -50px;
        max-height: 500px;
        padding-top: 0.6rem;
    }
    
    .language-btn {
        min-width: 100px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-section,
.games-section,
.donation-section {
    animation: fadeInUp 0.8s ease-out;
}

.game-card {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }

/* Coming Soon Modal */
.coming-soon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    margin: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}
