/* 游戏页面特殊header样式 */
header .site-branding {
    margin-bottom: 20px;
    text-align: center;
}

header .site-branding h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 添加网站名称在语言选择器前的样式 */
.header-top-bar {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 15px;
    width: 100%;
}

.website-name {
    position: absolute;
    left: 0;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

/* 确保语言选择器保持在右侧 */
.language-selector-container {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1000;
}

header h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
    text-align: center;
}

/* 页面标题和描述 */
header .subtitle {
    font-size: 32px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 5px;
    color: var(--text-color);
    padding-left: 0;
}

header .page-description {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0;
}

/* 游戏页面通用样式 */
.game-container {
    background-color: var(--card-color);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 40px;
    margin: 40px 0 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 反应时间测试样式 */
#reaction-box {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s ease;
}

#reaction-box.waiting {
    background-color: #f5f5f7;
}

#reaction-box.ready {
    background-color: #ff3b30;
}

#reaction-box.go {
    background-color: #34c759;
}

#reaction-box.too-soon {
    background-color: #ff9500;
}

.instruction {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.result {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 数字记忆测试样式 */
#number-box {
    width: 100%;
    min-height: 300px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f7;
    padding: 30px;
    transition: background-color 0.3s ease;
}

#number-box.waiting {
    background-color: #f5f5f7;
}

#number-box.showing {
    background-color: #ffffff;
}

.number-display {
    font-size: 64px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 30px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
}

.input-container {
    display: none;
    width: 100%;
    max-width: 400px;
    margin: 20px 0;
    gap: 10px;
}

.input-container.visible {
    display: flex;
}

#number-input {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 18px;
    border: 2px solid #e5e5ea;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s ease;
}

#number-input:focus {
    border-color: var(--primary-color);
}

#submit-btn {
    border-radius: 10px;
    padding: 12px 20px;
    min-width: 80px;
}

.timer-bar {
    width: 100%;
    height: 6px;
    background-color: #e5e5ea;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.timer-progress {
    height: 100%;
    width: 100%;
    background-color: var(--primary-color);
    transform-origin: left;
    transform: scaleX(1);
    transition: transform linear;
}

#number-box.correct {
    background-color: rgba(52, 199, 89, 0.1);
}

#number-box.incorrect {
    background-color: rgba(255, 59, 48, 0.1);
}

/* 数字顺序测试样式 */
#sequence-box {
    width: 100%;
    min-height: 400px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f7;
    padding: 30px;
}

.grid-container {
    width: 100%;
    max-width: 400px;
    margin: 30px auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    aspect-ratio: 1 / 1;
}

.grid-item {
    background-color: #e5e5ea;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.grid-item.active {
    background-color: var(--primary-color);
}

.grid-item.correct {
    background-color: #34c759;
}

.grid-item.incorrect {
    background-color: #ff3b30;
}

.grid-item:hover {
    background-color: #d1d1d6;
}

#sequence-box.showing .grid-item {
    pointer-events: none;
}

#sequence-box.player-turn .grid-item {
    pointer-events: auto;
}

#sequence-box.correct {
    background-color: rgba(52, 199, 89, 0.1);
}

#sequence-box.incorrect {
    background-color: rgba(255, 59, 48, 0.1);
}

/* 视觉记忆测试样式 */
#visual-box {
    width: 100%;
    min-height: 400px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f7;
    padding: 30px;
}

.visual-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
}

.visual-grid-item {
    background-color: #e5e5ea;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.visual-grid-item:hover {
    background-color: #d1d1d6;
}

.visual-grid-item.target {
    background-color: var(--primary-color);
}

.visual-grid-item.correct {
    background-color: #34c759;
}

.visual-grid-item.incorrect {
    background-color: #ff3b30;
}

#visual-box.showing .visual-grid-item {
    pointer-events: none;
}

#visual-box.player-turn .visual-grid-item {
    pointer-events: auto;
}

#visual-box.correct {
    background-color: rgba(52, 199, 89, 0.1);
}

#visual-box.incorrect {
    background-color: rgba(255, 59, 48, 0.1);
}

/* 词汇记忆测试样式 */
#verbal-box {
    width: 100%;
    min-height: 300px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f7;
    padding: 30px;
    transition: background-color 0.3s ease;
}

.word-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 30px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-container {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

#verbal-box.correct {
    background-color: rgba(52, 199, 89, 0.1);
}

#verbal-box.incorrect {
    background-color: rgba(255, 59, 48, 0.1);
}

#verbal-box.playing {
    background-color: #f5f5f7;
}

#verbal-box.result {
    background-color: #f5f5f7;
}

/* 打字测试样式 */
#typing-box {
    width: 100%;
    min-height: 400px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f7;
    padding: 30px;
}

.typing-content {
    width: 100%;
    max-width: 700px;
    margin: 20px 0;
}

.text-display {
    font-size: 18px;
    line-height: 1.6;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    white-space: pre-wrap;
}

.text-display span {
    position: relative;
}

.text-display span.correct {
    color: #34c759;
}

.text-display span.incorrect {
    color: #ff3b30;
    text-decoration: underline;
}

#typing-input {
    width: 100%;
    height: 150px;
    padding: 15px;
    font-size: 16px;
    line-height: 1.6;
    border: 2px solid #e5e5ea;
    border-radius: 10px;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#typing-input:focus {
    border-color: var(--primary-color);
}

.timer-display {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 20px;
}

#typing-box.playing {
    background-color: #f5f5f7;
}

#typing-box.finished {
    background-color: rgba(52, 199, 89, 0.05);
}

#typing-box.waiting .text-display,
#typing-box.waiting #typing-input {
    opacity: 0.5;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background-color: #e5e5ea;
    color: var(--text-color);
}

.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 游戏描述区域 */
.game-description {
    margin: 40px 0;
    padding: 30px;
    background-color: #f5f5f7;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.game-description h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.game-description h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 25px 0 15px;
    color: var(--text-color);
}

.game-description p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* 最近结果区域 */
.recent-results {
    margin: 40px 0 0;
    padding: 30px;
    background-color: #f5f5f7;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.recent-results h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.recent-results h4 {
    font-size: 18px;
    font-weight: 500;
    margin: 25px 0 15px;
    color: var(--text-secondary);
}

/* 统计信息 */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

/* 结果历史 */
.results-history {
    margin-top: 20px;
}

.results-list {
    list-style: none;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-list li {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-list li:last-child {
    border-bottom: none;
}

.results-list li .result-value {
    font-weight: 600;
    color: var(--primary-color);
}

.results-list li .result-date {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 返回链接 */
.back-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 25px;
    }
    
    #reaction-box, #number-box {
        height: auto;
        min-height: 200px;
    }
    
    .result, .number-display {
        font-size: 48px;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    #number-input {
        border-radius: 10px;
        margin-bottom: 10px;
    }
    
    #submit-btn {
        border-radius: 10px;
        width: 100%;
    }
    
    .grid-container {
        max-width: 300px;
    }
    
    .grid {
        gap: 10px;
    }
    
    .game-description,
    .recent-results {
        padding: 20px;
    }
    
    .game-description h2 {
        font-size: 24px;
    }
    
    .game-description h3 {
        font-size: 20px;
    }
    
    .word-display {
        font-size: 36px;
    }
    
    .button-container {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .typing-content {
        max-width: 100%;
    }
    
    .text-display {
        font-size: 16px;
        padding: 15px;
    }
    
    #typing-input {
        height: 120px;
        font-size: 14px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-left {
        margin-bottom: 10px;
    }
    
    .language-selector-container {
        align-self: flex-end;
    }
} 