/* 基础样式 */
body {
    font-family: Arial, sans-serif;
}

/* 导航菜单样式 */
.nav-menu {
    display: flex;
    transition: all 0.3s ease-in-out;
}

.nav-toggle {
    display: none;
    transition: transform 0.3s ease-in-out;
}

.nav-toggle.active {
    transform: rotate(90deg);
}

@media screen and (max-width: 767px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(88, 28, 135, 0.85);
        backdrop-filter: blur(10px);
        z-index: 1000;
        padding: 0.5rem 0;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 1rem;
        padding-left: 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        transition: background-color 0.3s ease;
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-menu a:hover, .nav-menu a:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-toggle {
        display: block;
    }
}

/* 游戏区域样式 */
.game-section {
    background: linear-gradient(
        135deg,
        #8A2BE2,
        #9932CC,
        #8B008B,
        #4B0082,
        #483D8B,
        #00008B,
        #00CED1
    );
    background-size: 400% 400%;
    animation: gradientAnimation 20s ease infinite;
    min-height: 660px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    width: 100%;
}

@keyframes gradientAnimation {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

.game-container {
    min-height: 661px;
    position: relative;
    overflow: hidden;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.game-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 2;
}

/* 游戏界面元素样式 */
.play-button {
    background-color: #4B0082;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.play-button:hover {
    background-color: #00CED1;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.play-button:active {
    transform: scale(0.98);
}

.game-icon {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

#game_iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    transition: all 0.3s ease;
}

/* 控制按钮样式 */
.control-button,
.reload-button,
#fullscreen_toggle {
    position: absolute;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

#fullscreen_toggle {
    bottom: 20px;
    right: 20px;
}

.reload-button {
    bottom: 20px;
    right: 70px;
}

.control-button:hover,
.reload-button:hover,
#fullscreen_toggle:hover {
    background-color: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.control-button:active,
.reload-button:active,
#fullscreen_toggle:active {
    transform: scale(0.95);
}

/* 加载指示器样式 */
.game-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

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

/* 错误提示样式 */
.game-error-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 10001;
    animation: fadeInOut 3s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    10% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* 全屏模式样式 */
.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: black !important;
}

/* 网站标题样式 */
.website-name {
    font-family: 'Bungee', cursive;
    font-size: clamp(1rem, 5vw, 2rem);
    color: #fff;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    display: inline-block;
    padding: 0.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .website-name {
        animation: bounce 4s infinite;
    }

    .website-name:hover {
        transform: scale(1.1) rotate(5deg);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 语言切换样式 */
.language-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

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

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .game-content {
        padding: 1rem;
    }

    .content-wrapper {
        flex-direction: column-reverse;
    }

    .game-icon {
        margin-bottom: 1rem;
        width: 100px;
        height: 100px;
    }

    .play-button {
        font-size: 0.9rem;
        padding: 0.5rem 1.5rem;
    }

    .nav-menu a {
        font-size: 0.9rem;
    }

    .control-button,
    .reload-button,
    #fullscreen_toggle {
        width: 36px;
        height: 36px;
    }

    #fullscreen_toggle {
        bottom: 16px;
        right: 16px;
    }

    .reload-button {
        bottom: 16px;
        right: 60px;
    }

    .language-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 1rem 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        max-height: 30vh;
        overflow-y: auto;
    }

    .dropdown-item {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1rem;
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}
/* 搜索框相关样式 */
.search-container {
    display: flex;
    align-items: center;
    margin-right: 0; /* 移除右边距 */
}

.search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 256px;
    height: 40px;
    padding: 0.5rem 2.5rem;
    border-radius: 0.5rem;
    background-color: rgba(147, 51, 234, 0.5);
    color: white;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    background-color: rgba(147, 51, 234, 0.7);
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3);
}

.search-submit {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.search-clear:hover {
    color: white;
}

/* 移动端搜索框样式 */
.mobile-search {
    display: none;
}

/* 响应式调整 */
@media screen and (max-width: 767px) {
    .desktop-search {
        display: none;
    }

    .mobile-search {
        display: block;
    }

    .search-container {
        order: 1; /* 将搜索框移到语言选择器后面 */
        margin-left: 1rem; /* 添加左边距 */
    }

    .search-input {
        width: 140px; /* 调整移动端搜索框宽度 */
        height: 36px;
        font-size: 14px;
    }

    .search-submit svg,
    .search-clear svg {
        width: 18px;
        height: 18px;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}