:root {
    /* 主色调 - 现代化蓝色系 */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    
    /* 辅助色 */
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* 中性色 */
    --light: #ffffff;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space: 12px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    
    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    
    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    font-size: var(--text-sm);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Header - 现代化设计 */
.header {
    margin-bottom: 0;
    padding: var(--space) var(--space-md);
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.header-left {
    flex: 1;
    text-align: left;
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.025em;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs);
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.site-logo {
    max-height: 32px;
    border: none;
    outline: none;
    box-shadow: none;
    max-width: 100px;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter var(--transition-fast);
}

.site-logo:hover {
    filter: brightness(1);
}

/* 清理重复的样式定义 */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space);
    margin-bottom: var(--space-xs);
}

.logo-icon {
    font-size: var(--text-xl);
    color: var(--primary);
}

.page-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.025em;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    max-width: 400px;
    margin: var(--space-xs) auto 0;
    line-height: 1.4;
}

/* Main Layout - 现代化网格布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-md);
    flex: 1;
    min-height: 0;
}

/* Cards - 现代化设计 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: var(--space);
    padding-bottom: var(--space);
    border-bottom: 1px solid var(--border-light);
}

.card-title i {
    font-size: var(--text-base);
    color: var(--primary);
    background: var(--primary-50);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
}

/* Form Elements - 现代化设计 */
.form-group {
    margin-bottom: var(--space);
}

label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--gray-700);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

input, textarea, select {
    width: 100%;
    padding: var(--space) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--gray-800);
    font-family: inherit;
    line-height: 1.5;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.6;
}

/* Buttons - 现代化设计 */
button {
    width: 100%;
    padding: var(--space) var(--space-md);
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--gray-700);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

button:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Prompt and Image Layout */
.prompt-image-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    align-items: start;
}

.prompt-section {
    grid-column: 1;
}

.image-section {
    grid-column: 2;
}

/* Image Upload */
.image-upload-container {
    position: relative;
}

.image-section .image-upload-area {
    min-height: 80px;
    padding: 12px;
    font-size: 0.75rem;
}

.image-section .image-preview-container {
    padding: 8px;
}

.image-section #imagePreview {
    max-height: 60px;
    margin-bottom: 6px;
}

.image-section .image-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-section .image-controls-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-section .image-controls-vertical .btn-icon {
    padding: 4px 6px;
    min-width: 28px;
    height: 24px;
    font-size: 0.65rem;
}

.image-section #imagePreview {
    max-height: 60px;
    max-width: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* Video Controls */
