    <style>
        :root {
        
            --bg-glass: rgba(10,12,22,0.55);
            --bg-glass-light: rgba(255,255,255,0.04);
            --bg-glass-card: rgba(255,255,255,0.05);
            --bg-glass-hover: rgba(255,255,255,0.08);
            --glass-border: rgba(255,255,255,0.08);
            --glass-border-hover: rgba(135,206,235,0.2);
            --glass-border-active: rgba(209,254,23,0.4);
            --glass-blur: 24px;
            --text-primary: #f0f2f8;
            --text-secondary: rgba(255,255,255,0.55);
            --text-muted: rgba(255,255,255,0.3);
            --accent-1: #87CEEB;
            --accent-2: #B0E0FF;
            --accent-3: #6BB5E8;
            --accent-green: #d1fe17;
            --accent-teal: #87CEEB;
            --accent-orange: #f59e0b;
            --accent-red: #ef4444;
            --gradient-main: linear-gradient(135deg, #d1fe17 0%, #87CEEB 50%, #90EE90 100%);
            --gradient-card: linear-gradient(145deg, rgba(135,206,235,0.08), rgba(209,254,23,0.03));
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 14px;
            --radius-xl: 18px;
            --panel-bg: rgba(8,10,20,0.65);
            --panel-bg-inner: rgba(8,10,22,0.5);
            --panel-border: rgba(255,255,255,0.06);
            --titlebar-bg: rgba(0,0,0,0.25);
            --dropdown-bg: rgba(8,10,20,0.85);
            --control-bg: rgba(0,0,0,0.3);
            --control-text: var(--text-primary);
            --control-border: rgba(255,255,255,0.12);
            --control-label: var(--text-secondary);
        }
        
        /* ===== 主题系统（直接在 html 上切换，影响全部元素） ===== */
        html.theme-light {
            --bg-glass: rgba(255,255,255,0.8);
            --bg-glass-light: rgba(0,0,0,0.03);
            --bg-glass-card: rgba(0,0,0,0.04);
            --bg-glass-hover: rgba(0,0,0,0.06);
            --glass-border: rgba(0,0,0,0.08);
            --glass-border-hover: rgba(83,204,238,0.3);
            --text-primary: #1a1a2e;
            --text-secondary: rgba(0,0,0,0.55);
            --text-muted: rgba(0,0,0,0.3);
            --accent-green: #8bc34a;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
            --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
            --gradient-main: linear-gradient(135deg, #8bc34a 0%, #53ccee 50%, #9561e2 100%);
            --gradient-card: linear-gradient(145deg, rgba(83,204,238,0.06), rgba(139,195,74,0.03));
            --panel-bg: rgba(255,255,255,0.85);
            --panel-bg-inner: rgba(245,247,250,0.7);
            --panel-border: rgba(0,0,0,0.06);
            --titlebar-bg: rgba(0,0,0,0.04);
            --dropdown-bg: rgba(255,255,255,0.95);
            --control-bg: rgba(255,255,255,0.92);
            --control-text: #1a1a2e;
            --control-border: rgba(0,0,0,0.18);
            --control-label: #384152;
        }
        html.theme-light body {
            background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 50%, #e8ecf2 100%) !important;
            color: #1a1a2e !important;
        }
        html.theme-teal { --bg-glass:rgba(8,28,12,0.6);--bg-glass-light:rgba(60,255,80,0.06);--bg-glass-card:rgba(60,255,80,0.07);--bg-glass-hover:rgba(60,255,80,0.10);--glass-border:rgba(60,255,80,0.12);--glass-border-hover:rgba(60,255,80,0.35);--glass-border-active:rgba(100,255,120,0.5);--text-primary:#d0ffd8;--text-secondary:rgba(180,255,190,0.65);--text-muted:rgba(80,200,100,0.4);--accent-green:#66ff80;--accent-teal:#55ff70;--accent-1:#44dd60;--accent-2:#88ffaa;--accent-3:#33cc55;--accent-orange:#bbff44;--gradient-main:linear-gradient(135deg,#33ff66 0%,#55ff70 50%,#88ffaa 100%);--gradient-card:linear-gradient(145deg,rgba(60,255,80,0.10),rgba(51,255,102,0.05));--panel-bg:rgba(4,20,8,0.7);--panel-bg-inner:rgba(3,16,6,0.55);--panel-border:rgba(60,255,80,0.10);--titlebar-bg:rgba(0,12,2,0.35);--dropdown-bg:rgba(4,20,8,0.92); }
        html.theme-teal body {
            background:linear-gradient(135deg,#040e06 0%,#061608 25%,#082010 50%,#061608 75%,#040e06 100%)!important;
        }
        html.theme-sky { --bg-glass:rgba(6,18,50,0.55);--bg-glass-light:rgba(100,180,255,0.06);--bg-glass-card:rgba(100,180,255,0.07);--bg-glass-hover:rgba(100,180,255,0.10);--glass-border:rgba(100,180,255,0.12);--glass-border-hover:rgba(100,180,255,0.35);--glass-border-active:rgba(135,206,255,0.5);--text-primary:#d8ecff;--text-secondary:rgba(180,220,255,0.65);--text-muted:rgba(100,170,240,0.4);--accent-green:#88ccff;--accent-teal:#66bbff;--accent-1:#55aaff;--accent-2:#77ccff;--accent-3:#4499ff;--accent-orange:#ffc844;--gradient-main:linear-gradient(135deg,#88ccff 0%,#66bbff 50%,#4499ff 100%);--gradient-card:linear-gradient(145deg,rgba(100,180,255,0.08),rgba(68,153,255,0.04));--panel-bg:rgba(4,12,40,0.65);--panel-bg-inner:rgba(3,10,35,0.50);--panel-border:rgba(100,180,255,0.10);--titlebar-bg:rgba(0,8,28,0.35);--dropdown-bg:rgba(4,12,40,0.92); }
        html.theme-sky body {
            background:linear-gradient(135deg,#061030 0%,#081840 25%,#0a2050 50%,#081840 75%,#061030 100%)!important;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #080816 0%, #0c1020 25%, #141020 50%, #0b1020 75%, #080816 100%);
            color: #fff;
            padding: 20px;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            position: relative;
        }
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background: 
                radial-gradient(ellipse at 25% 25%, rgba(83,204,238,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 75% 75%, rgba(209,254,23,0.04) 0%, transparent 50%);
            pointer-events: none;
            z-index: -1;
        }
        .preview-header {
            text-align: center;
            margin-bottom: 20px;
            padding: 15px;
            background: var(--gradient-main);
            border-radius: 12px;
            position: relative;
            overflow: hidden;
            opacity: 0.9;
        }
        .preview-header::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12) 0%, transparent 60%);
            pointer-events: none;
        }
        .preview-header h1 {
            font-size: 24px;
            margin-bottom: 8px;
        }
        .preview-header p {
            font-size: 14px;
            opacity: 0.9;
        }
        .preview-notice {
            background: rgba(83,204,238,0.06);
            border: 1px solid rgba(83,204,238,0.12);
            border-radius: 8px;
            padding: 12px 16px;
            margin-bottom: 20px;
            color: var(--accent-2);
            font-size: 14px;
        }
        .preview-notice strong {
            display: block;
            margin-bottom: 5px;
        }
        .plugin-wrapper {
            display: flex;
            justify-content: center;
        }
        .plugin-window {
            background: var(--panel-bg);
            border: 1px solid var(--panel-border);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
            width: 720px;
            position: relative;
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
        }
        .plugin-window::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(83,204,238,0.3), rgba(209,254,23,0.3), transparent);
        }
        .plugin-titlebar {
            background: var(--titlebar-bg);
            padding: 10px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--panel-border);
        }
        .plugin-title {
            font-size: 13px;
            font-weight: 500;
            color: #8b949e;
        }
        .window-controls {
            display: flex;
            gap: 8px;
        }
        .window-btn {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }
        .window-btn.close { background: #f85149; }
        .window-btn.min { background: #d29922; }
        .window-btn.max { background: #238636; }
        .plugin-content {
            height: 780px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            background: var(--panel-bg-inner);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            position: relative;
        }
        /* 用户下拉菜单 */
        .user-dropdown {
            position: absolute;
            top: 60px;
            right: 20px;
            background: var(--dropdown-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--panel-border);
            border-radius: 8px;
            padding: 8px 0;
            min-width: 160px;
            z-index: 100;
            display: none;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
        }
        .user-dropdown.show {
            display: block;
        }
        .dropdown-item {
            padding: 10px 16px;
            font-size: 13px;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s;
        }
        .dropdown-item:hover {
            background: rgba(255,255,255,0.06);
            color: var(--accent-green);
        }
        .dropdown-divider {
            height: 1px;
            background: rgba(255,255,255,0.06);
            margin: 4px 0;
        }
        /* 头部 */
        .app-header {
            padding: 14px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(0,0,0,0.15);
        }
        .logo-section {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .logo-icon {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, #d1fe17 0%, #53ccee 100%);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 16px;
        }
        .logo-text {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .user-section {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .username-display {
            font-size: 12px;
            color: #8b949e;
            display: none;
        }
        .username-display.show {
            display: block;
        }
        .credits-badge {
            background: #21262d;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 12px;
            color: #8b949e;
            border: 1px solid #30363d;
        }
        .user-avatar {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, #d1fe17 0%, #53ccee 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
        }
        .user-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 0 20px rgba(209,254,23,0.2);
        }
        /* 主导航标签 */
        .main-nav-tabs {
            display: flex;
            padding: 0 20px;
            border-bottom: 1px solid var(--panel-border);
            background: rgba(0,0,0,0.08);
        }
        .main-nav-tab {
            padding: 14px 14px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.2s;
        }
        .main-nav-tab.active {
            color: var(--accent-green);
            border-bottom-color: var(--accent-green);
        }
        .main-nav-tab:hover:not(.active) {
            color: var(--text-secondary);
        }
        /* 主内容区 */
        .main-area {
            flex: 1;
            overflow: hidden;
            position: relative;
            min-height: 0;
        }
        .page {
            display: none;
            height: 100%;
            flex-direction: column;
            min-height: 0;
        }
        .page.active {
            display: flex;
        }
        /* 功能卡片网格 */
        .feature-grid-page {
            padding: 16px 20px;
            overflow-y: auto;
            min-height: 0;
        }
        .category-title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 14px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .feature-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        .feature-card {
            background: rgba(255,255,255,0.04);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            padding: 16px 14px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .feature-card:hover {
            border-color: rgba(209,254,23,0.2);
            background: rgba(255,255,255,0.06);
            transform: translateY(-2px);
        }
        .feature-icon {
            width: 40px; height: 40px; margin-bottom: 10px;
            background: linear-gradient(135deg, rgba(209,254,23,0.1) 0%, rgba(83,204,238,0.06) 100%);
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px;
        }
        .feature-icon.has-img {
            background: none;
        }
        .feature-icon img {
            width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
        }
        .feature-name {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
            color: var(--text-primary);
        width:100%;display:block;}
        .feature-desc {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.4;
        width:100%;display:block;margin-top:2px;}
        /* 功能详情页 */
        .feature-detail-page {
            padding: 0;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }
        .detail-header {
            padding: 14px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            display: flex;
            align-items: center;
            gap: 12px;
            background: rgba(0,0,0,0.12);
        }
        .back-btn {
            width: 34px;
            height: 34px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s;
        }
        .back-btn:hover {
            border-color: var(--accent-green);
            color: var(--accent-green);
        }
        .detail-title {
            font-size: 16px;
            font-weight: 600;
        }
        .detail-content {
            flex: none;
            padding: 16px 20px 48px;
            min-height: 0;
        }
        .action-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 14px;
        }
        .action-btn {
            flex: 1;
            padding: 12px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
        }
        .action-btn:hover {
            border-color: rgba(209,254,23,0.2);
            background: rgba(255,255,255,0.06);
        }
        .action-btn input[type="file"] {
            position: absolute;
            opacity: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }
        /* 分屏对比 */
        .split-preview {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 14px;
        }
        /* 视频/图片预览 */
        .video-preview {
            background: rgba(0,0,0,0.3);
            border: 1px dashed rgba(255,255,255,0.08);
            border-radius: 10px;
            height: 160px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin-bottom: 14px;
            color: var(--text-muted);
            font-size: 13px;
            position: relative;
            overflow: hidden;
            transition: all 0.3s;
        }
        .video-preview.expanded {
            height: 280px;
        }
        .video-preview.has-content {
            border-style: solid;
            border-color: rgba(209,254,23,0.3);
        }
        .video-preview video {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        .video-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        .video-preview-icon {
            font-size: 44px;
            margin-bottom: 6px;
            opacity: 0.6;
        }
        .preview-label {
            position: absolute;
            top: 8px;
            left: 8px;
            background: rgba(0,0,0,0.6);
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 11px;
            color: #fff;
        }
        /* 生成结果区域 */
        .result-section {
            background: rgba(209,254,23,0.04);
            border: 1px solid rgba(209,254,23,0.12);
            border-radius: 10px;
            padding: 14px;
            margin-bottom: 14px;
            margin-top: 16px;
            display: none;
            position: relative;
            z-index: 5;
        }
        .result-section.show {
            display: block;
            scroll-margin-top: 70px;
        }
        .result-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--accent-green);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .result-preview {
            background: rgba(0,0,0,0.3);
            border: 1px solid #30363d;
            border-radius: 8px;
            min-height: 60px; max-height: 160px;
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 12px; overflow: hidden; cursor: zoom-in;
        }
        .result-preview video, .result-preview img {
            max-width: 100%; max-height: 150px;
            object-fit: contain;
        }
        .result-preview .preview-hint {
            position: absolute; bottom: 4px; right: 6px;
            font-size: 10px; color: rgba(255,255,255,0.3);
            pointer-events: none;
        }
        .result-actions {
            display: flex;
            gap: 10px;
        }
        .result-btn {
            flex: 1;
            padding: 10px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .result-btn:hover {
            border-color: rgba(209,254,23,0.2);
            background: rgba(255,255,255,0.06);
        }
        .result-btn.primary {
            background: linear-gradient(135deg, #d1fe17 0%, #a3e635 100%);
            border: none;
            color: #0a0a14;
            font-weight: 600;
        }
        .result-btn.primary:hover {
            box-shadow: 0 4px 16px rgba(209,254,23,0.3);
        }
        /* 照片缩略图横向排列 */
        .photos-thumb-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            padding: 8px;
            background: rgba(0,0,0,0.15);
            border-radius: 8px;
            overflow-x: auto;
            min-height: 70px;
        }
        .photo-thumb {
            width: 56px; height: 56px;
            background: rgba(0,0,0,0.3);
            border: 2px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; position: relative;
            overflow: visible;
            cursor: pointer; flex-shrink: 0;
            transition: all 0.2s;
        }
        .photo-thumb img {
            width: 100%; height: 100%;
            object-fit: cover; border-radius: 4px;
        }
        .photo-thumb.active {
            border-color: var(--accent-green);
            box-shadow: 0 0 0 2px rgba(209,254,23,0.2);
        }
        .photo-thumb .remove-btn {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 18px;
            height: 18px;
            background: #f85149;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            cursor: pointer;
            z-index: 10;
        }
        .photo-thumb-add {
            border: 2px dashed rgba(255,255,255,0.08);
            background: rgba(0,0,0,0.1);
        }
        .photo-thumb-add:hover {
            border-color: var(--accent-green);
        }
        .photo-large-preview {
            background: rgba(0,0,0,0.3);
            border: 2px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 14px;
            overflow: hidden;
        }
        .photo-large-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        /* 参考图片区域 */
        .ref-images-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .ref-image-item {
            width: 60px;
            height: 60px;
            background: rgba(0,0,0,0.3);
            border: 2px solid rgba(209,254,23,0.3);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            position: relative;
            overflow: hidden;
        }
        .ref-image-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .ref-image-item .remove-btn {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 18px;
            height: 18px;
            background: #f85149;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            cursor: pointer;
            z-index: 10;
        }
        .ref-image-add {
            border: 2px dashed rgba(255,255,255,0.08);
            background: rgba(0,0,0,0.1);
            cursor: pointer;
        }
        .ref-image-add:hover {
            border-color: var(--accent-green);
        }
        .settings-section {
            background: rgba(0,0,0,0.15);
            border: 1px solid rgba(255,255,255,0.04);
            border-radius: 10px;
            padding: 14px;
            margin-bottom: 14px;
        }
        .settings-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .model-select-control {
            width: 100%;
            min-height: 34px;
            padding: 6px 9px;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 6px;
            background: #101014;
            color: var(--text-primary);
            font-size: 12px;
            outline: none;
        }
        .model-select-control:focus { border-color: var(--accent-green); }
        .setting-row {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            gap: 10px;
        }
        .setting-row:last-child {
            margin-bottom: 0;
        }
        .setting-label {
            width: 100px;
            font-size: 12px;
            color: #8b949e;
            flex-shrink: 0;
        }
        .setting-input, .setting-select {
            flex: 1;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            padding: 8px 10px;
            color: var(--text-primary);
            font-size: 12px;
            outline: none;
        }
        .setting-input:focus, .setting-select:focus {
            border-color: rgba(209,254,23,0.3);
        }
        .prompt-textarea {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            padding: 10px 12px;
            color: var(--text-primary);
            font-size: 12px;
            resize: none;
            min-height: 70px;
            outline: none;
            margin-bottom: 12px;
            line-height: 1.6;
            font-family: inherit;
        }
        .prompt-textarea:focus {
            border-color: rgba(209,254,23,0.3);
        }
        .prompt-textarea::placeholder {
            color: var(--text-muted);
        }
        .char-count {
            text-align: right;
            font-size: 11px;
            color: #8b949e;
            margin-top: -8px;
            margin-bottom: 12px;
        }
        .generate-button {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #d1fe17 0%, #a3e635 100%);
            border: none;
            border-radius: 10px;
            color: #0a0a14;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s;
            margin-bottom: 14px;
        }
        .generate-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(209,254,23,0.25);
        }
        .generate-button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
        }
        .generate-button.secondary {
            background: rgba(255,255,255,0.05);
            color: var(--text-secondary);
            border: 1px solid rgba(255,255,255,0.06);
            width: auto;
            min-width: 120px;
        }
        .generate-button.secondary:hover {
            background: rgba(255,255,255,0.08);
        }
        .generate-button .loading {
            width: 18px;
            height: 18px;
            border: 2px solid rgba(10,10,20,0.2);
            border-top-color: #0a0a14;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        /* 单选/多选按钮 */
        .options-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 14px;
        }
        .option-btn {
            padding: 8px 14px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            min-width: 64px;
            text-align: center;
        }
        .option-btn:hover {
            border-color: rgba(209,254,23,0.2);
        }
        .option-btn.active {
            background: rgba(209,254,23,0.08);
            border-color: var(--accent-green);
            color: var(--accent-green);
        }
        /* 尺寸选择按钮 */
        .size-buttons {
            display: flex;
            gap: 8px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .size-btn {
            padding: 8px 16px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            min-width: 60px;
            text-align: center;
        }
        .size-btn:hover {
            border-color: rgba(209,254,23,0.2);
        }
        .size-btn.active {
            background: rgba(209,254,23,0.08);
            border-color: var(--accent-green);
            color: var(--accent-green);
        }
        /* 人脸检测缩略图 */
        .faces-bar {
            display: flex;
            gap: 10px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .face-item {
            width: 60px;
            height: 60px;
            background: rgba(0,0,0,0.3);
            border: 2px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.2s;
            overflow: hidden;
        }
        .face-item.active {
            border-color: var(--accent-green);
            box-shadow: 0 0 0 2px rgba(209,254,23,0.2);
        }
        .face-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .face-label {
            font-size: 11px;
            color: #8b949e;
            text-align: center;
            margin-top: 4px;
        }
        /* 工具按钮 */
        .tools-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        .tool-btn {
            padding: 8px 14px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .tool-btn:hover {
            border-color: rgba(209,254,23,0.2);
        }
        .tool-btn.active {
            background: rgba(209,254,23,0.08);
            border-color: var(--accent-green);
            color: var(--accent-green);
        }
        /* 素材库 */
        .library-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            padding: 10px;
        }
        .library-item {
            aspect-ratio: 1;
            background: rgba(0,0,0,0.15);
            border: 1px solid rgba(255,255,255,0.04);
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
        }
        .library-item:hover {
            border-color: rgba(209,254,23,0.2);
            transform: scale(1.02);
        }
        .library-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .library-video-poster {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.35);
            color: #fff;
            font-size: 28px;
            cursor: pointer;
        }
        .library-item .delete-btn {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            background: #f85149;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .library-item:hover .delete-btn {
            opacity: 1;
        }
        .library-item-actions {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 6px;
            opacity: 1;
            transition: opacity 0.2s;
        }
        .library-btn {
            min-width: 34px;
            height: 28px;
            padding: 0 8px;
            background: rgba(0, 0, 0, 0.72);
            border: 1px solid rgba(255, 255, 255, 0.24);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 600;
            color: #fff;
            cursor: pointer;
            transition: background 0.2s;
        }
        .library-btn:hover {
            background: rgba(255, 255, 255, 0.22);
        }
        .library-btn.delete:hover {
            background: rgba(220, 38, 38, 0.8);
        }
        .library-item-type {
            position: absolute;
            bottom: 4px;
            left: 4px;
            background: rgba(0, 0, 0, 0.6);
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            color: white;
        }
        .library-empty {
            text-align: center;
            padding: 60px 20px;
            color: #484f58;
        }
        .library-empty-icon {
            font-size: 48px;
            margin-bottom: 12px;
            opacity: 0.5;
        }
        /* 登录页面 */
        .login-page {
            padding: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
        .login-logo {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #d1fe17 0%, #53ccee 100%);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .login-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 30px;
        }
        .login-form {
            width: 100%;
            max-width: 320px;
        }
        .login-input {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            padding: 12px 16px;
            color: var(--text-primary);
            font-size: 14px;
            margin-bottom: 12px;
            outline: none;
        }
        .login-input:focus {
            border-color: rgba(209,254,23,0.3);
        }
        .login-remember {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: -2px 0 12px;
            color: #c9d1d9;
            font-size: 12px;
            cursor: pointer;
            user-select: none;
        }
        .login-remember input {
            width: 15px;
            height: 15px;
            margin: 0;
            accent-color: var(--accent-blue);
        }
        .login-buttons {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        .login-btn {
            flex: 1;
            padding: 12px;
            background: linear-gradient(135deg, #d1fe17 0%, #a3e635 100%);
            border: none;
            border-radius: 8px;
            color: #0a0a14;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        .register-btn {
            flex: 1;
            padding: 12px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        .login-footer {
            margin-top: 20px;
            font-size: 12px;
            color: #8b949e;
        }
        .login-footer a {
            color: var(--accent-green);
            cursor: pointer;
        }
        /* API设置弹窗 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
        .modal-overlay.show {
            display: flex;
        }
        .modal {
            background: var(--panel-bg);
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
            border: 1px solid var(--panel-border);
            border-radius: 12px;
            width: 520px;
            max-height: 85vh;
            overflow-y: auto;
        }
        .modal-content {
            background: var(--panel-bg);
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 24px 80px rgba(0,0,0,0.5);
        }
        .ai-tab-btn {
            transition: all 0.2s ease;
        }
        .ai-tab-btn:hover {
            opacity: 0.8;
        }
        .ai-tab-btn.active {
            background: rgba(209,254,23,0.1) !important;
            border-color: var(--accent-green) !important;
            color: var(--accent-green) !important;
        }
        .modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .modal-title {
            font-size: 16px;
            font-weight: 600;
        }
        .modal-close {
            width: 28px;
            height: 28px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }
        .modal-close:hover {
            border-color: var(--accent-red);
            color: var(--accent-red);
        }
        .modal-body {
            padding: 20px;
        }
        .connected-ai-list {
            margin-bottom: 20px;
        }
        .connected-ai-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.04);
            border-radius: 8px;
            margin-bottom: 8px;
        }
        .connected-ai-name {
            font-size: 13px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .connected-ai-status {
            width: 8px;
            height: 8px;
            background: var(--accent-green);
            border-radius: 50%;
        }
        .delete-ai-btn {
            padding: 4px 10px;
            background: rgba(248, 81, 73, 0.1);
            border: 1px solid #f85149;
            border-radius: 4px;
            color: #f85149;
            font-size: 11px;
            cursor: pointer;
        }
        .delete-ai-btn:hover {
            background: rgba(248, 81, 73, 0.2);
        }
        /* API设置面板新样式 - 左右分栏 */
        .api-settings-container {
            display: flex;
            gap: 16px;
            height: 100%;
            min-height: 0;
            max-height: none;
        }
        #apiModal .modal {
            display: grid;
            grid-template-rows: auto minmax(0, 1fr) auto;
            width: min(900px, calc(100vw - 24px));
            height: min(78vh, 760px);
            min-width: min(640px, calc(100vw - 24px));
            min-height: min(520px, calc(100vh - 24px));
            max-width: calc(100vw - 24px);
            max-height: calc(100vh - 24px);
            resize: both;
            overflow: hidden;
            box-sizing: border-box;
        }
        #apiModal .modal-body {
            min-height: 0;
            overflow: hidden;
        }
        .api-provider-list {
            width: 200px;
            flex-shrink: 0;
            overflow-y: auto;
            border-right: 1px solid rgba(255,255,255,0.06);
            padding-right: 12px;
        }
        .api-provider-list .list-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 10px;
            color: #c9d1d9;
        }
        .api-provider-card {
            padding: 8px 10px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.04);
            border-radius: 8px;
            margin-bottom: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 12px;
        }
        .api-provider-card:hover {
            background: rgba(255,255,255,0.06);
        }
        .api-provider-card.active {
            border-color: var(--accent-green);
            background: rgba(209,254,23,0.06);
        }
        .api-provider-card .provider-name {
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .api-provider-card .provider-status {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .api-provider-card .provider-status.online { background: #2ea043; }
        .api-provider-card .provider-status.offline { background: #8b949e; }
        .api-provider-card .provider-status.error { background: #f85149; }
        .api-provider-card .provider-meta {
            font-size: 10px;
            color: #8b949e;
            margin-top: 3px;
        }
        .api-provider-card .provider-badge {
            display: inline-block;
            font-size: 9px;
            padding: 1px 5px;
            border-radius: 4px;
            background: rgba(83,204,238,0.15);
            color: #53ccee;
            margin-right: 3px;
        }
        .api-config-form {
            flex: 1;
            overflow-y: auto;
            padding-left: 4px;
        }
        .api-config-form .form-section {
            margin-bottom: 14px;
        }
        .api-config-form .form-section-title {
            font-size: 12px;
            font-weight: 600;
            color: #c9d1d9;
            margin-bottom: 8px;
            padding-bottom: 4px;
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }
        .api-config-form .form-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .api-config-form .form-row label {
            font-size: 12px;
            color: #8b949e;
            min-width: 70px;
            flex-shrink: 0;
        }
        .api-config-form .form-row input,
        .api-config-form .form-row select {
            flex: 1;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            padding: 8px 10px;
            color: var(--text-primary);
            font-size: 12px;
            outline: none;
        }
        .api-config-form .form-row input:focus,
        .api-config-form .form-row select:focus {
            border-color: rgba(209,254,23,0.3);
        }
        .api-config-form .form-row input[readonly] {
            background: rgba(0,0,0,0.15);
            color: #8b949e;
        }
        .api-config-form .btn-sm {
            padding: 6px 14px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 6px;
            color: var(--text-secondary);
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .api-config-form .btn-sm:hover {
            background: rgba(255,255,255,0.1);
        }
        .api-config-form .btn-sm.primary {
            background: rgba(209,254,23,0.1);
            border-color: rgba(209,254,23,0.2);
            color: var(--accent-green);
        }
        .api-config-form .btn-sm.primary:hover {
            background: rgba(209,254,23,0.2);
        }
        .api-config-form .btn-sm.danger {
            background: rgba(248,81,73,0.1);
            border-color: #f85149;
            color: #f85149;
        }
        .api-config-form .btn-sm.danger:hover {
            background: rgba(248,81,73,0.2);
        }
        .api-config-form .btn-sm.success {
            background: rgba(46,160,67,0.1);
            border-color: #2ea043;
            color: #2ea043;
        }
        .api-config-form .test-result {
            font-size: 11px;
            padding: 6px 10px;
            border-radius: 4px;
            margin-top: 4px;
        }
        .api-config-form .test-result.success {
            background: rgba(46,160,67,0.1);
            color: #2ea043;
        }
        .api-config-form .test-result.error {
            background: rgba(248,81,73,0.1);
            color: #f85149;
        }
        .api-config-form .test-result.pending {
            background: rgba(139,148,158,0.1);
            color: #8b949e;
        }
        .api-config-form .model-checkbox-list {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            width: 100%;
            height: min(42vh, 360px);
            min-height: 180px;
            max-height: none;
            resize: vertical;
            overflow: auto;
            padding: 4px 4px 10px 0;
            box-sizing: border-box;
        }
        .api-config-form .model-category-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 12px 6px 8px;
            border-top: 1px solid rgba(255,255,255,0.08);
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 600;
            box-sizing: border-box;
        }
        .api-config-form .model-category-toggle {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            color: var(--text-muted);
            font-size: 11px;
            font-weight: 400;
            cursor: pointer;
        }
        .api-config-form .model-category-toggle input {
            margin: 0;
        }
        .api-config-form .model-checkbox-item {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            padding: 5px 10px;
            background: rgba(255,255,255,0.03);
            border-radius: 4px;
            cursor: pointer;
            width: calc(50% - 4px);
            box-sizing: border-box;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .api-config-form .model-checkbox-item:hover {
            background: rgba(255,255,255,0.06);
        }
        .api-config-form .model-checkbox-item input {
            margin: 0;
        }
        .api-config-form .runninghub-priced-model {
            width: 100%;
        }
        .api-config-form .model-checkbox-name {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .api-config-form .model-checkbox-price {
            flex: 0 0 auto;
            color: var(--accent-green);
            font-variant-numeric: tabular-nums;
        }
        .api-config-form .model-checkbox-actions {
            display: inline-flex;
            flex: 0 0 auto;
            align-items: center;
            gap: 3px;
            margin-left: 2px;
        }
        .api-config-form .model-item-action {
            width: 20px;
            height: 20px;
            padding: 0;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 4px;
            background: rgba(0,0,0,0.25);
            color: var(--text-secondary, rgba(255,255,255,0.55));
            cursor: pointer;
            font-size: 10px;
            line-height: 18px;
        }
        .api-config-form .model-item-action:hover {
            border-color: rgba(255,255,255,0.3);
            color: var(--text-primary, #f0f2f8);
        }
        .api-config-form .model-item-action.danger:hover {
            border-color: var(--accent-red, #ef4444);
            color: var(--accent-red, #ef4444);
        }
        .api-config-form .capability-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }
        .api-config-form .capability-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            padding: 4px 8px;
            background: rgba(255,255,255,0.03);
            border-radius: 4px;
        }
        .api-config-form .capability-item input[type="checkbox"] {
            margin: 0;
        }
        .api-provider-add-bar {
            display: flex;
            gap: 6px;
            margin-bottom: 10px;
        }
        .api-provider-add-bar select {
            flex: 1;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 6px;
            padding: 6px 8px;
            color: var(--text-primary);
            font-size: 11px;
            outline: none;
        }
        .api-provider-add-bar .btn-add {
            padding: 6px 12px;
            background: linear-gradient(135deg, #d1fe17 0%, #a3e635 100%);
            border: none;
            border-radius: 6px;
            color: #0a0a14;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
        }
        .connected-ai-item.disabled {
            opacity: 0.5;
            background: rgba(0,0,0,0.15);
        }
        .connected-ai-item.disabled .connected-ai-name::after {
            content: ' ⏸️ 已停用';
            color: #8b949e;
            font-size: 11px;
            margin-left: 4px;
        }
        /* Toast提示 */
        .toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: var(--dropdown-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--panel-border);
            border-radius: 8px;
            padding: 12px 20px;
            color: var(--text-primary);
            font-size: 13px;
            z-index: 2000;
            opacity: 0;
            transition: all 0.4s;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            width: max-content;
            max-width: min(720px, calc(100vw - 32px));
            line-height: 1.55;
            pointer-events: auto;
        }
        .toast.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
        .toast.error, .toast.warning {
            top: 50%;
            bottom: auto;
            transform: translate(-50%, -50%) translateY(24px);
        }
        .toast.error.show, .toast.warning.show {
            transform: translate(-50%, -50%);
            opacity: 1;
        }
        .toast.success {
            border-color: rgba(209,254,23,0.3);
        }
        .toast.error {
            border-color: var(--accent-red);
        }
        .toast-message {
            min-width: 0;
            overflow-wrap: anywhere;
            white-space: pre-wrap;
        }
        .toast-close {
            width: 22px;
            height: 22px;
            flex: 0 0 22px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 0;
            border-radius: 4px;
            background: rgba(255,255,255,0.08);
            color: var(--text-primary);
            font-size: 17px;
            line-height: 1;
            cursor: pointer;
        }
        .toast-close:hover { background: rgba(255,255,255,0.16); }
        /* 滚动条样式 */
        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.1);
            border-radius: 3px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.2);
        }
        /* 错误信息显示 */
        .error-message {
            background: rgba(239,68,68,0.06);
            border: 1px solid rgba(239,68,68,0.15);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 14px;
            color: var(--accent-red);
            font-size: 12px;
            display: none;
        }
        .error-message.show {
            display: block;
        }
    
.gen-card{margin-top:10px;background:rgba(0,0,0,0.12);border:1px solid rgba(255,255,255,0.04);border-radius:10px;overflow:hidden}.gen-card:hover{border-color:rgba(255,255,255,0.08)}.gen-card-header{padding:8px 12px;border-bottom:1px solid rgba(255,255,255,0.04);display:flex;align-items:center;gap:8px}.gen-card .dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.gen-card .dot.pending{background:#f59e0b}.gen-card .dot.running{background:#9561e2;animation:gp 1s ease infinite}.gen-card .dot.done{background:#d1fe17}.gen-card .dot.fail{background:#ef4444}@keyframes gp{0%,100%{opacity:1}50%{opacity:0.4}}.gen-card-body{padding:10px 12px}.gen-card-preview{display:none;margin-top:8px}.gen-card-preview.show{display:block}.gen-card-preview video,.gen-card-preview img{max-width:100%;max-height:300px;border-radius:8px}.gen-card-actions{display:flex;gap:6px;margin-top:8px}.gen-card-actions button{flex:1;padding:6px 12px;font-size:11px}.gen-card .gen-error{color:#ef4444;font-size:12px;padding:8px;display:none}.gen-container{margin-top:10px}.gen-container:empty{display:none}
                            .floating-orb{position:absolute;border-radius:50%;pointer-events:none;z-index:0;will-change:transform;mix-blend-mode:screen;}
                            #dynamic-bg-canvas{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;pointer-events:none;}
                            .orb-1{width:600px;height:600px;background:radial-gradient(circle,rgba(83,204,238,0.12) 0%,rgba(83,204,238,0.04) 40%,transparent 70%);filter:blur(70px);animation:orbFloat1 18s ease-in-out infinite;}
                            .orb-2{width:500px;height:500px;background:radial-gradient(circle,rgba(209,254,23,0.10) 0%,rgba(209,254,23,0.03) 40%,transparent 70%);filter:blur(65px);animation:orbFloat2 22s ease-in-out infinite;}
                            .orb-3{width:550px;height:550px;background:radial-gradient(circle,rgba(149,97,226,0.11) 0%,rgba(149,97,226,0.035) 40%,transparent 70%);filter:blur(68px);animation:orbFloat3 20s ease-in-out infinite;}
                            .orb-4{width:450px;height:450px;background:radial-gradient(circle,rgba(100,180,255,0.09) 0%,rgba(100,180,255,0.03) 40%,transparent 70%);filter:blur(65px);animation:orbFloat4 25s ease-in-out infinite;}
                            .orb-5{width:480px;height:480px;background:radial-gradient(circle,rgba(255,120,180,0.08) 0%,rgba(255,120,180,0.025) 40%,transparent 70%);filter:blur(68px);animation:orbFloat5 23s ease-in-out infinite;}
                            .orb-6{width:400px;height:400px;background:radial-gradient(circle,rgba(0,255,180,0.07) 0%,rgba(0,255,180,0.02) 40%,transparent 70%);filter:blur(60px);animation:orbFloat6 19s ease-in-out infinite;}
                            .orb-7{width:350px;height:350px;background:radial-gradient(circle,rgba(255,220,100,0.07) 0%,rgba(255,220,100,0.02) 40%,transparent 70%);filter:blur(55px);animation:orbFloat7 21s ease-in-out infinite;}
                            @keyframes orbFloat4{0%,100%{transform:translate(0,0) scale(1)}20%{transform:translate(-80px,120px) scale(1.1)}50%{transform:translate(110px,-60px) scale(0.95)}80%{transform:translate(-120px,-100px) scale(1.12)}}
                            @keyframes orbFloat5{0%,100%{transform:translate(0,0) scale(1)}30%{transform:translate(130px,80px) scale(1.15)}60%{transform:translate(-90px,-130px) scale(0.88)}90%{transform:translate(60px,-50px) scale(1.05)}}
                            @keyframes orbFloat6{0%,100%{transform:translate(0,0) scale(1)}25%{transform:translate(-110px,-90px) scale(1.18)}50%{transform:translate(80px,110px) scale(0.92)}75%{transform:translate(-60px,70px) scale(1.08)}}
                            @keyframes orbFloat7{0%,100%{transform:translate(0,0) scale(1)}35%{transform:translate(70px,-110px) scale(1.1)}70%{transform:translate(-100px,80px) scale(0.9)}}
                            @keyframes orbFloat1{0%,100%{transform:translate(0,0) scale(1)}25%{transform:translate(140px,-120px) scale(1.2)}50%{transform:translate(-100px,160px) scale(0.85)}75%{transform:translate(120px,90px) scale(1.1)}}
                            @keyframes orbFloat2{0%,100%{transform:translate(0,0) scale(1)}25%{transform:translate(-160px,100px) scale(0.9)}50%{transform:translate(120px,-140px) scale(1.15)}75%{transform:translate(-80px,-100px) scale(1.05)}}
                            @keyframes orbFloat3{0%,100%{transform:translate(0,0) scale(1)}33%{transform:translate(100px,140px) scale(1.25)}66%{transform:translate(-140px,-80px) scale(0.8)}}

        #feature-drama-generator input[type="number"] {
            appearance: textfield;
            -moz-appearance: textfield;
        }

        #feature-drama-generator input[type="number"]::-webkit-inner-spin-button,
        #feature-drama-generator input[type="number"]::-webkit-outer-spin-button {
            appearance: none;
            -webkit-appearance: none;
            margin: 0;
        }
    </style>

.image-result-grid {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    padding: 2px 1px 8px;
    scrollbar-width: thin;
}

.image-result-item {
    flex: 0 0 152px;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.image-result-item.selected {
    border-color: #2ea043;
    box-shadow: 0 0 0 1px #2ea043 inset;
}

.image-result-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #080b0f;
    cursor: pointer;
}

@media (max-width: 520px) {
    .image-result-item { flex-basis: 128px; }
}

.comic-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.comic-settings-grid label {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--control-label);
    font-size: 11px;
}

#feature-comic-storyboard .ref-image-add {
    position: relative;
}

#feature-comic-storyboard .ref-image-add input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 520px) {
    .comic-settings-grid { grid-template-columns: 1fr; }
}

.model-select-control,
.setting-input,
.setting-select,
.api-config-form .form-row input,
.api-config-form .form-row select,
.api-provider-add-bar select,
.login-input,
.prompt-textarea {
    background: var(--control-bg) !important;
    color: var(--control-text) !important;
    border-color: var(--control-border) !important;
}

.model-select-control option,
.setting-select option,
.api-config-form .form-row select option,
.api-provider-add-bar select option {
    background: var(--dropdown-bg);
    color: var(--text-primary);
}

.version-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.55);
}

.version-picker-panel {
    width: min(420px, 100%);
    max-height: min(620px, 90vh);
    overflow: auto;
    padding: 14px;
    background: var(--panel-bg);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.version-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--control-text);
}

.version-picker-close {
    border: 0;
    background: transparent;
    color: var(--control-label);
    font-size: 20px;
    cursor: pointer;
}

.version-picker-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 4px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--control-border);
    border-radius: 6px;
    background: var(--control-bg);
    color: var(--control-text);
    text-align: left;
    cursor: pointer;
}

.version-picker-item:hover {
    border-color: var(--accent-green);
}

.version-picker-item span {
    color: var(--control-label);
    font-size: 11px;
    line-height: 1.5;
}

.drama-asset-photo-grid {
    display: block;
    width: 144px;
    max-width: 100%;
    margin-top: 4px;
}

.drama-asset-photo-item {
    width: 144px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    background: #080808;
}

.drama-asset-photo-preview {
    position: relative;
    height: 108px;
    overflow: hidden;
}

.drama-asset-photo-item img {
    display: block;
    width: 100%;
    height: 108px;
    object-fit: cover;
    cursor: zoom-in;
}

.drama-asset-photo-count,
.drama-asset-photo-hint {
    position: absolute;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    font-size: 9px;
    line-height: 1.3;
    pointer-events: none;
}

.drama-asset-photo-count {
    top: 4px;
    right: 4px;
}

.drama-asset-photo-hint {
    left: 4px;
    bottom: 4px;
    color: #d1fe17;
}

.drama-asset-photo-item button {
    width: 100%;
    padding: 4px;
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: #111;
    color: #aaa;
    font-size: 9px;
    cursor: pointer;
}

.drama-project-manager {
    border-bottom: 1px solid var(--control-border);
    padding: 2px 0 12px;
}

.drama-project-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drama-project-row .dh-select {
    flex: 1;
    min-width: 0;
    background: var(--control-bg) !important;
    color: var(--control-text) !important;
    border-color: var(--control-border) !important;
}

.drama-project-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0 !important;
    font-size: 15px !important;
    line-height: 28px;
}

