/* 导入通用样式 */
@import url('style.css');

/* ==================== 输入方式选择区 ==================== */
.input-mode-section {
    margin-bottom: 30px;
    text-align: center;
}

.input-mode-section h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 20px 30px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    color: #555;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.mode-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* ==================== 上传区域 ==================== */
.upload-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.file-info {
    color: #666;
    font-size: 0.95em;
    margin: 5px 0;
}

.selected-file-info {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #4caf50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selected-file-info p {
    margin: 5px 0;
    color: #333;
    font-size: 1em;
}

.selected-file-info strong {
    color: #667eea;
}

/* ==================== 录音区域 ==================== */
.record-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
}

.record-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.recording-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.recording-hint {
    color: #888;
    font-size: 0.9em;
    margin-top: 10px;
}

/* ==================== 操作按钮区 ==================== */
.action-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #667eea;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-hint {
    color: #888;
    font-size: 0.9em;
}

/* ==================== 翻译结果 ==================== */
.result-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    animation: slideIn 0.5s ease-out;
}

.result-section h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.translation-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.translation-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.translation-header .label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1em;
}

.translation-header .arrow {
    font-size: 2em;
    color: #667eea;
}

.translation-content {
    margin: 20px 0;
}

.translation-text {
    font-size: 1.3em;
    line-height: 1.8;
    color: #333;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.translation-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* ==================== 使用说明 ==================== */
.instruction-group {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.instruction-group h4 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.instruction-group ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instruction-group li {
    margin-bottom: 8px;
    color: #555;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .mode-selector {
        flex-direction: column;
        align-items: center;
    }

    .mode-btn {
        width: 100%;
        max-width: none;
    }

    .record-controls {
        flex-direction: column;
    }

    .translation-header {
        flex-direction: column;
        gap: 10px;
    }

    .translation-header .arrow {
        transform: rotate(90deg);
    }

    .translation-text {
        font-size: 1.1em;
    }

    .action-section {
        flex-direction: column;
    }

    .action-section .btn {
        width: 100%;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-section,
.record-section,
.result-section {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== 状态指示器增强 ==================== */
.status-indicator.recording::before {
    content: '🔴';
    margin-right: 8px;
}

.status-indicator.stopped::before {
    content: '✅';
    margin-right: 8px;
}

.status-indicator.loading::before {
    content: '⏳';
    margin-right: 8px;
}

/* ==================== 按钮悬停效果增强 ==================== */
.mode-btn .icon {
    font-size: 1.5em;
    transition: transform 0.3s ease;
}

.mode-btn:hover .icon {
    transform: scale(1.2);
}

.mode-btn.active .icon {
    animation: bounce 0.5s ease;
}

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

/* ==================== 翻译模式选择器 ==================== */
.translation-mode-section {
    margin-bottom: 30px;
    text-align: center;
}

.translation-mode-section h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.translation-mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-option:hover .mode-label {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.mode-option input[type="radio"]:checked + .mode-label {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.mode-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.mode-text {
    text-align: left;
    flex: 1;
}

.mode-text strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.mode-text small {
    display: block;
    opacity: 0.85;
    font-size: 0.85em;
}

.mode-option input[type="radio"]:not(:checked) + .mode-label .mode-text small {
    color: #666;
}

/* ==================== 音频播放器 ==================== */
.translation-audio {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    display: block;
    border-radius: 10px;
}

.translation-audio audio {
    width: 100%;
    height: 40px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .translation-mode-selector {
        flex-direction: column;
        align-items: center;
    }

    .mode-option {
        width: 100%;
        max-width: none;
    }

    .mode-label {
        padding: 15px;
    }

    .mode-icon {
        font-size: 2em;
    }
}
