/* ============ 内部 UI 基座（ui.js）：自定义下拉 / 通用弹窗 / chip ============ */

/* ---- 自定义下拉 ---- */
  .ui-select { position: relative; display: inline-flex; width: 100%; }
  .ui-select[hidden] { display: none !important; } /* hidden 属性不被 display:inline-flex 覆盖 */
  .ui-pp-model-wrap { display: inline-flex; }
  .ui-pp-model-wrap[hidden] { display: none !important; } /* 模型选择器稳定容器：选 ComfyUI 时隐藏 */
  .ui-select-trigger {
    width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    background: var(--surface, rgba(255,255,255,0.04)); border: 1px solid var(--border, rgba(255,255,255,0.10));
    border-radius: 9px; color: var(--text, #e5e7eb); font-size: 13px; cursor: pointer; text-align: left;
    transition: border-color .15s, background .15s;
  }
  html[data-theme="light"] .ui-select-trigger { background: #fff; border-color: rgba(0,0,0,0.12); color: #111827; }
  .ui-select-trigger:hover { border-color: rgba(255,255,255,0.18); }
  .ui-select.open .ui-select-trigger { border-color: var(--neon, #22d3ee); }
  .ui-select-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ui-select-trigger svg { width: 14px; height: 14px; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
  .ui-select.open .ui-select-trigger svg { transform: rotate(180deg); }
  .ui-select-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 300;
    display: flex; flex-direction: column; max-height: 260px; overflow-y: auto;
    background: rgba(28,28,30,0.90); border: 1px solid var(--modal-border); border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
  }
  /* 修复：display:flex 会覆盖 hidden 属性导致选项“数据没收起”始终展开 */
  .ui-select-dropdown[hidden] { display: none !important; }
  /* 列表型下拉（平台/模型/通用）：按内容自适应宽度，选项完整显示（不截断） */
  .ui-select-dropdown.ui-select-layout-list { width: max-content; min-width: 100%; max-width: min(560px, calc(100vw - 24px)); left: 0; right: auto; }
  html[data-theme="light"] .ui-select-dropdown { background: rgba(255,255,255,0.86); border-color: rgba(0,0,0,0.12); box-shadow: 0 12px 28px rgba(0,0,0,0.12); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
  .ui-select-option {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
    font-size: 13px; color: var(--text-dim, #94a3b8); white-space: nowrap;
  }
  .ui-select-option:hover { background: rgba(255,255,255,0.06); color: var(--text); }
  html[data-theme="light"] .ui-select-option:hover { background: rgba(0,0,0,0.05); color: #111827; }
  .ui-select-option.active { color: var(--neon-bright, #4ade80); background: rgba(74,222,128,0.08); }
  html[data-theme="light"] .ui-select-option.active { color: #15803d; background: rgba(74,222,128,0.10); }
  .ui-select-opt-icon { width: 16px; height: 16px; display: inline-grid; place-items: center; }
  .ui-select-opt-icon svg { width: 16px; height: 16px; }
  /* Select 布局变体：model 模型卡 / grid 模块网格 */
  /* 模型下拉不限定宽度：按内容自适应，完整显示模型名（不截断） */
  .ui-select-dropdown.ui-select-layout-model { width: max-content; min-width: 320px; max-width: min(560px, calc(100vw - 32px)); right: 0; left: auto; padding: 6px; }
  .ui-select-opt-model .ui-select-opt-body { min-width: max-content; }
  .ui-select-opt-model .ui-select-opt-name { overflow: visible; text-overflow: clip; white-space: nowrap; }
  /* 工作流下拉同样不限定宽度 */
  .ui-select-dropdown.ui-select-layout-workflow { width: max-content; min-width: 240px; max-width: min(480px, calc(100vw - 32px)); }
  .ui-select-opt-model { align-items: flex-start; gap: 10px; padding: 9px 10px; }
  .ui-select-opt-model .ui-select-opt-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); flex-shrink: 0; }
  .ui-select-opt-model .ui-select-opt-icon svg { width: 16px; height: 16px; }
  html[data-theme="light"] .ui-select-opt-model .ui-select-opt-icon { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
  .ui-select-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .ui-select-opt-name { font-size: 13px; color: var(--text, #e5e7eb); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ui-select-opt-desc { font-size: 11px; color: var(--text-muted, #94a3b8); line-height: 1.4; }
  .ui-select-opt-badge { flex-shrink: 0; font-size: 10px; padding: 1px 7px; border-radius: 999px; color: var(--neon-bright, #86efac); background: var(--neon-dim, rgba(74,222,128,0.12)); border: 1px solid var(--neon-glow, rgba(74,222,128,0.3)); }
  html[data-theme="light"] .ui-select-opt-badge { color: #15803d; }
  .ui-select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; }
  .ui-select-opt-grid { flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border-radius: 10px; border: 1px solid transparent; text-align: center; }
  .ui-select-opt-grid:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); }
  html[data-theme="light"] .ui-select-opt-grid:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
  .ui-select-opt-grid .ui-select-opt-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); }
  .ui-select-opt-grid .ui-select-opt-icon svg { width: 15px; height: 15px; }
  .ui-select-opt-grid .ui-select-opt-name { font-size: 12px; white-space: normal; line-height: 1.3; }
  html[data-theme="light"] .ui-select-opt-grid .ui-select-opt-icon { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
  .ui-select-option.active .ui-select-opt-name { color: inherit; }

/* ---- 通用弹窗 ---- */
  .ui-overlay {
    position: fixed; inset: 0; z-index: 220;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(10px);
    opacity: 0; transition: opacity .25s ease;
  }
  .ui-overlay.show { opacity: 1; }
  .ui-modal-card {
    width: 100%; max-width: 640px; max-height: calc(100vh - 80px);
    background: var(--modal-bg); border: 1px solid var(--modal-border); border-radius: 18px;
    box-shadow: 0 40px 120px rgba(0,0,0,0.55);
    transform: translateY(10px); transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; display: flex; flex-direction: column;
  }
  html[data-theme="light"] .ui-modal-card { background: var(--modal-bg); border-color: var(--modal-border); }
  .ui-overlay.show .ui-modal-card { transform: translateY(0); }

/* ---- 确认对话框（Dialog） ---- */
  .ui-confirm-overlay { z-index: 100010; } /* 确认对话框永远最顶层（高于预设库下拉/添加弹窗 100000） */
  .ui-confirm-overlay .ui-modal-card {
    max-width: 420px; padding: 28px 24px 22px; overflow: visible;
  }
  .ui-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .ui-confirm-icon {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #4ade80; background: rgba(74,222,128,0.12);
    border: 1px solid rgba(74,222,128,0.25); margin-bottom: 6px;
  }
  .ui-confirm-icon.danger { color: #f87171; background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.28); }
  html[data-theme="light"] .ui-confirm-icon { color: #16a34a; background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.28); }
  html[data-theme="light"] .ui-confirm-icon.danger { color: #dc2626; background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.28); }
  .ui-confirm-title { font-size: 17px; font-weight: 700; color: var(--text); }
  .ui-confirm-msg { font-size: 13.5px; line-height: 1.6; color: var(--text-dim); white-space: pre-line; }
  .ui-confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
  .ui-confirm-btn {
    min-width: 96px; padding: 9px 18px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
    color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: all .15s ease;
  }
  .ui-confirm-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); }
  .ui-confirm-btn:focus-visible { outline: 2px solid rgba(74,222,128,0.6); outline-offset: 2px; }
  .ui-confirm-btn.ui-confirm-ok { background: rgba(74,222,128,0.16); border-color: rgba(74,222,128,0.45); color: #4ade80; }
  .ui-confirm-btn.ui-confirm-ok:hover { background: rgba(74,222,128,0.26); }
  .ui-confirm-btn.ui-confirm-ok.danger { background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.45); color: #f87171; }
  .ui-confirm-btn.ui-confirm-ok.danger:hover { background: rgba(248,113,113,0.24); }
  html[data-theme="light"] .ui-confirm-btn { border-color: rgba(0,0,0,0.12); background: rgba(0,0,0,0.04); color: #1f2937; }
  html[data-theme="light"] .ui-confirm-btn:hover { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.18); }
  html[data-theme="light"] .ui-confirm-btn.ui-confirm-ok { background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.35); color: #15803d; }
  html[data-theme="light"] .ui-confirm-btn.ui-confirm-ok:hover { background: rgba(22,163,74,0.16); }
  html[data-theme="light"] .ui-confirm-btn.ui-confirm-ok.danger { background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.35); color: #dc2626; }
  html[data-theme="light"] .ui-confirm-btn.ui-confirm-ok.danger:hover { background: rgba(220,38,38,0.16); }

/* ---- Chip ---- */
  .ui-chip {
    display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
    font-size: 11px; color: var(--text-dim); background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
  }
  html[data-theme="light"] .ui-chip { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); color: var(--text-dim); }
  .ui-chip-ok { color: #4ade80; border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.10); }
  .ui-chip-warn { color: #fbbf24; border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.10); }
  .ui-chip-err { color: #f87171; border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.10); }
  html[data-theme="light"] .ui-chip-ok { color: #15803d; border-color: rgba(21,128,61,0.35); background: rgba(21,128,61,0.10); }
  html[data-theme="light"] .ui-chip-warn { color: #b45309; border-color: rgba(180,83,9,0.35); background: rgba(180,83,9,0.10); }
  html[data-theme="light"] .ui-chip-err { color: #dc2626; border-color: rgba(220,38,38,0.35); background: rgba(220,38,38,0.10); }

/* ---- Prompt Input 提示词输入（设计系统组件） ---- */
  .ui-prompt-box {
    width: 100%; max-width: 560px; border: 1px solid var(--border, rgba(255,255,255,0.10)); border-radius: 16px;
    background: var(--surface, rgba(255,255,255,0.04)); padding: 12px 14px; text-align: left;
  }
  .ui-prompt-refs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .ui-prompt-refs .ui-ref-thumb {
    position: relative; width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border); background: var(--modal-bg, #1c1c1c); cursor: pointer;
  }
  .ui-prompt-refs .ui-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ui-prompt-refs .ui-ref-thumb .tag {
    position: absolute; left: 3px; bottom: 3px; padding: 0 5px; border-radius: 5px;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 9px;
  }
  .ui-prompt-text {
    min-height: 40px; border-radius: 10px; padding: 8px 10px; background: var(--modal-bg, #1c1c1c);
    border: 1px solid var(--border); font-size: 13px; color: var(--text, #e5e7eb); line-height: 1.6;
    outline: none; cursor: text; word-break: break-word;
  }
  .ui-prompt-text:empty::before { content: attr(data-placeholder); color: var(--text-muted, #6b7280); pointer-events: none; }
  .ui-mention-chip {
    display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; padding: 2px 8px; border-radius: 999px;
    background: var(--neon-dim, rgba(74,222,128,0.12)); border: 1px solid var(--neon-glow, rgba(74,222,128,0.3)); color: var(--neon-bright, #86efac);
    font-size: 12px; vertical-align: middle; white-space: nowrap;
  }
  html[data-theme="light"] .ui-mention-chip { color: #15803d; }
  .ui-mention-chip-thumb { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
  .ui-prompt-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
  .ui-prompt-tool {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--modal-bg, #1c1c1c); color: var(--text-dim, #94a3b8);
    font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-prompt-tool:hover { color: var(--text, #fff); border-color: var(--border-strong); }
  html[data-theme="light"] .ui-prompt-tool { color: #52525b; }
  html[data-theme="light"] .ui-prompt-tool:hover { color: #111827; }
  .ui-prompt-spacer { flex: 1; }
  .ui-prompt-params { display: flex; gap: 6px; flex-wrap: wrap; }
  .ui-prompt-params .param {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer;
  }
  .ui-prompt-params .param:hover { color: var(--text); border-color: var(--border-strong); }
  html[data-theme="light"] .ui-prompt-params .param:hover { color: #111827; }

/* ---- Prompt Input 完整版：头部模式/模型 + 引用缩略图 + 参数组 + 底栏 ---- */
  .ui-prompt-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
  .ui-prompt-modes { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2, rgba(255,255,255,0.06)); }
  html[data-theme="light"] .ui-prompt-modes { background: rgba(0,0,0,0.05); }
  .ui-prompt-mode {
    padding: 5px 14px; border: none; border-radius: 8px; background: transparent;
    color: var(--text-muted, #94a3b8); font-size: 12.5px; cursor: pointer; transition: all .15s;
  }
  .ui-prompt-mode:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-prompt-mode:hover { color: #111827; }
  .ui-prompt-mode.active { background: var(--modal-bg, #1c1c1c); color: var(--text, #fff); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
  html[data-theme="light"] .ui-prompt-mode.active { background: #fff; color: #111827; box-shadow: 0 2px 8px rgba(0,0,0,0.10); }
  .ui-prompt-model { margin-left: auto; }
  .ui-prompt-model .ui-select { width: 180px; }
  .ui-prompt-refs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
  .ui-prompt-ref {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    height: 40px; padding: 0 8px 0 5px; border-radius: 10px;
    border: 1px solid var(--border, rgba(255,255,255,0.10)); background: var(--modal-bg, #1c1c1c);
    cursor: pointer; transition: border-color .15s, transform .15s;
  }
  .ui-prompt-ref:hover { border-color: var(--neon-glow, rgba(74,222,128,0.4)); transform: translateY(-1px); }
  .ui-prompt-ref-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
  .ui-prompt-ref-ico {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 13px;
    background: var(--surface-2, rgba(255,255,255,0.06)); color: var(--text-dim, #94a3b8);
  }
  .ui-prompt-ref-tag { font-size: 12px; color: var(--text-dim, #cbd5e1); white-space: nowrap; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  .ui-prompt-ref-x {
    width: 16px; height: 16px; border: none; border-radius: 50%; background: transparent;
    color: var(--text-muted, #94a3b8); font-size: 12px; line-height: 1; cursor: pointer;
    display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s, color .15s;
  }
  .ui-prompt-ref:hover .ui-prompt-ref-x { opacity: 1; }
  .ui-prompt-ref-x:hover { background: rgba(239,68,68,0.18); color: #f87171; }
  html[data-theme="light"] .ui-prompt-ref-x:hover { color: #dc2626; }
  .ui-prompt-ref-add {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    border: 1px dashed var(--border-strong, rgba(255,255,255,0.2)); background: transparent;
    color: var(--text-muted, #94a3b8); font-size: 18px; cursor: pointer; transition: all .15s;
  }
  .ui-prompt-ref-add:hover { color: var(--neon-bright, #86efac); border-color: var(--neon-glow, rgba(74,222,128,0.5)); }
  html[data-theme="light"] .ui-prompt-ref-add:hover { color: #15803d; }
  .ui-prompt-params { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  .ui-prompt-param-group { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2, rgba(255,255,255,0.05)); }
  html[data-theme="light"] .ui-prompt-param-group { background: rgba(0,0,0,0.04); }
  .ui-prompt-param-label { padding: 0 6px; font-size: 11px; color: var(--text-muted, #94a3b8); }
  .ui-prompt-param {
    padding: 4px 10px; border: none; border-radius: 7px; background: transparent;
    color: var(--text-dim, #cbd5e1); font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-prompt-param:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-prompt-param:hover { color: #111827; }
  .ui-prompt-param.active { background: var(--neon-dim, rgba(74,222,128,0.14)); color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-prompt-param.active { color: #15803d; }
  .ui-prompt-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
  .ui-prompt-hint { font-size: 11.5px; color: var(--text-muted, #94a3b8); }
  .ui-prompt-count { font-size: 11.5px; color: var(--text-muted, #94a3b8); font-variant-numeric: tabular-nums; }
  .ui-prompt-clear, .ui-prompt-opt {
    padding: 6px 14px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
    border: 1px solid var(--border, rgba(255,255,255,0.12)); background: transparent; color: var(--text-dim, #cbd5e1);
    transition: all .15s;
  }
  .ui-prompt-clear:hover, .ui-prompt-opt:hover { color: var(--text, #fff); border-color: var(--border-strong); }
  html[data-theme="light"] .ui-prompt-clear:hover, html[data-theme="light"] .ui-prompt-opt:hover { color: #111827; }
  .ui-prompt-submit {
    padding: 6px 18px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer;
    border: none; color: #06200e;
    background: linear-gradient(135deg, var(--neon-bright, #86efac), var(--neon, #4ade80));
    box-shadow: 0 2px 10px rgba(74,222,128,0.3); transition: transform .15s, box-shadow .15s;
  }
  .ui-prompt-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,222,128,0.4); }
  .ui-mention-chip-x {
    width: 14px; height: 14px; border: none; border-radius: 50%; background: transparent;
    color: inherit; font-size: 11px; line-height: 1; cursor: pointer; opacity: .6;
    display: inline-grid; place-items: center; margin-left: 2px; padding: 0;
  }
  .ui-mention-chip-x:hover { opacity: 1; background: rgba(0,0,0,0.25); }

/* ---- Dropdown Menu 下拉菜单（ui.dropdown） ---- */
  .ui-dropdown { position: relative; display: inline-block; }
  .ui-dropdown.align-right .ui-dropdown-menu { left: auto; right: 0; }
  .ui-dd-trigger { padding: 0; border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
  .ui-dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 300;
    min-width: 180px; max-width: 280px; padding: 6px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,0.5);
  }
  .ui-dd-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border: none; border-radius: 8px; background: transparent;
    color: var(--text, #e5e7eb); font-size: 12.5px; text-align: left; cursor: pointer;
    transition: background .12s, color .12s;
  }
  .ui-dd-item:hover { background: var(--surface-hover, rgba(255,255,255,0.08)); }
  .ui-dd-item.danger { color: #f87171; }
  .ui-dd-item.danger:hover { background: rgba(239,68,68,0.12); }
  html[data-theme="light"] .ui-dd-item { color: #18181b; }
  html[data-theme="light"] .ui-dd-item:hover { background: rgba(0,0,0,0.05); }
  html[data-theme="light"] .ui-dd-item.danger { color: #dc2626; }
  .ui-dd-ico { width: 17px; height: 17px; display: grid; place-items: center; color: var(--text-muted, #94a3b8); flex-shrink: 0; }
  .ui-dd-ico svg { width: 15px; height: 15px; }
  .ui-dd-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ui-dd-hint { font-size: 11px; color: var(--text-muted, #94a3b8); }
  .ui-dd-sep { height: 1px; margin: 5px 8px; background: var(--border, rgba(255,255,255,0.10)); }

/* ---- Prompt Input 个性版 800×230（ui.promptPro） ---- */
  .ui-pp {
    position: relative; display: flex; flex-direction: column; min-height: 230px;
    border: 1px solid var(--border, rgba(255,255,255,0.10)); border-radius: 16px;
    background: var(--modal-bg, #1c1c1c); padding: 10px 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 4px 14px rgba(0,0,0,0.3);
  }
  html[data-theme="light"] .ui-pp { box-shadow: 0 16px 44px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.06); }
  html[data-theme="light"] .ui-pp { background: #ffffff; }
  .ui-pp-top { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 8px; }
  .ui-pp-top .ui-pp-thumbs { flex: 1; min-width: 0; margin-bottom: 0; padding-right: 34px; }
  .ui-pp-expand { position: absolute; top: 10px; right: 12px; flex-shrink: 0; }
  .ui-pp-refs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2, rgba(255,255,255,0.05)); }
  html[data-theme="light"] .ui-pp-refs { background: rgba(0,0,0,0.05); }
  .ui-pp-ref-tab {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border: none; border-radius: 7px;
    background: transparent; color: var(--text-muted, #94a3b8); font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-pp-ref-tab:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-ref-tab:hover { color: #111827; }
  .ui-pp-ref-tab em {
    font-style: normal; font-size: 10px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
    display: inline-grid; place-items: center; background: var(--surface-2, rgba(255,255,255,0.08)); color: var(--text-muted);
  }
  .ui-pp-ref-tab.active { background: var(--modal-bg, #1c1c1c); color: var(--text, #fff); box-shadow: 0 2px 8px rgba(0,0,0,0.22); }
  html[data-theme="light"] .ui-pp-ref-tab.active { background: #fff; color: #111827; }
  .ui-pp-ref-tab.active em { background: var(--neon-dim, rgba(74,222,128,0.15)); color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-pp-ref-tab.active em { color: #15803d; }
  .ui-pp-expand {
    width: 28px; height: 28px; border: none; background: transparent; color: var(--text-muted, #94a3b8); cursor: pointer;
    display: grid; place-items: center; font-size: 14px; transition: color .15s;
  }
  .ui-pp-expand:hover, .ui-pp.expanded .ui-pp-expand { color: var(--neon-bright, #86efac); border-color: var(--neon-glow, rgba(74,222,128,0.4)); }
  html[data-theme="light"] .ui-pp-expand:hover { color: #15803d; }
  .ui-pp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
  .ui-pp-textarea {
    flex: 1 1 auto; min-height: 80px; max-height: 180px; overflow-y: auto;
    border-radius: 10px; padding: 9px 20px 9px 0; background: transparent;
    border: none;
    color: var(--text, #e5e7eb); font-size: 13.5px; line-height: 1.6; outline: none; cursor: text; word-break: break-word;
  }
  .ui-pp-textarea.scroll { overflow-y: scroll; }
  .ui-pp-textarea.scroll { border-color: var(--border-strong, rgba(255,255,255,0.2)); }
  .ui-pp-textarea:empty::before { content: attr(data-placeholder); color: var(--text-muted, #6b7280); pointer-events: none; }
  /* 工具/参数行：完全扁平、不加框（参考图布局） */
  .ui-pp-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: nowrap; }
  .ui-pp-tool {
    display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px;
    border: none; background: transparent; color: var(--text-muted, #94a3b8);
    font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: color .15s;
  }
  .ui-pp-tool:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-tool { color: #52525b; }
  html[data-theme="light"] .ui-pp-tool:hover { color: #111827; }
  .ui-pp-tool-ico { display: inline-grid; place-items: center; font-size: 14px; color: inherit; }
  .ui-pp-tool-arrow { font-size: 9px; color: var(--text-muted, #94a3b8); }
  .ui-pp-tool .ui-dd-trigger { display: inline-flex; align-items: center; gap: 5px; height: 100%; color: inherit; }
  .ui-pp-selects { display: flex; gap: 8px; align-items: center; margin-left: 4px; }
  /* ComfyUI 平台：模型选择器隐藏，显示「工作流」选择器 */
  .ui-pp-workflow-wrap { display: inline-flex; align-items: center; }
  .ui-pp-workflow-wrap[hidden] { display: none; }
  .ui-pp-selects .ui-select { width: auto; }
  .ui-pp-selects .ui-select-trigger {
    height: 28px; padding: 0 6px; font-size: 12.5px;
    border: none; background: transparent; color: var(--text-muted, #94a3b8); gap: 5px;
  }
  .ui-pp-selects .ui-select-trigger > svg:first-child { width: 14px; height: 14px; flex-shrink: 0; }
  .ui-pp-selects .ui-select-trigger:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-selects .ui-select-trigger { color: #52525b; }
  html[data-theme="light"] .ui-pp-selects .ui-select-trigger:hover { color: #111827; }
  .ui-pp-selects .ui-select.open .ui-select-trigger { border: none; color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-pp-selects .ui-select.open .ui-select-trigger { color: #15803d; }
  .ui-pp-selects .ui-select-trigger svg { width: 12px; height: 12px; color: var(--text-muted); }
  .ui-pp-selects .ui-select-dropdown { top: calc(100% + 4px); }
  /* 下拉的扁平触发变体（通用） */
  .ui-select.flat .ui-select-trigger { border: none; background: transparent; color: var(--text-muted, #94a3b8); padding: 6px 8px; }
  .ui-select.flat .ui-select-trigger:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-select.flat .ui-select-trigger { color: #52525b; }
  html[data-theme="light"] .ui-select.flat .ui-select-trigger:hover { color: #111827; }
  .ui-pp-spacer { flex: 1; }
  .ui-pp-submit.btn-neon {
    width: 32px; height: 32px; padding: 0; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center;
  }
  .ui-pp-submit.btn-neon svg { width: 15px; height: 15px; }
  /* 悬浮风格库 */
  .ui-pp-style-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 320;
    width: 240px; padding: 8px; border-radius: 12px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 16px 44px rgba(0,0,0,0.5);
  }
  .ui-pp-style-item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: none; border-radius: 8px;
    background: transparent; color: var(--text, #e5e7eb); font-size: 12.5px; cursor: pointer; text-align: left; transition: background .12s;
  }
  .ui-pp-style-item:hover, .ui-pp-style-item.active { background: var(--surface-hover, rgba(255,255,255,0.08)); }
  .ui-pp-style-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.15); }

  /* 引用缩略图行（分类过滤 + × 删除） */
  .ui-pp-thumbs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; align-items: center; margin-bottom: 8px; min-height: 54px; padding-bottom: 2px; }
  .ui-pp-thumbs:empty { display: none; margin-bottom: 0; min-height: 0; padding-bottom: 0; }
  .ui-pp-thumbs::-webkit-scrollbar { height: 5px; }
  .ui-pp-ref-group { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .ui-pp-ref-group-label { font-size: 11.5px; color: var(--text-muted, #94a3b8); white-space: nowrap; }
  .ui-pp-ref-sep {
    width: 1px; height: 42px; flex-shrink: 0; margin: 0 4px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.32), transparent);
  }
  html[data-theme="light"] .ui-pp-ref-sep {
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.38), transparent);
  }
  .ui-pp-thumb.ui-pp-draggable { cursor: grab; }
  .ui-pp-thumb.ui-pp-dragging { opacity: 0.45; }
  .ui-pp-thumb.ui-pp-drop-target { border-color: var(--neon, #4ade80); box-shadow: 0 0 0 2px var(--neon-dim, rgba(74,222,128,0.18)); }
  .ui-pp-thumb {
    position: relative; width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
    background: var(--modal-bg, #1c1c1c); border: 1px solid rgba(255,255,255,0.26);
    cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s;
  }
  html[data-theme="light"] .ui-pp-thumb { border-color: rgba(0,0,0,0.2); }
  .ui-pp-thumb:hover { border-color: rgba(255,255,255,0.5); transform: translateY(-1px); }
  html[data-theme="light"] .ui-pp-thumb:hover { border-color: rgba(0,0,0,0.38); }
  .ui-pp-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ui-pp-thumb-ico {
    width: 100%; height: 100%; display: grid; place-items: center;
    color: var(--text-muted, #94a3b8); background: var(--surface-2, rgba(255,255,255,0.05)); font-size: 15px;
  }
  .ui-pp-thumb-tag {
    position: absolute; left: 3px; bottom: 3px; padding: 1px 6px; border-radius: 6px;
    background: rgba(0,0,0,0.62); color: #fff; font-size: 9.5px; line-height: 1.5; max-width: 40px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ui-pp-thumb-x {
    position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; line-height: 1; cursor: pointer;
    display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s;
  }
  .ui-pp-thumb:hover .ui-pp-thumb-x { opacity: 1; }
  .ui-pp-thumb-x:hover { background: rgba(239,68,68,0.9); }
  .ui-pp-thumbs-empty { font-size: 12px; color: var(--text-muted, #94a3b8); padding: 0 4px; }

/* ---- Tooltip 提示气泡（ui-tooltip-wrap / ui-tooltip） ---- */
  .ui-tooltip-wrap { position: relative; display: inline-flex; }
  .ui-tooltip {
    position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%) translateY(4px);
    padding: 5px 10px; border-radius: 7px; white-space: nowrap;
    background: var(--sh-primary, #fafafa); color: var(--sh-primary-fg, #18181b);
    font-size: 12px; line-height: 1.4; pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity .15s ease, transform .15s ease, visibility .15s; z-index: 400;
  }
  html[data-theme="dark"] .ui-tooltip { background: #fafafa; color: #18181b; }
  .ui-tooltip-wrap:hover .ui-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
  .ui-tooltip::after {
    content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--sh-primary, #fafafa);
  }
  html[data-theme="dark"] .ui-tooltip::after { border-top-color: #fafafa; }

  /* 风格库悬浮窗（参考图：分类 + 图片卡片网格） */
  .ui-pp-style-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 320;
    width: 480px; max-height: 360px; overflow-y: auto; padding: 10px; border-radius: 14px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  }
  .ui-pp-style-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
  .ui-pp-style-cats { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2, rgba(255,255,255,0.06)); }
  html[data-theme="light"] .ui-pp-style-cats { background: rgba(0,0,0,0.05); }
  .ui-pp-style-cat {
    padding: 4px 11px; border: none; border-radius: 7px; background: transparent;
    color: var(--text-muted, #94a3b8); font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-pp-style-cat:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-style-cat:hover { color: #111827; }
  .ui-pp-style-cat.active { background: var(--modal-bg, #1c1c1c); color: var(--text, #fff); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
  html[data-theme="light"] .ui-pp-style-cat.active { background: #fff; color: #111827; }
  .ui-pp-style-search { margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-muted); cursor: pointer; }
  .ui-pp-style-search-input {
    width: 150px; margin-left: auto; padding: 5px 10px 5px 26px; border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.12)); background: var(--surface-2, rgba(255,255,255,0.05));
    color: var(--text, #e5e7eb); font-size: 12px; outline: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.35-4.35'/></svg>");
    background-repeat: no-repeat; background-position: 8px center; background-size: 13px;
  }
  html[data-theme="light"] .ui-pp-style-search-input { background-color: #fff; color: #111827; }
  .ui-pp-style-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
  .ui-pp-style-card {
    position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
    cursor: pointer; text-align: left; padding: 0; background: none; transition: border-color .15s, transform .15s;
  }
  .ui-pp-style-card:hover { border-color: var(--neon-glow, rgba(74,222,128,0.5)); transform: translateY(-1px); }
  .ui-pp-style-card.active { border-color: var(--neon, #4ade80); }
  .ui-pp-style-card img { width: 100%; height: 52px; object-fit: cover; display: block; }
  .ui-pp-style-card-name {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px;
    font-size: 11.5px; color: #fff; line-height: 1.3;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ui-pp-style-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    width: 100%; height: 66px; border: 1px dashed var(--border-strong, rgba(255,255,255,0.25));
    border-radius: 10px; background: var(--surface-2, rgba(255,255,255,0.04)); cursor: pointer;
    color: var(--text-muted, #94a3b8); font-size: 11.5px;
  }
  .ui-pp-style-add:hover { color: var(--neon-bright, #86efac); border-color: var(--neon-glow, rgba(74,222,128,0.5)); }
  html[data-theme="light"] .ui-pp-style-add:hover { color: #15803d; }

  /* 规格面板（参考图：比例图形卡 + 分辨率 + 宽高输入，选中绿色） */
  .ui-pp-spec-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 320;
    width: 300px; padding: 10px 12px; border-radius: 14px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  }
  .ui-pp-spec-sec { margin-bottom: 10px; }
  .ui-pp-spec-title { font-size: 11px; color: var(--text-muted, #94a3b8); margin-bottom: 6px; letter-spacing: .03em; }
  .ui-pp-spec-ratios { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
  .ui-pp-spec-ratio {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 7px 2px 6px;
    border: 1px solid var(--border, rgba(255,255,255,0.10)); border-radius: 8px; background: transparent;
    cursor: pointer; color: var(--text-muted, #94a3b8); font-size: 11px; transition: all .15s;
  }
  .ui-pp-spec-ratio:hover { border-color: var(--border-strong); color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-spec-ratio:hover { color: #111827; }
  .ui-pp-spec-ratio.active { border-color: var(--neon, #4ade80); background: var(--neon-dim, rgba(74,222,128,0.12)); color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-pp-spec-ratio.active { color: #15803d; }
  .ui-pp-spec-shape { border: 1px solid currentColor; border-radius: 2px; opacity: .9; }
  .ui-pp-spec-res-row { display: flex; gap: 6px; }
  .ui-pp-spec-res {
    flex: 1; padding: 6px 0; border: 1px solid var(--border, rgba(255,255,255,0.10)); border-radius: 8px;
    background: transparent; color: var(--text-muted, #94a3b8); font-size: 12px; cursor: pointer; text-align: center; transition: all .15s;
  }
  .ui-pp-spec-res:hover { color: var(--text, #fff); border-color: var(--border-strong); }
  html[data-theme="light"] .ui-pp-spec-res:hover { color: #111827; }
  .ui-pp-spec-res.active { border-color: var(--neon, #4ade80); background: var(--neon-dim, rgba(74,222,128,0.12)); color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-pp-spec-res.active { color: #15803d; }
  .ui-pp-spec-wh { display: flex; align-items: center; gap: 6px; }
  .ui-pp-spec-wh input {
    width: 72px; padding: 5px 8px; border-radius: 7px; font-size: 12px; text-align: center;
    border: 1px solid var(--border, rgba(255,255,255,0.12)); background: var(--surface-2, rgba(255,255,255,0.05));
    color: var(--text, #e5e7eb); outline: none;
  }
  html[data-theme="light"] .ui-pp-spec-wh input { background: #fff; color: #111827; }
  .ui-pp-spec-wh span { color: var(--text-muted, #94a3b8); font-size: 12px; }
  /* 扁平下拉前的图标 */
  .ui-pp-sel-ico { display: inline-grid; place-items: center; color: var(--text-muted, #94a3b8); }
  .ui-pp-sel-ico svg { width: 14px; height: 14px; }

  /* 预设提示词库面板（参考图：标题栏 + 搜索/新建 + 列表/空态） */
  .ui-pp-preset-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 320;
    width: 360px; max-height: 340px; overflow-y: auto; padding: 12px; border-radius: 14px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  }
  .ui-pp-preset-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .ui-pp-preset-title { font-size: 13px; font-weight: 700; color: var(--text, #e5e7eb); flex: 1; }
  .ui-pp-preset-head-ico { width: 20px; height: 20px; display: grid; place-items: center; color: var(--text-muted); cursor: pointer; }
  .ui-pp-preset-actions { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
  .ui-pp-preset-search {
    flex: 1; min-width: 0; padding: 6px 10px 6px 26px; border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.12)); background: var(--surface-2, rgba(255,255,255,0.05));
    color: var(--text, #e5e7eb); font-size: 12px; outline: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.35-4.35'/></svg>");
    background-repeat: no-repeat; background-position: 8px center; background-size: 13px;
  }
  html[data-theme="light"] .ui-pp-preset-search { background-color: #fff; color: #111827; }
  .ui-pp-preset-new {
    padding: 6px 14px; border: none; border-radius: 8px; cursor: pointer;
    background: var(--text, #e5e7eb); color: var(--bg, #1c1c1c); font-size: 12px; font-weight: 600; white-space: nowrap;
  }
  html[data-theme="light"] .ui-pp-preset-new { background: #111827; color: #fff; }
  .ui-pp-preset-list { display: flex; flex-direction: column; gap: 2px; }
  .ui-pp-preset-item {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px;
    background: transparent; color: var(--text, #e5e7eb); font-size: 12.5px; cursor: pointer; text-align: left; transition: background .12s;
  }
  .ui-pp-preset-item:hover, .ui-pp-preset-item.active { background: var(--surface-hover, rgba(255,255,255,0.08)); }
  .ui-pp-preset-item .ui-pp-preset-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--neon-dim, rgba(74,222,128,0.12)); color: var(--neon-bright, #86efac); flex-shrink: 0; }
  html[data-theme="light"] .ui-pp-preset-item .ui-pp-preset-ico { color: #15803d; }
  .ui-pp-preset-item .ui-pp-preset-txt { flex: 1; min-width: 0; }
  .ui-pp-preset-item .ui-pp-preset-name { display: block; font-weight: 600; }
  .ui-pp-preset-item .ui-pp-preset-desc { display: block; font-size: 11px; color: var(--text-muted, #94a3b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ui-pp-preset-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; color: var(--text-muted, #94a3b8); font-size: 12px; }
  .ui-pp-preset-empty svg { width: 30px; height: 30px; opacity: .6; }

  /* 下拉互斥 + 打开态样式区分 */
  .ui-pp-tool.active, .ui-pp-tool.open { color: var(--neon-bright, #86efac) !important; }
  html[data-theme="light"] .ui-pp-tool.active, html[data-theme="light"] .ui-pp-tool.open { color: #15803d !important; }
  .ui-pp-tool.open .ui-pp-tool-arrow { color: var(--neon-bright, #86efac); }
  .ui-pp-tools .ui-dropdown.open .ui-dd-trigger { color: var(--neon-bright, #86efac) !important; }
  html[data-theme="light"] .ui-pp-tools .ui-dropdown.open .ui-dd-trigger { color: #15803d !important; }
  /* 所有下拉/面板左对齐触发按钮 */
  .ui-pp-selects .ui-select-dropdown { left: 0; right: auto; }
  .ui-pp-style-pop, .ui-pp-spec-pop, .ui-pp-preset-pop { left: 0; right: auto; }

/* ---- Hover Preview 悬浮预览（ui.hoverPreview：图片/视频/音频/文本，复用画布参考悬浮效果） ---- */
  .ui-hover-preview-pop {
    position: fixed; z-index: 9600; display: none;
    max-width: 240px; min-width: 220px; max-height: 320px;
    border-radius: 12px; background: rgba(26,26,31,0.90);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 18px 48px rgba(0,0,0,0.6);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    padding: 10px; pointer-events: auto; overflow: hidden; box-sizing: border-box;
  }
  html[data-theme="light"] .ui-hover-preview-pop { background: rgba(255,255,255,0.86); border-color: rgba(0,0,0,0.14); box-shadow: 0 18px 48px rgba(0,0,0,0.18); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
  .ui-hover-preview-pop.ui-hover-preview-image { padding: 0; border-radius: 10px; width: max-content; min-width: 0; max-width: 240px; max-height: 366px; }
  .ui-hover-preview-pop.ui-hover-preview-image .ui-hover-preview-imgbody {
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    width: max-content; min-width: 0; background: #0e0e12; border-radius: 10px 10px 0 0;
  }
  html[data-theme="light"] .ui-hover-preview-pop.ui-hover-preview-image .ui-hover-preview-imgbody { background: #f0f0f2; }
  .ui-hover-preview-pop.ui-hover-preview-image img, .ui-hover-preview-pop.ui-hover-preview-image video {
    display: block; max-width: 240px; max-height: 320px; width: auto; height: auto; object-fit: contain; margin: 0;
  }
  .ui-hover-preview-pop.ui-hover-preview-image video { background: #000; }
  .ui-hover-preview-pop.ui-hover-preview-image audio { width: 220px; height: 40px; border-radius: 8px; margin: 0; }
  .ui-hover-preview-foot { display: flex; justify-content: center; padding: 6px; background: rgba(255,255,255,0.05); border-top: 1px solid rgba(255,255,255,0.06); }
  html[data-theme="light"] .ui-hover-preview-foot { background: rgba(0,0,0,0.03); border-top-color: rgba(0,0,0,0.06); }
  .ui-hover-preview-full {
    display: inline-flex; align-items: center; gap: 5px; border: none; border-radius: 7px; cursor: pointer; padding: 5px 12px;
    background: rgba(0,0,0,0.45); color: rgba(255,255,255,0.9); font-size: 11px; line-height: 1; transition: background .15s, color .15s;
  }
  .ui-hover-preview-full:hover { background: rgba(0,0,0,0.75); color: #fff; }
  .ui-hover-preview-full svg { width: 12px; height: 12px; }
  .ui-hover-preview-pop.ui-hover-preview-text { padding: 8px; width: 240px; border: none; }
  html[data-theme="light"] .ui-hover-preview-pop.ui-hover-preview-text { border: 1px solid rgba(0,0,0,0.14); }
  .ui-hover-preview-pop.ui-hover-preview-text .ui-hover-preview-text-body {
    height: 260px; min-height: 100px; max-height: 260px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
    color: rgba(255,255,255,0.92); font-size: 12.5px; line-height: 1.65;
  }
  html[data-theme="light"] .ui-hover-preview-pop.ui-hover-preview-text .ui-hover-preview-text-body { color: #1f2937; }
  .ui-hover-preview-pop.ui-hover-preview-text .ui-hover-preview-foot { padding: 6px 0 0; }

  /* 画布 cr-custom-select 接入 Prompt Pro 工具行时保持扁平无框 */
  .ui-pp-selects .cr-custom-select .cr-cs-trigger {
    border: none; background: transparent; color: var(--text-muted, #94a3b8);
    font-size: 12.5px; height: 28px; padding: 0 6px; border-radius: 0;
  }
  .ui-pp-selects .cr-custom-select .cr-cs-trigger:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-selects .cr-custom-select .cr-cs-trigger { color: #52525b; }
  html[data-theme="light"] .ui-pp-selects .cr-custom-select .cr-cs-trigger:hover { color: #111827; }
  .ui-pp-selects .cr-custom-select.cs-open > .cr-cs-trigger { border: none; color: var(--neon-bright, #86efac); background: transparent; }
  html[data-theme="light"] .ui-pp-selects .cr-custom-select.cs-open > .cr-cs-trigger { color: #15803d; }

  /* ComfyUI 参数区无内容时不显示（避免空虚线） */
  .cr-comfy-fields:empty { display: none !important; border-top: none !important; margin-top: 0 !important; padding: 0 !important; }

  /* 视频节点：生成模式切换条 + 规格面板视频项（时长滑杆/音频/运镜）
     模式条样式与通用「模式」分段控件组件（.ui-prompt-mode）保持一致：
     深色主题用深色轨道 + 亮色激活胶囊，浅色主题用浅灰轨道 + 白色激活胶囊，不再使用实心绿块（对比度差、显得脏）。 */
  .ui-pp-mode {
    display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
    padding: 3px; margin-bottom: 8px; border-radius: 10px;
    background: var(--surface-2, rgba(255,255,255,0.06)); width: fit-content;
  }
  html[data-theme="light"] .ui-pp-mode { background: rgba(0,0,0,0.05); }
  .ui-pp-mode-btn {
    padding: 5px 12px; border: none; border-radius: 8px; background: transparent;
    color: var(--text-muted, #94a3b8); font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-pp-mode-btn:hover { color: var(--text, #fff); }
  html[data-theme="light"] .ui-pp-mode-btn:hover { color: #111827; }
  /* 选中态：使用系统主按钮（.btn-neon）的绿色渐变，选中项更突出（浅色主题白字 / 深色主题深字） */
  .ui-pp-mode-btn.active {
    background: linear-gradient(135deg, var(--neon-bright, #86efac), var(--neon, #4ade80) 55%, var(--neon, #4ade80));
    color: #06200e; font-weight: 700;
    box-shadow: 0 2px 10px rgba(74,222,128,0.35), inset 0 1px 0 rgba(255,255,255,0.40);
  }
  html[data-theme="light"] .ui-pp-mode-btn.active {
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(21,128,61,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
  }
  .ui-pp-spec-slider { display: flex; align-items: center; gap: 10px; }
  .ui-pp-spec-slider input[type="range"] { flex: 1; min-width: 0; accent-color: #4ade80; }
  .ui-pp-spec-dur-val { min-width: 48px; font-size: 12px; color: var(--text-muted, #94a3b8); text-align: right; }
  .ui-pp-spec-res-row.is-wrap { flex-wrap: wrap; }
  .ui-pp-spec-res.small { flex: 0 0 auto; padding: 5px 10px; }

  /* 运镜库弹层（参考图：标题 + 分类胶囊 + 6 列卡片，暗色适配） */
  .ui-pp-camera-pop {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + 10px); z-index: 400;
    width: 680px; max-width: calc(100vw - 24px);
    padding: 14px 14px 12px; border-radius: 16px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 22px 60px rgba(0,0,0,0.6);
  }
  .ui-pp-camera-pop[hidden] { display: none; }
  .ui-pp-camera-head b { display: block; font-size: 16px; font-weight: 700; color: var(--text, #e5e7eb); margin-bottom: 10px; }
  .ui-pp-camera-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .ui-pp-camera-tab {
    padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border, rgba(255,255,255,0.10));
    background: var(--surface-2, rgba(255,255,255,0.05)); color: var(--text-muted, #94a3b8);
    font-size: 12px; cursor: pointer; transition: all .15s;
  }
  .ui-pp-camera-tab:hover { color: var(--text, #fff); }
  .ui-pp-camera-tab.active { background: var(--neon, #4ade80); border-color: var(--neon, #4ade80); color: #0a1a0a; font-weight: 600; }
  .ui-pp-camera-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; max-height: 320px; overflow-y: auto; }
  .ui-pp-camera-card {
    display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 5px;
    padding: 6px; border-radius: 12px; border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--surface-2, rgba(255,255,255,0.03)); cursor: pointer; transition: all .15s;
  }
  .ui-pp-camera-card:hover { border-color: var(--border-strong, rgba(255,255,255,0.2)); }
  .ui-pp-camera-card.active { background: rgba(74,222,128,0.10); border-color: rgba(74,222,128,0.5); }
  .ui-pp-camera-thumb {
    position: relative; display: grid; place-items: center; height: 74px; border-radius: 9px;
    background: rgba(0,0,0,0.32); color: var(--text-muted, #94a3b8); overflow: hidden;
  }
  .ui-pp-camera-card.active .ui-pp-camera-thumb { color: var(--neon-bright, #86efac); }
  .ui-pp-camera-thumb svg { width: 44px; height: 44px; }
  .ui-pp-camera-check {
    position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--neon, #4ade80); display: grid; place-items: center;
  }
  .ui-pp-camera-check::after { content: ''; width: 8px; height: 5px; border-left: 2px solid #0a1a0a; border-bottom: 2px solid #0a1a0a; transform: rotate(-45deg) translate(0, -1px); }
  .ui-pp-camera-name { font-size: 12px; font-weight: 600; color: var(--text, #e5e7eb); }
  .ui-pp-camera-card.active .ui-pp-camera-name { color: var(--neon-bright, #86efac); }
  .ui-pp-camera-desc { font-size: 10.5px; color: var(--text-muted, #94a3b8); line-height: 1.35; min-height: 28px; }
  .ui-pp-camera-trigger {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 6px 10px; border: 1px solid var(--border, rgba(255,255,255,0.10)); border-radius: 8px;
    background: var(--surface-2, rgba(255,255,255,0.05)); color: var(--text, #e5e7eb); cursor: pointer;
  }
  .ui-pp-camera-trigger-ico { display: inline-grid; place-items: center; color: var(--text-muted, #94a3b8); }
  .ui-pp-camera-trigger-ico svg { width: 18px; height: 18px; }
  .ui-pp-camera-trigger-label { flex: 1; text-align: left; font-size: 12px; }

  /* 参数栏：运镜按钮 + 时长滑杆 */
  .ui-pp-camera-bar { display: inline-flex; align-items: center; gap: 4px; }
  .ui-pp-camera-bar > svg:first-child { width: 16px; height: 16px; }
  .ui-pp-dur-bar { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; }
  .ui-pp-dur-label { font-size: 11px; color: var(--text-muted, #94a3b8); }
  .ui-pp-dur-bar input[type="range"] { width: 76px; height: 4px; margin: 0; accent-color: #4ade80; }
  .ui-pp-dur-val { min-width: 30px; font-size: 11px; color: var(--text, #e5e7eb); text-align: right; }
  .ui-pp-camera-pop-fixed { position: fixed; z-index: 10000; left: 0; top: 0; transform: none; }

  /* 时长下拉弹层（视频时长 + 滑杆 + 数值） */
  .ui-pp-dur-pop {
    padding: 12px 14px; border-radius: 14px; width: 260px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  }
  .ui-pp-dur-pop-fixed { position: fixed; z-index: 10000; left: 0; top: 0; }
  .ui-pp-dur-pop[hidden] { display: none; }
  .ui-pp-dur-head { font-size: 12px; color: var(--text-muted, #94a3b8); margin-bottom: 10px; }
  .ui-pp-dur-body { display: flex; align-items: center; gap: 12px; }
  .ui-pp-dur-body input[type="range"] { flex: 1; min-width: 0; accent-color: #4ade80; }
  .ui-pp-dur-num {
    min-width: 64px; text-align: center; padding: 5px 10px; border-radius: 8px;
    background: var(--surface-2, rgba(255,255,255,0.08)); color: var(--text, #e5e7eb); font-size: 13px;
  }
  .ui-pp-dur-num b { font-weight: 700; }
  .ui-pp-dur-trigger { display: inline-flex; align-items: center; gap: 4px; }

  /* 输入框内运镜标签 */
  /* 运镜标签样式与 @引用标签一致（胶囊圆角/内边距/字号/间距），图标扁平线性 */
  .cr-video-cam-chip {
    display: inline-flex; align-items: center; gap: 3px; vertical-align: middle;
    padding: 1px 8px; margin: 0 2px;
    background: var(--neon-dim, rgba(74,222,128,0.16)); border: 1px solid var(--neon-glow, rgba(74,222,128,0.4));
    border-radius: 999px; color: var(--neon-bright, rgba(74,222,128,0.98)); font-size: 12px; line-height: 1.6;
    user-select: none; cursor: default; outline: none;
  }
  .cr-video-cam-chip:hover { background: var(--neon-dim, rgba(74,222,128,0.26)); border-color: var(--neon-glow, rgba(74,222,128,0.7)); }
  .cr-video-cam-ico {
    display: inline-grid; place-items: center; width: 18px; height: 18px;
    color: rgba(74,222,128,0.85); background: rgba(74,222,128,0.22); border-radius: 4px; flex-shrink: 0;
  }
  .cr-video-cam-ico svg { width: 13px; height: 13px; }
  .cr-video-cam-chip-x {
    border: none; background: transparent; color: inherit; cursor: pointer;
    font-size: 13px; line-height: 1; padding: 0 2px; opacity: .8;
  }
  .cr-video-cam-chip-x:hover { opacity: 1; }

  /* 生成模式：禁用态 + Tooltip */
  .ui-pp-mode-wrap { display: inline-flex; }
  .ui-pp-mode-btn.is-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
  .ui-pp-mode-wrap .ui-tooltip { white-space: normal; width: max-content; max-width: 220px; }

  /* 「更多设置」（⋯）：只收起预设提示词库 */
  .ui-pp-more { position: relative; display: inline-flex; }
  .ui-pp-more-btn { display: inline-flex; align-items: center; }
  .ui-pp-more-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 320;
    min-width: 140px; padding: 6px; border-radius: 12px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 16px 44px rgba(0,0,0,0.55);
  }
  .ui-pp-more-pop[hidden] { display: none; }

  /* 中英文翻译方向弹层（中⇄英 双向） */
  .ui-pp-translate-wrap { display: inline-flex; align-items: center; }
  .ui-pp-translate-caret { display: inline-flex; align-items: center; padding: 0 2px; margin-left: -4px; }
  .ui-pp-translate-caret svg { width: 11px; height: 11px; opacity: .8; }
  .ui-pp-translate-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 320;
    min-width: 158px; padding: 6px; border-radius: 12px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 16px 44px rgba(0,0,0,0.55);
  }
  .ui-pp-translate-pop[hidden] { display: none; }
  .ui-pp-translate-head { font-size: 11px; color: var(--text-muted, #94a3b8); padding: 4px 8px 6px; }
  .ui-pp-translate-opt {
    display: block; width: 100%; text-align: left; border: none; background: transparent;
    color: var(--text, #e5e7eb); font-size: 12.5px; padding: 7px 8px; border-radius: 8px; cursor: pointer;
  }
  .ui-pp-translate-opt:hover { background: var(--surface-2, rgba(255,255,255,0.08)); }
  .ui-pp-translate-opt.active { color: var(--neon-bright, #4ade80); background: var(--neon-dim, rgba(74,222,128,0.14)); }

  /* 系统提示词弹层（文本节点，左对齐） */
  .ui-pp-system-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 320;
    width: 320px; max-height: 420px; overflow: hidden;
    padding: 10px; border-radius: 12px;
    display: flex; flex-direction: column; gap: 8px;
    background: var(--modal-bg, #1c1c1c); border: 1px solid var(--modal-border, rgba(255,255,255,0.12));
    box-shadow: 0 16px 44px rgba(0,0,0,0.55);
  }
  .ui-pp-system-pop[hidden] { display: none; }
  .ui-pp-system-title { font-size: 12px; font-weight: 700; color: var(--text, #e5e7eb); }
  .ui-pp-system-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .ui-pp-system-switch { position: relative; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
  .ui-pp-system-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
  .ui-pp-system-switch-slider { position: relative; width: 30px; height: 16px; border-radius: 999px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.16); transition: background .15s ease, border-color .15s ease; }
  .ui-pp-system-switch-slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; transition: transform .15s ease, background .15s ease; }
  .ui-pp-system-switch input:checked + .ui-pp-system-switch-slider { background: var(--neon, #4ade80); border-color: var(--neon, #4ade80); }
  .ui-pp-system-switch input:checked + .ui-pp-system-switch-slider::before { transform: translateX(14px); background: #fff; }
  .ui-pp-system-status { font-size: 11px; color: var(--text-muted, #94a3b8); min-width: 34px; text-align: right; }
  html[data-theme="light"] .ui-pp-system-switch-slider { background: #e2e8f0; border-color: #cbd5e1; }
  html[data-theme="light"] .ui-pp-system-switch-slider::before { background: #94a3b8; }
  html[data-theme="light"] .ui-pp-system-switch input:checked + .ui-pp-system-switch-slider { background: #15803d; border-color: #15803d; }
  html[data-theme="light"] .ui-pp-system-switch input:checked + .ui-pp-system-switch-slider::before { background: #fff; }
  .ui-pp-system-search {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    color: var(--text, #e5e7eb); font-size: 12px; padding: 6px 8px; outline: none;
  }
  .ui-pp-system-search:focus { border-color: var(--neon-glow, rgba(74,222,128,0.4)); }
  .ui-pp-system-lib {
    max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  }
  .ui-pp-system-lib-item {
    display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
    padding: 6px 8px; border-radius: 8px; border: 1px solid transparent;
    background: transparent; color: var(--text, #e5e7eb); transition: all .12s ease;
  }
  .ui-pp-system-lib-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(125,211,252,0.3); }
  .ui-pp-system-lib-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .ui-pp-system-lib-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ui-pp-system-lib-actions { flex: none; display: inline-flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .12s ease; }
  .ui-pp-system-lib-item:hover .ui-pp-system-lib-actions { opacity: 1; }
  .ui-pp-system-lib-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 6px; border: 1px solid transparent;
    background: transparent; color: var(--text-muted, #94a3b8); cursor: pointer;
    transition: all .12s ease; padding: 0;
  }
  .ui-pp-system-lib-act:hover { color: var(--neon-bright, #86efac); border-color: rgba(125,211,252,0.35); background: rgba(255,255,255,0.05); }
  .ui-pp-system-lib-act.ui-pp-system-lib-del:hover { color: #f87171; border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.08); }
  .ui-pp-system-editing {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 5px 8px; border-radius: 8px; font-size: 11px; color: var(--neon-bright, #86efac);
    background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25);
  }
  .ui-pp-system-editing b { font-weight: 700; }
  .ui-pp-system-editing-cancel { font-size: 11px; padding: 2px 8px; flex: none; }
  .ui-pp-system-lib-name-input {
    flex: 1; min-width: 0; font-size: 12px; line-height: 1.4; padding: 1px 6px; box-sizing: border-box;
    border-radius: 6px; border: 1px solid rgba(74,222,128,0.45); background: rgba(255,255,255,0.06);
    color: var(--text, #e5e7eb); outline: none; font-family: inherit;
  }
  html[data-theme="light"] .ui-pp-system-lib-name-input { background: #fff; color: #111827; }
  .ui-pp-system-lib-preview { font-size: 11px; color: var(--text-muted, #94a3b8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ui-pp-system-lib-empty { font-size: 11.5px; color: var(--text-muted, #6b7280); padding: 4px 2px; }
  .ui-pp-system-input {
    width: 100%; resize: vertical; min-height: 64px; box-sizing: border-box;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    color: var(--text, #e5e7eb); font-size: 12px; padding: 6px 8px; outline: none;
    font-family: inherit; line-height: 1.5;
  }
  .ui-pp-system-input:focus { border-color: var(--neon-glow, rgba(74,222,128,0.4)); }
  .ui-pp-system-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
  .ui-pp-system-save { font-size: 11.5px; padding: 4px 10px; }
  .ui-pp-system-clear { font-size: 11.5px; padding: 4px 10px; }
  .ui-pp-system-done { font-size: 11.5px; padding: 4px 12px; }
  .ui-pp-system-add { font-size: 11.5px; padding: 4px 12px; }
  html[data-theme="light"] .ui-pp-system-input, html[data-theme="light"] .ui-pp-system-search {
    background: #fff; border-color: rgba(0,0,0,0.15); color: #111827;
  }
  html[data-theme="light"] .ui-pp-system-lib-item:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.15); }
  /* 选中态：边框凸显 + 右上角扁平对勾（当前节点已启用的系统提示词） */
  .ui-pp-system-lib-item.selected {
    border-color: var(--neon-glow, rgba(74,222,128,0.45));
    background: var(--neon-dim, rgba(74,222,128,0.10));
  }
  html[data-theme="light"] .ui-pp-system-lib-item.selected { border-color: rgba(21,128,61,0.45); background: rgba(21,128,61,0.08); }
  .ui-pp-system-lib-item.selected .ui-pp-system-lib-name { color: var(--neon-bright, #86efac); }
  html[data-theme="light"] .ui-pp-system-lib-item.selected .ui-pp-system-lib-name { color: #15803d; }
  .ui-pp-system-lib-check {
    flex: none; display: inline-grid; place-items: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-bright, #86efac), var(--neon, #4ade80));
    color: #06200e;
  }
  html[data-theme="light"] .ui-pp-system-lib-check { color: #ffffff; }

/* ═══ 胶囊选项卡 / 参数 chips（系统 UI 统一组件：Agent 选择器 / 画幅比例 / 清晰度同款） ═══ */
.ui-pills {
  display: inline-flex; flex-wrap: nowrap; gap: 2px; align-items: center;
  padding: 3px; border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(255,255,255,0.12));
}
html[data-theme="light"] .ui-pills { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }
.ui-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: none; background: transparent; color: var(--text-muted, #94a3b8);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.ui-pill:hover { color: var(--text, #fff); }
html[data-theme="light"] .ui-pill:hover { color: #111827; }
.ui-pill.active {
  background: linear-gradient(135deg, var(--neon-bright, #86efac), var(--neon, #4ade80) 55%, var(--neon, #4ade80));
  color: #06200e; font-weight: 700;
  box-shadow: 0 2px 10px rgba(74,222,128,0.35), inset 0 1px 0 rgba(255,255,255,0.40);
}
html[data-theme="light"] .ui-pill.active { color: #ffffff; box-shadow: 0 2px 8px rgba(21,128,61,0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.ui-pill-icon { display: inline-grid; place-items: center; }
.ui-pill-icon svg { width: 14px; height: 14px; }

  /* 下拉空间不足时向上展开（设置弹窗等底部场景） */
  .ui-select.drop-up > .ui-select-dropdown { top: auto; bottom: calc(100% + 6px); }
  /* 打开时提升所在行层级，避免相邻行盖住下拉（导致选项点不到） */
  .ui-select { position: relative; }
  .ui-select.open { z-index: 400; }

/* ═══════ 可搜索下拉（工作流选择等，ui.js uiSelect.searchable）═══════ */
.ui-select-searchable .ui-select-dropdown { overflow: hidden; padding: 4px; }
.ui-select-search { padding: 2px 2px 6px; }
.ui-select-search-input {
  width: 100%; box-sizing: border-box; padding: 6px 9px; font-size: 12.5px; color: #e5e5e5;
  background: rgba(255,255,255,0.06); border: 1px solid #2c2c2c; border-radius: 7px; outline: none;
}
.ui-select-search-input::placeholder { color: #7d7d7d; }
.ui-select-search-input:focus { border-color: #22d3ee; box-shadow: 0 0 0 2px rgba(34,211,238,0.18); }
html[data-theme="light"] .ui-select-search-input { color: #111; background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.15); }
html[data-theme="light"] .ui-select-search-input::placeholder { color: #8a8a8a; }
html[data-theme="light"] .ui-select-search-input:focus { border-color: #0891b2; box-shadow: 0 0 0 2px rgba(8,145,178,0.14); }
.ui-select-searchable .ui-select-opts { max-height: 216px; overflow-y: auto; } /* 仅可搜索下拉内部滚动，普通下拉保持原下拉容器滚动 */
.ui-select-empty { padding: 12px 10px; font-size: 12.5px; color: #9ca3af; text-align: center; }
html[data-theme="light"] .ui-select-empty { color: #6b7280; }
.ui-select-option.ui-select-opt-focus { background: rgba(34,211,238,0.16); }
html[data-theme="light"] .ui-select-option.ui-select-opt-focus { background: rgba(8,145,178,0.12); }
.ui-select-option.hidden { display: none; }

/* ---------- 顶层悬浮 Portal 下拉（统一规则：不受卡片/弹窗滚动容器裁切） ---------- */
.ui-select-dropdown.ui-select-portal {
  position: fixed;
  z-index: 8000;
  width: max-content;
  min-width: 220px;
  max-width: min(560px, calc(100vw - 24px));
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  border: 1px solid var(--modal-border);
}
.ui-select-dropdown.ui-select-layout-model.ui-select-portal { min-width: 320px; }
.ui-select-dropdown.ui-select-layout-grid.ui-select-portal { min-width: 300px; }
