/* ==========================================================================
   design.css — “复古海报 / Vintage Poster” 全局设计语言覆盖层
   --------------------------------------------------------------------------
   设计规则（与原玻璃拟态风格刻意拉开差距）：
     · 10px 圆角卡片 + 2px 实色描边（浅色=墨黑，深色=暖棕，激活=主题强调色）
     · 4px 4px 0 实色硬投影（无模糊、无扩散，复古印刷套版错位感）
     · 扁平色块，去掉毛玻璃/大模糊阴影
     · 标题改衬线字体（Georgia / 宋体系），小标签全大写宽字距
     · 按钮粗体 + 字距，hover 位移 + 投影加深，active 压下
   加载顺序：本文件在所有页面样式之后引入（13 个页面末位 <link>），
   全部规则带 !important 压制旧样式。
   令牌：--dv-* 在 :root（浅色 autumn）与 html.studio-theme-dark（深色 halloween）
   各定义一组，同一套规则自动适配两种模式。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */

/* —— 浅色（autumn 复古纸面）：象牙纸底、深酒红主墨、墨黑描边 —— */
:root {
    --dv-bg: #f1f1f1;              /* 页面底：autumn base-100 */
    --dv-paper: #f1f1f1;
    --dv-card: #faf6ec;            /* 卡片面：暖米白 */
    --dv-card-2: #e9e3d8;          /* 次级面：米黄 */
    --dv-ink: #141414;             /* 主墨（autumn base-content） */
    --dv-ink-soft: #5d5347;        /* 次级墨 */
    --dv-stroke: #141414;          /* 结构描边：墨黑 */
    --dv-stroke-soft: #826a5c;     /* 弱描边：autumn neutral */
    --dv-accent: #8c0327;          /* 强调：autumn primary 酒红 */
    --dv-accent-hover: #a3042f;
    --dv-accent-2: #d85251;        /* 陶红 */
    --dv-accent-contrast: #f6e7d7; /* 强调色上的文字：纸白 */
    --dv-gold: #e97f16;            /* 秋橙 */
    --dv-shadow-c: rgba(20, 20, 20, .88);   /* 硬投影色 */
    --dv-shadow: 4px 4px 0 var(--dv-shadow-c);
    --dv-shadow-sm: 3px 3px 0 var(--dv-shadow-c);
    --dv-shadow-lg: 6px 6px 0 var(--dv-shadow-c);
    --dv-scroll: #b9b0a2;
    --dv-heading-font: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
}

/* —— 深色（halloween 复古夜海报）：夜棕纸面、南瓜橙强调、墨黑投影 —— */
html.studio-theme-dark,
html.theme-dark,
body.studio-theme-dark,
body.theme-dark {
    --dv-bg: #1b1816;
    --dv-paper: #1b1816;
    --dv-card: #221d18;
    --dv-card-2: #2a241e;
    --dv-ink: #e9e2d6;
    --dv-ink-soft: #c9b391;
    --dv-stroke: #8a6b45;          /* 结构描边：暖棕 */
    --dv-stroke-soft: #52402a;
    --dv-accent: #ff8f00;          /* 强调：南瓜橙 */
    --dv-accent-hover: #ffa133;
    --dv-accent-2: #9d4edd;        /* 紫罗兰 */
    --dv-accent-contrast: #131616;
    --dv-gold: #ff8f00;
    --dv-shadow-c: rgba(0, 0, 0, .82);
    --dv-shadow: 4px 4px 0 var(--dv-shadow-c);
    --dv-shadow-sm: 3px 3px 0 var(--dv-shadow-c);
    --dv-shadow-lg: 6px 6px 0 var(--dv-shadow-c);
    --dv-scroll: #52402a;
    --dv-heading-font: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
}

/* --------------------------------------------------------------------------
   2. 全局底色 / 纸纹：扁平纸面 + 细微印刷网点
   -------------------------------------------------------------------------- */

body,
html.studio-theme-dark body,
body.studio-theme-dark {
    background-color: var(--dv-bg) !important;
    background-image:
        repeating-linear-gradient(0deg, rgba(127, 108, 84, .05) 0 1px, transparent 1px 4px),
        radial-gradient(rgba(127, 108, 84, .06) 1px, transparent 1.4px) !important;
    background-size: auto, 22px 22px !important;
}

html.studio-theme-dark body,
body.studio-theme-dark {
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 143, 0, .025) 0 1px, transparent 1px 4px),
        radial-gradient(rgba(255, 143, 0, .035) 1px, transparent 1.4px) !important;
    background-size: auto, 22px 22px !important;
}

/* --------------------------------------------------------------------------
   3. 排版：衬线标题、全大写宽字距小标签、加粗导航文字
   -------------------------------------------------------------------------- */

body h1,
body h2,
body h3,
body h4,
body .gate-title,
body .picker-title,
body .create-card-title,
body .canvas-card-title{
    font-family: var(--dv-heading-font) !important;
    letter-spacing: .01em !important;
}

body .label-nano,
body .setting-meta,
body .nav-label{
    text-transform: uppercase !important;
    letter-spacing: .14em !important;
}

body .nav-text,
body .side-pill-text {
    font-weight: 700 !important;
    letter-spacing: .05em !important;
}

/* --------------------------------------------------------------------------
   4. 卡片 / 面板：10px 圆角 + 2px 描边 + 硬投影
   -------------------------------------------------------------------------- */

html.studio-theme-dark body .console-card,
html.studio-theme-dark body .nano-input,
html.studio-theme-dark body .engine-panel,
html.studio-theme-dark body .tool-panel,
html.studio-theme-dark body .control-panel,
html.studio-theme-dark body .work-panel,
html.studio-theme-dark body .setting-row,
html.studio-theme-dark body .upload-item,
html.studio-theme-dark body .result-frame,
html.studio-theme-dark body .masonry-item,
html.studio-theme-dark body .select-shell,
html.studio-theme-dark body .mode-switcher,
html.studio-theme-dark body .engine-switch,
html.studio-theme-dark body .provider-switch,
html.studio-theme-dark body .gate-panel,
html.studio-theme-dark body .canvas-item,
html.studio-theme-dark body .create-card,
html.studio-theme-dark body .history-popover,
html.studio-theme-dark body .thread-item,
html.studio-theme-dark body .bubble.assistant,
html.studio-theme-dark body .emoji-picker,
html.studio-theme-dark body .create-menu,
html.studio-theme-dark body .selection-hub,
html.studio-theme-dark body .output-preview,
html.studio-theme-dark body .lightbox-card,
html.studio-theme-dark body #lightboxCard,
html.studio-theme-dark body .bg-white,
html.studio-theme-dark body .bg-white\/90,
html.studio-theme-dark body .bg-white\/95,
html.studio-theme-dark body .bg-gray-50,
html.studio-theme-dark body .bg-slate-50,
html.studio-theme-dark body .bg-gray-50\/50,
body.studio-theme-dark .console-card,
body.studio-theme-dark .nano-input,
body.studio-theme-dark .engine-panel,
body.studio-theme-dark .tool-panel,
body.studio-theme-dark .control-panel,
body.studio-theme-dark .work-panel,
body.studio-theme-dark .setting-row,
body.studio-theme-dark .upload-item,
body.studio-theme-dark .result-frame,
body.studio-theme-dark .masonry-item,
body.studio-theme-dark .select-shell,
body.studio-theme-dark .mode-switcher,
body.studio-theme-dark .engine-switch,
body.studio-theme-dark .provider-switch,
body.studio-theme-dark .gate-panel,
body.studio-theme-dark .canvas-item,
body.studio-theme-dark .create-card,
body.studio-theme-dark .history-popover,
body.studio-theme-dark .thread-item,
body.studio-theme-dark .bubble.assistant,
body.studio-theme-dark .emoji-picker,
body.studio-theme-dark .create-menu,
body.studio-theme-dark .selection-hub,
body.studio-theme-dark .output-preview,
body.studio-theme-dark .lightbox-card,
body.studio-theme-dark #lightboxCard,
body.studio-theme-dark .bg-white,
body.studio-theme-dark .bg-white\/90,
body.studio-theme-dark .bg-white\/95,
body.studio-theme-dark .bg-gray-50,
body.studio-theme-dark .bg-slate-50,
body.studio-theme-dark .bg-gray-50\/50,
body .console-card,
body .nano-input,
body .engine-panel,
body .tool-panel,
body .control-panel,
body .work-panel,
body .setting-row,
body .upload-item,
body .result-frame,
body .masonry-item,
body .select-shell,
body .mode-switcher,
body .engine-switch,
body .provider-switch,
body .gate-panel,
body .canvas-item,
body .create-card,
body .history-popover,
body .thread-item,
body .bubble.assistant,
body .emoji-picker,
body .create-menu,
body .selection-hub,
body .output-preview,
body .lightbox-card,
body #lightboxCard,
body .bg-white,
body .bg-white\/90,
body .bg-white\/95,
body .bg-gray-50,
body .bg-slate-50,
body .bg-gray-50\/50 {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}

