/* ============================================================
   泽盛赋能 - AI短剧创作平台 (PHP版)
   style.css - 完整样式表
   ============================================================ */

/* ============ CSS Variables ============ */
:root {
    --bg: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --bg-elevated: #27272a;
    --bg-input: #1a1a1e;
    --border: #27272a;
    --border-hover: #3f3f46;
    --foreground: #fafafa;
    --muted: #71717a;
    --muted-foreground: #a1a1aa;
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-foreground: #09090b;
    --secondary: #27272a;
    --secondary-hover: #3f3f46;
    --accent: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --info: #3b82f6;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --font-sans: 'DM Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.2s ease;
}

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img, video { max-width: 100%; display: block; }
::selection { background: var(--accent-soft); color: var(--primary); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============ Container ============ */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ============ Typography ============ */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
.text-gradient-amber {
    background: linear-gradient(135deg, #f59e0b, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }

/* ============ Navbar ============ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    padding: 0 16px;
}
.navbar.scrolled { border-bottom-color: var(--border); background: rgba(9, 9, 11, 0.9); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.navbar-brand { display: flex; align-items: center; gap: 8px; }
.navbar-brand .brand-icon { color: var(--primary); }
.brand-text { font-weight: 700; font-size: 1rem; color: var(--foreground); }
.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* ============ Buttons ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: var(--font-sans); font-weight: 500; font-size: 0.875rem;
    padding: 8px 16px; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; transition: var(--transition); white-space: nowrap;
    text-decoration: none; line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--bg-elevated); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--muted-foreground); border: none; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--foreground); }
.btn-ghost.active { background: var(--accent-soft); color: var(--primary); }
.btn-secondary { background: var(--secondary); color: var(--foreground); }
.btn-secondary:hover:not(:disabled) { background: var(--secondary-hover); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }
.glow-amber { box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.glow-amber:hover { box-shadow: 0 0 30px rgba(245, 158, 11, 0.4); }

/* ============ Forms ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 12px; font-size: 0.875rem;
    background: var(--bg-input); color: var(--foreground);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-sans); transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ============ Badge ============ */
.badge {
    display: inline-flex; align-items: center; padding: 2px 8px;
    font-size: 0.6875rem; font-weight: 500; border-radius: 999px;
    background: var(--accent-soft); color: var(--primary);
}
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted-foreground); }
.badge-scene { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }

/* ============ Alert ============ */
.alert {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    border-radius: var(--radius); font-size: 0.875rem;
}
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }

/* ============ Hero Section ============ */
.hero-section {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    justify-content: center; overflow: hidden; padding-top: 56px;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.15; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(9,9,11,0.5), var(--bg)); }
.hero-content { position: relative; text-align: center; max-width: 700px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 999px; font-size: 0.8125rem;
    background: var(--accent-soft); color: var(--primary);
    margin-bottom: 24px; font-weight: 500;
}
.hero-title { font-size: 3.5rem; font-weight: 700; line-height: 1.15; margin-bottom: 20px; }
.hero-desc { font-size: 1.125rem; color: var(--muted-foreground); line-height: 1.7; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============ Stages Section (Home) ============ */
.stages-section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; margin-bottom: 8px; }
.section-header p { color: var(--muted-foreground); font-size: 1.0625rem; }
.stages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.stage-card {
    position: relative; border-radius: var(--radius-xl); overflow: hidden;
    border: 1px solid var(--border); height: 280px;
    transition: var(--transition); cursor: default;
}
.stage-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stage-card-bg { position: absolute; inset: 0; }
.stage-card-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.2; transition: var(--transition); }
.stage-card:hover .stage-card-bg img { opacity: 0.3; }
.stage-card-content {
    position: relative; height: 100%; display: flex; flex-direction: column;
    justify-content: flex-end; padding: 24px;
    background: linear-gradient(to top, rgba(9,9,11,0.95) 30%, transparent);
}
.stage-icon-wrap { margin-bottom: 12px; color: var(--primary); }
.stage-number { font-size: 0.6875rem; font-weight: 600; color: var(--primary); letter-spacing: 2px; text-transform: uppercase; }
.stage-info h3 { font-size: 1.25rem; margin: 4px 0 6px; }
.stage-info p { font-size: 0.8125rem; color: var(--muted-foreground); }