#drama-project-name {
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
    border: 1px solid var(--control-border);
    border-radius: 5px;
    background: var(--control-bg);
    color: var(--control-text);
    padding: 7px 9px;
    font-size: 12px;
}

.drama-project-footer {
    display: flex;
    align-items: center;
    margin-top: 8px;
    min-height: 30px;
}

.drama-project-footer .dh-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.feature-detail-page .detail-content,
.feature-detail-page .avs-standard-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feature-detail-page .detail-content > *,
.feature-detail-page .avs-standard-layout > * {
    width: 100%;
    box-sizing: border-box;
}

.avs-video-output-settings .avs-output-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.avs-output-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.avs-output-grid .setting-select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.avs-output-grid .setting-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    margin: 0;
    gap: 6px;
}

.avs-output-grid .setting-label {
    width: auto;
}

.avs-duration-hint {
    margin-top: 8px;
    margin-bottom: 0;
}

.feature-detail-page .action-buttons {
    flex-wrap: wrap;
}

.feature-detail-page .action-buttons .action-btn {
    min-width: 0;
}

.feature-detail-page .action-btn,
.feature-detail-page .tool-btn,
.feature-detail-page .option-btn,
.feature-detail-page .result-btn,
.feature-detail-page .btn-sm:not(.primary),
.feature-detail-page .dh-btn-ghost {
    background: transparent;
    box-shadow: none;
}