html.studio-theme-dark body .console-card,
html.studio-theme-dark body .nano-input,
html.studio-theme-dark body .engine-panel,
html.studio-theme-dark body .tool-panel,
html.studio-theme-dark body .control-panel,
html.studio-theme-dark body .work-panel,
html.studio-theme-dark body .setting-row,
html.studio-theme-dark body .result-frame,
html.studio-theme-dark body .select-shell,
html.studio-theme-dark body .mode-switcher,
html.studio-theme-dark body .engine-switch,
html.studio-theme-dark body .provider-switch,
html.studio-theme-dark body .gate-panel,
html.studio-theme-dark body .canvas-item,
html.studio-theme-dark body .create-card,
html.studio-theme-dark body .history-popover,
html.studio-theme-dark body .thread-item,
html.studio-theme-dark body .bubble.assistant,
html.studio-theme-dark body .lightbox-card,
html.studio-theme-dark body #lightboxCard,
body.studio-theme-dark .console-card,
body.studio-theme-dark .nano-input,
body.studio-theme-dark .engine-panel,
body.studio-theme-dark .tool-panel,
body.studio-theme-dark .control-panel,
body.studio-theme-dark .work-panel,
body.studio-theme-dark .setting-row,
body.studio-theme-dark .result-frame,
body.studio-theme-dark .select-shell,
body.studio-theme-dark .mode-switcher,
body.studio-theme-dark .engine-switch,
body.studio-theme-dark .provider-switch,
body.studio-theme-dark .gate-panel,
body.studio-theme-dark .canvas-item,
body.studio-theme-dark .create-card,
body.studio-theme-dark .history-popover,
body.studio-theme-dark .thread-item,
body.studio-theme-dark .bubble.assistant,
body.studio-theme-dark .lightbox-card,
body.studio-theme-dark #lightboxCard,
body .console-card,
body .nano-input,
body .engine-panel,
body .tool-panel,
body .control-panel,
body .work-panel,
body .setting-row,
body .result-frame,
body .select-shell,
body .mode-switcher,
body .engine-switch,
body .provider-switch,
body .gate-panel,
body .canvas-item,
body .create-card,
body .history-popover,
body .thread-item,
body .bubble.assistant,
body .lightbox-card,
body #lightboxCard {
    border-radius: 10px !important;
    border-width: 2px !important;
    border-style: solid !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* 次级小控件面：米黄 / 深棕，不加重投影 */
html.studio-theme-dark body .bg-gray-100,
html.studio-theme-dark body .bg-slate-100,
html.studio-theme-dark body .model-pill,
html.studio-theme-dark body .ratio-grid,
html.studio-theme-dark body .resolution-toggle,
html.studio-theme-dark body .mode-switch,
html.studio-theme-dark body .mini-ratio,
body.studio-theme-dark .bg-gray-100,
body.studio-theme-dark .bg-slate-100,
body.studio-theme-dark .model-pill,
body.studio-theme-dark .ratio-grid,
body.studio-theme-dark .resolution-toggle,
body.studio-theme-dark .mode-switch,
body.studio-theme-dark .mini-ratio,
body .bg-gray-100,
body .bg-slate-100,
body .model-pill,
body .ratio-grid,
body .resolution-toggle,
body .mode-switch,
body .mini-ratio {
    background-color: var(--dv-card-2) !important;
    border-radius: 8px !important;
}

/* --------------------------------------------------------------------------
   5. 主容器（主页外壳 / 侧栏 / 舞台 / 聊天壳）
   -------------------------------------------------------------------------- */

body .stage {
    border-radius: 10px !important;
    border-width: 2px !important;
}

body .sidebar {
    border-right-width: 2px !important;
    border-right-color: var(--dv-stroke-soft) !important;
}

/* --------------------------------------------------------------------------
   6. 按钮：粗体、方一点、硬投影、位移反馈
   -------------------------------------------------------------------------- */

body button,
body .btn {
    font-weight: 700 !important;
    letter-spacing: .04em !important;
}

/* 主要操作按钮 = 强调色块 + 墨描边 + 硬投影 */
html.studio-theme-dark body .gen-btn,
html.studio-theme-dark body .primary-btn,
html.studio-theme-dark body .send-btn,
html.studio-theme-dark body .comfy-run,
html.studio-theme-dark body .llm-run,
html.studio-theme-dark body .bg-black,
body.studio-theme-dark .gen-btn,
body.studio-theme-dark .primary-btn,
body.studio-theme-dark .send-btn,
body.studio-theme-dark .comfy-run,
body.studio-theme-dark .llm-run,
body.studio-theme-dark .bg-black,
body .gen-btn,
body .primary-btn,
body .send-btn,
body .comfy-run,
body .llm-run,
body .bg-black{
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    border-color: var(--dv-stroke) !important;
    border-width: 2px !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow) !important;
    transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease !important;
}

body .gen-btn:hover,
body .primary-btn:hover,
body .send-btn:hover,
body .comfy-run:hover,
body .llm-run:hover,
body .bg-black:hover{
    background-color: var(--dv-accent-hover) !important;
    transform: translate(-1px, -1px) !important;
    box-shadow: 5px 5px 0 var(--dv-shadow-c) !important;
}

body .gen-btn:active,
body .primary-btn:active,
body .send-btn:active,
body .comfy-run:active,
body .llm-run:active,
body .bg-black:active{
    transform: translate(2px, 2px) !important;
    box-shadow: 0 0 0 var(--dv-shadow-c) !important;
}

/* 次级 / 幽灵按钮：描边风格 */
html.studio-theme-dark body .glass-btn,
html.studio-theme-dark body .secondary-btn,
html.studio-theme-dark body .ghost-btn,
html.studio-theme-dark body .action-btn,
html.studio-theme-dark body .tool-btn,
html.studio-theme-dark body .asset-mini-btn,
html.studio-theme-dark body .danger-btn,
body.studio-theme-dark .glass-btn,
body.studio-theme-dark .secondary-btn,
body.studio-theme-dark .ghost-btn,
body.studio-theme-dark .action-btn,
body.studio-theme-dark .tool-btn,
body.studio-theme-dark .asset-mini-btn,
body.studio-theme-dark .danger-btn,
body .glass-btn,
body .secondary-btn,
body .ghost-btn,
body .action-btn,
body .tool-btn,
body .asset-mini-btn,
body .danger-btn{
    border-width: 2px !important;
    border-radius: 8px !important;
    background-color: var(--dv-card) !important;
    color: var(--dv-ink) !important;
    transition: transform .12s ease, box-shadow .12s ease !important;
}

