/* 音频分类组件样式 */
.audio-classification-container {
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background-color: #f0f2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 1.5em;
    color: #ddd;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    font-size: 1.0em;
    margin-bottom: 10px;
}

.upload-hint {
    color: #999;
    font-size: 0.8em;
}

#fileInput {
    display: none;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 音频控制按钮样式 */
.audio-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.btn-record {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.btn-play {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.btn-stop {
    background: linear-gradient(135deg, #ffa726, #ff9800);
}

/* 录制状态样式 */
.recording-status {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #dc3545;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: #dc3545;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.1s ease;
}

.recording-time {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    font-weight: bold;
}

.result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 15px;
    display: none;
    text-align: left;
}

.result.success {
    background-color: #f0f9ff;
    border: 2px solid #0ea5e9;
}

.result.error {
    background-color: #fef2f2;
    border: 2px solid #ef4444;
}

.result h3 {
    margin-bottom: 15px;
    color: #333;
}

.classification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.classification-item:last-child {
    border-bottom: none;
}

.confidence-bar {
    width: 100px;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-left: 10px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.loading {
    display: none;
    margin: 20px 0;
}

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

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

.file-info {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    display: none;
}

/* 音声認識结果样式 */
.transcription-result {
    margin-top: 20px;
    text-align: left;
}

.transcription-text {
    margin-bottom: 20px;
    text-align: left;
}

.transcription-text h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.transcription-text-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.transcription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    font-weight: 700;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .audio-classification-container {
        padding: 20px;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .transcription-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .detail-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

/* 改进的 Loading 样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    margin: 20px 0;
}

.loading-text h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.loading-text p {
    margin: 0 0 20px 0;
    opacity: 0.9;
    font-size: 1em;
}

.loading-progress {
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: block;
    text-align: center;
    font-size: 0.9em;
    opacity: 0.9;
}

/* 改进的结果显示样式 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.result-status {
    font-size: 0.9em;
    font-weight: 600;
}

.status-success {
    color: #4CAF50;
    background: #e8f5e8;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #4CAF50;
}

.status-error {
    color: #f44336;
    background: #ffebee;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #f44336;
}

.transcription-text-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 15px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
}

.api-response-details {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.api-response-details h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.detail-value {
    font-weight: 500;
    color: #212529;
}

.detail-value.confidence {
    color: #28a745;
    font-weight: 600;
}

.detail-value.language {
    color: #007bff;
    font-weight: 600;
}

.detail-value.duration {
    color: #6f42c1;
    font-weight: 600;
}

.raw-response {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.raw-response h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.json-response {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.error-content {
    padding: 20px;
    background: #fff5f5;
    border-radius: 10px;
    border: 1px solid #fed7d7;
}

.error-message h4 {
    color: #e53e3e;
    margin: 0 0 10px 0;
}

.error-text {
    color: #c53030;
    font-weight: 500;
    margin: 0 0 20px 0;
}

.error-suggestions h4 {
    color: #2d3748;
    margin: 0 0 10px 0;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 20px;
    color: #4a5568;
}

.error-suggestions li {
    margin: 5px 0;
    line-height: 1.5;
}

/* 简化的音声認識结果显示样式 */
.simple-details {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.simple-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin: 8px 0;
}

.simple-details .detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.simple-details .detail-value {
    font-weight: 500;
    color: #212529;
    font-size: 0.95em;
}

.simple-details .detail-value.language {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.simple-details .detail-value.duration {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.simple-details .detail-value.speakers {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 話者別の文字起こし表示スタイル */
.speaker-utterance {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    text-align: left;
}

.speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.speaker-name {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

.speaker-time {
    font-size: 0.9em;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
}

.speaker-text {
    color: #212529;
    line-height: 1.6;
    font-size: 1em;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}