.video-controls-horizontal {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.video-controls-horizontal .btn-icon {
    width: auto;
    padding: 6px 10px;
    min-width: 40px;
    height: 32px;
    font-size: 0.75rem;
}

.video-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.video-controls .btn-icon {
    width: auto;
    padding: 8px 12px;
    min-width: 40px;
    height: 36px;
    font-size: 0.8rem;
}

.image-upload-area {
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    min-height: 60px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.image-upload-area.dragover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.image-preview-container {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    background: var(--bg-secondary);
    margin-top: 8px;
}

#imagePreview {
    max-width: 100%;
    max-height: 80px;
    border-radius: 4px;
    display: block;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.image-controls {
    display: flex;
    gap: 8px;
}

.btn-small {
    width: auto;
    padding: 6px 12px;
    font-size: 0.75rem;
    flex: 1;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Model Selection */
.model-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-primary);
    color: #1a1a1a;
    cursor: pointer;
}

.model-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.model-info {
    margin-top: 12px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.model-param {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.model-param:last-child {
    margin-bottom: 0;
}

.param-label {
    color: var(--gray-600);
    font-weight: 500;
}

/* History Controls */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-controls {
    display: flex;
    gap: 8px;
}

.history-controls .btn-small {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.history-item-controls {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.history-item-controls .btn-small {
    padding: 2px 6px;
    font-size: 0.65rem;
    flex: 1;
}

/* Icon Buttons */
.btn-icon {
    width: auto;
    padding: 6px 8px;
    font-size: 0.7rem;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

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

.option-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

.option-buttons {
    display: flex;
    gap: 6px;
}

.option-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    text-align: center;
}

.option-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.option-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.option-btn i {
    margin-right: 3px;
    font-size: 0.7rem;
}

/* Status Messages */
.status {
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    text-align: center;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

.status.loading {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.status.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

/* Progress - 现代化进度条 */
.progress-container {
    margin: var(--space) 0;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: var(--space);
    border: 1px solid var(--border-light);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: var(--bg-gradient);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius);
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 进度条动画效果 */
.progress.animate {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Multi-task Progress */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.task-prompt {
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.task-status {
    color: var(--gray-500);
    font-size: 0.7rem;
}

.task-progress {
    height: 2px;
    background: var(--gray-200);
    border-radius: 1px;
    overflow: hidden;
}

.task-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 1px;
}

/* Result Section */
#resultContainer {
    margin-top: 0;
    display: none;
}

#videoResult {
    width: 100%;
    border-radius: 6px;
    background: #000;
    margin-bottom: 12px;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow);
}

/* Sidebar Video Preview */
.sidebar-panel {
    position: relative;
}

.sidebar-panel #resultContainer {
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
}

.sidebar-panel #videoResult {
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
}

/* Video Info and Controls Layout */
.video-info-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.video-info-compact {
    font-size: 0.75rem;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.video-info-compact span {
    margin-right: 8px;
}

.video-info-compact span:last-child {
    margin-right: 0;
}

.sidebar-panel .video-controls-horizontal {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.sidebar-panel .video-controls-horizontal .btn-icon {
    padding: 4px 6px;
    font-size: 0.65rem;
    min-width: 30px;
    height: 24px;
}

.sidebar-panel .history-progress-list {
    margin-top: 16px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

/* Ensure content fits in one page */
.app-container {
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 80px);
    overflow: hidden;
}

.sidebar-panel {
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-panel .card {
    flex-shrink: 0;
}

.sidebar-panel .history-progress-list {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

/* Optimize layout for better fit */
.generation-panel {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Reduce padding and margins for better space utilization */
.card {
    padding: 12px;
}

.prompt-image-container {
    gap: 12px;
}

.options-grid {
    gap: 6px;
    margin-bottom: 8px;
}

.option-group {
    gap: 3px;
}

.option-buttons {
    gap: 4px;
}

.option-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
}

.progress-container {
    margin: 8px 0;
}

.video-info-controls {
    margin-top: 8px;
}

.history-progress-item {
    padding: 8px;
    margin-bottom: 8px;
}

.history-progress-header {
    margin-bottom: 4px;
}

.history-progress-content {
    gap: 6px;
}

.history-thumbnail {
    width: 45px;
    height: 32px;
}

.history-progress-actions .btn-icon {
    padding: 2px 4px;
    font-size: 8px;
    min-width: 26px;
    height: 22px;
}

.video-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* 历史记录滚动列表样式 - 现代化设计 */
.history-progress-list {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    margin-top: var(--space);
    padding-right: var(--space-xs);
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) var(--gray-100);
}

.history-progress-list::-webkit-scrollbar {
    width: 6px;
}

.history-progress-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

.history-progress-list::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius);
}

.history-progress-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}



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

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

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

.history-progress-time {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    text-align: left;
}

.history-progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.history-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
}

.history-progress-percent {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-bottom: 8px;
}

.history-progress-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-thumbnail {
    width: 50px;
    height: 35px;
    border-radius: 4px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-thumbnail:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.history-thumbnail i {
    font-size: 14px;
}

.history-progress-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.history-progress-actions .btn-icon {
    padding: 3px 5px;
    font-size: 9px;
    min-width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 历史记录项样式 */
.history-item {
    display: flex;
    align-items: center;
    gap: var(--space);
    padding: var(--space) var(--space-md);
    margin-bottom: var(--space-xs);
    background: var(--gray-50);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    min-height: 60px;
    cursor: pointer;
}

.history-item:hover {
    background: var(--gray-100);
    border-color: var(--primary-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.history-item.active {
    border-color: var(--primary);
    background: var(--primary-50);
    box-shadow: 0 0 0 1px var(--primary-200);
}

.history-thumbnail {
    width: 48px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.history-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.history-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.history-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
}

.history-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.3;
}

.history-status {
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--success);
    color: white;
    border: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.history-status.processing {
    background: var(--warning);
}

.history-status.failed {
    background: var(--error);
}

.history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
}

.history-time {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
}

.history-actions {
    display: flex;
    gap: var(--space-xs);
}

.history-actions .btn-icon {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
    min-width: 28px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--gray-600);
}

.history-actions .btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Remember Key */
.remember-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

#rememberKey {
    margin: 0;
    width: auto;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }
    
    .header {
        padding: 16px 12px;
        margin-bottom: 16px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .card {
        padding: 12px;
        border-radius: 6px;
    }
    
    .option-buttons {
        flex-direction: column;
    }
    
    .video-controls {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

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

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Remember Key */
.remember-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

#rememberKey {
    margin: 0;
    width: auto;
    transform: scale(1.1);
}

/* 生成按钮发光效果 */
.glow {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
}

/* 生成中状态 */
.generating {
    background: var(--primary-dark) !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* 修复缺失的选择器 */
.history-thumbnail img {
    background: #000;
    object-fit: cover;
}

.history-prompt {
    font-weight: 500;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a1a;
    font-size: 0.75rem;
    line-height: 1.2;
}

.history-controls {
    margin-top: 6px;
}

.history-controls button {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.7rem;
    margin-top: 4px;
}