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

body {
    background-color: #fafafa;
    background-image: linear-gradient(#121212 220px, #fafafa 220px);
    background-repeat: no-repeat;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    margin: 0;
}


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

header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    color: #ffffff;
    border: none;
    padding-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.inline-icon {
    vertical-align: middle;
    margin-right: 8px;
}

.button-icon {
    margin-right: 8px;
    vertical-align: middle;
}

header p {
    font-size: 1.1rem;
    opacity: 0.7;
    font-weight: 300;
}

main {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 30px;
}

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

.upload-area {
    border: 2px dashed #000000;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #ffffff;
}

.upload-area:hover {
    border-color: #666666;
    background-color: #f8f8f8;
}

.upload-area.dragover {
    border-color: #000000;
    background-color: #f0f0f0;
}

.upload-content .upload-icon {
    margin-bottom: 20px;
    color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-content .upload-icon svg {
    width: 64px;
    height: 64px;
    stroke: #000000;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon svg {
    stroke: #333333;
    transform: scale(1.05);
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #000000;
    font-weight: 400;
}

.upload-content p {
    color: #666666;
    margin-bottom: 20px;
    font-weight: 300;
}

.upload-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
}

.upload-btn:hover {
    background: #333333;
}

.upload-btn:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.upload-btn:disabled:hover {
    background: #cccccc;
}

.init-message {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    text-align: center;
}

.init-message p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    font-weight: 400;
}

.loading-dots .dot1,
.loading-dots .dot2,
.loading-dots .dot3,
.loading-dots .dot4 {
    animation: loading 5s infinite;
}

.loading-dots .dot1 {
    animation-delay: 0s;
}

.loading-dots .dot2 {
    animation-delay: 1s;
}

.loading-dots .dot3 {
    animation-delay: 2s;
}

.loading-dots .dot4 {
    animation-delay: 3s;
}

@keyframes loading {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    80%, 100% {
        opacity: 0;
    }
}

