/* Global style reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    touch-action: manipulation;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    -webkit-text-size-adjust: 100%;
}

/* Header styles */
.site-header {
    background-color: #1a237e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Language selector */
.language-selector {
    position: relative;
}

.language-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-height: 44px;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.language-btn.active .arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 0.5rem;
    display: none;
    z-index: 9999;
}

.language-dropdown.show {
    display: block;
}

.language-dropdown a {
    display: block;
    padding: 0.8rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
    white-space: nowrap;
    min-height: 44px;
}

.language-dropdown a:hover {
    background: #f5f5f5;
}

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Main content area */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Game container */
.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.game-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-controls {
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    background: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.game-controls button {
    min-width: 120px;
    padding: 0.8rem 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #ff9800;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.game-controls button:hover {
    background: #f57c00;
}

/* Game information area */
.game-info, .game-guide {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-content {
    margin-bottom: 1rem;
    line-height: 1.5;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a237e;
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0 0.8rem;
    color: #1a237e;
}

.features-list, .tips-list {
    list-style-type: none;
    padding-left: 1.5rem;
    margin: 0.8rem 0 1rem 0;
}

.features-list li, .tips-list li {
    position: relative;
    margin-bottom: 0.6rem;
    padding: 0.3rem 0 0.3rem 1.5rem;
}

.features-list li:before, .tips-list li:before {
    content: "•";
    color: #1a237e;
    font-size: 1.2em;
    position: absolute;
    left: 0;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group h3 {
    color: #1a237e;
    margin-bottom: 0.5rem;
}

.control-group p {
    margin-left: 1rem;
}

/* Comments area */
.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    resize: vertical;
    min-height: 100px;
}

.submit-comment {
    background: #1a237e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-comment:hover {
    background: #0e1642;
}

/* Footer styles */
.site-footer {
    background: #1a237e;
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

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

.footer-nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-nav a:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .site-header {
        padding: 0.8rem 0 0 0;
        flex-direction: column;
        align-items: center;
        background: none;
        box-shadow: none;
    }

    .logo {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        text-align: center;
        padding: 0 1rem;
        color: white;
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    .game-container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .game-wrapper {
        padding-top: 56.25%; /* 保持16:9比例 */
    }

    .language-selector {
        width: 100%;
        background: #1a237e;
        padding: 0.5rem 0;
    }

    .language-btn {
        width: 100%;
        max-width: none;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 0;
        padding: 1rem;
    }

    .language-dropdown {
        position: absolute;
        width: 100%;
        top: 100%;
        left: 0;
        margin: 0;
        border-radius: 0;
        background: #1a237e;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .language-dropdown a {
        color: white;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem;
    }

    .language-dropdown a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .game-controls {
        padding: 0.8rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .game-controls button {
        flex: 1;
        min-width: 120px;
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 4px;
    }

    main {
        padding: 1rem;
        margin-top: 1rem;
    }

    .game-info, .game-guide {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .info-content {
        margin-bottom: 0.8rem;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    h3 {
        font-size: 1.1rem;
        margin: 0.8rem 0 0.6rem;
    }

    .features-list, .tips-list {
        margin: 0.6rem 0 0.8rem 0;
    }

    .features-list li, .tips-list li {
        margin-bottom: 0.4rem;
        padding: 0.2rem 0 0.2rem 1.2rem;
    }

    /* 页脚适配 */
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .footer-nav {
        margin-top: 1rem;
    }

    .footer-nav a {
        margin: 0.5rem;
        padding: 0.5rem;
        display: block;
    }
}

/* 针对横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .game-wrapper {
        padding-top: 75vh;
    }

    .game-controls {
        flex-direction: row;
    }

    .game-controls button {
        width: auto;
        flex: 1;
    }
}

/* 针对高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 针对平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    main {
        padding: 1.5rem;
    }

    .game-controls button {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
}

/* 性能优化 */
* {
    will-change: transform;
    backface-visibility: hidden;
}

 