/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 1em;
    opacity: 0.9;
}

/* 主内容 */
main {
    padding: 25px 30px;
}

/* 文件选择区域 */
.file-select-section {
    margin-bottom: 25px;
}

.file-select-area {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.file-select-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.file-select-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

/* 已选择文件信息 */
.selected-file-info {
    margin-top: 15px;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f0f8ff;
    border: 2px solid #667eea;
    border-radius: 10px;
}

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

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

.file-size {
    color: #666;
    font-size: 0.85em;
}

.btn-change-file {
    padding: 10px 20px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-change-file:hover {
    background: #667eea;
    color: white;
}

.upload-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 8px;
}

.upload-hint {
    color: #666;
    font-size: 0.85em;
}

/* 历史记录 */
.history-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

.history-section h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9ff;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #f0f2ff;
    transform: translateX(5px);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-filename {
    font-weight: 500;
    color: #333;
}

.history-status {
    font-size: 0.85em;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* 处理中页面 */
.processing-section {
    text-align: center;
}

.processing-animation {
    margin: 40px 0;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

.task-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

.task-info code {
    background: #e8ebff;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* 结果页面 */
.result-section {
    text-align: center;
}

.result-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

.download-section {
    margin: 40px 0;
}

.download-section h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.download-hint {
    color: #666;
    margin-bottom: 30px;
}

.download-actions {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.audio-preview {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 10px;
}

.preview-hint {
    color: #999;
    font-style: italic;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

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

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

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

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(17, 153, 142, 0.4);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1em;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9em;
}

.action-buttons {
    margin-top: 40px;
}

/* 底部 */
footer {
    background: #f8f9ff;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 30px 20px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 3em;
    }

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

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-large {
        padding: 15px 30px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    header .subtitle {
        font-size: 0.95em;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* 格式选择器 */
.format-selector-section {
    margin-bottom: 25px;
}

.format-selector-section h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
    color: #333;
}

.format-hint {
    color: #666;
    margin-bottom: 18px;
    font-size: 0.9em;
}

/* Tab 导航 */
.format-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.format-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.format-tab:hover {
    color: #667eea;
    background: #f8f9ff;
}

.format-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* Tab 内容 */
.format-tab-content {
    position: relative;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.format-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.format-option input[type="radio"]:checked+.format-label {
    color: #667eea;
    font-weight: 600;
}

.format-option input[type="radio"]:checked~.format-desc {
    color: #667eea;
}

.format-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f2ff 0%, #f8f9ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.format-label {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
}

.format-desc {
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

.format-option-wide {
    grid-column: 1 / -1;
}

/* 常用混音 checkbox 样式 */
.mix-hint {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
}

.mix-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.mix-checkbox-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mix-checkbox-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.mix-checkbox-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.mix-checkbox-option input[type="checkbox"]:checked + .checkbox-label {
    color: #667eea;
    font-weight: 600;
}

.mix-checkbox-option input[type="checkbox"]:checked ~ .checkbox-desc {
    color: #667eea;
}

.mix-checkbox-option:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f2ff 0%, #f8f9ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.checkbox-label {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
}

.checkbox-desc {
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

/* 开始处理按钮区域 */
.process-section {
    text-align: center;
    margin: 25px 0 20px;
    padding: 20px 0;
    border-top: 2px solid #f0f0f0;
}

.selected-format-display {
    margin-bottom: 15px;
    text-align: center;
}

.format-display-label {
    font-weight: 600;
    color: #333;
}

.format-display-value {
    color: #667eea;
    font-weight: 600;
    font-size: 1.05em;
}

.process-section .btn {
    min-width: 200px;
}

.process-section .btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.process-section .btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.process-hint {
    margin-top: 12px;
    color: #999;
    font-size: 0.85em;
}

/* 音频播放器 */
.audio-player-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9ff;
    border-radius: 12px;
}

.audio-player-section h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
}

.player-hint {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.audio-player {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
    outline: none;
}

.audio-player::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.file-info strong {
    color: #333;
    font-weight: 600;
}

/* 响应式:格式选择器 */
@media (max-width: 768px) {
    .format-options {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .format-option {
        padding: 12px 10px;
    }

    .format-label {
        font-size: 0.95em;
    }

    .format-desc {
        font-size: 0.8em;
    }

    .format-tabs {
        gap: 5px;
    }

    .format-tab {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .file-info-content {
        flex-direction: column;
        text-align: center;
    }

    .btn-change-file {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .format-options {
        grid-template-columns: 1fr 1fr;
    }

    .format-selector-section h2 {
        font-size: 1.5em;
    }

    .format-tabs {
        flex-wrap: wrap;
    }

    .format-tab {
        flex: 1;
        min-width: calc(50% - 5px);
    }
}