* {
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

body {
    background: #f8f9fa !important;
    margin: 0;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar {
    height: 80px !important;
}

/* 主容器 */
.converter-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2rem;
    box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 2rem;
    transition: all 0.3s;
    margin-top: 70px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: #333;
    text-align: center;
}

.sub {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* 控制栏 */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    background: #f3f4f6;
    padding: 20px;
    border-radius: 1.5rem;
}

.upload-area {
    flex: 2;
    min-width: 200px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0D6EFD;
    color: white;
    padding: 12px 28px;
    border-radius: 60px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.upload-btn:hover {
    transform: scale(0.97);
}

#videoInput {
    display: none;
}

.format-panel {
    flex: 2;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.format-label {
    color: #374151;
    font-weight: 500;
}

.format-select {
    padding: 5px 16px;
    border-radius: 40px;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    font-weight: 500;
}

.action-buttons {
    align-items: center;
    margin-top: 14px;
    border-radius: 20px !important;
    gap: 12px;
    justify-content: flex-end;
}

.cleanbtn {
    color: #e74032 !important;
}

.btn {
    border: none;
    padding: 0px 20px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #cddfe7;
   
    height: 40px;
}

.btn-primary {
    background: #0D6EFD;
    color: white;
    border: none;
    padding: 0 20px;
    height: 40px;
    line-height: 40px;
}

.btn-primary:hover, .btn:hover {
    transform: scale(0.97);
}

/* 高级选项 */
.advanced-options {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-item label {
    font-size: 0.85rem;
    color: #374151;
}

.option-item select {
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: white;
    cursor: pointer;
}

/* 视频网格 */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.video-card {
    background: white;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: 1px solid #e5e7eb;
}

.video-card:hover {
    transform: translateY(-4px);
}

.card-header {
    padding: 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

.preview-area {
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 16px;
    position: relative;
}

.preview-video {
    max-width: 100%;
    max-height: 160px;
    border-radius: 8px;
    cursor: pointer;
}

.convert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 10;
}

.progress-text {
    color: white;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.progress-bar-container {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 10px;
    transition: width 0.3s;
    width: 0%;
}

.info-panel {
    padding: 12px;
    font-size: 0.8rem;
    background: white;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 8px;
}

.convert-status {
    color: #10b981;
    font-weight: 600;
}

.download-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    margin: 12px;
   
    transition: 0.2s;
}

.download-btn:hover {
    background: #059669;
    transform: scale(0.97);
}

.download-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 1rem;
}

footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.loading-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 40px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 640px) {
    .converter-container { padding: 1rem; }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .action-buttons { justify-content: stretch; }
    .btn { text-align: center; }
    .advanced-options { flex-direction: column; align-items: stretch; }
    .option-item { justify-content: space-between; }
}