        * { font-family: 'Noto Sans SC', sans-serif; }
        .gradient-bg { background: linear-gradient(160deg, #1A1208 0%, #2C1F0E 50%, #1A1208 100%); }
        .glass-panel { background: rgba(255,255,255,0.97); backdrop-filter: blur(12px); }
        .cinematic-glow { box-shadow: 0 0 30px rgba(217, 119, 6, 0.25); }
        .shot-preview { background: linear-gradient(45deg, #0F0A05 0%, #1C1208 100%); }
        .loader { border: 3px solid #f3f4f6; border-top: 3px solid #D97706; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        .pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
        @keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 5px rgba(217, 119, 6, 0.45); } 50% { box-shadow: 0 0 20px rgba(217, 119, 6, 0.75); } }
        .typing-cursor::after { content: '|'; animation: blink 1s infinite; }
        @keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
       /* 导演列表自定义滚动条样式 */
        #directorGrid::-webkit-scrollbar {
            height: 8px; /* 滚动条高度 */
        }
        #directorGrid::-webkit-scrollbar-track {
            background: #f1f1f1; /* 轨道颜色 */
            border-radius: 10px;
        }
        #directorGrid::-webkit-scrollbar-thumb {
            background: #cbd5e1; /* 滑块颜色 */
            border-radius: 10px;
            border: 2px solid #f1f1f1;
        }
        #directorGrid::-webkit-scrollbar-thumb:hover {
            background: #D97706; /* 悬停时滑块变色 */
        }
        .markdown-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
        .markdown-body th { background: linear-gradient(135deg, #1A1208 0%, #3D2B0F 100%); color: #FDE68A; padding: 12px; text-align: left; font-weight: 600; letter-spacing: 0.02em; }
        .markdown-body td { border: 1px solid #e5e7eb; padding: 12px; vertical-align: top; line-height: 1.6; }
        .markdown-body tr:nth-child(even) { background-color: #f8fafc; }
        .markdown-body tr:hover { background-color: #FFFBEB; }
        .scene-tag { transition: all 0.2s; }
        .scene-tag:hover { transform: scale(1.05); }
        .emotion-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
        .timeline-track { background: linear-gradient(90deg, #D97706 0%, #B45309 100%); height: 4px; border-radius: 2px; }
        .material-item { transition: all 0.2s; }
        .material-item:hover { background-color: #FFFBEB; }
        .preview-frame { aspect-ratio: 16/9; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #666; }
        .tab-btn.active { background: linear-gradient(135deg, #D97706 0%, #92400E 100%); color: white; }
        .safety-badge { animation: safetyPulse 2s infinite; }
        @keyframes safetyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
        .history-item { transition: all 0.2s; }
        .history-item:hover { background-color: #f8fafc; }
        .creator-watermark { background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 900; }
        .footer-watermark { text-shadow: 0 0 10px rgba(217, 119, 6, 0.5); }

        /* ===== 悬浮生成按钮 ===== */
        #floatGenerateBtn {
            position: fixed;
            bottom: 28px;
            right: 28px;
            z-index: 999;
            background: linear-gradient(135deg, #D97706 0%, #92400E 100%);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 14px 28px;
            font-size: 15px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            box-shadow: 0 8px 30px rgba(217, 119, 6, 0.5);
            transition: all 0.25s;
            white-space: nowrap;
        }
        #floatGenerateBtn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 40px rgba(217, 119, 6, 0.65); }
        #floatGenerateBtn:active { transform: translateY(0) scale(0.98); }
        #floatGenerateBtn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

        /* ===== 参数 Tab 面板 ===== */
        .param-tab-btn { padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: #6b7280; background: transparent; border: none; white-space: nowrap; }
        .param-tab-btn.active { background: linear-gradient(135deg, #D97706 0%, #B45309 100%); color: white; box-shadow: 0 4px 12px rgba(217,119,6,0.3); }
        .param-tab-btn:hover:not(.active) { background: #FEF3C7; color: #92400E; }
        .param-panel { display: none; }
        .param-panel.active { display: block; }

        /* ===== 导演卡片优化 ===== */
        .director-card { transition: all 0.3s ease; }
        .director-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.13); }
        .director-card.active { border-color: #D97706; background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); }

        /* ===== 分析卡片折叠 ===== */
        .collapsible-header { cursor: pointer; user-select: none; }
        .collapsible-header:hover { background: #f8fafc; border-radius: 8px; }
        .collapse-icon { transition: transform 0.3s; }
        .collapsed .collapse-icon { transform: rotate(-90deg); }

        /* ===== 情节输入工具栏 ===== */
        .plot-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
        .toolbar-btn { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all 0.18s; }
        .toolbar-btn-primary { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
        .toolbar-btn-primary:hover { background: #FEF3C7; border-color: #FCD34D; }
        .toolbar-btn-safe { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
        .toolbar-btn-safe:hover { background: #dcfce7; }
        .char-counter { margin-left: auto; font-size: 12px; color: #9ca3af; }

        /* ===== 平台选择卡片 ===== */
        .platform-card {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.18s;
            background: white;
            text-align: left;
        }
        .platform-card:hover { border-color: #FCD34D; background: #FFFBEB; }
        .platform-card.selected { border-color: #D97706; background: linear-gradient(135deg, #FFFBEB, #FEF3C7); box-shadow: 0 0 0 3px rgba(217,119,6,0.2); }
        .platform-card .p-icon { font-size: 20px; flex-shrink: 0; }
        .platform-card .p-name { font-size: 13px; font-weight: 700; color: #374151; }
        .platform-card .p-sub { font-size: 10px; color: #9ca3af; }

        /* ===== 单镜修改按钮 ===== */
        .shot-edit-btn {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            margin-top: 6px;
            padding: 3px 8px;
            font-size: 11px;
            font-weight: 600;
            color: #92400E;
            background: #FFFBEB;
            border: 1.5px solid #FDE68A;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .shot-edit-btn:hover { background: #FEF3C7; border-color: #FCD34D; transform: scale(1.03); }

        /* ===== 连接测试状态 ===== */
        .test-ok { color: #16a34a; }
        .test-fail { color: #dc2626; }
        .test-loading { color: #D97706; }


/* 流式生成时的闪烁光标 */
        .streaming-cursor::after {
            content: '▋';
            animation: blink 1s infinite;
            color: #D97706;
            margin-left: 2px;
        }
        /* @人物 高亮标签 - 玫瑰粉 */
        .at-character {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: linear-gradient(135deg, #fce7f3, #fdf2f8);
            color: #be185d;
            border: 1px solid #f9a8d4;
            border-radius: 5px;
            padding: 1px 7px;
            font-size: 0.78em;
            font-weight: 700;
            letter-spacing: 0.02em;
            white-space: nowrap;
            box-shadow: 0 1px 3px rgba(190,24,93,0.15);
        }
        .at-character::before { content: '👤'; font-size: 0.9em; }
        /* @图片 高亮标签 - 青蓝 */
        .at-scene {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: linear-gradient(135deg, #ECFEFF, #E0F7FA);
            color: #0E7490;
            border: 1px solid #A5F3FC;
            border-radius: 5px;
            padding: 1px 7px;
            font-size: 0.78em;
            font-weight: 700;
            letter-spacing: 0.02em;
            white-space: nowrap;
            box-shadow: 0 1px 3px rgba(8,145,178,0.15);
        }
        .at-scene::before { content: '🏞️'; font-size: 0.9em; }
        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }

        /* ===== 违禁词过滤开关 ===== */
        .filter-toggle-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 5px 10px;
            font-size: 12px;
            font-weight: 700;
            border-radius: 8px;
            cursor: pointer;
            border: 1.5px solid;
            transition: all 0.18s;
            white-space: nowrap;
            user-select: none;
        }
        .filter-toggle-btn.filter-on {
            color: #16a34a;
            background: #f0fdf4;
            border-color: #86efac;
        }
        .filter-toggle-btn.filter-on:hover { background: #dcfce7; }
        .filter-toggle-btn.filter-off {
            color: #6b7280;
            background: #f9fafb;
            border-color: #d1d5db;
        }
        .filter-toggle-btn.filter-off:hover { background: #f3f4f6; }
        .filter-dot {
            width: 7px; height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .filter-on .filter-dot { background: #16a34a; }
        .filter-off .filter-dot { background: #9ca3af; }

        #storylineTimeline {
            display: flex;
            gap: 6px;
            overflow-x: auto;
            padding: 6px 2px 10px;
            scrollbar-width: thin;
        }
        #storylineTimeline::-webkit-scrollbar { height: 4px; }
        #storylineTimeline::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
        #storylineTimeline::-webkit-scrollbar-thumb { background: #FCD34D; border-radius: 4px; }

        .scene-block {
            flex-shrink: 0;
            min-width: 110px;
            max-width: 160px;
            padding: 8px 10px;
            border-radius: 10px;
            border: 2px solid #e2e8f0;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
        }
        .scene-block:hover { border-color: #FCD34D; transform: translateY(-2px); }
        .scene-block.scene-waiting { border-color: #e2e8f0; background: #f8fafc; }
        .scene-block.scene-loading { border-color: #D97706; background: linear-gradient(135deg, #FFFBEB, #FEF3C7); animation: sceneLoadingPulse 1.5s ease-in-out infinite; }
        .scene-block.scene-done { border-color: #10b981; background: linear-gradient(135deg, #f0fdf4, #ecfdf5); }
        .scene-block.scene-error { border-color: #ef4444; background: linear-gradient(135deg, #fef2f2, #fee2e2); }
        @keyframes sceneLoadingPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0.4); } 50% { box-shadow: 0 0 0 6px rgba(217,119,6,0); } }

        .scene-block-id { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; margin-bottom: 2px; }
        .scene-block-title { font-size: 11px; font-weight: 700; color: #1e293b; line-height: 1.3; margin-bottom: 3px; word-break: break-all; }
        .scene-block-dur { font-size: 10px; color: #64748b; font-weight: 500; }
        .scene-block-status { position: absolute; top: 6px; right: 7px; font-size: 12px; }

        .scene-block.scene-loading .scene-block-status::after {
            content: '';
            display: inline-block;
            width: 11px; height: 11px;
            border: 2px solid #FDE68A;
            border-top-color: #D97706;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            vertical-align: middle;
        }

        .scene-block-beat {
            display: inline-block;
            font-size: 8px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 1px 5px;
            border-radius: 4px;
            margin-top: 3px;
            background: linear-gradient(90deg,#D97706,#F59E0B);
            color: #fff;
            line-height: 1.6;
        }
        .scene-block-beat.beat-catalyst { background: linear-gradient(90deg,#7c3aed,#a78bfa); }
        .scene-block-beat.beat-midpoint { background: linear-gradient(90deg,#dc2626,#f87171); }
        .scene-block-beat.beat-allis { background: linear-gradient(90deg,#1d4ed8,#60a5fa); }
        .scene-block-beat.beat-finale  { background: linear-gradient(90deg,#065f46,#34d399); }

        /* STC QA panel */
        #stcQaPanel {
            margin-top: 16px;
            border: 1.5px solid #FCD34D;
            border-radius: 14px;
            background: linear-gradient(135deg,#FFFBEB,#FEF9EE);
            overflow: hidden;
        }
        .stc-qa-header {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 16px;
            background: linear-gradient(90deg,#D97706,#F59E0B);
            color: #fff;
            font-size: 12px; font-weight: 800; cursor: pointer;
        }
        .stc-qa-body { padding: 12px 16px; }
        .stc-qa-item { margin-bottom: 10px; }
        .stc-qa-item-title { font-size: 11px; font-weight: 700; color: #92400e; margin-bottom: 3px; }
        .stc-qa-item-content { font-size: 11px; color: #451a03; line-height: 1.6; white-space: pre-wrap; }
        .stc-qa-item-pass { color: #065f46; }
        .stc-qa-item-warn { color: #b45309; }
        .stc-qa-item-fail { color: #dc2626; }
        .stc-qa-loading { font-size: 11px; color: #b45309; padding: 8px 0; }

        .scene-block-retry {
            display: none;
            margin-top: 4px;
            padding: 2px 6px;
            font-size: 9px;
            font-weight: 700;
            color: #ef4444;
            background: #fef2f2;
            border: 1px solid #fca5a5;
            border-radius: 5px;
            cursor: pointer;
            width: 100%;
            text-align: center;
        }
        .scene-block.scene-error .scene-block-retry { display: block; }

        /* 生成步骤状态条 */
        #chainStatusBar {
            display: none;
            align-items: center;
            gap: 10px;
            padding: 8px 14px;
            background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
            border: 1px solid #FDE68A;
            border-radius: 10px;
            margin-top: 8px;
            font-size: 12px;
            font-weight: 600;
            color: #92400E;
        }
        #chainStatusBar.active { display: flex; }
        #chainStatusBar .chain-step { display: flex; align-items: center; gap: 4px; }
        #chainStatusBar .chain-step.active-step { color: #D97706; font-weight: 800; }
        #chainStatusBar .chain-step.done-step { color: #10b981; }
        #chainStatusBar .chain-divider { color: #FCD34D; }

        /* Scene 锚点标题 */
        .scene-section-title {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            margin: 18px 0 4px;
            background: linear-gradient(90deg, #FFFBEB 0%, transparent 100%);
            border-left: 4px solid #D97706;
            border-radius: 0 8px 8px 0;
            font-size: 13px;
            font-weight: 800;
            color: #92400E;
            cursor: pointer;
        }
        .scene-section-title:hover { background: linear-gradient(90deg, #FEF3C7 0%, transparent 100%); }
        .scene-section-title .scene-badge { background: linear-gradient(135deg,#D97706,#92400E); color:white; font-size:10px; padding:2px 7px; border-radius:20px; }

        /* 取消生成按钮 */
        #cancelChainBtn {
            display: none;
            align-items: center;
            gap: 5px;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: 700;
            color: #dc2626;
            background: #fef2f2;
            border: 1.5px solid #fca5a5;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        #cancelChainBtn:hover { background: #fee2e2; }
        #cancelChainBtn.visible { display: flex; }

        /* ═══ RETHEME: Warm Dusk Flame ═══ */
        :root {
            --brand: #D97706;
            --brand-dark: #92400E;
            --brand-light: #FFFBEB;
            --brand-mid: #FEF3C7;
        }
        /* Warm body background with subtle texture feel */
        body { background: #F9F6F1 !important; }
        /* Header has rich dark cinematic feel */
        .gradient-bg { 
            background: linear-gradient(160deg, #1A1208 0%, #2C1F0E 40%, #1A1208 100%) !important;
            border-bottom: 1px solid rgba(217,119,6,0.2);
        }
        /* Tab strip — warm white */
        .bg-white.border-b { background: #FDFAF6 !important; }
        /* Section step numbers — amber gold */
        .bg-amber-600 { background-color: #D97706 !important; }
        /* Cards take warm white */
        .bg-white.rounded-2xl, .glass-panel.rounded-2xl { background: #FFFFFF; border-color: #EDE9E1 !important; }
        /* Markdown table rows alternate warm */
        .markdown-body tr:nth-child(even) { background-color: #FEFCF7; }
        /* History item hover */
        .history-item:hover { background-color: #FFFBEB !important; }
        /* filter-btn active stays amber already */
        /* Improve gradient-bg header text readability */
        .gradient-bg h1, .gradient-bg p { text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
        /* duration badge */
        #durationBadge { background: #D97706 !important; }