/* ============ Footer ============ */
.site-footer { padding: 40px 0; text-align: center; border-top: 1px solid var(--border); }
.site-footer p { color: var(--muted); font-size: 0.8125rem; }

/* ============ Page Container ============ */
.page-container { max-width: 1280px; margin: 0 auto; padding: 80px 24px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-title { font-size: 1.75rem; }
.page-subtitle { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 4px; }
.page-header-actions { display: flex; gap: 8px; }

/* ============ Projects Grid ============ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.project-card-new {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; min-height: 280px; border: 2px dashed var(--border);
    border-radius: var(--radius-xl); cursor: pointer; background: transparent;
    color: var(--muted-foreground); font-family: var(--font-sans); font-size: 0.9375rem;
    transition: var(--transition);
}
.project-card-new:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }
.new-project-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); }
.project-card {
    border-radius: var(--radius-xl); overflow: hidden; background: var(--bg-card);
    border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.project-card-cover { position: relative; height: 160px; background: var(--bg-elevated); overflow: hidden; }
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-card-cover-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.project-card-delete {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
    border-radius: 50%; background: rgba(0,0,0,0.6); border: none;
    color: var(--muted-foreground); cursor: pointer; display: flex;
    align-items: center; justify-content: center; opacity: 0; transition: var(--transition);
}
.project-card:hover .project-card-delete { opacity: 1; }
.project-card-delete:hover { background: var(--danger); color: white; }
.project-card-body { padding: 16px; }
.project-card-body h3 { font-size: 1.0625rem; margin-bottom: 4px; }
.project-card-desc { font-size: 0.8125rem; color: var(--muted-foreground); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card-meta { display: flex; gap: 16px; font-size: 0.75rem; color: var(--muted); margin-bottom: 12px; }
.project-card-meta span { display: flex; align-items: center; gap: 4px; }
.project-card-episodes { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ Empty State ============ */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 80px 20px; text-align: center; color: var(--muted-foreground);
}
.empty-icon { color: var(--muted); }
.empty-state h3 { font-size: 1.25rem; color: var(--foreground); }
.stage-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 80px 20px; text-align: center; color: var(--muted-foreground);
    min-height: 400px;
}
.stage-empty-state h3 { color: var(--foreground); }

