/* 从 figure_styles.css 复制相关样式，移除单词练习相关样式 */

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #F0F8FF;
    background-image: 
        linear-gradient(45deg, #E6F3FF 25%, transparent 25%), 
        linear-gradient(-45deg, #E6F3FF 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #E6F3FF 75%), 
        linear-gradient(-45deg, transparent 75%, #E6F3FF 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

/* 修改标题样式，与 index 保持一致 */
header h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 添加 header-content 样式 */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.game-area {
    background: linear-gradient(135deg, #FFE5F1 0%, #E0F7FF 100%);
    border-radius: 25px;
    padding: 10px;
    margin: 10px auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* 添加可爱的背景装饰 */
.game-area::before {
    content: '🌈';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
}

.game-area::after {
    content: '🌟';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
}

/* 目标字母样式优化 */
#target-letter {
    font-size: 80px; /* 从150px调小到120px */
    font-weight: bold;
    color: #6C5CE7;
    text-shadow: 4px 4px 0 #A8A4E3;
    margin: 5px auto; /* 减小上下边距 */
    animation: bounce 1s infinite;
    transition: all 0.3s ease;
    text-align: center;
}

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

/* 调整 finger-info 样式 */
#finger-info {
    background: linear-gradient(135deg, #FFD3E0 0%, #FFB6C1 100%);
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 24px;
    color: #2c3e50;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.2);
    border: 3px solid #FF69B4;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

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

/* 输入框样式优化 */
#input-field {
    width: 400px; /* 从200px调小到150px */
    height: 50px; /* 从50px调小到45px */
    font-size: 24px; /* 从28px调小到24px */
    text-align: center;
    border: 3px solid #6C5CE7;
    border-radius: 25px;
    background: #FFF;
    color: #6C5CE7;
    margin: 5px auto; /* 减小上下距 */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.1);
}

#input-field:focus {
    outline: none;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.2);
    border-color: #A8A4E3;
}

/* 键盘样式优化 */
#keyboard {
    background: linear-gradient(135deg, #F0F3FF 0%, #E8ECFD 100%);
    border-radius: 20px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.row {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.key {
    width: 45px; /* 从40px调大到45px */
    height: 45px; /* 从40px调大到45px */
    border: 2px solid #4CAF50;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 2px;
    font-weight: bold;
    font-size: 18px; /* 增加字体大小 */
    cursor: pointer;
    background-color: #FFFFFF;
    transition: all 0.3s ease;
}

.key:hover {
    transform: scale(1.1);
}

.key.left-hand {
    background-color: #FFB6C1;
}

.key.right-hand {
    background-color: #ADD8E6;
}

.key.active {
    background-color: #4CAF50;
    color: white;
}

.key.wide {
    width: 90px; /* 相应调整宽键的宽度 */
}

.key.extra-wide {
    width: 135px; /* 相应调整特宽键的宽度 */
}

.key.error {
    background-color: #FF6347;
    color: white;
}

.key.correct-hint {
    background-color: #4CAF50;
    border-color: #FFD700;
    color: #FFFFFF;
    box-shadow: 0 0 10px #FFD700;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn {
    font-size: 20px;
    padding: 12px 30px;
    border-radius: 25px;
    background: linear-gradient(135deg, #6C5CE7 0%, #A8A4E3 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    margin: 0 10px;
}

#start-audio {
    background-color: #4CAF50;
    color: white;
}

#end-practice {
    background-color: #FF6347;
    color: white;
    display: none;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.difficulty select {
    font-size: 16px;
    padding: 5px;
    border-radius: 5px;
}

.stats {
    background: #FFF;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 20px auto;
    display: flex;
    justify-content: space-around;
    max-width: 500px;
}

#timer, #accuracy {
    font-size: 20px;
    color: #6C5CE7;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

#timer::before {
    content: '⏱️';
}

#accuracy::before {
    content: '🎯';
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #8B4513;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #f0f0f0;
    border-radius: 15px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.progress {
    width: 0;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.5s ease-in-out;
}

.animal {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🐰</text></svg>');
    background-size: contain;
    transition: left 0.5s ease-in-out;
}

.practice-input {
    text-align: center;
    font-size: 24px;
    padding: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .game-area {
        font-size: 24px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        margin: 5px 0;
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        font-size: 2em;
        margin-bottom: 10px;
    }
    
    #finger-info {
        font-size: 16px;
        padding: 6px 15px;
    }
}

.practice-mode-container {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 900px;
}

.finger-groups {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 20px 0;
}

.hand-section {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
}

.left-hand {
    background: rgba(144, 202, 249, 0.2);
}

.right-hand {
    background: rgba(255, 171, 145, 0.2);
}

.mode-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: none;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.additional-modes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.additional-modes .mode-btn {
    width: auto;
    padding: 12px 24px;
    font-size: 1.1em;
    background: #4CAF50;
    color: white;
}

/* 添加模式选择对话框样式 */
.mode-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.mode-dialog-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: #f0f7f0;  /* 改为浅绿色背景 */
}

