﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.logo i {
    margin-right: 8px;
    color: #ffd700;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

/* 语言切换 */
.language-switcher {
    display: flex;
    align-items: center;
    margin-right: 20px;
    gap: 10px;
}

.language-btn {
    background: linear-gradient(to bottom, #5a7fbb, #3a5f9e);
    border: none;
    color: white;
    padding: 6px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 0 #2c3e50, 0 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
    width: 60px;
    height: 32px;
    flex-direction: column;
}

.language-btn:hover {
    background: linear-gradient(to bottom, #6a8fcb, #4a6fae);
}

.language-btn:active {
    box-shadow: 0 1px 0 #2c3e50, 0 2px 3px rgba(0, 0, 0, 0.2);
    top: 2px;
}

.language-btn.active {
    background: linear-gradient(to bottom, #ffd700, #e5bf00);
    color: #2c3e50;
    box-shadow: 0 2px 0 #ccaa00, 0 3px 5px rgba(0, 0, 0, 0.2);
}

.language-btn.active:active {
    box-shadow: 0 1px 0 #ccaa00, 0 2px 3px rgba(0, 0, 0, 0.2);
}

.language-btn i {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.language-btn span {
    line-height: 1;
    font-size: 0.7rem;
    display: block;
}

/* 导航样式 */
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 8px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffd700;
}

nav ul li a.active {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

nav ul li a i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
}

/* 主内容区样式 */
.hero {
    padding: 30px 0 20px;
    text-align: center;
    background: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="%234a6491" opacity="0.1" width="50" height="50"/><rect fill="%234a6491" opacity="0.1" x="50" y="50" width="50" height="50"/></svg>');
    background-size: 300px;
    width: 100%;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 游戏内容样式 */
.game-container {
    padding: 20px 0 40px;
    flex-grow: 1;
    width: 100%;
}

.game-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 调整游戏信息区域布局 */
.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f5ff, #e6f0ff);
    border-radius: 10px;
}

.game-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.score, .timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2575fc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score i, .timer i {
    color: #4a6491;
}

.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 游戏选择下拉菜单 */
.game-selector {
    position: relative;
    display: inline-block;
}

.game-select-btn {
    background: linear-gradient(to bottom, #5a7fbb, #3a5f9e);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 0 #2c3e50, 0 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 22px;
    gap: 5px;
}

.game-select-btn:hover {
    background: linear-gradient(to bottom, #6a8fcb, #4a6fae);
}

.game-select-btn:active {
    box-shadow: 0 1px 0 #2c3e50, 0 2px 3px rgba(0, 0, 0, 0.2);
    top: 2px;
}

.game-select-btn i {
    font-size: 10px;
}

.game-dropdown {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 120px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.game-dropdown a {
    color: #333;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    font-size: 12px;
    transition: background-color 0.3s;
}

.game-dropdown a:hover {
    background-color: #f1f1f1;
}

.game-selector:hover .game-dropdown {
    display: block;
}

/* 更新开始按钮样式 - 高度22px，文字相应变小 */
.game-btn {
    background: linear-gradient(to bottom, #5a7fbb, #3a5f9e);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 0 #2c3e50, 0 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 22px;
}

.game-btn:hover {
    background: linear-gradient(to bottom, #6a8fcb, #4a6fae);
}

.game-btn:active {
    box-shadow: 0 1px 0 #2c3e50, 0 2px 3px rgba(0, 0, 0, 0.2);
    top: 2px;
}

.settings {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.setting-group label {
    white-space: nowrap;
    font-weight: bold;
    color: #4a6491;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
    flex: 1;
}

.game-board {
    display: grid;
    gap: 10px;
    margin: 0 auto;
    max-width: 95vw;
    justify-content: center;
    margin-bottom: 20px;
}

.card {
    width: 100%;
    height: 80px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    color: #333;
}

.card-back {
    background: white;
    color: #333;
    transform: rotateY(180deg);
    border: 2px solid #e9ecef;
}

.card.matched {
    visibility: hidden;
}

.instructions {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    font-size: 0.9rem;
    border: 1px solid #e9ecef;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #4a6491;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructions h3 i {
    color: #ffcc00;
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 页脚样式 */
footer {
    background: #2c3e50;
    color: white;
    padding: 15px 0 10px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-section {
    text-align: center;
    margin-bottom: 5px;
    width: 100%;
}

.footer-section h3 {
    margin-bottom: 8px;
    color: #ffd700;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-section ul li {
    margin-bottom: 5px;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.footer-section a:hover {
    color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
}

.footer-section a i {
    margin-right: 6px;
}

.copyright {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* 响应式设计 - 新增部分 */
@media (max-width: 1200px) {
    nav ul li {
        margin-left: 6px;
    }
    
    nav ul li a {
        font-size: 0.8rem;
        padding: 5px 8px;
    }
}

@media (max-width: 992px) {
    nav ul li {
        margin-left: 5px;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    
    .language-btn {
        width: 55px;
        height: 30px;
        font-size: 0.65rem;
    }
    
    .game-btn {
        min-width: 0;
        font-size: 11px;
        padding: 3px 6px;
        height: 22px;
    }
}

@media (max-width: 900px) {
    nav ul li a span.nav-text {
        display: none;
    }
    
    nav ul li a i {
        margin-right: 0;
    }
    
    nav ul li {
        margin-left: 4px;
    }
    
    nav ul li a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #2c3e50;
        display: none;
        padding: 15px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 8px 0;
    }
    
    nav ul li a {
        justify-content: center;
        padding: 8px;
        font-size: 0.9rem;
    }
    
    nav ul li a span.nav-text {
        display: inline;
    }
    
    nav ul li a i {
        margin-right: 8px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero {
        padding: 25px 0 15px;
    }
    
    .game-container {
        padding: 10px 0 25px;
    }
    
    .game-content {
        padding: 15px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-settings {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-stats {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    
    .game-controls {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    /* 在移动设备上开始按钮保持22px高度 */
    .game-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 80px;
        height: 22px;
    }
    
    .settings-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .setting-group {
        width: 100%;
    }
    
    .card {
        height: 70px;
    }
    
    .language-btn {
        font-size: 0.6rem;
        width: 50px;
        height: 28px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-left {
        order: 1;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    nav {
        order: 3;
        width: 100%;
    }
    
    .menu-toggle {
        order: 2;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 15px;
    }
    
    .footer-section a {
        font-size: 0.85rem;
    }
    
    .game-btn {
        min-width: 0;
        flex: 1;
        font-size: 11px;
        padding: 3px 6px;
        height: 22px;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .header-left {
        order: 1;
        width: auto;
        justify-content: flex-start;
        margin-bottom: 0;
        flex-wrap: nowrap;
    }
    
    .logo {
        margin-right: 15px;
        margin-bottom: 0;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
    }
    
    .language-switcher {
        order: 2;
        flex-direction: row;
        justify-content: flex-start;
        margin-right: 0;
        margin-bottom: 0;
        width: auto;
        gap: 8px;
        margin-left: 10px;
    }
    
    .menu-toggle {
        order: 3;
        align-self: center;
        margin-top: 0;
        margin-left: 15px;
        display: flex;
        align-items: center;
        padding: 6px 10px;
    }
    
    .language-btn {
        width: 45px;
        height: 26px;
        font-size: 0.55rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 15px;
    }
    
    .card {
        height: 60px;
    }
    
    .card-front, .card-back {
        font-size: 1rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    /* 在移动设备上开始按钮保持22px高度 */
    .game-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 80px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero {
        padding: 20px 0 10px;
    }
    
    .game-container {
        padding: 8px 0 20px;
    }
    
    .game-content {
        padding: 10px;
    }
    
    .card {
        height: 50px;
    }
    
    .card-front, .card-back {
        font-size: 0.9rem;
    }
    
    /* 在移动设备上开始按钮保持22px高度 */
    .game-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 80px;
        height: 22px;
    }
    
    .score, .timer {
        font-size: 1rem;
    }
    
    .game-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .game-stats {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .language-btn {
        width: 40px;
        height: 24px;
        font-size: 0.5rem;
        padding: 2px 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 10px;
    }
    
    .footer-section ul li {
        margin-bottom: 3px;
    }
    
    .footer-section a {
        font-size: 0.8rem;
    }
    
    .footer-section h3 {
        margin-bottom: 8px;
        font-size: 1.1rem;
    }
    
    .copyright {
        margin-top: 10px;
        padding-top: 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .header-left {
        flex-wrap: nowrap;
    }
    
    .logo {
        margin-bottom: 0;
        font-size: 1rem;
    }
    
    .language-switcher {
        width: auto;
        justify-content: flex-start;
        gap: 6px;
        margin-left: 8px;
    }
    
    .menu-toggle {
        margin-left: 12px;
    }
    
    .language-btn {
        width: 38px;
        height: 22px;
        font-size: 0.45rem;
    }
    
    .menu-toggle {
        padding: 5px 8px;
        font-size: 1.3rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 8px;
    }
    
    /* 在移动设备上开始按钮保持22px高度 */
    .game-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 80px;
        height: 22px;
    }
}

/* 修复右侧白色块问题 */
html, body {
    overflow-x: hidden;
    width: 100%;
}

main {
    width: 100%;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}