/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px 20px;
}

/* 模式选择页面样式 */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 20px;
}

.mode-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
}

.mode-card:hover {
    transform: translateY(-5px);
}

/* 练习页面样式 */
.practice-area {
    background: #e8f5e9;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
}

.word-display {
    text-align: center;
    margin-bottom: 30px;
}

.chinese {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.english {
    font-size: 2.2rem;
    color: #1a73e8;
    min-height: 45px;
    letter-spacing: 2px;
}

.input-area {
    text-align: center;
    margin-bottom: 20px;
}

#word-input {
    padding: 15px;
    font-size: 1.5rem;
    width: 80%;
    max-width: 400px;
    border: 2px solid #e0e5ec;
    border-radius: 6px;
    margin-bottom: 10px;
    color: #2c3e50;
    background-color: white;
}

#word-input::placeholder {
    color: #a0a0a0;
}

.feedback-area {
    text-align: center;
}

#result-message {
    margin: 10px 0;
    font-size: 16px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #666;
}

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

.controls .btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1.2rem;
    color: white;
}

#add-word {
    background-color: #4CAF50;
}

#add-word:hover {
    background-color: #45a049;
}

#next-word {
    background-color: #2196F3;
}

#next-word:hover {
    background-color: #1976D2;
}

#end-practice {
    background-color: #FF9800;
}

#end-practice:hover {
    background-color: #F57C00;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .practice-area {
        padding: 15px;
    }
    
    #word-input {
        width: 90%;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 80%;
    }
}

/* 添加顶部导航样式 */
.top-nav {
    display: flex;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

.back-btn {
    padding: 8px 15px;
    background-color: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-right: 20px;
    font-size: 14px;
}

.back-btn:hover {
    background-color: #1976D2;
}

.top-nav h1 {
    margin: 0;
    font-size: 24px;
}

/* 更新模式选择对话框样式 */
.mode-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.mode-dialog-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
}

.mode-title {
    text-align: center;
    color: #4CAF50;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-family: 'ZCOOL KuaiLe', cursive;
}

.section-title {
    color: #4CAF50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: 'ZCOOL KuaiLe', cursive;
}

.mode-sections {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.mode-section {
    flex: 1;
}

.mode-select-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-select-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.mode-select-btn.primary {
    background: #4CAF50;
    color: white;
    border: none;
}

.mode-select-btn.primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.mode-select-btn.return-home {
    background: #FF9800;
    color: white;
    border: none;
}

.mode-select-btn.return-home:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

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

@media (max-width: 768px) {
    .mode-sections {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mode-dialog-content {
        padding: 1rem;
    }
    
    .mode-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}

/* 添加动画效果 */
.mode-dialog-content {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 添加单词练习相关样式 */
.word-display span {
    display: inline-block;
    margin: 0 2px;
    font-size: 24px;
    min-width: 20px;
}

.word-display span.hidden {
    color: #ccc;
}

.word-display span.correct {
    color: #4CAF50;
}

.word-display span.incorrect {
    color: #f44336;
}

.word-display span.space {
    width: 10px;
}

#word-input {
    font-size: 20px;
    padding: 10px;
    width: 80%;
    max-width: 400px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-top: 20px;
}

#word-input:focus {
    outline: none;
    border-color: #2196F3;
}

.chinese {
    font-size: 24px;
    margin-bottom: 15px;
    color: #666;
}

.english {
    font-size: 28px;
    color: #333;
    min-height: 40px;
    letter-spacing: 2px;
}

/* 更新标题和按钮样式 */
.mode-dialog h2,
.mode-dialog h3 {
    text-align: center;
    font-family: 'ZCOOL KuaiLe', cursive;
}

.mode-dialog h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.mode-dialog h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1rem;
}

/* 添加未支持模式对话框的样式 */
.unsupported-message {
    text-align: center;
    padding: 2rem 0;
    color: #666;
}

.unsupported-message p {
    margin: 0.5rem 0;
    font-size: 1.2rem;
    font-family: 'ZCOOL KuaiLe', cursive;
}

.unsupported-message p:first-child {
    color: #FF9800;
}

/* 添加导航栏样式 */
.main-nav {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 32px;
    margin-right: 0.5rem;
}

.logo-text {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.2rem;
    color: #333;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 更新主容器样式以适应固定导航栏 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px 20px;
}

.practice-section {
    text-align: center;
}

/* 更新标题样式 */
h1 {
    font-family: 'ZCOOL KuaiLe', cursive;
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* 更新练习区域样式 */
.practice-area {
    background: #e8f5e9;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 24px;
    }
    
    .container {
        padding: 70px 15px 15px;
    }
}