.mode-dialog-content h2 {
    text-align: center;
    color: #2c5530;  /* 深绿色标题 */
    margin-bottom: 20px;
    font-size: 1.8em;
}

.mode-sections {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.mode-section {
    flex: 1;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
}

.mode-section h3 {
    color: #3a7144;  /* 稍微浅一点的绿色用于子标题 */
    margin: 15px 0;
    font-size: 1.4em;
    text-align: center;  /* 添加这行来确保标题左对齐 */
}

/* 可选：为了视觉层次感，可以给标题添加一个柔和的底部边框 */
.mode-dialog-content h2,
.mode-section h3 {
    border-bottom: 2px solid #e0ebe0;
    padding-bottom: 8px;
}

.mode-select-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: none;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-select-btn:hover {
    background: #4CAF50;  /* 改为绿色背景 */
    color: white;  /* 添加白色文字，增加对比度 */
    transform: translateY(-2px);
}

.mode-select-btn.primary {
    background: #4CAF50;
    color: white;
    font-size: 1.1em;
    padding: 12px 24px;
}

.mode-select-btn.primary:hover {
    background: #388E3C;  /* 使用更深的绿色 */
    color: white;
}

.mode-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .mode-sections {
        flex-direction: column;
    }
    
    .mode-footer {
        flex-direction: column;
    }
}

/* 结果对话框样式 */
.result-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.result-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.result-celebration {
    animation: celebrate 0.5s ease-out;
}

@keyframes celebrate {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.result-grade {
    margin: 20px 0;
}

.grade-text {
    font-size: 2em;
    font-weight: bold;
    color: #FF6B6B;
    display: block;
    margin-bottom: 10px;
}

.grade-stars {
    font-size: 1.5em;
    margin: 10px 0;
}

.star {
    margin: 0 2px;
    transition: all 0.3s ease;
}

.star.full {
    animation: starPop 0.3s ease-out;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

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

.stat-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #4CAF50;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.encouragement {
    font-size: 1.2em;
    color: #666;
    margin: 20px 0;
    padding: 10px;
    border-radius: 10px;
    background: #f5f5f5;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.result-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn {
    background: #4CAF50;
    color: white;
}

.close-btn {
    background: #FF6B6B;
    color: white;
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .result-btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* 调整 practice-content 布局 */
.practice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 调整输入框容器样式 */
.input-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* 为 finger-info 添加手形图标 */
#finger-info::before {
    content: '👆';
    font-size: 28px;
    margin-right: 10px;
    animation: pointUp 1s infinite;
}

/* 添加指向动画 */
@keyframes pointUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 为左手和右手添加不同的样式 */
#finger-info.left-hand {
    background: linear-gradient(135deg, #FFD3E0 0%, #FFB6C1 100%);
    border-color: #FF69B4;
}

#finger-info.right-hand {
    background: linear-gradient(135deg, #D4E7FF 0%, #ADD8E6 100%);
    border-color: #4169E1;
}

/* 在移动设备上保持合适的大小 */
@media (max-width: 768px) {
    #target-letter {
        font-size: 100px;
    }
    
    #finger-info {
        font-size: 20px;
        padding: 10px 20px;
    }
    
    #finger-info::before {
        font-size: 24px;
    }
    
    .practice-content {
        min-height: 250px;
    }
}

/* 添加倒计时样式 */
.countdown {
    font-size: 72px;
    color: #4CAF50;
    font-weight: bold;
    text-align: center;
    animation: pulse 1s infinite;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.return-home {
    background-color: #ff9800 !important;
    color: white !important;
    margin-top: 10px !important;
    width: 100% !important;
}

.return-home:hover {
    background-color: #f57c00 !important;
}
