/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 25%, #4a5568 50%, #667eea 75%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #f7fafc;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo h1 {
    font-size: 28px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-info span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 年级选择样式 - 3D透明效果 */
.grade-selector {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.grade-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: -1;
}

.grade-selector h2 {
    font-size: 36px;
    color: #ffffff;
    margin-bottom: 50px;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grade-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

.grade-btn {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    padding: 35px 25px;
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.grade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.3) 0%, 
        rgba(118, 75, 162, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.grade-btn:hover {
    transform: translateY(-8px) rotateX(5deg) rotateY(5deg);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.grade-btn:hover::before {
    opacity: 1;
}

.grade-btn:active {
    transform: translateY(-4px) rotateX(2deg) rotateY(2deg);
    transition: all 0.1s ease;
}

.grade-number {
    font-size: 36px;
    font-weight: 700;
}

.grade-text {
    font-size: 18px;
    font-weight: 600;
}

.grade-desc {
    font-size: 14px;
    opacity: 0.9;
}

/* 模式选择样式 - 3D透明效果 */
.mode-selector {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.mode-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: -1;
}

.mode-selector h2 {
    font-size: 36px;
    color: #ffffff;
    margin-bottom: 50px;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    padding: 35px 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.15) 0%, 
        rgba(118, 75, 162, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.mode-btn:hover {
    transform: translateY(-8px) rotateX(3deg) rotateY(3deg);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.mode-btn:hover::before {
    opacity: 1;
}

.mode-btn:active {
    transform: translateY(-4px) rotateX(1deg) rotateY(1deg);
    transition: all 0.1s ease;
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mode-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mode-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 15px 30px;
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 学习界面样式 */
.learning-container {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.current-mode {
    font-size: 24px;
    font-weight: 700;
    color: #4a5568;
}

.timer {
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 15px;
}

/* 进度条样式 */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    background: #e2e8f0;
    border-radius: 15px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text, .score-text {
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
}

/* 学习内容样式 */
.learning-content {
    background: #f7fafc;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.word-display {
    font-size: 48px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 20px;
}

.word-meaning {
    font-size: 20px;
    color: #718096;
    margin-bottom: 20px;
}

.word-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.sentence-display {
    font-size: 24px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

.blank-space {
    display: inline-block;
    min-width: 100px;
    height: 2px;
    background: #667eea;
    margin: 0 5px;
    vertical-align: middle;
}

/* 答题区域样式 */
.answer-area {
    margin-bottom: 30px;
}

.answer-input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 18px;
    text-align: center;
    margin: 0 auto;
    display: block;
    transition: all 0.3s ease;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.answer-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 16px;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.answer-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pronunciation-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.pronunciation-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 15px;
    padding: 15px 25px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pronunciation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* 反馈区域样式 */
.feedback {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.feedback-icon {
    font-size: 48px;
}

.feedback-message {
    font-size: 18px;
    font-weight: 600;
}

.feedback-score {
    font-size: 16px;
    color: #718096;
}

.feedback.correct {
    border-left: 5px solid #48bb78;
}

.feedback.wrong {
    border-left: 5px solid #f56565;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.control-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.control-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.control-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.control-btn.secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* 结果页面样式 */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.result-header {
    margin-bottom: 40px;
}

.result-header h2 {
    font-size: 36px;
    color: #4a5568;
    margin-bottom: 20px;
}

.result-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.badge-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.badge-text {
    font-size: 18px;
    font-weight: 600;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    flex: 1;
    text-align: left;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #4a5568;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.result-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.result-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.result-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.result-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.result-btn.secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* 错题库样式 */
.error-review-container {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.error-header {
    text-align: center;
    margin-bottom: 30px;
}

.error-header h2 {
    font-size: 32px;
    color: #4a5568;
    margin-bottom: 20px;
}

.error-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 16px;
    color: #718096;
}

.error-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 30px;
}

.error-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-word {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
}

.error-details {
    font-size: 14px;
    color: #718096;
}

.error-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .grade-buttons {
        grid-template-columns: 1fr;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .word-display {
        font-size: 36px;
    }
    
    .sentence-display {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .grade-selector, .mode-selector, .learning-container, .result-container {
        padding: 20px;
    }
    
    .word-display {
        font-size: 28px;
    }
    
    .sentence-display {
        font-size: 18px;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* 加载动画 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 发音练习样式 */
.pronunciation-instruction {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.pronunciation-instruction p {
    margin: 0;
    font-size: 16px;
    color: #4a5568;
    font-weight: 500;
}

.pronunciation-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.pronunciation-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 180px;
}

.pronunciation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pronunciation-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.play-count {
    font-size: 14px;
    opacity: 0.8;
    margin-left: 8px;
}

/* 录音区域样式 */
.recording-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
}

.recording-instruction p {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 600;
}

.recording-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.record-btn, .stop-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
    min-width: 150px;
}

.stop-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

.record-btn:hover, .stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.stop-btn:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.recording-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    min-height: 20px;
}

.recording-status.recording {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.recording-status.error {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

.recording-status.processing {
    background: rgba(49, 130, 206, 0.1);
    color: #3182ce;
    border: 1px solid rgba(49, 130, 206, 0.3);
}

/* 发音结果样式 */
.pronunciation-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
}

.score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.score-emoji {
    font-size: 48px;
}

.score-number {
    font-size: 36px;
    font-weight: 700;
}

.feedback-content {
    text-align: left;
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.feedback-content p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.5;
}

.feedback-content strong {
    color: #2d3748;
}

.result-actions {
    margin-top: 20px;
}

.retry-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

/* 备用发音选项样式 */
.fallback-pronunciation {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #fed7d7;
}

.fallback-pronunciation p {
    margin: 10px 0;
    font-size: 16px;
    color: #2d3748;
}

.fallback-pronunciation p:first-child {
    color: #e53e3e;
    font-weight: 600;
}

/* 组词练习样式 */
.word-parts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.word-part-btn {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.word-part-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.word-part-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.word-builder {
    min-height: 60px;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.word-builder:not(:empty) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.word-builder span {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.word-builder span:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.word-form-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn.info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.control-btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.current-word-display {
    margin-top: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #4a5568;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.target-word-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* 响应式设计 */
/* 完整的响应式设计 - 统一管理所有断点 */

/* 大屏幕桌面 (1200px+) - 默认样式已适配 */

/* 中等桌面/笔记本 (992px - 1199px) */
@media (max-width: 1199px) {
    .app-container {
        max-width: 100%;
        padding: 18px;
    }
    
    .header {
        padding: 18px 25px;
    }
}

/* 平板设备 (768px - 991px) */
@media (max-width: 991px) {
    .app-container {
        padding: 15px;
    }
    
    .grade-buttons, .mode-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机横屏/小平板 (576px - 767px) */
@media (max-width: 767px) {
    .app-container {
        padding: 12px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .user-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .grade-buttons, .mode-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .controls, .result-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    /* 发音练习适配 */
    .pronunciation-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .pronunciation-btn {
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
    
    .recording-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .record-btn, .stop-btn {
        min-width: 180px;
        width: 100%;
        max-width: 250px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-emoji {
        font-size: 36px;
    }
    
    .score-number {
        font-size: 28px;
    }
    
    /* 组词练习适配 */
    .word-parts {
        gap: 8px;
        justify-content: center;
    }
    
    .word-part-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 60px;
    }
    
    .word-form-controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .control-btn.info {
        min-width: 120px;
        width: 100%;
        max-width: 200px;
    }
    
    .current-word-display {
        font-size: 16px;
    }
    
    .word-builder {
        min-height: 50px;
        padding: 15px;
    }
    
    .word-display {
        font-size: 36px;
    }
    
    .sentence-display {
        font-size: 20px;
    }
}

/* 手机竖屏 (320px - 575px) */
@media (max-width: 575px) {
    .app-container {
        padding: 10px;
    }
    
    .grade-selector, .mode-selector, .learning-container, .result-container {
        padding: 15px;
        margin: 8px 0;
    }
    
    .header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .logo h1 {
        font-size: 22px;
    }
    
    .user-info {
        font-size: 13px;
        gap: 12px;
    }
    
    .word-display {
        font-size: 30px;
    }
    
    .sentence-display {
        font-size: 18px;
    }
    
    .grade-btn, .mode-btn {
        padding: 15px;
        min-height: 85px;
    }
    
    .grade-number {
        font-size: 26px;
    }
    
    .mode-icon {
        font-size: 26px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .answer-input {
        font-size: 16px; /* 防止iOS自动缩放 */
        max-width: 100%;
        padding: 12px 15px;
    }
    
    .pronunciation-btn, .record-btn, .stop-btn {
        font-size: 14px;
        padding: 12px 20px;
        min-width: 160px;
    }
    
    .word-part-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 55px;
    }
    
    .word-builder {
        min-height: 48px;
        padding: 12px;
    }
    
    .feedback-content {
        padding: 15px;
        font-size: 14px;
    }
}

/* 超小屏幕 (最小320px) */
@media (max-width: 374px) {
    .app-container {
        padding: 8px;
    }
    
    .header {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .user-info {
        font-size: 11px;
        gap: 8px;
    }
    
    .grade-btn, .mode-btn {
        padding: 12px;
        min-height: 75px;
    }
    
    .word-display {
        font-size: 26px;
    }
    
    .sentence-display {
        font-size: 16px;
    }
    
    .pronunciation-btn, .record-btn, .stop-btn {
        font-size: 12px;
        padding: 10px 15px;
        min-width: 140px;
    }
    
    .word-part-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 45px;
    }
    
    .answer-input {
        font-size: 16px;
        padding: 10px 12px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 15px;
        margin-bottom: 10px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .user-info {
        font-size: 12px;
    }
    
    .grade-selector, .mode-selector, .learning-container, .result-container {
        padding: 10px;
    }
    
    .word-display {
        font-size: 24px;
    }
    
    .grade-btn, .mode-btn {
        padding: 8px;
        min-height: 60px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .word-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .loading-spinner {
        border-width: 2px;
    }
}

/* 设备特定样式 */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.touch-device .grade-btn:hover,
.touch-device .mode-btn:hover,
.touch-device .answer-option:hover {
    transform: none; /* 触摸设备禁用hover效果 */
}

.ios-device {
    -webkit-overflow-scrolling: touch;
}

.ios-device input {
    border-radius: 0; /* 修复iOS圆角问题 */
    -webkit-appearance: none;
}

.landscape-mode .header {
    padding: 8px 15px;
}

.landscape-mode .grade-selector,
.landscape-mode .mode-selector {
    padding: 15px;
}

.portrait-mode .word-display {
    margin: 15px 0;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* 暗色模式支持 */
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .header {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
    
    .grade-btn, .mode-btn {
        background: rgba(45, 55, 72, 0.8);
        color: #e2e8f0;
        border-color: #4a5568;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .grade-btn, .mode-btn, .answer-option {
        border-width: 3px;
        font-weight: bold;
    }
    
    .word-display {
        text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    }
}

/* 打印样式 */
@media print {
    .header, .controls, .result-buttons {
        display: none !important;
    }
    
    .app-container {
        max-width: 100%;
        padding: 0;
    }
    
    .learning-container, .result-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .word-display, .sentence-display {
        color: #000 !important;
    }
}

/* 错误提示样式 */
.error-toast, .success-toast {
    font-family: inherit;
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* 性能优化 */
.grade-btn, .mode-btn, .answer-option, .word-part-btn {
    will-change: transform;
    backface-visibility: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}