/* 全局样式 */
:root {
    --primary-color: #3a6ea5;
    --secondary-color: #f0f7ff;
    --accent-color: #ff9e2c;
    --text-color: #333;
    --success-color: #4caf50;
    --warning-color: #ff9e2c;
    --danger-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* 工作流程步骤样式 */
.workflow-steps {
    margin: 15px 0;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    transition: var(--transition);
    opacity: 0.6;
}

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

.step-item.active {
    opacity: 1;
    background-color: rgba(58, 110, 165, 0.05);
    border-radius: 6px;
    padding: 12px 8px;
    margin: 4px 0;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 16px;
    color: #6c757d;
    transition: var(--transition);
}

.step-item .step-icon i.fa-check {
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    padding: 2px;
}

.step-item .step-icon i.fa-spinner {
    color: var(--primary-color);
    background: rgba(58, 110, 165, 0.1);
    border-radius: 50%;
    padding: 2px;
}

.step-item .step-icon i.fa-times {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    padding: 2px;
}

.step-content {
    flex: 1;
}

.step-content h6 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.step-content p {
    margin: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.step-content p i {
    font-size: 11px;
}

/* MP3预览区域样式 */
.mp3-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.audio-preview {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.audio-preview audio {
    border-radius: 6px;
    background: #f8f9fa;
}

.file-selection {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.file-selection .form-check {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
    transition: var(--transition);
}

.file-selection .form-check:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
}

.file-selection .form-check-input:checked + .form-check-label {
    color: var(--primary-color);
    font-weight: 500;
}

.file-selection .form-check-input:checked ~ * {
    border-color: var(--primary-color);
    background: rgba(58, 110, 165, 0.05);
}

#other-mp3-upload {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 2px dashed #dee2e6;
    margin-top: 10px;
}

.text-success {
    color: var(--success-color) !important;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 12px 30px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

/* 侧边栏样式 */
.sidebar {
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    color: white;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 步骤指示器 */
.steps-indicator {
    padding: 2rem 1.5rem;
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    z-index: 100;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    transition: var(--transition);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    position: relative;
}

.step:hover {
    background-color: rgba(255,255,255,0.1);
    opacity: 0.8;
    transform: translateX(5px);
}

.step:active {
    transform: translateX(3px) scale(0.98);
}

.step.active {
    opacity: 1;
    background-color: rgba(255,255,255,0.15);
}

.step.completed {
    opacity: 0.8;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.step.active .step-number {
    background-color: var(--accent-color);
    color: white;
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step-text {
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
}

.step::after {
    content: '›';
    opacity: 0;
    transition: var(--transition);
    font-size: 1.2rem;
    font-weight: bold;
}

.step:hover::after {
    opacity: 0.6;
    transform: translateX(2px);
}

/* 主内容区域 */
.main-content {
    padding: 2rem;
    background-color: #f8f9fa;
}

.content-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
}

.content-section.disabled {
    opacity: 0.7;
    background: #f8f9fa;
}

.content-section.waiting {
    opacity: 0.8;
    background: #f9f9f9;
    border-left: 4px solid var(--warning-color);
}

.content-section.disabled .section-header {
    background: #e9ecef;
    color: #6c757d;
}

.content-section.disabled .btn:not(.btn-success) {
    opacity: 0.5;
    cursor: not-allowed;
}

.content-section.disabled .btn.btn-success:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.content-section.highlight {
    animation: highlightPulse 3s ease-in-out;
    border: 2px solid var(--accent-color);
}

@keyframes highlightPulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
        border-color: var(--accent-color);
    }
    50% { 
        box-shadow: 0 0 0 20px rgba(255, 193, 7, 0);
        border-color: var(--accent-color);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
        border-color: transparent;
    }
}

.section-header {
    background: linear-gradient(135deg, var(--secondary-color), #e6f3ff);
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.section-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
}

/* 文件上传区域 */
.upload-area {
    padding: 3rem 2rem;
    text-align: center;
}

.upload-content {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    transition: var(--transition);
    cursor: pointer;
}

.upload-content:hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.upload-content.dragover {
    border-color: var(--accent-color);
    background-color: #fff8f0;
}

.upload-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-content h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.upload-progress {
    margin-top: 2rem;
}

.file-info {
    margin-top: 2rem;
    text-align: left;
}

.file-details p {
    margin-bottom: 0.5rem;
}

.content-preview {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 0.5rem;
}

/* 分析选项样式 */
.analysis-options {
    padding: 2rem;
}

.option-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.option-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(58, 110, 165, 0.1);
}

.option-card .form-check-input:checked ~ .form-check-label {
    color: var(--primary-color);
}

.option-card .form-check-input:checked ~ .form-check-label i {
    color: var(--accent-color);
}

.form-check-label {
    cursor: pointer;
    display: block;
    padding-left: 2rem;
}

.form-check-label i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.form-check-label strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.form-check-input {
    margin-top: 0.5rem;
}

/* 处理动画 */
.processing-animation {
    padding: 4rem 2rem;
    text-align: center;
}

.spinner-border {
    width: 4rem;
    height: 4rem;
}

.processing-text {
    margin-top: 2rem;
}

.processing-text p {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 结果编辑器 */
.result-editor {
    padding: 2rem;
}

.editor-toolbar {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.editor-content {
    margin-bottom: 1rem;
    height: 500px;
    overflow-y: auto;
}

.editor-textarea {
    min-height: 400px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.7;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    resize: vertical;
}

.editor-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(58, 110, 165, 0.25);
    outline: none;
}

.editor-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

/* 预览区域 */
.preview-controls {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background-color: var(--secondary-color);
}


/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    border-color: var(--primary-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #388e3c);
    border-color: var(--success-color);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #f57c00);
    border-color: var(--warning-color);
}

/* Toast消息样式 */
.toast {
    background-color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-header {
    background-color: var(--secondary-color);
    border-bottom: 1px solid #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        min-height: auto;
        margin-bottom: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .section-header {
        padding: 1.5rem 1rem;
    }
    
    .section-header h3 {
        font-size: 1.3rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-content {
        padding: 2rem 1rem;
    }
    
    .analysis-options {
        padding: 1rem;
    }
    
    .option-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .result-editor {
        padding: 1rem;
    }
    
    .editor-textarea {
        min-height: 300px;
    }
    
    
    .row > .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .sidebar-header {
        padding: 1.5rem 1rem;
    }
    
    .steps-indicator {
        padding: 1.5rem 1rem;
    }
    
    .section-header h3 {
        font-size: 1.3rem;
    }
    
    .upload-content i {
        font-size: 2rem;
    }
    
    .processing-animation {
        padding: 3rem 1rem;
    }
    
    .spinner-border {
        width: 3rem;
        height: 3rem;
    }
}

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

.content-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.upload-content.dragover {
    animation: pulse 1s infinite;
}

/* 滚动条样式 */
.content-preview::-webkit-scrollbar,
.editor-textarea::-webkit-scrollbar {
    width: 8px;
}

.content-preview::-webkit-scrollbar-track,
.editor-textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content-preview::-webkit-scrollbar-thumb,
.editor-textarea::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.content-preview::-webkit-scrollbar-thumb:hover,
.editor-textarea::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 上传状态样式 */
.upload-content.uploading {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
    position: relative;
}

/* 只对上传区域的背景层禁用pointer-events，不影响按钮 */
.upload-content.uploading > *:not(.btn):not(button) {
    pointer-events: none;
}

/* 确保按钮在任何状态下都可点击 */
.upload-content .btn,
.upload-content button,
#file-select-btn {
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative;
}

.upload-content.uploading .btn,
.upload-content.uploading button {
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative;
}

.upload-content.uploading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1;
    pointer-events: none;
}

.upload-content.success {
    border-color: var(--success-color);
    background-color: #f0fff4;
}

.upload-content.error {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.65;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* 加载状态 */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误状态 */
.error {
    border-color: var(--danger-color) !important;
    background-color: #fff5f5 !important;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 成功状态 */
.success {
    border-color: var(--success-color) !important;
    background-color: #f0fff4 !important;
}

.success-message {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 分析结果格式化样式 */
.analysis-result-formatted {
    line-height: 1.6;
}

.analysis-result-formatted .result-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.analysis-result-formatted .result-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.analysis-result-formatted .result-section h4 i {
    margin-right: 0.5rem;
}

.analysis-result-formatted .result-section p {
    margin-bottom: 0.8rem;
}

.analysis-result-formatted .result-section strong {
    color: var(--text-color);
    font-weight: 600;
}

.analysis-result-formatted .result-section ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.analysis-result-formatted .result-section li {
    margin-bottom: 0.3rem;
}

.analysis-result-formatted .suggestion-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.analysis-result-formatted .suggestion-item h5 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.analysis-result-formatted .suggestion-item h5 i {
    margin-right: 0.5rem;
}