:root {
    /* 主色调 - 保留黄色系 */
    --primary-color: #FFAB00;
    --primary-hover: #FF9500;
    --primary-light: #FFF4E0;
    --primary-dark: #CC8800;
    
    /* 深色系统 - 新增专业感 */
    --dark-bg: #1A1514;
    --dark-card: #2A241E;
    --dark-border: #3D352C;
    --dark-text: #F7F4EE;
    --dark-text-secondary: #C4B5A4;
    
    /* 基础色 */
    --secondary-color: #666666;
    --secondary-hover: #333333;
    --success-color: #52C41A;
    --danger-color: #FF4D4F;
    --warning-color: #FAAD14;
    
    /* 浅色模式 */
    --bg-color: #FAFAFA;
    --card-bg: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-color: #E5E5E7;
    
    /* 阴影系统 - 增强层次 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 40px rgba(255, 171, 0, 0.15);
    
    /* 圆角系统 */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* 动画时长 */
    --transition-fast: 0.2s;
    --transition-base: 0.3s;
    --transition-slow: 0.5s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 动画类 */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

/* 延迟动画 */
.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 标题字体 - 使用Poppins */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #FFAB00, #FF6F00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    transition: all var(--transition-base) cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    transition: all var(--transition-slow) ease;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.upload-area:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.upload-area:hover::before {
    width: 600px;
    height: 600px;
}

.upload-area.dragover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: scale(1.02);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.upload-subtext {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.format-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 20px;
}

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

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

.audio-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.info-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.waveform-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

#waveform {
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
}

#wave-timeline {
    width: 100%;
    height: 30px;
}

.controls {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.playback-controls,
.zoom-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base) cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.025em;
}

/* 按钮波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 171, 0, 0.25);
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #FF6F00);
    box-shadow: 0 6px 25px rgba(255, 171, 0, 0.35);
    transform: translateY(-3px) scale(1.02);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-icon:hover {
    background: #FFFBF0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-large svg {
    width: 20px;
    height: 20px;
}

.trim-settings,
.export-settings {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.trim-settings h3,
.export-settings h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
}

.time-input-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.time-input-group input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.time-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.1);
}

.time-input-group input[readonly] {
    background: var(--bg-color);
    cursor: not-allowed;
}

.trim-actions,
.export-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.option-group select,
.option-group input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.1);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loadingMessage {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    transform: translateX(400px);
    transition: all var(--transition-base) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
    max-width: 350px;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
    animation: toastBounce 0.5s ease;
}

@keyframes toastBounce {
    0% {
        transform: translateX(400px);
        opacity: 0;
    }
    70% {
        transform: translateX(-10px);
        opacity: 1;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

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

    header h1 {
        font-size: 2rem;
    }

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

    .audio-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    #waveform {
        height: 150px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .playback-controls,
    .zoom-controls {
        justify-content: center;
    }

    .time-inputs {
        grid-template-columns: 1fr;
    }

    .export-options {
        grid-template-columns: 1fr;
    }

    .trim-actions,
    .export-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .btn-icon {
        width: auto;
        flex: 1;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

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

    .subtitle {
        font-size: 1rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    #waveform {
        height: 120px;
    }
}

/* WaveSurfer区域边界高亮 */
.wavesurfer-region {
    border-left: 2px solid rgba(255, 171, 0, 0.8) !important;
    border-right: 2px solid rgba(255, 171, 0, 0.8) !important;
}

/* 边界handle高亮效果 */
.wavesurfer-handle {
    background-color: rgba(255, 171, 0, 0.8) !important;
    width: 2px !important;
}

.wavesurfer-handle:hover {
    background-color: rgba(255, 171, 0, 1) !important;
    box-shadow: 0 0 4px rgba(255, 171, 0, 0.5);
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }

    .upload-area.dragover {
        background: #1e293b;
    }

    .option-group select,
    .option-group input,
    .time-input-group input {
        background: #334155;
        color: var(--text-primary);
    }

    .btn-icon {
        background: var(--card-bg);
    }

    .btn-icon:hover {
        background: #334155;
    }
}