:root {
    --audio-purple: #8b5cf6;
    --audio-purple-light: #f5f3ff;
    --audio-purple-dark: #7c3aed;
}

.audio-editor-page {
    padding: 40px 20px;
    max-width: var(--small-width);
    margin: 0 auto;
}

.audio-editor-container {
    display: flex;
    gap: 30px;
}

.audio-editor-config {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.audio-editor-preview {
    flex: 2;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid var(--audio-purple);
}

.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    background: #f8fafc;
}

.upload-area:hover {
    border-color: var(--audio-purple);
    background: var(--audio-purple-light);
}

.upload-area.dragover {
    border-color: var(--audio-purple);
    background: var(--audio-purple-light);
    transform: scale(1.02);
}

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

.upload-area p {
    margin: 0 0 8px 0;
    color: #64748b;
    font-size: 14px;
}

.upload-tip {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--audio-purple-light);
    border-radius: 8px;
}

.file-icon {
    font-size: 32px;
}

.file-info {
    text-align: left;
}

.file-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.config-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.config-row .config-section {
    flex: 1;
    margin-bottom: 0;
}

.config-section {
    margin-bottom: 16px;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.button-row .btn-generate,
.button-row .btn-reset {
    flex: 1;
    margin-bottom: 0;
}

.config-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.config-section input[type="text"],
.config-section select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.2s;
    box-sizing: border-box;
}

.config-section input[type="text"]:focus,
.config-section select:focus {
    outline: none;
    border-color: var(--audio-purple);
    box-shadow: 0 0 0 3px var(--audio-purple-light);
}

.btn-generate {
    width: 100%;
    padding: 14px;
    background: var(--audio-purple);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.btn-generate:hover:not(:disabled) {
    background: var(--audio-purple-dark);
    transform: translateY(-1px);
}

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

.btn-reset {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #e2e8f0;
}

.result-section {
    margin-top: 10px;
}

.btn-download {
    width: 100%;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover:not(:disabled) {
    background: #059669;
}

.btn-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #94a3b8;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.preview-placeholder p {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
}

.audio-player {
    display: none;
}

.audio-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label {
    color: #64748b;
    font-weight: 500;
}

.info-item span:last-child {
    color: #1e293b;
    font-weight: 600;
}

.waveform-container {
    position: relative;
    height: 100px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
}

.waveform-container canvas {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 10;
    pointer-events: none;
}

.selection-start,
.selection-end {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    background: var(--audio-purple);
    cursor: ew-resize;
    z-index: 5;
}

.selection-start {
    border-radius: 3px 0 0 3px;
}

.selection-end {
    border-radius: 0 3px 3px 0;
}

.selection-highlight {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(139, 92, 246, 0.3);
    z-index: 2;
    cursor: move;
}

.timeline-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.timeline-btn {
    flex: 1;
    padding: 10px 12px;
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-btn:hover {
    background: var(--audio-purple-light);
    border-color: var(--audio-purple);
    color: var(--audio-purple);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.zoom-btn {
    padding: 8px 12px;
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: var(--audio-purple-light);
    border-color: var(--audio-purple);
    color: var(--audio-purple);
}

.zoom-controls input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}

.zoom-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--audio-purple);
    border-radius: 50%;
    cursor: pointer;
}

.scrollbar-container {
    margin-bottom: 15px;
}

.scrollbar-track {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
}

.scrollbar-thumb {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--audio-purple);
    border-radius: 4px;
    cursor: ew-resize;
}

.format-options {
    display: flex;
    gap: 8px;
}

.format-btn {
    padding: 8px 20px;
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.format-btn:hover {
    border-color: var(--audio-purple);
    color: var(--audio-purple);
}

.format-btn.active {
    background: var(--audio-purple-light);
    border-color: var(--audio-purple);
    color: var(--audio-purple);
}

.time-display {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

@media (max-width: 1024px) {
    .audio-editor-container {
        flex-direction: column;
    }
    
    .audio-editor-config,
    .audio-editor-preview {
        flex: none;
    }
}

@media (max-width: 768px) {
    .audio-editor-page {
        padding: 20px 15px;
    }
    
    .timeline-controls {
        flex-wrap: wrap;
    }
    
    .timeline-btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }
}