/* ============ Modal ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); width: 90%; max-width: 560px;
    max-height: 85vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg); transform: scale(0.95); transition: var(--transition);
}
.modal-overlay.active .modal-container { transform: scale(1); }
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 800px; }
.modal-header-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header-bar h2 { font-size: 1.0625rem; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tab-btn {
    padding: 10px 16px; font-size: 0.8125rem; font-weight: 500;
    color: var(--muted-foreground); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-family: var(--font-sans); transition: var(--transition);
}
.tab-btn:hover { color: var(--foreground); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ Settings ============ */
.settings-modal { max-width: 600px; }
.settings-section { margin-bottom: 24px; }
.settings-section h3 { font-size: 0.9375rem; margin-bottom: 12px; }
.settings-section-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.settings-section-header h3 { margin-bottom: 2px; }
.settings-section-header p { font-size: 0.8125rem; color: var(--muted-foreground); }
.settings-icon {
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-icon.text-api { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.settings-icon.text-image { background: rgba(168, 85, 247, 0.1); color: #c084fc; }
.settings-icon.text-video { background: rgba(34, 197, 94, 0.1); color: #4ade80; }

/* ============ Editor Layout ============ */
.editor-body { overflow: hidden; }
.editor-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 48px; background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px;
}
.editor-header-left, .editor-header-right { display: flex; align-items: center; gap: 8px; }
.editor-brand { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.875rem; }
.editor-brand .brand-icon { color: var(--primary); }
.editor-breadcrumb { font-size: 0.8125rem; color: var(--muted-foreground); }
.editor-breadcrumb-current { font-size: 0.8125rem; color: var(--foreground); font-weight: 500; }
.editor-main { display: flex; height: calc(100vh - 48px); margin-top: 48px; }

/* ============ Editor Sidebar ============ */
.editor-sidebar {
    width: 240px; min-width: 240px; background: var(--bg-card);
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    overflow-y: auto;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.sidebar-label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav { flex: 1; padding: 0 8px; }
.stage-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: none; background: transparent;
    border-radius: var(--radius); cursor: pointer; text-align: left;
    font-family: var(--font-sans); transition: var(--transition);
    margin-bottom: 2px; color: var(--muted-foreground);
}
.stage-btn:hover { background: var(--bg-elevated); color: var(--foreground); }
.stage-btn.active { background: var(--accent-soft); color: var(--primary); }
.stage-btn.completed { color: var(--success); }
.stage-btn-icon { width: 32px; height: 32px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); flex-shrink: 0; }
.stage-btn.active .stage-btn-icon { background: rgba(245, 158, 11, 0.15); }
.stage-btn-info { display: flex; flex-direction: column; overflow: hidden; }
.stage-btn-number { font-size: 0.625rem; font-weight: 600; letter-spacing: 1px; opacity: 0.6; }
.stage-btn-title { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-btn-subtitle { font-size: 0.6875rem; opacity: 0.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Episode List ============ */
.sidebar-episodes { border-top: 1px solid var(--border); padding: 8px; }
.episode-list { max-height: 200px; overflow-y: auto; }
.episode-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-radius: var(--radius); cursor: pointer;
    font-size: 0.8125rem; color: var(--muted-foreground); transition: var(--transition);
}
.episode-item:hover { background: var(--bg-elevated); color: var(--foreground); }
.episode-item.active { background: var(--accent-soft); color: var(--primary); }
.episode-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Editor Content ============ */
.editor-content { flex: 1; overflow-y: auto; background: var(--bg); }
.stage-content-scroll { padding: 24px; }

/* ============ Stage Layout (Script) ============ */
.stage-layout { display: flex; gap: 0; padding: 0; min-height: 100%; height: calc(100vh - 48px); position: relative; }
.stage-sidebar-config {
    width: 320px; min-width: 320px; flex-shrink: 0;
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    height: 100%; overflow: hidden;
}
.stage-main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.config-title { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; margin-bottom: 16px; color: var(--foreground); }
.section-title-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title-bar h3 { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }

/* ============ Script Editor ============ */
.script-editor-section { margin-bottom: 24px; }
.script-textarea {
    width: 100%; min-height: 300px; padding: 16px;
    background: var(--bg-input); color: var(--foreground);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    font-family: var(--font-sans); font-size: 0.9375rem;
    line-height: 1.7; resize: vertical; transition: var(--transition);
}
.script-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-section { margin-bottom: 24px; }
.synopsis-text { font-size: 0.9375rem; color: var(--muted-foreground); line-height: 1.7; padding: 16px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.progress-text { font-size: 0.8125rem; color: var(--primary); margin-top: 8px; text-align: center; }

/* ============ Cards ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mini-card { padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.mini-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-card-desc { font-size: 0.8125rem; color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ============ Shots List ============ */
.shots-list { display: flex; flex-direction: column; gap: 8px; }
.shot-card { padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.shot-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.shot-number { font-size: 0.6875rem; font-weight: 700; color: var(--primary); font-family: var(--font-mono); }
.shot-action { font-size: 0.875rem; color: var(--foreground); }
.shot-dialogue { font-size: 0.8125rem; color: var(--muted-foreground); font-style: italic; margin-top: 6px; }

/* ============ Resource Cards (Casting) ============ */
.resource-section { margin-bottom: 32px; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.resource-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.resource-card:hover { border-color: var(--border-hover); }
.resource-card-image { height: 180px; background: var(--bg-elevated); cursor: pointer; overflow: hidden; }
.resource-card-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.resource-card-image:hover img { transform: scale(1.05); }
.resource-card-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.resource-card-body { padding: 12px; }
.resource-card-body h4 { font-size: 0.9375rem; margin-bottom: 4px; }
.resource-card-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.empty-hint { text-align: center; padding: 40px; color: var(--muted-foreground); }

/* ============ Progress Bar ============ */
.progress-bar-container { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 16px 0; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.progress-bar { flex: 1; height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s ease; width: 0%; }

/* ============ Storyboard ============ */
.storyboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.storyboard-header h3 { display: flex; align-items: center; gap: 8px; }
.storyboard-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.storyboard-shot-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.storyboard-shot-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.grid-image-area { margin: 12px 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-elevated); min-height: 200px; }
.grid-image { width: 100%; cursor: pointer; transition: var(--transition); }
.grid-image:hover { opacity: 0.9; }
.grid-placeholder { height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }

/* ============ Director ============ */
.director-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.director-header h3 { display: flex; align-items: center; gap: 8px; }
.director-actions { display: flex; gap: 8px; }
.director-shots { display: flex; flex-direction: column; gap: 16px; }
.director-shot-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.director-shot-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.keyframes-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
.keyframe-card { text-align: center; }
.keyframe-label { font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); margin-bottom: 6px; }
.keyframe-image { height: 140px; background: var(--bg-elevated); border-radius: var(--radius); overflow: hidden; cursor: pointer; margin-bottom: 8px; }
.keyframe-image img { width: 100%; height: 100%; object-fit: cover; }
.keyframe-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.video-preview, .video-preview-lg { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* ============ Export ============ */
.export-section { text-align: center; padding: 40px 0; }
.export-header { margin-bottom: 40px; }
.export-header h2 { font-size: 1.75rem; margin: 16px 0 8px; }
.export-header p { color: var(--muted-foreground); }
.export-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8125rem; color: var(--muted-foreground); }
.export-videos { margin-bottom: 40px; text-align: left; }
.export-videos h3 { margin-bottom: 16px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.video-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.video-card video { height: 200px; }
.video-card-info { display: flex; align-items: center; justify-content: space-between; padding: 12px; }
.export-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============ Assets Library ============ */
.assets-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.assets-header h3 { display: flex; align-items: center; gap: 8px; }
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.asset-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.asset-card-image { height: 160px; background: var(--bg-elevated); cursor: pointer; overflow: hidden; }
.asset-card-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.asset-card-image:hover img { transform: scale(1.05); }
.asset-video-icon { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.asset-card-body { padding: 12px; }
.asset-card-body h4 { font-size: 0.875rem; margin-bottom: 6px; }
.asset-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.asset-card-actions { display: flex; gap: 6px; }

/* ============ Stage 01 Sidebar Config ============ */
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 16px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.stage-tag { font-size: 0.6875rem; font-weight: 600; color: var(--primary); font-family: var(--font-mono); letter-spacing: 1px; }
.stage-title { font-size: 1.125rem; font-weight: 700; margin: 4px 0 0; }

/* Icons */
.icon-sm { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.icon-xs { width: 12px; height: 12px; display: inline-block; vertical-align: middle; }
.icon-green { width: 16px; height: 16px; color: #4ade80; }

/* Form extras */
.form-hint { font-size: 0.625rem; color: var(--muted-foreground); margin-top: 6px; line-height: 1.5; }
.form-input-sm { padding: 6px 10px; font-size: 0.75rem; height: 28px; }
.alert-sm { padding: 8px 12px; font-size: 0.6875rem; border-radius: var(--radius); margin-bottom: 12px; }
.alert-link { color: inherit; text-decoration: underline; margin-left: 4px; font-size: inherit; }

/* Duration Grid */
.duration-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.duration-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 6px 8px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500;
    border: none; background: rgba(39, 39, 42, 0.5);
    color: var(--muted-foreground); cursor: pointer; transition: var(--transition);
    font-family: var(--font-sans); line-height: 1.4; text-align: center;
}
.duration-btn:hover { background: var(--secondary); color: var(--foreground); }
.duration-btn.active {
    background: var(--primary); color: var(--primary-foreground);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.duration-desc { display: block; font-size: 0.625rem; opacity: 0.7; margin-top: 1px; }

/* Visual Style Grid */
.style-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.style-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 8px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500;
    border: none; background: rgba(39, 39, 42, 0.5);
    color: var(--muted-foreground); cursor: pointer; transition: var(--transition);
    font-family: var(--font-sans); text-align: left; line-height: 1.4;
}
.style-btn:hover { background: var(--secondary); color: var(--foreground); }
.style-btn.active {
    background: var(--primary); color: var(--primary-foreground);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    outline: 1px solid rgba(245, 158, 11, 0.5); outline-offset: 1px;
}
.style-emoji { font-size: 0.875rem; flex-shrink: 0; }

/* Model Info Card */
.model-info-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.model-info-text { flex: 1; min-width: 0; }
.model-name { font-size: 0.875rem; font-weight: 500; color: var(--foreground); margin: 0; }
.model-hint { font-size: 0.625rem; color: var(--muted-foreground); margin: 2px 0 0; }

/* Quality Check Card */
.quality-check-card {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px; border-radius: var(--radius-lg); background: var(--bg-elevated);
    border: 1px solid var(--border);
}
.quality-check-info { display: flex; align-items: center; gap: 8px; }
.quality-title { font-size: 0.75rem; font-weight: 500; color: var(--foreground); margin: 0; }
.quality-desc { font-size: 0.625rem; color: var(--muted-foreground); margin: 0; }

/* AI Toolbar */
.ai-toolbar {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    padding: 8px 16px; border-bottom: 1px solid var(--border);
}
.toolbar-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500;
    border: none; background: transparent; color: var(--muted-foreground);
    cursor: pointer; transition: var(--transition); font-family: var(--font-sans);
}
.toolbar-btn:hover { background: var(--bg-elevated); color: var(--foreground); }
.toolbar-btn.active { background: var(--secondary); color: var(--foreground); }
.toolbar-divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 1; justify-content: flex-end; }
.toolbar-hint { font-size: 0.625rem; color: var(--muted-foreground); }
.rewrite-input-group { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 400px; }
.rewrite-input-group .form-input { flex: 1; }

/* Script Editor Area */
.script-editor-area { flex: 1; display: flex; flex-direction: column; padding: 16px; min-height: 0; }
.script-status-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px; font-size: 0.625rem; color: var(--muted-foreground);
}
.script-status-right { display: flex; align-items: center; gap: 12px; }
.status-saved { color: rgba(74, 222, 128, 0.7); }

/* Progress Overlay */
.progress-overlay {
    position: absolute; inset: 0; z-index: 10;
    background: rgba(9, 9, 11, 0.8); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
}
.progress-card {
    border-radius: var(--radius-xl); border: 1px solid rgba(245, 158, 11, 0.2);
    background: var(--bg-card); padding: 32px; max-width: 380px; width: 100%;
    box-shadow: var(--shadow-lg);
}
.progress-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); flex-shrink: 0;
}
.progress-title { font-weight: 600; color: var(--foreground); display: block; }
.progress-subtitle { font-size: 0.75rem; color: var(--muted-foreground); margin: 2px 0 0; }
.progress-steps { display: flex; flex-direction: column; gap: 12px; }
.progress-step {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.875rem; color: var(--muted-foreground); opacity: 0.5;
}
.progress-step.active { color: var(--primary); opacity: 1; }
.progress-step.done { color: #4ade80; opacity: 1; }
.step-num {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.625rem; font-weight: 700;
    background: var(--secondary); color: var(--muted-foreground);
}
.progress-step.active .step-num { background: rgba(245, 158, 11, 0.2); color: var(--primary); }
.progress-step.done .step-num { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.step-text { flex: 1; }
.progress-detail { font-size: 0.6875rem; color: var(--muted-foreground); margin-top: 12px; text-align: center; }

/* Turnaround & Multiview Actions */
.turnaround-actions, .multiview-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ============ Prompt Panel ============ */
.prompt-panel {
    width: 420px; min-width: 420px; background: var(--bg-card);
    border-left: 1px solid var(--border); display: flex; flex-direction: column;
    overflow: hidden;
}
.prompt-panel-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.prompt-panel-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.prompt-panel-header-left { display: flex; align-items: center; gap: 8px; }
.prompt-panel-header-left h3 { font-size: 1.125rem; font-weight: 700; margin: 0; }
.prompt-panel-tag { font-size: 0.6875rem; font-family: var(--font-mono); color: var(--primary); }
.prompt-panel-badges { display: flex; gap: 6px; }
.prompt-panel-search { display: flex; align-items: center; gap: 8px; }
.prompt-panel-search .form-input { flex: 1; }
.prompt-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.prompt-panel-footer {
    border-top: 1px solid var(--border); padding: 10px 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
}
.prompt-panel-footer-info { display: flex; align-items: center; gap: 6px; font-size: 0.625rem; color: var(--muted-foreground); }

/* Prompt Category */
.prompt-category { margin-bottom: 12px; }
.prompt-category-trigger {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: var(--bg-card); cursor: pointer; transition: var(--transition);
    font-family: var(--font-sans);
}
.prompt-category-trigger:hover { background: var(--bg-card-hover); }
.prompt-category-icon {
    width: 32px; height: 32px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    background: var(--secondary); flex-shrink: 0;
}
.prompt-category-icon.cat-storyboard { color: var(--primary); }
.prompt-category-icon.cat-keyframe { color: #3b82f6; }
.prompt-category-icon.cat-turnaround { color: #4ade80; }
.prompt-category-icon.cat-image { color: #f59e0b; }
.prompt-category-icon.cat-video { color: #ef4444; }
.prompt-category-icon.cat-voiceover { color: #a855f7; }
.prompt-category-info { flex: 1; text-align: left; }
.prompt-category-info h4 { font-size: 0.875rem; font-weight: 600; margin: 0; color: var(--foreground); }
.prompt-category-info p { font-size: 0.625rem; color: var(--muted-foreground); margin: 2px 0 0; }
.prompt-category-chevron { color: var(--muted-foreground); transition: transform 0.2s; }
.prompt-category.open .prompt-category-chevron { transform: rotate(90deg); }
.prompt-category-content { display: none; margin-top: 8px; padding-left: 8px; }
.prompt-category.open .prompt-category-content { display: block; }

/* Prompt Template Item */
.prompt-section { margin-bottom: 20px; }
.prompt-section h4 { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.prompt-item {
    padding: 12px; background: var(--bg-elevated); border-radius: var(--radius);
    margin-bottom: 8px; border: 1px solid var(--border);
}
.prompt-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.prompt-item-name { font-size: 0.75rem; font-weight: 600; color: var(--foreground); }
.prompt-item-desc { font-size: 0.625rem; color: var(--muted-foreground); margin-top: 2px; }
.prompt-item-actions { display: flex; gap: 4px; }
.prompt-item-text {
    font-size: 0.75rem; color: var(--muted-foreground); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-item-textarea {
    width: 100%; min-height: 160px; padding: 10px; margin-top: 8px;
    font-size: 0.75rem; font-family: var(--font-mono); line-height: 1.6;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--foreground); resize: vertical;
}
.prompt-item-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.prompt-item-variables { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.prompt-var-badge {
    font-size: 0.5625rem; font-family: var(--font-mono); padding: 1px 6px;
    border-radius: 4px; border: 1px solid rgba(245, 158, 11, 0.2);
    color: rgba(245, 158, 11, 0.7); background: transparent;
}
.badge-modified {
    font-size: 0.5625rem; padding: 1px 6px; border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3); color: #fbbf24;
    background: transparent;
}

/* ============ Image Viewer ============ */
.image-viewer-modal { max-width: 90vw; max-height: 90vh; }
.image-viewer-body { padding: 16px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.image-viewer-body img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius); }

/* ============ Toast ============ */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 0.875rem;
    box-shadow: var(--shadow-lg); transform: translateX(100%);
    opacity: 0; transition: all 0.3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success svg { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error svg { color: var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info svg { color: var(--info); }

/* ============ Animations ============ */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ============ Mobile ============ */
.mobile-warning { display: none; }
.hide-mobile {}

@media (max-width: 768px) {
    .hero-title { font-size: 2.25rem; }
    .hero-desc { font-size: 1rem; }
    .stages-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .hide-mobile { display: none !important; }
    .mobile-warning {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 16px; padding: 40px; text-align: center; min-height: 100vh;
        color: var(--muted-foreground);
    }
    .mobile-warning h2 { color: var(--foreground); }
    .editor-body > *:not(.mobile-warning) { display: none !important; }
    .mobile-warning { display: flex !important; }
    .stage-layout { flex-direction: column; }
    .stage-sidebar-config { width: 100%; min-width: auto; }

}

@media (min-width: 769px) {
    .mobile-warning { display: none !important; }
}

/* ============ Stage 3/4 Split Layout ============ */
.stage-split-layout { display: flex; height: 100%; min-height: 600px; }
.stage-shot-list { width: 280px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.shot-list-header { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.shot-list-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.shot-list-header h2 { font-size: 1.125rem; font-weight: 700; margin: 0 0 8px 0; }
.shot-list-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shot-list-scroll { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.shot-list-item { width: 100%; display: flex; gap: 10px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); text-align: left; cursor: pointer; transition: all 0.15s; }
.shot-list-item:hover { border-color: var(--muted-foreground); }
.shot-list-item.active { border-color: rgba(var(--primary-rgb), 0.4); background: rgba(var(--primary-rgb), 0.05); }
.shot-thumb { width: 64px; height: 48px; border-radius: 6px; background: var(--bg-secondary); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-item-info { flex: 1; min-width: 0; }
.shot-item-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.shot-num { font-size: 10px; font-family: monospace; color: var(--primary); }
.shot-item-desc { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); opacity: 0.8; margin: 0; }
.shot-item-tags { display: flex; gap: 4px; margin-top: 4px; }
.badge-xs { font-size: 8px; padding: 1px 4px; border-radius: 3px; background: var(--bg-secondary); color: var(--muted-foreground); }
.badge-success-sm { font-size: 8px; padding: 1px 4px; border-radius: 3px; background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.badge-info-sm { font-size: 8px; padding: 1px 4px; border-radius: 3px; background: rgba(59,130,246,0.1); color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }
.score-badge { font-size: 10px; color: #f59e0b; }

.stage-shot-detail { flex: 1; overflow-y: auto; padding: 20px; }
.shot-detail-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.shot-detail-title { display: flex; align-items: center; gap: 10px; }
.shot-num-lg { font-size: 14px; font-family: monospace; color: var(--primary); font-weight: 600; }
.shot-nav-btns { display: flex; align-items: center; gap: 4px; }

/* Shot Info Card */
.shot-info-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-secondary); padding: 16px; margin-bottom: 16px; }
.shot-info-row { margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px; }
.shot-info-row label { font-size: 11px; color: var(--muted-foreground); min-width: 60px; flex-shrink: 0; }
.shot-info-row p { font-size: 13px; color: var(--foreground); margin: 0; flex: 1; }
.shot-info-meta { display: flex; gap: 16px; margin-top: 8px; }
.shot-info-meta span { display: flex; align-items: center; gap: 4px; }
.shot-info-meta label { font-size: 10px; color: var(--muted-foreground); }
.text-italic { font-style: italic; }

/* Grid Image Section (Stage 3) */
.grid-image-section { margin-bottom: 16px; }
.grid-image-container { cursor: pointer; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.grid-image { width: 100%; display: block; }
.grid-image-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.grid-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted-foreground); }
.grid-placeholder-actions { display: flex; gap: 8px; }
.upload-btn { position: relative; cursor: pointer; }

/* Grid Panels */
.grid-panels-section { margin-top: 16px; }
.grid-panels-section h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.grid-panels-list { display: flex; flex-direction: column; gap: 8px; }
.grid-panel-item { display: flex; gap: 10px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-secondary); }
.panel-index { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.panel-info { flex: 1; }
.panel-tags { display: flex; gap: 4px; margin-bottom: 4px; }
.panel-desc { font-size: 12px; color: var(--foreground); opacity: 0.8; margin: 0; }

/* Progress */
.progress-hint { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--primary); }
.progress-bar-container { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.progress-bar { flex: 1; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

/* Keyframes Section (Stage 4) */
.keyframes-section { margin-bottom: 20px; }
.keyframes-section h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.keyframes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.keyframe-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; }
.keyframe-card.empty { padding: 40px; text-align: center; color: var(--muted-foreground); }
.keyframe-header { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.keyframe-label { font-size: 12px; font-weight: 600; }
.keyframe-image { min-height: 120px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.keyframe-image img { width: 100%; display: block; }
.keyframe-placeholder { padding: 40px; color: var(--muted-foreground); display: flex; align-items: center; justify-content: center; }
.keyframe-prompt-text { font-size: 11px; color: var(--muted-foreground); padding: 8px 12px; border-top: 1px solid var(--border); }
.keyframe-actions { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); }

/* Video Generation Section (Stage 4) */
.video-gen-section { margin-bottom: 20px; }
.video-gen-section h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.video-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.form-group-inline { display: flex; flex-direction: column; gap: 4px; }
.form-group-inline label { font-size: 11px; color: var(--muted-foreground); }
.video-gen-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.video-preview-section { margin-top: 12px; }
.video-preview-lg { width: 100%; max-height: 400px; border-radius: var(--radius); background: black; }
.video-preview-actions { display: flex; gap: 8px; margin-top: 8px; }

/* AI Enhance Toggle */
.ai-enhance-toggle { display: flex; align-items: center; gap: 6px; }
.switch { position: relative; display: inline-block; width: 32px; height: 18px; }
.switch.switch-sm { transform: scale(0.85); }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: var(--bg-secondary); border-radius: 18px; transition: 0.3s; border: 1px solid var(--border); }
.switch-slider::before { content: ''; position: absolute; height: 12px; width: 12px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: 0.3s; }
.switch input:checked + .switch-slider { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(14px); }

/* Inline Actions */
.inline-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ============ Stage 5: Export ============ */
.export-overview-card, .export-settings-card, .export-actions-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); padding: 16px; margin-bottom: 16px; }
.export-overview-card h4, .export-settings-card h4, .export-actions-card h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.export-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.export-actions-grid { display: flex; gap: 12px; flex-wrap: wrap; }

/* Shots Strip */
.export-shots-strip { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); padding: 16px; margin-bottom: 16px; }
.export-shots-strip h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.shots-strip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.shot-strip-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.shot-strip-thumb { width: 56px; height: 42px; border-radius: 6px; overflow: hidden; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); position: relative; }
.shot-strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-strip-item.completed .shot-strip-thumb { border-color: #22c55e; }
.shot-strip-item.partial .shot-strip-thumb { border-color: #f59e0b; }
.video-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); color: white; border-radius: 4px; }
.shot-strip-label { font-size: 10px; font-family: monospace; color: var(--muted-foreground); }
.shot-strip-status { font-size: 9px; padding: 1px 4px; border-radius: 3px; }
.status-done { background: rgba(34,197,94,0.1); color: #22c55e; }
.status-partial { background: rgba(245,158,11,0.1); color: #f59e0b; }
.status-empty { background: var(--bg-secondary); color: var(--muted-foreground); }

/* ============ Stage 6: Asset Library ============ */
.asset-library-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.asset-library-toolbar .form-input { max-width: 300px; }
.asset-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab { padding: 4px 10px; border-radius: 16px; font-size: 12px; border: 1px solid var(--border); background: var(--bg-card); color: var(--muted-foreground); cursor: pointer; transition: all 0.15s; }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.asset-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); overflow: hidden; transition: border-color 0.15s; }
.asset-card:hover { border-color: var(--primary); }
.asset-card-thumb { height: 140px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); position: relative; }
.asset-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb-video { width: 100%; height: 100%; object-fit: cover; }
.asset-card-info { padding: 8px 10px; }
.asset-card-title { font-size: 12px; margin: 4px 0 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-actions { display: flex; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--border); }
.btn-danger { color: var(--danger) !important; }
.btn-danger:hover { background: rgba(239,68,68,0.1) !important; }

.asset-library-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
