/* Speech Recognition Demo 样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    /*padding: 20px;*/
}

.speech-recognition-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 头部样式 */
.speech-recognition-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.speech-recognition-header h1 {
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 15px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.description {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主表单容器 */
.speech-recognition-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 文件上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f2ff 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.upload-area.dragover {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.upload-text p {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-text small {
    color: #6b7280;
    font-size: 1rem;
}

/* 已上传音频显示 */
.uploaded-audio {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
}

.audio-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.audio-meta {
    flex: 1;
}

.audio-name {
    display: block;
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.audio-size {
    display: block;
    color: #666;
    font-size: 0.9rem;
}

.remove-audio-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.remove-audio-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 18px rgba(255, 107, 107, 0.4);
}

.audio-player {
    width: 100%;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 设置区域 */
.settings-section {
    margin-bottom: 30px;
}

.settings-header h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.setting-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.setting-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.setting-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.setting-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 复选框样式 */
.setting-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
    display: inline-block;
    vertical-align: middle;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

input[type="checkbox"]:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

/* 操作按钮区域 */
.action-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.secondary-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.success-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.danger-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 状态显示区域 */
.status-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    background: linear-gradient(135d, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.progress-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 2px solid #e2e8f0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, .3) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .3) 50%,
        rgba(255, 255, 255, .3) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: move 1.5s linear infinite;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    color: #4a5568;
    font-weight: 600;
}

.progress-percent {
    color: #667eea;
    font-weight: 700;
}

/* 模型状态 */
.model-status {
    background: linear-gradient(135deg, #fff9e6 0%, #fef3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.model-info h4 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.model-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.model-details span {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #856404;
}

.model-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.model-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #ffca2c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.model-progress-text {
    text-align: center;
    color: #856404;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 结果区域 */
.result-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    padding: 30px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
}

.result-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #64748b;
}

.result-stats span {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.result-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #64748b;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
    min-height: 200px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-text {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    font-size: 1.1rem;
    line-height: 1.6;
    outline: none;
}

.timeline-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.timeline-time {
    font-family: monospace;
    color: #667eea;
    font-weight: 600;
    min-width: 80px;
}

.timeline-text {
    flex: 1;
    line-height: 1.5;
}

.raw-data {
    background: #1a1a1a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 400px;
    overflow: auto;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.result-action-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #4a5568;
}

.result-action-btn:hover {
    background: #f8fafc;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

/* 信息区域 */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.info-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.info-item h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.info-item ul {
    list-style: none;
    padding: 0;
}

.info-item li {
    padding: 8px 0;
    color: #4a5568;
    line-height: 1.5;
    position: relative;
    padding-left: 20px;
}

.info-item li::before {
    content: '•';
    color: #667eea;
    font-weight: 700;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .speech-recognition-container {
        padding: 15px;
    }
    
    .speech-recognition-form {
        padding: 25px;
        border-radius: 15px;
    }
    
    .speech-recognition-header h1 {
        font-size: 2.2rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .action-section {
        grid-template-columns: 1fr;
    }
    
    .speech-recognition-header h1 {
        font-size: 1.8rem;
    }
    
    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    
    .model-details {
        flex-direction: column;
        gap: 10px;
    }
}