body .glass-btn:hover,
body .secondary-btn:hover,
body .ghost-btn:hover,
body .action-btn:hover,
body .tool-btn:hover,
body .asset-mini-btn:hover{
    transform: translate(-1px, -1px) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

body .danger-btn {
    border-color: #d40014 !important;
    color: #d40014 !important;
}

html.studio-theme-dark body .danger-btn,
body.studio-theme-dark .danger-btn {
    border-color: #f35248 !important;
    color: #f35248 !important;
}

/* --------------------------------------------------------------------------
   7. 主页侧栏：导航项 / 药丸按钮 / 监视器，全部方角化
   -------------------------------------------------------------------------- */

html.studio-theme-dark body .nav-item,
body.studio-theme-dark .nav-item,
body .nav-item{
    border-radius: 10px !important;
    border: 2px solid transparent !important;
}

html.studio-theme-dark body .nav-item.active,
body.studio-theme-dark .nav-item.active,
body .nav-item.active {
    background: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    border-color: var(--dv-stroke) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

html.studio-theme-dark body .side-pill,
body.studio-theme-dark .side-pill,
body .side-pill{
    border-radius: 8px !important;
}

body .side-pill {
    border-width: 2px !important;
}

body .side-pill.active {
    background: var(--dv-stroke) !important;
    color: var(--dv-paper) !important;
    border-color: var(--dv-stroke) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

body .nano-monitor {
    border-radius: 4px !important;
    border-width: 2px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    backdrop-filter: none !important;
}

body .nano-monitor.is-busy {
    background: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    border-color: var(--dv-stroke) !important;
}

/* --------------------------------------------------------------------------
   8. 模态弹窗：硬边海报卡片
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   9. 表单控件：文本输入 / 下拉 / 滑杆轨道
   -------------------------------------------------------------------------- */

body input[type="text"],
body input[type="number"],
body input[type="password"],
body input[type="search"],
body input[type="email"],
body input[type="url"],
body input[type="tel"],
body input[type="date"],
body textarea:not(#prompt):not(#promptInput),
body select,
body .size-select,
body .size-custom,
body .field-frame,
body .input-item,
body .gate-name-input {
    border-width: 2px !important;
    border-radius: 8px !important;
    background-color: var(--dv-card) !important;
    color: var(--dv-ink) !important;
}

body input[type="text"]:focus,
body input[type="number"]:focus,
body textarea:not(#prompt):not(#promptInput):focus,
body select:focus {
    outline: none !important;
    border-color: var(--dv-accent) !important;
    box-shadow: 3px 3px 0 var(--dv-shadow-c) !important;
}

body input[type="range"] {
    accent-color: var(--dv-accent) !important;
}

body input[type="checkbox"],
body input[type="radio"] {
    accent-color: var(--dv-accent) !important;
}

/* iOS 开关：方一点 + 硬投影 */
html.studio-theme-dark body .ios-switch .ios-slider,
body.studio-theme-dark .ios-switch .ios-slider,
body .ios-switch .ios-slider {
    border-radius: 6px !important;
    background: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    box-shadow: none !important;
}

html.studio-theme-dark body .ios-switch input:checked + .ios-slider,
body.studio-theme-dark .ios-switch input:checked + .ios-slider,
body .ios-switch input:checked + .ios-slider {
    background: var(--dv-accent) !important;
    border-color: var(--dv-stroke) !important;
}

html.studio-theme-dark body .ios-switch .ios-slider:before,
body.studio-theme-dark .ios-switch .ios-slider:before,
body .ios-switch .ios-slider:before {
    border-radius: 3px !important;
    background: var(--dv-ink) !important;
    box-shadow: none !important;
}

html.studio-theme-dark body .ios-switch input:checked + .ios-slider:before,
body.studio-theme-dark .ios-switch input:checked + .ios-slider:before,
body .ios-switch input:checked + .ios-slider:before {
    background: var(--dv-paper) !important;
}

/* 模式切换滑块 */
body .mode-glider {
    border-radius: 6px !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

body .mode-switcher,
body .engine-switch,
body .provider-switch {
    border-width: 2px !important;
    border-radius: 8px !important;
}

/* --------------------------------------------------------------------------
   10. 选项块（模型 / 比例 / 分辨率）：描边块，激活 = 强调色 + 硬投影
   -------------------------------------------------------------------------- */

html.studio-theme-dark body .size-btn,
html.studio-theme-dark body .model-option,
html.studio-theme-dark body .ratio-option,
html.studio-theme-dark body .resolution-option,
html.studio-theme-dark body .mini-ratio button,
html.studio-theme-dark body .mode-switch button,
html.studio-theme-dark body .engine-btn,
html.studio-theme-dark body .mode-btn,
html.studio-theme-dark body .provider-btn,
html.studio-theme-dark body .crop-ratio-btn,
html.studio-theme-dark body .resolution-picker-option,
body.studio-theme-dark .size-btn,
body.studio-theme-dark .model-option,
body.studio-theme-dark .ratio-option,
body.studio-theme-dark .resolution-option,
body.studio-theme-dark .mini-ratio button,
body.studio-theme-dark .mode-switch button,
body.studio-theme-dark .engine-btn,
body.studio-theme-dark .mode-btn,
body.studio-theme-dark .provider-btn,
body.studio-theme-dark .crop-ratio-btn,
body.studio-theme-dark .resolution-picker-option,
body .size-btn,
body .model-option,
body .ratio-option,
body .resolution-option,
body .mini-ratio button,
body .mode-switch button,
body .engine-btn,
body .mode-btn,
body .provider-btn,
body .crop-ratio-btn,
body .resolution-picker-option {
    border-radius: 8px !important;
    border-width: 2px !important;
    background: var(--dv-card) !important;
    color: var(--dv-ink) !important;
}

html.studio-theme-dark body .size-btn.active,
html.studio-theme-dark body .model-option.active,
html.studio-theme-dark body .ratio-option.active,
html.studio-theme-dark body .resolution-option.active,
html.studio-theme-dark body .mini-ratio button.active,
html.studio-theme-dark body .mode-switch button.active,
html.studio-theme-dark body .engine-btn.active,
html.studio-theme-dark body .mode-btn.active,
html.studio-theme-dark body .provider-btn.active,
body.studio-theme-dark .size-btn.active,
body.studio-theme-dark .model-option.active,
body.studio-theme-dark .ratio-option.active,
body.studio-theme-dark .resolution-option.active,
body.studio-theme-dark .mini-ratio button.active,
body.studio-theme-dark .mode-switch button.active,
body.studio-theme-dark .engine-btn.active,
body.studio-theme-dark .mode-btn.active,
body.studio-theme-dark .provider-btn.active,
body .size-btn.active,
body .model-option.active,
body .ratio-option.active,
body .resolution-option.active,
body .mini-ratio button.active,
body .mode-switch button.active,
body .engine-btn.active,
body .mode-btn.active,
body .provider-btn.active {
    background: var(--dv-accent) !important;
    border-color: var(--dv-stroke) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* --------------------------------------------------------------------------
   11. 灯箱 / 遮罩：减模糊，硬边化
   -------------------------------------------------------------------------- */

body .gallery-lightbox,
body #lightbox {
    backdrop-filter: blur(4px) !important;
}

body .gallery-lightbox img,
body #lightbox img,
body #lightboxImg,
body .masonry-item img,
body .result-frame img,
body .studio-preview-img {
    border-radius: 6px !important;
}

/* --------------------------------------------------------------------------
   12. 滚动条 / 选区 / 焦点
   -------------------------------------------------------------------------- */

* {
    scrollbar-color: var(--dv-scroll) transparent !important;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--dv-scroll) !important;
    border-radius: 2px !important;
}

body ::selection {
    background: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}

body :focus-visible {
    outline: 2px dashed var(--dv-accent) !important;
    outline-offset: 2px !important;
}

body ::placeholder {
    color: var(--dv-stroke-soft) !important;
    opacity: .8 !important;
}

/* --------------------------------------------------------------------------
   13. 无限画布：节点卡片 / 头部 / 端口 / 缩略图 / 内部卡片
   -------------------------------------------------------------------------- */

/* 画布世界底色：纸面 + 印刷网点，和主页一致（覆盖旧点阵配色）
   ★★ 点阵只保留在 #board（静态层，鼠标滚轮缩放时点的大小不变）。
   #world 是随 zoom 一起缩放的子层，这里必须保持「透明 + 无背景图」：
   否则 #world 自己那层点会跟着放大缩小，还会因为不透明底色把 #board 的静态点整个盖住。
   （改动记录 2026-09-14：删除 .world 的点阵，只留 #board 的静态点） */
body #board,
body .shell {
    background-color: var(--dv-bg) !important;
}
body .world {
    background-color: transparent !important;
    background-image: none !important;
}

/* 节点卡片：10px 圆角 + 2px 描边 + 硬投影（普通节点 / prompt 卡 / 底部输入卡） */
body .image-node:not(.group-node):not(.smart-group-node),
body .prompt-node-card,
body .composer-card {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
}
body .image-node.selected:not(.group-node):not(.smart-group-node),
body .image-node.drop-target {
    border-color: var(--dv-accent) !important;
    box-shadow: var(--dv-shadow) !important;
}
body .image-node.dragging:not(.group-node):not(.smart-group-node) {
    box-shadow: var(--dv-shadow-lg) !important;
}

/* 空节点 / 上传节点：虚线描边的"占位海报框" */
body .image-node.empty-node,
body .upload-node-main,
body .workflow-import-drop,
body .asset-drop-zone {
    border: 2px dashed var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    background-color: var(--dv-card) !important;
    color: var(--dv-ink-soft) !important;
    box-shadow: none !important;
}
body .image-node.empty-node:hover,
body .image-node.empty-node.selected,
body .workflow-import-drop:hover,
body .workflow-import-drop.drag-over {
    border-color: var(--dv-accent) !important;
    color: var(--dv-ink) !important;
}

/* 分组框：保留大范围半透明框，改暖棕实描边 */
body .image-node.group-node,
body .image-node.history-group-node,
body .image-node.smart-group-node {
    border: 2px dashed var(--dv-stroke-soft) !important;
    border-radius: 12px !important;
}
body .image-node.group-node.selected,
body .image-node.smart-group-node.selected {
    border-color: var(--dv-accent) !important;
    border-style: solid !important;
}
body .image-node.drag-out {
    border-color: var(--dv-accent-2) !important;
}

/* 节点头部：次级色块 + 衬线标题 */
body .image-node:not(.empty-node) .node-head {
    background-color: var(--dv-card-2) !important;
    border-bottom: 2px solid var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body .image-node:not(.empty-node) .node-title {
    color: var(--dv-ink) !important;
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
}
body .image-node:not(.empty-node) .node-hint {
    color: var(--dv-ink-soft) !important;
}

/* 端口：复古方点（圆角 4px + 2px 实描边） */
body .node-port {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}
body .node-port:hover,
body .node-port.is-active,
body .image-node.port-hover .node-port,
body .image-node.selected .node-port {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-accent) !important;
}

/* 缩放手柄：方角墨点 */
body .node-resize-handle {
    border-color: var(--dv-stroke-soft) !important;
    background-color: var(--dv-card) !important;
    border-radius: 2px !important;
}
body .node-resize-handle:hover {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-accent) !important;
}

/* 节点内图片 / 缩略图：方一点 + 描边 */
body .node-img,
body .image-wrap > img,
body .thumb-item {
    border-radius: 8px !important;
}
body .thumb-item {
    border: 2px solid var(--dv-stroke-soft) !important;
}
body .smart-node-input-thumb {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 6px !important;
}
body .smart-node-input-badge,
body .smart-node-input-more {
    background-color: var(--dv-ink) !important;
    color: var(--dv-paper) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}

/* 媒体卡（视频 / 音频 / 文件）：次级面板色 */
body .media-video-card,
body .media-audio-card,
body .media-file-card,
body .minimax-material-card,
body .minimax-current-panel,
body .loop-smart-card,
body .loop-smart-panel,
body .minimax-card,
body .minimax-player-card,
body .smart-group-card {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    color: var(--dv-ink) !important;
}
body .media-card-title,
body .media-card-sub {
    color: var(--dv-ink) !important;
}
body .media-card-title {
    font-family: var(--dv-heading-font) !important;
}

/* prompt 节点内部：文本区 / 分段 / 选项块 */
body .prompt-node-text,
body .prompt-node-segment,
body .prompt-node-upstream-list,
body .prompt-node-split-control,
body .dynamic-params,
body .popover-fields {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body .prompt-node-text {
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
}
body .prompt-node-pill {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    color: var(--dv-ink-soft) !important;
    font-weight: 700 !important;
}
body .prompt-node-pill.active {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}
body .prompt-node-run:not(:disabled) {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    font-weight: 700 !important;
}

/* 选中框 / 蒙版描边 */
body .selection-box {
    border: 2px dashed var(--dv-accent) !important;
    border-radius: 4px !important;
}

/* --------------------------------------------------------------------------
   14. 无限画布：浮动操作 / 弹层 / 外壳控件 / 提示
   -------------------------------------------------------------------------- */

/* 浮动操作条：硬边小卡 */
body .floating-node-actions,
body .smart-node-floating-menu,
body .node-actions {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
}
body .floating-node-actions button,
body .smart-node-floating-menu button,
body .node-actions button,
body .asset-mini-btn,
body .image-edit-btn,
body .preview-icon-btn,
body .preview-nav-btn,
body .minimap-arrange-btn,
body .composer-template-btn {
    background-color: transparent !important;
    color: var(--dv-ink) !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}
body .floating-node-actions button:hover,
body .smart-node-floating-menu button:hover,
body .node-actions button:hover,
body .asset-mini-btn:hover,
body .image-edit-btn:hover,
body .preview-icon-btn:hover,
body .preview-nav-btn:hover,
body .minimap-arrange-btn:hover {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: none !important;
}

/* 参数弹层：描边硬投影小海报 */
body .smart-popover,
body .model-popover,
body .compact-popover,
body .loop-number-popover,
body .slider-popover,
body .rh-slider-popover,
body .rh-param-popover,
body .rh-picker-popover,
body .comfy-popover,
body .mention-picker,
body .input-prompt-preview {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow) !important;
    color: var(--dv-ink) !important;
}
body .smart-popover-title,
body .rh-picker-popover .smart-popover-title {
    color: var(--dv-ink) !important;
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
}

/* 侧边面板群：资产库 / 快捷键 / 日志 / 工作流转入 / 预设 / 模板 */
body .asset-panel,
body .shortcut-panel,
body .log-panel,
body .workflow-transfer-panel,
body .prompt-preset-panel,
body .prompt-template-panel,
body .image-edit-panel,
body .panorama-controls,
body .grid-join-canvas {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
}
body .asset-head,
body .log-head,
body .shortcut-head,
body .image-edit-head,
body .prompt-preset-panel-head,
body .workflow-transfer-head {
    border-bottom: 2px solid var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body .asset-title,
body .log-title,
body .shortcut-title,
body .image-edit-title,
body .workflow-transfer-title {
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
    color: var(--dv-ink) !important;
}
body .workflow-transfer-card {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    color: var(--dv-ink) !important;
}
body .workflow-transfer-btn {
    font-weight: 700 !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .asset-tab {
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    background-color: var(--dv-card-2) !important;
    color: var(--dv-ink-soft) !important;
    font-weight: 700 !important;
}
body .asset-tab.active {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}

/* 画布顶栏标题 / 小地图 */
body .smart-title {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
    font-family: var(--dv-heading-font) !important;
}
body .smart-minimap {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .smart-minimap-viewport,
body .minimap-viewport {
    border: 2px solid var(--dv-accent) !important;
    border-radius: 2px !important;
}

/* 资产弹窗 */
body .asset-dialog {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 12px !important;
    box-shadow: var(--dv-shadow-lg) !important;
    color: var(--dv-ink) !important;
}
body .asset-dialog-title {
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
}
body .asset-dialog-btn {
    font-weight: 700 !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
}
body .asset-dialog-btn.primary,
body #assetDialogOk {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}

/* 提示 toast：强调色硬边标签 */
body .toast {
    background-color: var(--dv-ink) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-paper) !important;
    font-weight: 700 !important;
}
html.studio-theme-dark body .toast,
body.studio-theme-dark .toast {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}

/* --------------------------------------------------------------------------
   15. API 设置：页面骨架 / 卡片块 / 标题
   -------------------------------------------------------------------------- */

body .layout {
    background-color: transparent !important;
    color: var(--dv-ink) !important;
}
body .sidebar {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .provider-item,
body .provider-list > button,
body .picker-summary {
    border-radius: 8px !important;
}
body .provider-item.active,
body .provider-onboarding-card {
    border: 2px solid var(--dv-accent) !important;
}
body .content-head,
body .models-toolbar {
    border-bottom: 2px solid var(--dv-stroke-soft) !important;
}
body .editor-title {
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
    color: var(--dv-ink) !important;
}
body .editor-sub,
body .hint,
body .sub,
body .ms-hint,
body .rh-key-desc,
body .recommend-note,
body .apimart-hint,
body .runninghub-hint,
body .volcengine-hint {
    color: var(--dv-ink-soft) !important;
}

/* 设置卡片块：统一米面 + 描边 + 硬投影 */
body .block,
body .key-panel,
body .form,
body .key-input-line,
body .field-frame,
body .volcengine-project-card,
body .recommend-inline-card,
body .rh-key-item,
body .cli-quick-group,
body .jimeng-cli-panel,
body .provider-onboarding-card {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
}
body .block-head {
    border-bottom: 2px solid var(--dv-stroke-soft) !important;
}
body .block-title,
body .side-section-title,
body .rh-card-title-field {
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
    color: var(--dv-ink) !important;
}
body .label,
body .api-key-label {
    color: var(--dv-ink-soft) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    font-size: .72rem !important;
}

/* 模型列表 / 网格条目 */
body .model-list,
body .model-grid {
    color: var(--dv-ink) !important;
}
body .model-list > *,
body .model-grid > * {
    border-radius: 8px !important;
}

/* 状态药丸：方角 + 描边 */
body .status-pill,
body .jimeng-status-pill {
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 6px !important;
    background-color: var(--dv-card-2) !important;
    color: var(--dv-ink) !important;
    font-weight: 700 !important;
}

/* --------------------------------------------------------------------------
   16. API 设置：按钮 / 弹层 / RunningHub 编辑器
   -------------------------------------------------------------------------- */

/* 页面按钮统一：粗体 + 方角 + 描边，主操作 = 强调色硬投影 */
body .save-btn,
body .add-btn,
body .key-btn,
body .api-link-btn,
body .cli-quick-btn,
body .api-page-save-btn,
body .api-page-delete-btn,
body .key-clear,
body .picker-close {
    font-weight: 700 !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}
body .save-btn,
body .add-btn,
body .api-page-save-btn,
body .primary-btn {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .save-btn:hover,
body .add-btn:hover,
body .api-page-save-btn:hover,
body .primary-btn:hover {
    background-color: var(--dv-accent-hover) !important;
    color: var(--dv-accent-contrast) !important;
    transform: translate(-1px, -1px) !important;
    box-shadow: var(--dv-shadow) !important;
}
body .key-btn,
body .api-link-btn,
body .cli-quick-btn,
body .key-clear {
    background-color: var(--dv-card-2) !important;
    color: var(--dv-ink) !important;
    border-color: var(--dv-stroke-soft) !important;
}
body .key-btn:hover,
body .api-link-btn:hover,
body .cli-quick-btn:hover {
    border-color: var(--dv-accent) !important;
    color: var(--dv-accent) !important;
}
body .api-page-delete-btn {
    background-color: transparent !important;
    color: var(--dv-accent-2) !important;
    border-color: var(--dv-accent-2) !important;
}
body .api-page-delete-btn:hover {
    background-color: var(--dv-accent-2) !important;
    color: var(--dv-accent-contrast) !important;
}

/* 弹层 / 遮罩：硬边海报 */
body .picker-modal,
body .rh-workflow-editor-modal,
body .jimeng-help-modal,
body .recommend-api-body {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 12px !important;
    box-shadow: var(--dv-shadow-lg) !important;
    color: var(--dv-ink) !important;
}
body .picker-overlay,
body .rh-workflow-editor-overlay,
body #recommendApiOverlay {
    background-color: rgba(20, 20, 20, .55) !important;
}
html.studio-theme-dark body .picker-overlay,
html.studio-theme-dark body .rh-workflow-editor-overlay {
    background-color: rgba(0, 0, 0, .66) !important;
}
body .picker-head,
body .picker-foot,
body .rh-workflow-editor-head,
body .jimeng-cli-head {
    border-bottom: 2px solid var(--dv-stroke-soft) !important;
}
body .picker-title,
body .rh-workflow-editor-title,
body .rh-workflow-editor-side {
    font-family: var(--dv-heading-font) !important;
    font-weight: 700 !important;
    color: var(--dv-ink) !important;
}
body .picker-cat-tab {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    color: var(--dv-ink-soft) !important;
    font-weight: 700 !important;
}
body .picker-cat-tab.active {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}
body .picker-sum-chip {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 6px !important;
    color: var(--dv-ink) !important;
}
body .picker-sum-chip-empty {
    border-style: dashed !important;
    color: var(--dv-ink-soft) !important;
}

/* RunningHub 工作流编辑器面板 */
body .rh-workflow-editor-side {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
}
body .rh-editor-field,
body .rh-paste-row,
body .rh-group-head {
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    background-color: var(--dv-card-2) !important;
    color: var(--dv-ink) !important;
}
body .rh-workflow-editor-actions .primary-btn {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* 行内代码 / Key 展示：墨底纸字小标签 */
body .inline-code {
    background-color: var(--dv-card-2) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 6px !important;
    color: var(--dv-ink) !important;
}
body .output,
body .jimeng-output,
body .jimeng-help-output {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 8px !important;
    color: var(--dv-ink) !important;
}

/* --------------------------------------------------------------------------
   17. API 设置页：--api-* 令牌重映射
   api-settings.css 里有大量高特异性的 !important 背景规则（如
   body:not(.studio-theme-dark) .block { background:var(--api-light-panel) }），
   直接压制追加规则。这里不再逐条硬顶，而是把它的整条令牌链改指向
   复古海报 --dv-* 令牌，让那些 !important 规则自然渲染出正确颜色。
   -------------------------------------------------------------------------- */

/* —— 浅色：remap 到秋日纸面 —— */
:root {
    --api-light-page: var(--dv-bg);
    --api-light-panel: var(--dv-card);
    --api-light-soft: var(--dv-card-2);
    --api-light-raised: var(--dv-card-2);
    --api-light-hover: var(--dv-card-2);
    --api-light-line: var(--dv-stroke-soft);
    --api-light-line-strong: var(--dv-stroke-soft);
    --api-light-text: var(--dv-ink);
    --api-light-muted: var(--dv-ink-soft);
    --api-light-faint: var(--dv-ink-soft);
    --api-light-primary: var(--dv-accent);
    --api-light-primary-hover: var(--dv-accent-hover);
    /* 通用 / readable 系列同样收口 */
    --api-page-bg: var(--dv-bg);
    --api-panel-bg: var(--dv-card);
    --api-surface-bg: var(--dv-card);
    --api-soft-bg: var(--dv-card-2);
    --api-line: var(--dv-stroke-soft);
    --api-line-strong: var(--dv-stroke);
    --api-readable-bg: var(--dv-card);
    --api-readable-panel: var(--dv-card);
    --api-readable-field: var(--dv-card);
    --api-readable-soft: var(--dv-card-2);
    --api-readable-line: var(--dv-stroke-soft);
    --api-readable-button: var(--dv-accent);
    --api-readable-button-hover: var(--dv-accent-hover);
    /* 投影：收口为硬投影体系（--api-shadow 用于弹窗大投影，--api-shadow-sm 用于小控件） */
    --api-shadow: var(--dv-shadow-lg);
    --api-shadow-sm: var(--dv-shadow-sm);
}

/* —— 深色：remap 到夜棕纸面（与 api-settings.css 的宿主选择器同特异性，末位加载取胜） —— */
html.studio-theme-dark body,
body.studio-theme-dark,
html.theme-dark body,
body.theme-dark {
    --api-dark-page: var(--dv-bg);
    --api-dark-panel: var(--dv-card);
    --api-dark-soft: var(--dv-card-2);
    --api-dark-raised: var(--dv-card-2);
    --api-dark-hover: #33291f;
    --api-dark-line: var(--dv-stroke-soft);
    --api-dark-line-strong: var(--dv-stroke);
    --api-dark-text: var(--dv-ink);
    --api-dark-muted: var(--dv-ink-soft);
    --api-dark-faint: var(--dv-ink-soft);
    --api-dark-primary: var(--dv-accent);
    --api-dark-primary-hover: var(--dv-accent-hover);
}

/* 页面级底色兜底（部分规则直接硬写 #221d18 / #f5f7fa 等，特异性较低，可压回） */
html.studio-theme-dark body .page,
body.studio-theme-dark .page,
body .page {
    background-color: transparent !important;
    color: var(--dv-ink) !important;
}

/* RunningHub 编辑器中的硬写浅色块（白底输入类），统一收口 */
html.studio-theme-dark body .rh-paste-input,
body.studio-theme-dark .rh-paste-input,
html.studio-theme-dark body .rh-paste-row input,
body.studio-theme-dark .rh-paste-row input {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}

/* --------------------------------------------------------------------------
   18. API 设置页：高特异性按钮颜色补刀
   api-settings.css 用 body:not(.studio-theme-dark) .action-btn.xxx 这类
   高特异性 + !important 写死了部分按钮颜色，普通 body .xxx 压不住。
   这里用与之同构的选择器（design.css 末位加载取胜）把主操作按钮统一
   回复古令牌：强调色底 + 纸白字。
   -------------------------------------------------------------------------- */

html.studio-theme-dark body .action-btn.save-btn,
body.studio-theme-dark .action-btn.save-btn,
html.theme-dark body .action-btn.save-btn,
body.theme-dark .action-btn.save-btn,
body:not(.studio-theme-dark) .action-btn.save-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .action-btn.save-btn,
html.studio-theme-dark body .action-btn.primary-btn,
body.studio-theme-dark .action-btn.primary-btn,
body:not(.studio-theme-dark) .action-btn.primary-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .action-btn.primary-btn {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    border-color: var(--dv-stroke) !important;
}

/* 删除 / 危险类按钮：陶红描边方案 */
html.studio-theme-dark body .action-btn.danger-btn,
body.studio-theme-dark .action-btn.danger-btn,
body:not(.studio-theme-dark) .action-btn.danger-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .action-btn.danger-btn {
    background-color: transparent !important;
    border-color: var(--dv-accent-2) !important;
    color: var(--dv-accent-2) !important;
}

/* --------------------------------------------------------------------------
   19. API 设置页：推荐 / 新手引导区硬编码颜色收编
   api-settings.css 浅色区用 body:not(...) .onboarding-x / .recommend-x
   硬编码 #221d18 深色卡（不经过 --api-* 令牌），这里用同构选择器 + 末位
   加载覆盖回复古纸面体系；深色变体直接指向 --dv-* 令牌，两种模式都统一。
   -------------------------------------------------------------------------- */

/* —— 引导卡 / 来源组 / 平台信息：浅色=米黄纸卡，深色=夜棕卡 —— */
body:not(.studio-theme-dark) .provider-onboarding-card,
html:not(.studio-theme-dark) body:not(.theme-dark) .provider-onboarding-card,
body:not(.studio-theme-dark) .onboarding-rh-source-group,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-rh-source-group,
body:not(.studio-theme-dark) .recommend-platform-info,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-platform-info,
html.studio-theme-dark body .provider-onboarding-card,
body.studio-theme-dark .provider-onboarding-card,
html.studio-theme-dark body .onboarding-rh-source-group,
body.studio-theme-dark .onboarding-rh-source-group,
html.studio-theme-dark body .recommend-platform-info,
body.studio-theme-dark .recommend-platform-info,
html.theme-dark body .provider-onboarding-card,
body.theme-dark .provider-onboarding-card {
    background-color: var(--dv-card-2) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* 引导卡内的输入框：纸面底 */
body:not(.studio-theme-dark) .onboarding-key-field input,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-key-field input,
html.studio-theme-dark body .onboarding-key-field input,
body.studio-theme-dark .onboarding-key-field input {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body:not(.studio-theme-dark) .onboarding-key-field input:focus,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-key-field input:focus,
html.studio-theme-dark body .onboarding-key-field input:focus,
body.studio-theme-dark .onboarding-key-field input:focus {
    border-color: var(--dv-accent) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* 引导区标题 / 描述文字 */
body:not(.studio-theme-dark) .onboarding-title,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-title,
body:not(.studio-theme-dark) .onboarding-step-title,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-step-title,
body:not(.studio-theme-dark) .recommend-name,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-name,
html.studio-theme-dark body .onboarding-title,
body.studio-theme-dark .onboarding-title {
    color: var(--dv-ink) !important;
    font-family: var(--dv-heading-font) !important;
}
body:not(.studio-theme-dark) .onboarding-desc,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-desc,
body:not(.studio-theme-dark) .recommend-platform-summary,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-platform-summary {
    color: var(--dv-ink-soft) !important;
}

/* 步骤面板 / 平台卡 / 设置块：次级面 */
body:not(.studio-theme-dark) .onboarding-step-panel,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-step-panel,
body:not(.studio-theme-dark) .recommend-platform-card,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-platform-card,
body:not(.studio-theme-dark) .recommend-platform-setup,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-platform-setup {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}

/* 引导按钮：取 Key = 次级纸卡，保存 = 强调色 */
body:not(.studio-theme-dark) .onboarding-key-btn,
body:not(.studio-theme-dark) .recommend-guide-key-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-key-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-guide-key-btn,
html.studio-theme-dark body .onboarding-key-btn,
body.studio-theme-dark .onboarding-key-btn {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    color: var(--dv-ink) !important;
    font-weight: 700 !important;
}
body:not(.studio-theme-dark) .onboarding-save-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-save-btn,
html.studio-theme-dark body .onboarding-save-btn,
body.studio-theme-dark .onboarding-save-btn {
    background-color: var(--dv-accent) !important;
    border: 2px solid var(--dv-stroke) !important;
    border-radius: 8px !important;
    color: var(--dv-accent-contrast) !important;
    font-weight: 700 !important;
}
body:not(.studio-theme-dark) .onboarding-save-btn:hover,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-save-btn:hover {
    background-color: var(--dv-accent-hover) !important;
}

/* 徽章 / 标签：统一米黄面 + 强调色字 */
body:not(.studio-theme-dark) .recommend-badge,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-badge,
body:not(.studio-theme-dark) .onboarding-badge,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-badge,
body:not(.studio-theme-dark) .recommend-cap-icons span,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-cap-icons span,
body:not(.studio-theme-dark) .recommend-tag,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-tag {
    background-color: var(--dv-card-2) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-accent) !important;
}

/* 蓝色箭头 / 装饰点：换成强调酒红 */
body:not(.studio-theme-dark) .recommend-flow-arrow,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-flow-arrow,
body:not(.studio-theme-dark) .recommend-vertical-arrow,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-vertical-arrow {
    color: var(--dv-accent) !important;
}
body:not(.studio-theme-dark) .recommend-advantages span::before,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-advantages span::before {
    background-color: var(--dv-accent) !important;
}

/* --------------------------------------------------------------------------
   20. API 设置页：剩余硬编码深色卡 / 保存按钮文字 / 深色推荐按钮收口
   -------------------------------------------------------------------------- */

/* 浅色模式下硬编码 #221d18 的剩余容器 → 米黄纸卡 */
body:not(.studio-theme-dark) .onboarding-rh-row-field,
html:not(.studio-theme-dark) body:not(.theme-dark) .onboarding-rh-row-field,
body:not(.studio-theme-dark) .recommend-guide-save,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-guide-save,
body:not(.studio-theme-dark) .runninghub-config-block,
html:not(.studio-theme-dark) body:not(.theme-dark) .runninghub-config-block,
body:not(.studio-theme-dark) .rh-paste-row,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-paste-row,
body:not(.studio-theme-dark) .rh-group-count,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-group-count,
body:not(.studio-theme-dark) .rh-config-card,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-config-card,
body:not(.studio-theme-dark) .rh-empty,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-empty {
    background-color: var(--dv-card-2) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink-soft) !important;
}
body:not(.studio-theme-dark) .rh-card-title-field input,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-card-title-field input {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body:not(.studio-theme-dark) .rh-thumb,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-thumb {
    background-color: var(--dv-card-2) !important;
    border-color: var(--dv-stroke-soft) !important;
}

/* 引导区保存按钮链：强调色底 + 纸白字（镜像其同构选择器，末位取胜） */
.provider-onboarding-card .onboarding-save-btn,
.recommend-inline-card .onboarding-save-btn,
.recommend-inline-card .recommend-guide-save-btn,
body:not(.studio-theme-dark) .provider-onboarding-card .onboarding-save-btn,
body:not(.studio-theme-dark) .recommend-inline-card .onboarding-save-btn,
body:not(.studio-theme-dark) .recommend-inline-card .recommend-guide-save-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .provider-onboarding-card .onboarding-save-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-inline-card .onboarding-save-btn,
html:not(.studio-theme-dark) body:not(.theme-dark) .recommend-inline-card .recommend-guide-save-btn,
body.studio-theme-dark .provider-onboarding-card .onboarding-save-btn,
body.studio-theme-dark .recommend-inline-card .onboarding-save-btn,
body.studio-theme-dark .recommend-inline-card .recommend-guide-save-btn,
html.studio-theme-dark body .provider-onboarding-card .onboarding-save-btn,
html.studio-theme-dark body .recommend-inline-card .onboarding-save-btn,
html.studio-theme-dark body .recommend-inline-card .recommend-guide-save-btn {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-stroke) !important;
    color: var(--dv-accent-contrast) !important;
}
.provider-onboarding-card .onboarding-save-btn:hover,
.recommend-inline-card .onboarding-save-btn:hover,
.recommend-inline-card .recommend-guide-save-btn:hover {
    background-color: var(--dv-accent-hover) !important;
    color: var(--dv-accent-contrast) !important;
}

/* 深色模式左侧"推荐API"入口按钮：南瓜橙主操作 */
body.studio-theme-dark .api-link-btn,
body.studio-theme-dark .api-link-btn:hover,
body.studio-theme-dark.show-recommend-mode .api-link-btn,
html.studio-theme-dark body .api-link-btn,
html.studio-theme-dark body .api-link-btn:hover,
html.studio-theme-dark body.show-recommend-mode .api-link-btn {
    background-color: var(--dv-accent) !important;
    border-color: var(--dv-stroke) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}

/* RunningHub 组标题深色文字统一 */
body:not(.studio-theme-dark) .rh-group-title,
html:not(.studio-theme-dark) body:not(.theme-dark) .rh-group-title {
    color: var(--dv-ink) !important;
    font-family: var(--dv-heading-font) !important;
}

/* --------------------------------------------------------------------------
   21. API 设置页：通用调色板变量收编（修复深色冷蓝 + 标题低对比）
   api-settings.css 在 :root 与深色作用域里重定义了 --panel/--soft/--text
   等通用变量（冷蓝灰；--text 甚至写成深棕导致暗底标题不可读）。
   design.css 末位加载，用同名变量把它整体指回复古暖色系。
   -------------------------------------------------------------------------- */

:root {
    --bg: var(--dv-bg);
    --panel: var(--dv-card);
    --soft: var(--dv-card-2);
    --line: var(--dv-stroke-soft);
    --line-strong: var(--dv-stroke-soft);
    --text: var(--dv-ink);
    --muted: var(--dv-ink-soft);
    --faint: var(--dv-ink-soft);
}

body.studio-theme-dark,
html.studio-theme-dark body,
body.theme-dark,
html.theme-dark body {
    --bg: var(--dv-bg);
    --panel: var(--dv-card);
    --soft: var(--dv-card-2);
    --line: var(--dv-stroke-soft);
    --line-strong: var(--dv-stroke);
    --text: var(--dv-ink);
    --muted: var(--dv-ink-soft);
    --faint: var(--dv-ink-soft);
}

/* 深色推荐卡悬停：暖棕抬升一档即可，别回冷蓝 */
body.studio-theme-dark .recommend-card:hover,
html.studio-theme-dark body .recommend-card:hover,
body.studio-theme-dark .recommend-platform-card:hover,
html.studio-theme-dark body .recommend-platform-card:hover {
    border-color: var(--dv-accent) !important;
}

/* 平台卡标题：纸色字，压在暖棕卡上可读 */
body.studio-theme-dark .recommend-name,
html.studio-theme-dark body .recommend-name,
body.studio-theme-dark .onboarding-title,
html.studio-theme-dark body .onboarding-title,
body.studio-theme-dark .onboarding-step-title,
html.studio-theme-dark body .onboarding-step-title {
    color: var(--dv-ink) !important;
}

/* --------------------------------------------------------------------------
   22. API 设置页：模型选择器弹层深色底上的低对比文字
   api-settings.css 硬编码 .picker-summary-title:#2a241e、
   .picker-sum-chip-empty 深色底配近黑字，夜底不可读。收口到暖色令牌。
   -------------------------------------------------------------------------- */

html.studio-theme-dark body .picker-summary-title,
body.studio-theme-dark .picker-summary-title,
html.theme-dark body .picker-summary-title,
body.theme-dark .picker-summary-title {
    color: var(--dv-ink) !important;
}

html.studio-theme-dark body .picker-sum-chip,
body.studio-theme-dark .picker-sum-chip,
html.studio-theme-dark body .picker-sum-chip-empty,
body.studio-theme-dark .picker-sum-chip-empty,
html.theme-dark body .picker-sum-chip,
body.theme-dark .picker-sum-chip {
    background-color: var(--dv-card-2) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   23. 2026.09.09 浏览器巡检补充：残余大圆角面板与柔光阴影收口
   -------------------------------------------------------------------------- */

/* 通用 Tailwind 大圆角类统一压到 10px（圆形/胶囊元素单独豁免） */
body [class*="rounded-2xl"],
body [class*="rounded-3xl"],
body [class*="rounded-[1"],
body [class*="rounded-[2"] {
    border-radius: 10px !important;
}

/* 各页残余大圆角面板/卡片/输入 */
body .upload-item,
body .content-head,
body .recommend-card,
body .recommend-platform-card,
body .recommend-platform-setup,
body .recommend-api-body,
body .recommend-inline-body,
body .recommend-guide-save,
body .recommend-guide-source,
body .recommend-platform-info,
body .detail-empty,
body .empty-state,
body .upload-grid-card,
body .graph-card,
body .side-card,
body .composer,
body .composer-body,
body .asset-empty,
body .prompt-input,
body .shortcut-modal,
body .smart-minimap-content,
body .system-prompt-popover,
body .ws-card {
    border-radius: 10px !important;
}

/* 毛玻璃/柔光阴影组件：压平为复古纸面 + 硬投影 */
body .composer,
body .shortcut-modal,
body .system-prompt-popover,
body .ws-card {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    box-shadow: var(--dv-shadow-sm) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* --------------------------------------------------------------------------
   24. 2026.09.09 GPT 对话页（gpt-chat.html）全量收口
   根因：gpt-chat.html 内联 <style> 在 design.css 之后声明 :root{--chat-*}，
   同特异性下后者优先。故这里给 --chat-* 重映射全部加 !important，
   重要声明无视加载顺序压回复古令牌；再对弹层/气泡等结构组件补硬边。
   -------------------------------------------------------------------------- */

/* —— 浅色：冷蓝灰 → autumn 纸面暖色 —— */
:root {
    --chat-bg: #f1f1f1 !important;
    --chat-panel: #faf6ec !important;
    --chat-panel-2: #f3ecdd !important;
    --chat-soft: #e9e3d8 !important;
    --chat-line: #826a5c !important;
    --chat-line-2: #6b5545 !important;
    --chat-text: #141414 !important;
    --chat-muted: #5d5347 !important;
    --chat-faint: #8a7a66 !important;
    --chat-strong: #8c0327 !important;
    --chat-strong-text: #f6e7d7 !important;
    --chat-strong-hover: #a3042f !important;
    --chat-active-bg: #e9dcc8 !important;
    --chat-active-text: #141414 !important;
    --chat-active-border: #826a5c !important;
    --chat-user-bg: #2a241e !important;
    --chat-user-text: #f6e7d7 !important;
    --chat-shadow: rgba(20, 20, 20, .10) !important;
}

/* —— 深色：压回 halloween 暖色（修掉 --chat-muted/--chat-active-bg 等冷蓝残留） —— */
html.studio-theme-dark,
html.theme-dark,
body.studio-theme-dark,
body.theme-dark {
    --chat-bg: #1b1816 !important;
    --chat-panel: #221d18 !important;
    --chat-panel-2: #2a241e !important;
    --chat-soft: #2a241e !important;
    --chat-line: #52402a !important;
    --chat-line-2: #8a6b45 !important;
    --chat-text: #e9e2d6 !important;
    --chat-muted: #c9b391 !important;
    --chat-faint: #93805f !important;
    --chat-strong: #ff8f00 !important;
    --chat-strong-text: #131616 !important;
    --chat-strong-hover: #ffa133 !important;
    --chat-active-bg: #2f2417 !important;
    --chat-active-text: #e9e2d6 !important;
    --chat-active-border: #8a6b45 !important;
    --chat-user-bg: #3d2c14 !important;
    --chat-user-text: #f5ead6 !important;
    --chat-shadow: rgba(0, 0, 0, .28) !important;
}

/* 对话页骨架面板：纸面底，不吃旧冷色 */
body .chat-shell {
    background-color: var(--dv-bg) !important;
    color: var(--dv-ink) !important;
}

/* 侧栏历史 / 系统提示词 / 模型选择 / 分辨率弹层：纸卡 + 2px 描边 + 硬投影，去毛玻璃 */
body .chat-rail,
body .model-picker-popover,
body .resolution-picker-popover {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--dv-ink) !important;
}

/* 气泡：10px 圆角、2px 描边、硬投影 */
body .bubble {
    border-radius: 10px !important;
    border-width: 2px !important;
    border-style: solid !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .bubble.user {
    background-color: var(--chat-user-bg) !important;
    border-color: var(--dv-stroke) !important;
    color: var(--chat-user-text) !important;
}
body .bubble.assistant {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}
body .bubble img.generated {
    border-radius: 10px !important;
    border-width: 2px !important;
}

/* 触发按钮：模型 / 分辨率选择器统一复古描边，去内阴影与柔影 */
body .model-picker-button,
body .resolution-picker-button,
body .model-picker-scope,
body .resolution-picker-scope {
    border-radius: 10px !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: var(--dv-stroke-soft) !important;
    background-color: var(--dv-card) !important;
    color: var(--dv-ink) !important;
    box-shadow: var(--dv-shadow-sm) !important;
}
body .model-picker-scope button.active,
body .resolution-picker-scope button.active,
body .mode-switch button.active {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
    box-shadow: none !important;
}
body .model-picker-option.active {
    background-color: var(--dv-accent) !important;
    color: var(--dv-accent-contrast) !important;
}

/* 上传钮 / 引用芯片 / 文件芯片 / 系统提示词输入框 / 自定义分辨率盒：统一 10px + 2px */
body .upload-btn,
body .ref-chip,
body .system-prompt-textarea,
body .resolution-custom-box,
body .resolution-custom-row input {
    border-radius: 10px !important;
    border-width: 2px !important;
    border-style: solid !important;
}
body .upload-btn,
body .ref-chip {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink-soft) !important;
}
body .system-prompt-textarea,
body .resolution-custom-box {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    color: var(--dv-ink) !important;
}

/* 顶栏标题：衬线 + 副题小标签全大写 */
body .title-block h1 {
    font-family: var(--dv-heading-font) !important;
}
body .title-block p {
    text-transform: uppercase !important;
    letter-spacing: .12em !important;
}

/* 输入区底衬渐变：改为复古纸色渐隐，不留冷白 */
body .composer-wrap {
    background: linear-gradient(to top, var(--dv-bg) 82%, rgba(241, 241, 241, 0)) !important;
}
html.studio-theme-dark body .composer-wrap,
body.studio-theme-dark .composer-wrap {
    background: linear-gradient(to top, var(--dv-bg) 82%, rgba(27, 24, 22, 0)) !important;
}

/* --------------------------------------------------------------------------
   25. 2026.09.09 GPT 对话页深色模式高特异性收口
   根因：theme.css / 页面内联 <style> 的深色规则用 `html.studio-theme-dark body X`
   （0,2,2）且带 !important，硬编码 #334155 冷蓝描边、rgba(23,29,41,.96) 冷蓝底、
   0 18px 44px 柔光阴影，压过了第 24 节的 `body X`（0,1,1）。
   本节用同等特异性 + 双类加成压回复古令牌。
   -------------------------------------------------------------------------- */

/* 次级按钮冷蓝描边 → 暖棕描边（浅色一并按同特异性对齐，无副作用） */
html.studio-theme-dark body.studio-theme-dark .action-btn,
body.studio-theme-dark .action-btn,
html.theme-dark body.theme-dark .action-btn,
body.theme-dark .action-btn,
html.studio-theme-dark body.studio-theme-dark .upload-btn,
body.studio-theme-dark .upload-btn {
    border-color: var(--dv-stroke-soft) !important;
    background-color: var(--dv-card) !important;
    color: var(--dv-ink-soft) !important;
    box-shadow: none !important;
}

/* 输入区：去柔光阴影与冷底，压回纸卡 + 硬投影（内联规则为 (0,2,1)，本节 (0,2,2) 必胜） */
html.studio-theme-dark body.studio-theme-dark .composer,
body.studio-theme-dark .composer,
html.theme-dark body.theme-dark .composer,
body.theme-dark .composer {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow-sm) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html.studio-theme-dark body.studio-theme-dark .composer-body,
body.studio-theme-dark .composer-body,
html.theme-dark body.theme-dark .composer-body,
body.theme-dark .composer-body {
    background-color: var(--dv-card-2) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: var(--dv-ink) !important;
}

/* 弹层（历史 rail / 系统提示词 / 模型 / 分辨率）：冷蓝毛玻璃 → 暖纸卡硬投影 */
html.studio-theme-dark body.studio-theme-dark .chat-rail,
body.studio-theme-dark .chat-rail,
html.theme-dark body.theme-dark .chat-rail,
body.theme-dark .chat-rail,
html.studio-theme-dark body.studio-theme-dark .system-prompt-popover,
body.studio-theme-dark .system-prompt-popover,
html.theme-dark body.theme-dark .system-prompt-popover,
body.theme-dark .system-prompt-popover,
html.studio-theme-dark body.studio-theme-dark .model-picker-popover,
body.studio-theme-dark .model-picker-popover,
html.theme-dark body.theme-dark .model-picker-popover,
body.theme-dark .model-picker-popover,
html.studio-theme-dark body.studio-theme-dark .resolution-picker-popover,
body.studio-theme-dark .resolution-picker-popover,
html.theme-dark body.theme-dark .resolution-picker-popover,
body.theme-dark .resolution-picker-popover {
    background-color: var(--dv-card) !important;
    border: 2px solid var(--dv-stroke-soft) !important;
    border-radius: 10px !important;
    box-shadow: var(--dv-shadow) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--dv-ink) !important;
}

/* 顶栏（若深色写死 rgba(11,9,8,.8) 冷黑玻璃）：对齐夜纸面 */
html.studio-theme-dark body.studio-theme-dark .topbar,
body.studio-theme-dark .topbar,
html.theme-dark body.theme-dark .topbar,
body.theme-dark .topbar {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 深色下模型/分辨率触发器与 scope：去冷蓝阴影残留 */
html.studio-theme-dark body.studio-theme-dark .model-picker-button,
body.studio-theme-dark .model-picker-button,
html.studio-theme-dark body.studio-theme-dark .resolution-picker-button,
body.studio-theme-dark .resolution-picker-button,
html.studio-theme-dark body.studio-theme-dark .model-picker-scope,
body.studio-theme-dark .model-picker-scope,
html.studio-theme-dark body.studio-theme-dark .resolution-picker-scope,
body.studio-theme-dark .resolution-picker-scope {
    background-color: var(--dv-card) !important;
    border-color: var(--dv-stroke-soft) !important;
    box-shadow: var(--dv-shadow-sm) !important;
    color: var(--dv-ink) !important;
}