* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007aff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #007aff;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1d1d1f;
    cursor: pointer;
}

main {
    padding: 40px 0;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #007aff, #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.3rem;
    text-align: center;
    color: #86868b;
    margin-bottom: 50px;
    font-weight: 400;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 60px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.fullscreen-controls {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 5;
    display: block;
}

.fullscreen-btn {
    background: rgba(0, 122, 255, 0.9);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.fullscreen-btn:hover {
    background: rgba(0, 122, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

/* PC端全屏按钮增强样式 */
@media (min-width: 769px) {
    .fullscreen-btn {
        padding: 15px;
        font-size: 1.3rem;
        border-radius: 10px;
        min-width: 50px;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .fullscreen-btn:hover {
        background: linear-gradient(135deg, #007aff, #5856d6);
        transform: scale(1.08) rotate(5deg);
    }
    
    .fullscreen-btn:active {
        transform: scale(0.95);
    }
}

/* PC端全屏模式优化 */
@media (min-width: 769px) {
    .game-container.fullscreen {
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .game-container.fullscreen .game-iframe {
        max-width: 100vw;
        max-height: 100vh;
        width: auto;
        height: auto;
        aspect-ratio: 16/9; /* 保持游戏比例 */
    }
    
    .game-container.fullscreen .fullscreen-controls {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
    }
    
    .game-container.fullscreen .fullscreen-btn {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .game-container.fullscreen .fullscreen-btn:hover {
        background: rgba(255, 0, 0, 0.8);
        border-color: rgba(255, 0, 0, 0.5);
        transform: scale(1.1);
    }
}

/* 全屏提示样式 */
#fullscreen-tip {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: none;
}

.game-container.fullscreen .game-iframe {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.game-container.fullscreen .fullscreen-controls {
    top: 20px;
    right: 20px;
}

.device-orientation-warning {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 15px;
    z-index: 10;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.orientation-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.game-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 15px;
    background: #000;
}

.mobile-controls-info {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.mobile-controls-info h3 {
    color: #007aff;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.mobile-controls-info p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0;
}

.content-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 20px;
    position: relative;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #007aff, #5856d6);
    border-radius: 2px;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #424245;
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: #f5f7fa;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d1d1f;
}

.feature-desc {
    font-size: 1rem;
    color: #86868b;
    line-height: 1.5;
}

.cta-section {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #007aff, #5856d6);
    border-radius: 20px;
    color: white;
    margin: 40px 0;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.cta-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.play-button {
    display: inline-block;
    background: white;
    color: #007aff;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

footer {
    background: #1d1d1f;
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Language Selector Styles */
.language-selector-container {
    position: relative;
    z-index: 1000;
}

#languageSelector {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #1d1d1f;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 160px;
    backdrop-filter: blur(10px);
}

#languageSelector:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#languageSelector:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

/* 确保语言选择器在所有设备上正确显示 */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .header-content > * {
        width: 100%;
    }
    
    .logo {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .header-content nav {
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .mobile-menu-toggle {
        display: block;
        order: 1;
    }

    .language-selector-container {
        order: 2;
        margin: 0;
    }
    
    #languageSelector {
        width: 120px;
        background: white;
    }

    .game-container {
        padding: 15px;
        margin-bottom: 40px;
    }

    .game-iframe {
        height: 300px;
    }

    .mobile-controls-info {
        display: block;
    }

    .content-section {
        padding: 25px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cta-section {
        padding: 40px 20px;
    }

    .cta-title {
        font-size: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    main {
        padding: 20px 0;
    }

    .game-iframe {
        height: 250px;
    }

    .content-section {
        padding: 20px;
    }

    .game-container {
        padding: 10px;
    }
}

/* 移动端优化 - 支持竖屏 */
@media screen and (max-width: 768px) {
    .game-iframe {
        height: 400px; /* 竖屏默认高度 */
    }

    .mobile-controls-info {
        display: block;
    }

    .fullscreen-controls {
        display: block;
    }
    
    /* 竖屏时显示提示但不强制 */
    .device-orientation-warning {
        display: none; /* 不再强制要求横屏 */
    }
    
    /* 竖屏优化提示 */
    .portrait-tip {
        background: #fff3cd;
        border: 1px solid #ffeaa7;
        border-radius: 10px;
        padding: 15px;
        margin-top: 15px;
        text-align: center;
        color: #856404;
    }
}

/* 横屏游戏时隐藏header */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body.landscape-gaming header {
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    body.landscape-gaming main {
        padding-top: 0;
    }
    
    .game-iframe {
        height: 80vh; /* 横屏时更大，给隐藏header留出空间 */
    }
    
    .portrait-tip {
        display: none;
    }
    
    /* 横屏时显示退出全屏样式的按钮 */
    .landscape-exit-btn {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2000;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        padding: 10px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 1.2rem;
        display: none;
    }
    
    body.landscape-gaming .landscape-exit-btn {
        display: block;
    }
}

/* 横屏检测 - 仅在极小屏幕时显示 */
@media screen and (max-width: 480px) and (orientation: portrait) {
    .device-orientation-warning {
        display: none; /* 即使在小屏幕也不强制横屏 */
    }
    
    .game-iframe {
        height: 300px; /* 小屏竖屏时的高度 */
    }
}

/* 平板横屏优化 */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .game-iframe {
        height: 500px;
    }
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #86868b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}