* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

/* 提示条样式 */
.prompt-section {
    font-size: 18px;
    padding-right: 50px; /* 为可折叠语言按钮留出少量空间 */
}

.highlight {
    color: #e74c3c;
    font-weight: bold;
    font-size: 24px;
    transition: all 0.5s ease;
}

/* 单词显示区域样式 */
.word-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    min-height: 100px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    position: relative;
}

.word {
    width: 33.33%;
    padding: 10px;
    text-align: center;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    transition: all 0.3s ease;
}

.prev-word, .next-word {
    width: 20%;
    font-size: 12px !important;
    color: #7f8c8d;
    padding: 5px;
    white-space: normal;
    line-height: 1.2;
    min-height: 100px;
    overflow-y: auto;
    max-height: 150px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.current-word {
    width: 60%;
    font-size: 16px !important;
    font-weight: bold;
    color: #2c3e50;
    background-color: #d4e6f1;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 10px;
    white-space: normal;
    line-height: 1.4;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 波形条样式 */
.waveform-section {
    height: 200px;
    position: relative;
    overflow: hidden;
}

#waveform {
    height: 150px;
    background-color: #f9f9f9;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

#waveform canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.time-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* 按钮区样式 */
.button-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

#redo-btn {
    order: 1;
    min-width: 120px;
}
#record-btn {
    order: 2;
    min-width: 180px;
    font-size: 22px;
    padding-left: 40px;
    padding-right: 40px;
}
#next-btn {
    order: 3;
    min-width: 120px;
}

.btn {
    border: none;
    border-radius: 32px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-weight: 500;
    padding: 15px 32px;
}

.record-btn {
    background-color: #e74c3c;
    color: #fff;
}
.record-btn.recording {
    background-color: #27ae60;
    color: #fff;
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
    }

.redo-btn, .next-btn {
    background-color: #bdc3c7;
    color: #fff;
}
.redo-btn.enabled, .next-btn.enabled {
    background-color: #1e88e5;
    color: #fff;
}
.btn:disabled {
    background-color: #bdc3c7;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 提示区样式 */
.hint-section {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

/* 进度条样式 */
#progress-container {
    margin-top: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .section {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .word-section {
        flex-direction: row;
        min-height: 80px;
        padding: 10px 5px;
        margin: 10px 0;
    }
    
    .word {
        height: 60px;
        font-size: 16px;
        padding: 5px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .current-word {
        font-size: 20px;
    }
    
    .prev-word, .next-word {
        font-size: 14px;
    }
    
    .button-section {
        flex-direction: row;
        gap: 5px;
        padding: 15px 10px;
    }

    .btn {
        width: auto;
        padding: 6px 10px;
        font-size: 12px;
    }

    .record-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .prompt-section {
        font-size: 16px;
        padding-right: 45px; /* 移动端为可折叠语言按钮留出少量空间 */
    }
    
    .highlight {
        font-size: 20px;
    }
    
    .waveform-section {
        height: 150px;
    }
    
    #waveform {
        height: 100px;
    }
}

/* 加载指示器 */
.loading-indicator {
    padding: 10px;
    color: #e74c3c;
    font-weight: bold;
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.message.success {
    background-color: #2ecc71;
}

.message.error {
    background-color: #e74c3c;
}

.message.info {
    background-color: #3498db;
}

.message.warning {
    background-color: #f39c12;
} 

#prev-word, #next-word {
  display: none !important;
}

/* ==================== 反馈功能样式 ==================== */

/* 浮动反馈按钮 */
.feedback-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    outline: none;
}

.feedback-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.feedback-floating-btn:active {
    transform: scale(0.95);
}

/* 反馈模态框 */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.feedback-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 模态框头部 */
.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.feedback-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.feedback-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* 模态框主体 */
.feedback-modal-body {
    padding: 24px;
}

.feedback-form-group {
    margin-bottom: 20px;
}

.feedback-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.feedback-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.feedback-select:focus {
    outline: none;
    border-color: #667eea;
}

.feedback-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.feedback-textarea::placeholder {
    color: #999;
}

/* 错误和成功消息 */
.feedback-error-msg {
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    font-size: 14px;
    margin-top: 10px;
}

.feedback-success-msg {
    padding: 12px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 6px;
    color: #3c3;
    font-size: 14px;
    margin-top: 10px;
}

/* 模态框底部 */
.feedback-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
}

.feedback-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.feedback-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feedback-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feedback-btn-primary:active {
    transform: translateY(0);
}

.feedback-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.feedback-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.feedback-btn-secondary:hover {
    background: #e0e0e0;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .feedback-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .feedback-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .feedback-modal-header {
        padding: 16px 20px;
    }

    .feedback-modal-body {
        padding: 20px;
    }

    .feedback-modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }

    .feedback-btn {
        width: 100%;
    }
}