.video-preview {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.video-preview h3 {
    margin-bottom: 15px;
    color: #000000;
    font-weight: 400;
}

.video-container {
    position: relative;
    margin-bottom: 15px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.video-player {
    position: relative;
    background: #000;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    height: 300px; /* 固定高度 */
}

.video-preview video {
    width: 100%;
    height: 100%; /* 填满容器高度 */
    display: block;
    background: #000;
    object-fit: contain; /* 保持宽高比，完整显示视频 */
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player:hover .video-controls {
    opacity: 1;
}

.play-button, .remove-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button:hover, .remove-button:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.play-button svg, .remove-button svg {
    width: 24px;
    height: 24px;
}

.video-duration {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.timeline-container {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-bottom: none;
    padding: 10px 15px;
    position: relative;
}

.timeline-ticks {
    position: relative;
    height: 20px;
}

.big-intervals, .small-intervals {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-repeat: repeat-x;
    background-position: 0 bottom;
}

.big-intervals {
    background-image: linear-gradient(to right, #ccc 1px, transparent 1px);
    z-index: 2;
}

.small-intervals {
    background-image: linear-gradient(to right, #e0e0e0 1px, transparent 1px);
    z-index: 1;
}

.time-delimiters {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.time-delimiter {
    position: absolute;
    bottom: -2px;
    transform: translateX(-50%);
    white-space: nowrap;
}

.progress-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%; /* 初始宽度为0 */
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 68, 68, 0.3) 0%, rgba(255, 68, 68, 0.2) 100%);
    border-radius: 4px;
    z-index: 2; /* 在轨道之上，但在手柄之下 */
    opacity: 0;
    transition: opacity 0.2s ease, width 0.1s ease;
    border-right: 2px solid #ff4444; /* 右边界显示当前播放位置 */
}

.progress-indicator.visible {
    opacity: 1;
}

.progress-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -4px; /* 在右边界位置 */
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px rgba(255, 68, 68, 0.7);
    border: 2px solid #ffffff;
}

.video-time-slider {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 15px;
}

.time-range-section {
    background: #ffffff;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #000000;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 15px;
}

.time-range-section h4 {
    margin-bottom: 15px;
    color: #000000;
    font-weight: 400;
    font-size: 1.1rem;
}

.time-range-section p {
    margin-bottom: 8px;
    color: #333333;
    font-weight: 300;
}

.time-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-input-row {
    display: flex;
    gap: 30px;
    align-items: center;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.time-input-group label {
    min-width: 80px;
    color: #333333;
    font-weight: 500;
}

.time-input-group input[type="time"] {
    padding: 2px 12px;
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
    color: #333333;
    min-width: 150px;
    transition: border-bottom-color 0.2s ease;
}

/* 隐藏时间选择器的AM/PM显示 */
.time-input-group input[type="time"]::-webkit-datetime-edit-ampm-field {
    display: none;
}

.time-input-group input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    display: flex;
}

.time-input-group input[type="time"]::-webkit-datetime-edit-hour-field,
.time-input-group input[type="time"]::-webkit-datetime-edit-minute-field,
.time-input-group input[type="time"]::-webkit-datetime-edit-second-field {
    padding: 0 2px;
}

/* 调整时间选择器的时钟图标，避免遮挡时间显示 */
.time-input-group input[type="time"]::-webkit-calendar-picker-indicator {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.time-input-group input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.time-input-group input[type="time"]:focus {
    outline: none;
    border-bottom-color: #000000;
}

.time-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Video Time Slider Styles */
.video-time-slider .time-slider-track {
    position: relative;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin: 12px 0 15px 0;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.time-slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    position: relative;
    z-index: 5;
}

.time-label-start, .time-label-end {
    position: absolute;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
    transform: translateX(-50%);
    z-index: 4;
}

.time-label-start:hover, .time-label-end:hover {
    background: rgba(0, 212, 170, 0.1);
    color: #00d4aa;
}

.time-label-start.dragging, .time-label-end.dragging {
    background: rgba(0, 212, 170, 0.2);
    color: #00c49a;
    transform: translateX(-50%) scale(1.05);
}



.video-time-slider .time-slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #00c49a);
    border-radius: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 212, 170, 0.2);
}

/* Tooltip styles for range selection */
.range-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.range-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.time-slider-handle:hover .range-tooltip {
    opacity: 1;
    visibility: visible;
}

.time-slider-handle.dragging .range-tooltip {
    opacity: 1;
    visibility: visible;
}

.video-time-slider .time-slider-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #00d4aa;
    border: 2px solid #ffffff;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
    z-index: 3;
}

.video-time-slider .time-slider-handle:hover {
    background: #00c49a;
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.video-time-slider .time-slider-handle:active,
.video-time-slider .time-slider-handle.dragging {
    cursor: pointer;
    background: #00c49a;
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 6px 16px rgba(0, 212, 170, 0.5);
}

.video-time-slider .time-slider-handle-start {
    z-index: 3;
    left: 0%;
}

.video-time-slider .time-slider-handle-end {
    z-index: 3;
    left: 100%;
}



/* Responsive adjustments */
@media (max-width: 600px) {
    .time-slider-handle {
        width: 24px;
        height: 24px;
    }
    

    
    /* 时间输入组件移动端优化 */
    .time-input-row {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .time-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .time-input-group label {
        min-width: auto;
        font-size: 14px;
    }
    
    .time-input-group input[type="time"] {
        width: 100%;
        min-width: auto;
        padding: 10px 12px;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
    }
    
    /* 移动端隐藏AM/PM */
    .time-input-group input[type="time"]::-webkit-datetime-edit-ampm-field {
        display: none;
    }
    
    /* 移动端调整时钟图标 */
    .time-input-group input[type="time"]::-webkit-calendar-picker-indicator {
        width: 18px;
        height: 18px;
        margin-left: 10px;
        opacity: 0.7;
    }
}

/* 视频错误占位符样式 */
.video-error-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.video-error-placeholder .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.video-error-placeholder .error-text h4 {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

.video-error-placeholder .error-text p {
    margin: 0;
    color: #888;
    font-size: 14px;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .video-error-placeholder .error-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .video-error-placeholder .error-text h4 {
        font-size: 14px;
    }
    
    .video-error-placeholder .error-text p {
        font-size: 12px;
    }
    
    /* 超小屏幕时间输入组件优化 */
    .time-input-group {
        gap: 6px;
    }
    
    .time-input-group label {
        font-size: 13px;
    }
    
    .time-input-group input[type="time"] {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .time-buttons {
        justify-content: center;
    }
}



.conversion-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.conversion-section h3 {
    margin-bottom: 20px;
    color: #000000;
    font-weight: 400;
}

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

.setting-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.setting-group label {
    margin-bottom: 0;
    font-weight: 400;
    color: #000000;
    white-space: nowrap;
}

.setting-group select {
    padding: 8px 12px;
    border: none;
    border-bottom: 2px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
    color: #333333;
    min-width: 120px;
    transition: border-bottom-color 0.2s ease;
}

.setting-group select:focus {
    outline: none;
    border-bottom-color: #000000;
}

.convert-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 400;
}

.convert-btn:hover {
    background: #333333;
}

.convert-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.progress-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.progress-section h3 {
    margin-bottom: 20px;
    color: #000000;
    font-weight: 400;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: #000000;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-fill.error {
    background: #666666;
}

.progress-fill.success {
    background: #000000;
}

.progress-text {
    text-align: center;
    color: #333333;
    font-weight: 400;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.progress-text.error {
    color: #666666;
}

.progress-text.success {
    color: #000000;
}

.refresh-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    margin: 10px auto;
}

.refresh-btn:hover {
    background: #333333;
}

.log-output {
    background: #000000;
    color: #ffffff;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.result-section {
    padding: 20px;
    background: #f8f8f8;
    border: 2px solid #000000;
    border-radius: 8px;
}

.result-section h3 {
    margin-bottom: 20px;
    color: #000000;
    text-align: center;
    font-weight: 400;
}

.audio-preview {
    text-align: center;
    margin-bottom: 25px;
}

.audio-preview audio {
    width: 100%;
    max-width: 500px;
}

.download-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.download-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
}

.download-btn:hover {
    background: #333333;
}

.reset-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
}

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

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 8px;
    line-height: 1.4;
}



@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .settings {
        grid-template-columns: 1fr;
    }
    
    .download-section {
        grid-template-columns: 1fr;
    }
}

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

.video-preview,
.conversion-section,
.progress-section,
.result-section {
    animation: fadeIn 0.5s ease;
}

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

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}





/* Features Section */
.features-section {
    background: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 20px 40px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.features-section:hover {
    border-color: #666666;
    background-color: #f8f8f8;
}

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

.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #000000;
    font-weight: 300;
    letter-spacing: -1px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #000000;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #000000, #333333);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    background: #000000;
    color: #ffffff;
}

.feature-icon svg {
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon svg {
    stroke: #ffffff;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #000000;
    font-weight: 500;
}

.feature-card p {
    color: #666666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Responsive adjustments for features */
@media (max-width: 768px) {
    .features-section {
        padding: 40px 20px;
        margin: 30px 0;
    }
    
    .features-section h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 20px;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
    }
    
    .feature-icon svg {
        width: 24px;
        height: 24px;
    }
}