.feature-detail-page .result-btn.primary,
.feature-detail-page .btn-sm.primary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-secondary);
    box-shadow: none;
}

.feature-detail-page .result-btn.primary:hover,
.feature-detail-page .btn-sm.primary:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: transparent;
}

.feature-detail-page .setting-select,
.feature-detail-page .model-select-control,
.feature-detail-page input,
.feature-detail-page textarea {
    color: var(--text-primary);
}

.feature-detail-page .setting-select option,
.feature-detail-page .model-select-control option {
    color: #e6edf3;
    background: #141414;
}

.feature-detail-page .result-section {
    width: 100%;
}

@media (max-width: 520px) {
    .avs-video-output-settings .avs-output-grid {
        grid-template-columns: 1fr;
    }

   .feature-detail-page .result-actions {
       flex-direction: column;
   }
}

/* 面板最小化：整个窗口折叠为一条细栏（点击细栏恢复），同时尝试把 CEP 面板高度缩到最小 */
#avs-mini-bar { display: none; }
body.avs-minimized { width: 64px !important; min-width: 64px !important; max-width: 64px !important; height: 64px !important; min-height: 64px !important; max-height: 64px !important; overflow: hidden !important; padding: 0 !important; }
body.avs-minimized > *:not(#avs-mini-bar) { display: none !important; }
body.avs-minimized #avs-mini-bar { display: flex !important; }
.avs-min-btn {
    margin-left: 8px; padding: 2px 8px; font-size: 12px; cursor: pointer;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px; color: #aab4c0; user-select: none;
}
.avs-min-btn:hover { color: #4a9eff; border-color: #4a9eff; }

/* ===== 紧凑密度覆盖：面板缩小后仍可一眼看完，整体比例/字体/间距统一收紧 ===== */
html { font-size: 13px; }
body { padding: 12px 16px; font-size: 13px; }
.app-header { padding: 10px 16px; }
.logo-icon { width: 32px; height: 32px; font-size: 14px; }
.logo-text { font-size: 16px; }
.user-avatar { width: 28px; height: 28px; font-size: 12px; }
.main-nav-tabs { padding: 0 16px; }
.main-nav-tab { padding: 10px 12px; font-size: 12.5px; }
.feature-grid-page { padding: 12px 16px; }
.category-title { font-size: 13px; margin-bottom: 10px; }
.feature-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.feature-card { padding: 12px; border-radius: 8px; }
.feature-icon { width: 34px; height: 34px; margin-bottom: 8px; font-size: 17px; border-radius: 8px; }
.feature-name { font-size: 12.5px; }
.feature-desc { font-size: 10.5px; line-height: 1.35; }
.detail-header { padding: 10px 16px; }
.detail-title { font-size: 15px; }
.detail-content { padding: 12px 16px; }
.back-btn, .refresh-btn { width: 30px; height: 30px; font-size: 14px; }
.action-btn { padding: 9px 10px; font-size: 12.5px; }
.settings-grid { gap: 6px; }
.settings-grid label, .media-input-group label { font-size: 10.5px; gap: 4px; }
.option-btn { padding: 8px 10px; }
.field-hint { font-size: 10.5px; margin-top: 4px; }
.prompt-actions { margin-bottom: 8px; }
.media-input-stack { gap: 8px; }
.media-input-group { margin: 8px 0; }
.result-section { margin-top: 8px; }

/* ===== Unified operational UI scale ===== */
:root {
    --avs-space-xs: 4px;
    --avs-space-sm: 8px;
    --avs-space-md: 12px;
    --avs-space-lg: 16px;
    --avs-space-xl: 20px;
    --avs-control-height: 34px;
    --avs-button-height: 36px;
    --avs-radius: 8px;
    --avs-title-xl: 18px;
    --avs-title-lg: 15px;
    --avs-title-md: 13px;
    --avs-title-sm: 12px;
    --avs-body: 12px;
    --avs-caption: 11px;
}

button, input, select, textarea { font-family: inherit; }

.settings-section,
.media-input-group,
.video-model-section,
.audio-model-section,
.image-model-section {
    margin: var(--avs-space-md) 0;
}

.detail-title {
    font-size: var(--avs-title-xl);
    font-weight: 650;
    line-height: 1.3;
}

.settings-title,
.result-title,
.category-title,
.dh-panel-title {
    font-size: var(--avs-title-md);
    font-weight: 600;
    line-height: 1.35;
}

.feature-name { font-size: var(--avs-title-md); font-weight: 600; }
.feature-desc { font-size: var(--avs-caption); line-height: 1.45; }
.field-hint,
.model-provider,
.gen-status,
.gen-model,
.library-pagination button { font-size: var(--avs-caption); }
.model-name { font-size: var(--avs-title-sm); }

.action-btn,
.option-btn,
.result-btn,
.tool-btn {
    min-height: var(--avs-control-height);
    padding: 7px 12px;
    font-size: var(--avs-body);
    border-radius: var(--avs-radius);
}

.generate-button {
    min-height: var(--avs-button-height);
    padding: 9px 14px;
    font-size: var(--avs-body);
    font-weight: 600;
    border-radius: var(--avs-radius);
}

.model-select-control,
.setting-input,
.setting-select {
    min-height: var(--avs-control-height);
    padding: 7px 9px;
    font-size: var(--avs-body);
    border-radius: var(--avs-radius);
}

.prompt-textarea {
    min-height: 74px;
    padding: 9px 10px;
    font-size: var(--avs-body);
    line-height: 1.5;
    border-radius: var(--avs-radius);
}

.action-buttons,
.options-group,
.result-actions,
.prompt-actions,
.result-actions.avs-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--avs-space-sm);
}

.settings-grid { gap: var(--avs-space-sm); }
.feature-grid { gap: var(--avs-space-sm); }
.media-input-stack { gap: var(--avs-space-md); }

.video-preview { min-height: 92px; border-radius: 10px; }
.result-preview { min-height: 120px; }

.action-btn,
.option-btn,
.result-btn,
.tool-btn,
.generate-button,
.model-select-control,
.setting-input,
.setting-select {
    transition: border-color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out;
}

@media (max-width: 560px) {
    .action-buttons,
    .options-group,
    .result-actions,
    .result-actions.avs-result-actions {
        gap: 6px;
    }
}

/* 手机/平板 Web 与 Android 快照：隐藏仅适用于 Premiere Pro 的按钮。 */
.avs-web-runtime [onclick*="Timeline"],
.avs-web-runtime [onclick*="ToPR"],
.avs-web-runtime [onclick*="FromTimeline"] {
    display: none !important;
}
