:root {
      --bg-dark: #070a0f;
      --bg-panel: #0d121c;
      --bg-box: #121824;
      --bg-input: #080c14;
      --border-color: #1e2638;
      --border-focus: #388bfd;
      --primary: #ffd700;
      --accent-blue: #1f6feb;
      --accent-blue-hover: #388bfd;
      --accent-green: #238636;
      --accent-purple: #8957e5;
      --text-main: #f0f6fc;
      --text-muted: #8b949e;
      --danger: #da3633;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
    input, textarea, [contenteditable="true"], pre {
      user-select: text !important; -webkit-user-select: text !important;
    }
    body {
      background-color: var(--bg-dark); color: var(--text-main);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
      font-size: 11px; overflow: hidden; height: 100vh; width: 100vw; display: flex; flex-direction: column;
    }
    ::-webkit-scrollbar { width: 4px; height: 4px; }
    ::-webkit-scrollbar-thumb { background: #263044; border-radius: 2px; }
    ::-webkit-scrollbar-track { background: transparent; }

    .app-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 6px 16px; background: var(--bg-panel);
      border-bottom: 1px solid var(--border-color); flex-shrink: 0;
    }
    .app-header .brand { display: flex; align-items: center; gap: 10px; }
    .app-header .brand-mark {
      width: 28px; height: 28px; border-radius: 6px;
      background: linear-gradient(135deg, #3b82f6, #8b5cf6);
      display: flex; align-items: center; justify-content: center;
      font-weight: 800; font-size: 10px; color: #fff; letter-spacing: 0.5px;
    }
    .app-header .brand-title { font-size: 13px; font-weight: 700; color: #f0f6fc; }
    .app-header .brand-sub { font-size: 10px; color: #8b949e; }
    .btn-remote-lib {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 5px 12px; background: #1a1f2e; border: 1px solid #30363d;
      border-radius: 6px; color: #58a6ff; cursor: pointer; font-size: 11px;
      font-weight: 600; transition: all 0.15s;
    }
    .btn-remote-lib:hover { background: #21262d; border-color: #58a6ff; }
    .btn-remote-lib.active { color: #4ade80; border-color: #4ade80; }

    /* 顶部 API Key / 远程词库 统一绿色、同尺寸对齐（以 API 按钮尺寸为准） */
    #btn-api-key-cfg, #btn-remote-lib {
      padding: 3px 8px; font-size: 10px; border-radius: 4px; gap: 4px;
      height: 22px; line-height: 1; justify-content: center;
      background: #1a1f2e; border: 1px solid rgba(74, 222, 128, 0.45);
      color: #4ade80; font-weight: 600; white-space: nowrap;
    }
    #btn-api-key-cfg:hover, #btn-remote-lib:hover {
      background: rgba(74, 222, 128, 0.12); border-color: #4ade80; color: #4ade80;
    }
    #btn-remote-lib.active {
      background: rgba(74, 222, 128, 0.18); border-color: #4ade80; color: #4ade80;
    }

    /* 桌面端三栏常驻布局 */
    .app-content-row { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; }

    aside.left-pane {
      width: 330px; background: var(--bg-panel); border-right: 1px solid var(--border-color);
      padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex-shrink: 0;
      transition: width 0.2s ease, opacity 0.2s ease;
    }
    .pane-title {
      font-size: 12px; font-weight: bold; color: var(--text-main);
      display: flex; justify-content: space-between; align-items: center;
      border-bottom: 1px solid var(--border-color); padding-bottom: 6px;
    }
    .badge {
      font-size: 9px; background: #162032; color: #388bfd;
      border: 1px solid #388bfd33; padding: 1px 5px; border-radius: 3px; font-family: monospace;
    }
    .section-box {
      border: 1px solid var(--border-color); background: var(--bg-box); border-radius: 6px;
      padding: 8px; display: flex; flex-direction: column; gap: 6px;
    }
    .section-header {
      display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-weight: 600; font-size: 11px;
    }
    .form-row { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 2px; }
    
    select, textarea, input[type="text"] {
      display: block; width: 100% !important; box-sizing: border-box !important;
      background: var(--bg-input); border: 1px solid #212a3d;
      color: var(--text-main); border-radius: 4px; padding: 5px 6px; font-size: 11px; outline: none; transition: border-color 0.2s;
    }
    select:focus, textarea:focus, input[type="text"]:focus { border-color: var(--accent-blue-hover); }

    .btn-primary.btn-video-mode {
      background: linear-gradient(135deg, #7928ca, #ff0080) !important;
      color: #ffffff !important;
      box-shadow: 0 4px 15px rgba(255, 0, 128, 0.35);
    }
    .btn-primary.btn-video-mode:hover {
      background: linear-gradient(135deg, #8a3ffc, #ff1a8c) !important;
    }

    textarea.expandable {
      resize: vertical; min-height: 40px; height: 40px; line-height: 1.45; font-family: inherit; width: 100%;
    }
    .custom-input { color: #3fb950 !important; }
    .custom-input::placeholder { color: #57606a !important; }

    .switch { position: relative; display: inline-block; width: 28px; height: 15px; flex-shrink: 0; }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider {
      position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
      background-color: #212a3d; transition: .2s; border-radius: 15px;
    }
    .slider:before {
      position: absolute; content: ""; height: 11px; width: 11px; left: 2px; bottom: 2px;
      background-color: var(--text-muted); transition: .2s; border-radius: 50%;
    }
    input:checked + .slider { background-color: var(--accent-blue); }
    input:checked + .slider:before { transform: translateX(13px); background-color: #fff; }

    .mode-toggle-group {
      display: flex; background: #080c14; border: 1px solid #212a3d;
      border-radius: 4px; padding: 1px; gap: 2px;
    }
    .btn-mode-toggle {
      background: transparent; border: 1px solid transparent; color: var(--text-muted);
      font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 3px;
      cursor: pointer; transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 3px;
    }
    .btn-mode-toggle:hover { color: var(--text-main); }
    .btn-mode-toggle.active {
      background: rgba(56, 139, 253, 0.22); color: #58a6ff;
      border-color: rgba(56, 139, 253, 0.45);
    }
    .action-button-group {
      display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 4px;
    }
    .btn-action-tab {
      padding: 6px 4px; font-size: 10.5px; font-weight: 600; border-radius: 4px; border: 1px solid var(--border-color);
      cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.2s;
      background: #101624; color: var(--text-main);
    }
    .btn-action-tab:hover { border-color: var(--accent-blue-hover); background: #182236; }
    .btn-action-tab.active-purple {
      background: rgba(137, 87, 229, 0.18); border-color: var(--accent-purple); color: #d2a8ff;
    }
    .btn-action-tab.active-green {
      background: rgba(35, 134, 54, 0.18); border-color: #3fb950; color: #56d364;
    }

    .drop-zone {
      border: 1px dashed #28334a; border-radius: 6px; padding: 6px; cursor: pointer;
      background: rgba(7, 10, 15, 0.6); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 65px;
    }
    .drop-zone.drag-active { border-color: #388bfd !important; background: rgba(56, 139, 253, 0.12) !important; }
    .slots-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
    .slot-thumb {
      position: relative; height: 44px; border-radius: 4px; overflow: hidden;
      border: 1px solid var(--border-color); background: #000; cursor: pointer;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .slot-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .slot-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
    .slot-thumb.is-ref { border-color: var(--accent-purple); box-shadow: 0 0 0 2px var(--accent-purple); }
    .slot-thumb.ctrl-selected { border-color: #388bfd; box-shadow: 0 0 0 2px #388bfd, 0 0 8px rgba(56,139,253,0.5); }
    .slot-badge {
      position: absolute; bottom: 1px; left: 2px; background: rgba(0,0,0,0.75);
      color: #fff; font-size: 8px; padding: 1px 3px; border-radius: 2px; font-family: monospace; pointer-events: none;
    }
    .slot-thumb.active .slot-badge { background: var(--primary); color: #000; font-weight: bold; }
    .slot-thumb.is-ref .slot-badge { background: var(--accent-purple); color: #fff; font-weight: bold; }
    .slot-thumb.ctrl-selected .slot-badge { background: #388bfd; color: #fff; font-weight: bold; }
    .slot-del {
      position: absolute; top: 1px; right: 1px; background: rgba(0,0,0,0.85);
      color: var(--danger); width: 15px; height: 15px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; z-index: 5;
    }
    .slot-del:hover { background: #da3633; color: #fff; }

    .dual-ref-bar {
      display: none; grid-template-columns: 1fr 1fr; gap: 6px; background: #080c14;
      border: 1px solid #1f283d; border-radius: 4px; padding: 4px 6px; margin-top: 4px;
    }
    .dual-ref-col { display: flex; flex-direction: column; gap: 2px; font-size: 9.5px; }
    .dual-ref-col label { color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 3px; }
    .dual-ref-col select { padding: 2px 4px; font-size: 10px; height: 22px; }

    .lamp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 5px 0; }
    .lamp-grid label { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 10.5px; cursor: pointer; }
    .lamp-grid input { accent-color: var(--accent-blue); cursor: pointer; }

    .btn-primary {
      width: 100%; padding: 8px; background: var(--accent-blue); color: #ffffff;
      border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 11px; transition: background 0.2s, opacity 0.2s;
      display: flex; align-items: center; justify-content: center; gap: 6px;
    }
    .btn-primary:hover { background: var(--accent-blue-hover); }
    .btn-sub {
      background: transparent; border: 1px solid #212a3d; color: var(--text-muted);
      padding: 3px 8px; border-radius: 4px; cursor: pointer; font-size: 10px; transition: all 0.2s;
      display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    }
    .btn-sub:hover { color: #f0f6fc; border-color: var(--accent-blue-hover); }
    .btn-tool-mini {
      background: #101624; border: 1px solid #212a3d; color: var(--text-muted);
      width: 21px; height: 21px; border-radius: 3px; cursor: pointer; font-size: 9.5px; transition: all 0.2s;
      display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .btn-tool-mini:hover { color: #58a6ff; border-color: #388bfd; background: #162032; }

    .prompt-top-pill-bar {
      display: flex; justify-content: space-between; align-items: center;
      background: #090e18; border: 1px solid #1a2336; border-radius: 5px;
      padding: 4px 8px; margin-bottom: 6px; min-height: 28px;
    }
    .prompt-top-pill-bar label {
      display: inline-flex; align-items: center; gap: 5px; font-size: 10px;
      cursor: pointer; color: #ffd700; font-weight: 700; user-select: none;
    }
    .prompt-top-pill-bar input[type="checkbox"] {
      cursor: pointer; margin: 0; accent-color: var(--primary);
    }
    .btn-reset-lighting-prompt {
      background: rgba(31, 111, 235, 0.14); border: 1px solid rgba(31, 111, 235, 0.55);
      color: #58a6ff; height: 21px; padding: 0 8px; border-radius: 4px;
      font-size: 9.5px; font-weight: 700; cursor: pointer; display: inline-flex;
      align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; transition: all 0.2s;
    }
    .btn-reset-lighting-prompt:hover {
      background: rgba(31, 111, 235, 0.26); border-color: #58a6ff;
    }

    .clipboard-float-window {
      position: fixed; top: 80px; left: 420px; width: 380px; height: 320px;
      background: #0f1624fa; border: 1px solid #388bfd; border-radius: 8px;
      box-shadow: 0 14px 40px rgba(0,0,0,0.85); z-index: 99990; display: none;
      flex-direction: column; overflow: hidden; resize: both; min-width: 260px; min-height: 200px;
    }
    .clipboard-float-header {
      background: #151f33; padding: 6px 10px; border-bottom: 1px solid #243049;
      display: flex; justify-content: space-between; align-items: center; cursor: move; user-select: none;
    }
    .clipboard-textarea {
      flex: 1; width: 100%; background: #080c14; border: none;
      color: #f0f6fc; padding: 8px 10px; font-size: 11px;
      font-family: Consolas, "Microsoft YaHei", monospace; outline: none; resize: none; line-height: 1.45;
    }
    .clipboard-textarea:focus { background: #060910; }
    .clipboard-float-footer {
      background: #0f1624; border-top: 1px solid #1e293f; padding: 5px 8px;
      display: flex; justify-content: space-between; align-items: center;
    }

    /* 中间画布工作区 */
    main.center-pane {
      flex: 1; background: #05080e; display: flex; flex-direction: column; position: relative; overflow: hidden; min-width: 320px;
    }
    .workspace-header {
      height: 38px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center;
      justify-content: space-between; padding: 0 12px; background: #111622aa; backdrop-filter: blur(8px); z-index: 10;
      min-width: 0; gap: 8px;
    }
    .ws-tabs { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
    .ws-tab-btn {
      background: #0d121c; border: 1px solid var(--border-color); color: var(--text-muted);
      padding: 4px 10px; font-size: 11px; font-weight: 700; border-radius: 5px; cursor: pointer;
      display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; white-space: nowrap;
    }
    .ws-tab-btn.active {
      background: rgba(255, 215, 0, 0.12); color: var(--primary); border-color: var(--primary);
    }
    .ws-tab-badge {
      font-size: 9px; padding: 1px 5px; border-radius: 8px; background: rgba(255,255,255,0.08); font-family: monospace;
    }
    .ws-tab-btn.active .ws-tab-badge { background: var(--primary); color: #000; font-weight: bold; }

    .main-canvas-body { flex: 1; overflow: hidden; position: relative; display: flex; flex-direction: column; }
    .gallery-container {
      flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; position: relative;
    }
    .render-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; padding: 4px; align-content: start; }
    @media (max-width: 1400px) and (min-width: 901px) { .render-cards-grid { grid-template-columns: repeat(2, 1fr); } }

    .render-card {
      position: relative; width: 100%; aspect-ratio: 3 / 4; min-height: 220px;
      background: var(--bg-box); border: 1px solid var(--border-color); border-radius: 8px;
      display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
      box-shadow: 0 6px 18px rgba(0,0,0,0.5); transition: border-color 0.2s, box-shadow 0.2s;
    }
    .render-card:hover { border-color: #388bfd66; box-shadow: 0 8px 24px rgba(0,0,0,0.7); }
    .render-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; pointer-events: auto; }
    .render-card video { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; pointer-events: auto; }
    .card-video-badge {
      position: absolute; top: 8px; left: 8px; background: rgba(121, 40, 202, 0.85); color: #fff;
      font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: 700; pointer-events: none; z-index: 5;
      display: flex; align-items: center; gap: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    }
    .card-timestamp {
      position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, 0.75); color: var(--text-muted);
      font-size: 9px; padding: 2px 6px; border-radius: 3px; font-family: monospace; pointer-events: none;
    }

    .card-del-btn {
      position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d; color: var(--danger);
      display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; line-height: 1;
      cursor: pointer; opacity: 0; transition: opacity 0.2s, background-color 0.2s; z-index: 10;
    }
    .render-card:hover .card-del-btn, .render-card.is-waiting .card-del-btn { opacity: 1; }
    .card-del-btn:hover { background: #da3633; color: #ffffff; }

    /* 圆圈对钩样式：与回填、删除、复制图标完全对齐 */
    .card-check-circle {
      position: absolute; top: 6px; right: 32px; width: 22px; height: 22px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d;
      display: flex; align-items: center; justify-content: center; color: var(--text-muted);
      font-size: 10px; cursor: pointer; z-index: 15; opacity: 0; transition: opacity 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
    }
    .render-card:hover .card-check-circle {
      opacity: 1;
    }
    .card-check-circle:hover {
      border-color: #388bfd; color: #58a6ff; background: rgba(31, 111, 235, 0.35);
    }
    .render-card.is-selected .card-check-circle {
      opacity: 1 !important; background: #1f6feb !important;
      border-color: #388bfd !important; color: #ffffff !important;
      box-shadow: 0 0 6px rgba(56, 139, 253, 0.6);
    }
    .render-card.is-selected {
      border-color: #388bfd !important;
      box-shadow: 0 0 0 2px #388bfd, 0 8px 24px rgba(0,0,0,0.8) !important;
    }

    .btn-abort-global {
      background: rgba(218, 54, 51, 0.15) !important;
      border: 1px solid #da3633 !important;
      color: #ff7b72 !important;
      cursor: pointer; font-weight: 700;
    }
    .btn-abort-global:hover {
      background: #da3633 !important; color: #ffffff !important;
    }

    .gallery-batch-toolbar {
      display: flex; align-items: center; gap: 8px; font-size: 10px;
    }

    .card-refill-btn {
      position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d; color: #3fb950;
      display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer;
      opacity: 0; transition: opacity 0.2s, background-color 0.2s; z-index: 10;
    }
    .render-card:hover .card-refill-btn { opacity: 1; }
    .card-refill-btn:hover { background: #238636; color: #ffffff; }

    .card-to-slot-btn {
      position: absolute; top: 6px; left: 32px; width: 22px; height: 22px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d; color: #ffd700;
      display: flex; align-items: center; justify-content: center; font-size: 10px; cursor: pointer;
      opacity: 0; transition: opacity 0.2s, background-color 0.2s; z-index: 10;
    }
    .render-card:hover .card-to-slot-btn { opacity: 1; }
    .card-to-slot-btn:hover { background: #ffd700; color: #000; }

    .card-copy-btn {
      position: absolute; top: 6px; left: 58px; width: 22px; height: 22px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d; color: #58a6ff;
      display: flex; align-items: center; justify-content: center; font-size: 10px; cursor: pointer;
      opacity: 0; transition: opacity 0.2s, background-color 0.2s; z-index: 10;
    }
    .render-card:hover .card-copy-btn { opacity: 1; }
    .card-copy-btn:hover { background: #1f6feb; color: #ffffff; }

    .card-spinner {
      width: 32px; height: 32px; border: 2px solid #1e2638; border-top: 2px solid #388bfd; border-radius: 50%; animation: spin 1s linear infinite;
    }
    .card-spinner-purple {
      width: 28px; height: 28px; border: 2px dashed #8957e5; border-radius: 50%; animation: spin 3s linear infinite;
    }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

    .swatch-container { flex: 1; display: none; flex-direction: column; padding: 14px; overflow-y: auto; }
    .swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; align-content: start; }
    .swatch-card {
      position: relative; background: #0d121c; border: 1px solid var(--border-color); border-radius: 8px;
      padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: all 0.2s;
    }
    .swatch-card:hover {
      border-color: var(--primary); background: #141b29; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    }
    .swatch-del-btn {
      position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.85); border: 1px solid #30363d; color: var(--text-muted);
      display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer;
      opacity: 0; transition: opacity 0.2s, background-color 0.2s, color 0.2s; z-index: 5;
    }
    .swatch-card:hover .swatch-del-btn { opacity: 1; }
    .swatch-del-btn:hover { background: #da3633; color: #fff; border-color: #da3633; }
    .swatch-ball {
      width: 68px; height: 68px; border-radius: 50%; margin-bottom: 8px; display: block;
      /* 球体体积与反光由 Canvas 2D 径向高光反射算法绘制，此处仅保留外投影 */
      box-shadow: 0 6px 18px rgba(0,0,0,0.6);
      transition: transform 0.2s;
    }
    .swatch-card:hover .swatch-ball { transform: scale(1.06); }
    .swatch-name {
      font-size: 10px; color: #f0f6fc; text-align: center; line-height: 1.3; max-height: 28px;
      overflow: hidden; word-break: break-word; width: 100%; font-weight: 600;
    }
    .swatch-sub {
      font-size: 8.5px; color: var(--text-muted); margin-top: 4px; font-family: monospace;
      max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    /* 材质详情弹窗 */
    .material-modal {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(5, 8, 14, 0.85); backdrop-filter: blur(8px);
      z-index: 10005; display: none; align-items: center; justify-content: center;
    }
    .material-modal-box {
      width: 530px; max-width: 92vw; background: #111622; border: 1px solid var(--primary);
      border-radius: 10px; padding: 16px; box-shadow: 0 16px 48px rgba(0,0,0,0.9);
      display: flex; flex-direction: column; gap: 8px; max-height: 86vh; overflow-y: auto;
    }
    .mat-edit-field {
      display: flex; flex-direction: column; gap: 2px;
      padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .mat-edit-label {
      font-size: 10px; font-weight: 600; color: #58a6ff; font-family: monospace;
      display: flex; justify-content: space-between; align-items: center;
    }
    .mat-edit-input {
      width: 100%; background: #080c14; border: 1px solid #212a3d;
      color: #f0f6fc; border-radius: 4px; padding: 4px 6px; font-size: 11px;
      font-family: Consolas, "Microsoft YaHei", monospace; outline: none; transition: border-color 0.2s;
    }
    .mat-edit-input:focus { border-color: var(--accent-blue-hover); }

    /* Lightbox 弹窗 */
    .lightbox-modal {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(5, 8, 14, 0.96); backdrop-filter: blur(12px);
      z-index: 9999; display: none; align-items: center; justify-content: center; overflow: hidden; cursor: default;
    }
    .lightbox-viewport {
      width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
    }
    .lightbox-img-wrapper {
      position: absolute; display: flex; align-items: center; justify-content: center;
      transform-origin: center center; will-change: transform; user-select: none;
    }
    .compare-container {
      position: relative; display: block; box-shadow: 0 20px 60px rgba(0,0,0,0.9);
      border-radius: 6px; overflow: hidden; border: 1px solid #1f6feb55;
    }
    .compare-img {
      display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none;
      image-rendering: -webkit-optimize-contrast; image-rendering: high-quality;
    }
    .compare-img.render-img {
      position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    }
    .compare-container.no-compare .compare-img.orig-img { display: none; }
    .compare-container.no-compare .compare-img.render-img { position: relative; clip-path: none !important; }
    .compare-container.no-compare .compare-handle,
    .compare-container.no-compare .compare-label { display: none !important; }
    .compare-label {
      position: absolute; top: 12px; padding: 3px 8px; font-size: 10px; font-weight: 600;
      border-radius: 4px; pointer-events: none; z-index: 8; letter-spacing: 0.5px;
    }
    .label-render { left: 12px; background: rgba(31, 111, 235, 0.85); color: #fff; }
    .label-orig { right: 12px; background: rgba(0, 0, 0, 0.75); color: var(--text-muted); border: 1px solid #30363d; }
    .compare-handle {
      position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
      background: rgba(255, 255, 255, 0.95); z-index: 10; cursor: ew-resize; transform: translateX(-50%);
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    }
    .compare-handle::after {
      content: ""; position: absolute; top: 0; bottom: 0; left: -10px; width: 22px; cursor: ew-resize;
    }
    .lightbox-toolbar {
      position: absolute; bottom: 24px; display: flex; gap: 8px; align-items: center;
      background: #111622f0; padding: 8px 18px; border-radius: 30px;
      border: 1px solid var(--border-color); box-shadow: 0 8px 30px rgba(0,0,0,0.8); z-index: 10000;
    }

    /* 移动端/全平台右上角常驻安全关闭按钮 */
    .lightbox-top-close-btn {
      position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
      width: 36px; height: 36px; border-radius: 50%;
      background: rgba(13, 18, 28, 0.75); border: 1px solid #30363d; color: #f0f6fc;
      display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold;
      cursor: pointer; z-index: 10002; backdrop-filter: blur(8px);
      box-shadow: 0 4px 16px rgba(0,0,0,0.6); transition: all 0.2s;
    }
    .lightbox-top-close-btn:hover, .lightbox-top-close-btn:active {
      background: #da3633; color: #ffffff; border-color: #da3633; transform: scale(1.08);
    }

    /* 远程词库弹窗 */
    .remote-modal-overlay {
      display: none; position: fixed; inset: 0; z-index: 99999;
      background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
      align-items: center; justify-content: center;
    }
    .remote-modal-overlay.show { display: flex; }
    .remote-modal {
      background: #0d1117; border: 1px solid #30363d; border-radius: 10px;
      padding: 24px; width: 460px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    }
    .remote-modal h3 { margin: 0 0 6px; font-size: 15px; color: #f0f6fc; }
    .remote-modal .desc { font-size: 11px; color: #8b949e; margin-bottom: 16px; line-height: 1.6; }
    .remote-modal label { display: block; font-size: 11px; color: #8b949e; margin-bottom: 6px; }
    .remote-modal input[type="text"] {
      width: 100%; box-sizing: border-box; padding: 8px 10px;
      background: #010409; border: 1px solid #30363d; border-radius: 6px;
      color: #e6edf3; font-family: monospace; font-size: 12px; margin-bottom: 8px;
    }
    .remote-modal input[type="text"]:focus { outline: none; border-color: #58a6ff; }
    .remote-modal .modal-status { font-size: 11px; margin-bottom: 16px; min-height: 16px; }
    .remote-modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
    .remote-modal .btn-confirm {
      padding: 7px 18px; background: #238636; border: none; border-radius: 6px;
      color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
    }
    .remote-modal .btn-confirm:hover { background: #2ea043; }
    .remote-modal .btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
    .remote-modal .btn-cancel {
      padding: 7px 18px; background: #21262d; border: 1px solid #30363d;
      border-radius: 6px; color: #e6edf3; font-size: 12px; cursor: pointer;
    }
    .remote-modal .btn-cancel:hover { background: #30363d; }

    /* 中间与右侧之间的拉条及折叠按钮 */
    .pane-resizer {
      width: 8px; background: #090d14; border-left: 1px solid var(--border-color);
      border-right: 1px solid var(--border-color); cursor: col-resize; flex-shrink: 0;
      position: relative; display: flex; align-items: center; justify-content: center;
      transition: background 0.15s; z-index: 25;
    }
    .pane-resizer:hover, .pane-resizer.is-dragging {
      background: #1f6feb;
    }
    .resizer-toggle-btn {
      position: absolute; width: 22px; height: 22px; border-radius: 50%;
      background: #162032; border: 1.5px solid #388bfd; color: #58a6ff;
      display: flex; align-items: center; justify-content: center; font-size: 10px;
      cursor: pointer; box-shadow: 0 0 10px rgba(0,0,0,0.8); z-index: 30;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .resizer-toggle-btn:hover {
      background: #1f6feb; color: #ffffff; border-color: #58a6ff; transform: scale(1.15);
    }

    /* 右侧提示词面板 */
    aside.right-pane {
      width: 380px; background: var(--bg-panel);
      padding: 10px; display: flex; flex-direction: column; flex-shrink: 0;
      font-family: Consolas, "Microsoft YaHei", "PingFang SC", monospace;
      transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
      overflow: hidden;
    }
    aside.right-pane.is-collapsed {
      width: 0 !important; padding: 0 !important; border-left: none !important; opacity: 0; pointer-events: none;
    }

    .code-box {
      flex: 1; background: var(--bg-input); border: 1px solid var(--border-color);
      border-radius: 6px; padding: 8px; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 6px; position: relative;
    }
    
    .unified-prompt-header {
      display: grid;
      grid-template-columns: 140px 1fr auto;
      gap: 5px;
      align-items: center;
      border-bottom: 1px solid #162032;
      padding-bottom: 4px;
      margin-bottom: 4px;
      font-size: 10px;
      min-height: 25px;
    }
    .unified-header-label {
      font-weight: bold;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .unified-select {
      width: 100% !important;
      padding: 2px 4px !important;
      font-size: 10px !important;
      height: 22px !important;
    }
    .unified-btn-group {
      display: flex;
      align-items: center;
      gap: 2px;
      flex-shrink: 0;
    }

    .skill-editor-area {
      flex: 1; min-height: 0; width: 100%; background: transparent; border: none; outline: none; resize: none;
      color: #8b949e; font-family: Consolas, "Microsoft YaHei", "PingFang SC", monospace;
      font-size: 10px; line-height: 1.45; padding: 4px 8px 4px 4px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
    }
    .skill-editor-area:focus { color: #f0f6fc; }
    .skill-editor-area::-webkit-scrollbar { width: 6px; }
    .skill-editor-area::-webkit-scrollbar-track { background: transparent; }
    .skill-editor-area::-webkit-scrollbar-thumb { background: #263044; border-radius: 3px; }
    /* 反推规则编辑框吃满了全局 textarea.custom-input 的 58px / max-height:160px 限制，
       内容被压进一个很矮的滚动区，看起来像文字出了框；这里解除限制，高度交给 flex 分配 */
    #txt-skill-content {
      height: auto !important; min-height: 0 !important; max-height: none !important;
    }

    .prompt-highlight-wrap {
      position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
      background: var(--bg-input); border-radius: 4px;
    }
    .prompt-highlight-layer {
      position: absolute; inset: 0; z-index: 1; overflow-y: scroll;
      padding: 8px !important; margin: 0 !important; border: none !important;
      color: var(--text-main);
      font-family: Consolas, "Microsoft YaHei", "PingFang SC", "Segoe UI", monospace !important;
      font-size: 11px !important; line-height: 17px !important; letter-spacing: 0px !important;
      word-spacing: 0px !important; tab-size: 2 !important;
      white-space: pre-wrap !important; word-break: break-all !important; overflow-wrap: break-word !important;
      pointer-events: none; box-sizing: border-box !important;
      font-variant-ligatures: none !important; text-rendering: optimizeSpeed !important;
    }
    .prompt-highlight-layer::-webkit-scrollbar { width: 6px !important; }
    .prompt-highlight-layer::-webkit-scrollbar-track { background: transparent !important; }
    .prompt-highlight-layer::-webkit-scrollbar-thumb { background: transparent !important; }

    .prompt-editable {
      position: absolute; inset: 0; z-index: 2; width: 100% !important; height: 100% !important;
      padding: 8px !important; margin: 0 !important; border: none !important; outline: none !important; resize: none !important;
      font-family: Consolas, "Microsoft YaHei", "PingFang SC", "Segoe UI", monospace !important;
      font-size: 11px !important; line-height: 17px !important; letter-spacing: 0px !important;
      word-spacing: 0px !important; tab-size: 2 !important;
      white-space: pre-wrap !important; word-break: break-all !important; overflow-wrap: break-word !important;
      user-select: text; overflow-y: scroll !important; box-sizing: border-box !important;
      background: transparent !important; color: transparent !important; caret-color: var(--primary) !important;
      font-variant-ligatures: none !important; text-rendering: optimizeSpeed !important;
    }
    .prompt-editable::-webkit-scrollbar { width: 6px !important; }
    .prompt-editable::-webkit-scrollbar-track { background: transparent !important; }
    .prompt-editable::-webkit-scrollbar-thumb { background: #263044 !important; border-radius: 3px !important; }

    .prompt-editable::selection {
      background: rgba(56, 139, 253, 0.45) !important;
      color: #ffffff !important;
      -webkit-text-fill-color: #ffffff !important;
    }

    .hl-bracket {
      color: #3fb950 !important; font-weight: normal !important;
      -webkit-text-fill-color: #3fb950 !important;
      background: transparent !important;
      padding: 0 !important; margin: 0 !important; border: none !important;
      border-radius: 0; text-shadow: none !important;
    }
    .app-dialog-overlay {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background: rgba(5, 8, 14, 0.85); backdrop-filter: blur(8px);
      z-index: 10001; display: none; align-items: center; justify-content: center;
    }
    .app-dialog-box {
      width: 360px; background: var(--bg-panel); border: 1px solid #30363d;
      border-radius: 8px; padding: 16px; box-shadow: 0 12px 36px rgba(0,0,0,0.8);
      display: flex; flex-direction: column; gap: 12px;
    }
    #toast-notice {
      position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
      background: var(--primary); color: #000; padding: 6px 16px; border-radius: 20px;
      font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transition: 0.25s; z-index: 10008;
    }

    /* ===== 手机/移动端流式上下堆叠适配方案 (PC 端 >900px 零改动零污染) ===== */
    @media (max-width: 900px) {
      body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
      }
      .app-content-row {
        flex-direction: column !important;
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
      }

      aside.left-pane {
        width: 100% !important;
        flex: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
      }

      main.center-pane {
        width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 70vh !important;
        border-bottom: 1px solid var(--border-color);
      }

      aside.right-pane {
        width: 100% !important;
        flex: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        border-left: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
      }

      aside.right-pane.is-collapsed {
        width: 100% !important;
        padding: 10px !important;
        opacity: 1 !important;
        pointer-events: auto !important;
      }

      aside.right-pane .code-box {
        min-height: 42vh;
      }

      .pane-resizer {
        display: none !important;
      }

      .workspace-header {
        flex-wrap: wrap;
        height: auto;
        padding: 6px 10px;
        row-gap: 6px;
      }
      .app-header {
        flex-wrap: wrap;
        row-gap: 6px;
        padding: 8px 12px;
      }

      .render-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }
      .swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
      }
      .app-dialog-box {
        width: 92vw;
        max-width: 400px;
      }

      /* 16px 防 iOS 自动聚焦放大 */
      select, textarea, input[type="text"] {
        font-size: 16px !important;
      }
      .btn-primary, .btn-action-tab, .btn-sub, .btn-mode-toggle, .ws-tab-btn, .btn-tool-mini, .btn-remote-lib {
        font-size: 13.5px !important;
      }
      .switch {
        transform: scale(1.15);
      }
    }

    @media (max-width: 640px) {
      .render-cards-grid {
        grid-template-columns: 1fr !important;
      }
      .slots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }
      .ws-tabs {
        width: 100%;
      }
      .brand-sub {
        display: none;
      }
    }

/* ===== PBR Pro 增强样式 (纯净单例版) ===== */
/* 隐藏卡片上的画面尺寸标签 (如 1792 × 2388) */
    .card-res-badge,
    .card-meta-dim,
    .render-card-dim,
    .dimension-tag,
    .card-dim,
    .card-res,
    .card-size,
    [data-role="dim"],
    [data-dim] {
      display: none !important;
    }

    /* 隐藏原生常驻在卡片底部的静态模型标签 */
    .render-card > .card-model,
    .render-card .model-tag,
    .card-box .card-model,
    .gallery-card .card-model {
      display: none !important;
    }

    /* 多视角参考图 "参" 徽章按钮：严格位于右上角操作区正下方 */
    .card-ref-toggle-badge {
      position: absolute;
      top: 34px;
      right: 8px;
      width: 20px;
      height: 20px;
      box-sizing: border-box;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      z-index: 30;
      user-select: none;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      background: rgba(13, 17, 23, 0.88);
      color: rgba(240, 246, 252, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.35);
opacity: 0;
      transform: scale(0.9);
      pointer-events: none;
    }

    /* 悬停已完成卡片时显现 */
    .is-card-ready:hover .card-ref-toggle-badge,
    [data-pbr-ready="1"]:hover .card-ref-toggle-badge,
    .render-card:hover .card-ref-toggle-badge {
      opacity: 1 !important;
      transform: scale(1) !important;
      pointer-events: auto !important;
    }

    .card-ref-toggle-badge:hover {
      transform: scale(1.15) !important;
      border-color: #58a6ff !important;
      color: #fff !important;
    }

    /* 激活态：已选为参考图（常驻显现，经典蔚蓝光圈与发光投影） */
    .card-ref-toggle-badge.active {
      display: flex !important;
      opacity: 1 !important;
      transform: scale(1) !important;
      pointer-events: auto !important;
      background: #1f6feb !important;
      color: #ffffff !important;
      border-color: #58a6ff !important;
      box-shadow: 0 0 12px rgba(56, 139, 253, 0.95) !important;
    }

    /* 选中为参考图时的卡片高亮轮廓 */
    .is-space-reference {
      box-shadow: 0 0 0 2px #388bfd, 0 8px 24px rgba(0, 0, 0, 0.65) !important;
      border-color: #388bfd !important;
    }

    /* ===== 独立编号锚定按钮（图N）——与【参】蓝色区分，采用青绿 ===== */
    .card-anchor-badge {
      position: absolute;
      top: 59px;
      right: 8px;
      width: 20px;
      height: 20px;
      box-sizing: border-box;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      z-index: 30;
      user-select: none;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      background: rgba(13, 17, 23, 0.88);
      color: rgba(240, 246, 252, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.35);
opacity: 0;
      transform: scale(0.9);
      pointer-events: none;
    }
    .is-card-ready:hover .card-anchor-badge,
    [data-pbr-ready="1"]:hover .card-anchor-badge,
    .render-card:hover .card-anchor-badge {
      opacity: 1 !important;
      transform: scale(1) !important;
      pointer-events: auto !important;
    }
    .card-anchor-badge:hover {
      transform: scale(1.15) !important;
      border-color: #3fb950 !important;
      color: #fff !important;
    }
    .card-anchor-badge.active {
      display: flex !important;
      opacity: 1 !important;
      transform: scale(1) !important;
      pointer-events: auto !important;
      background: #1f883d !important;
      color: #ffffff !important;
      border-color: #3fb950 !important;
      box-shadow: 0 0 12px rgba(63, 185, 80, 0.9) !important;
    }
    .is-anchor {
      box-shadow: 0 0 0 2px #3fb950, 0 8px 24px rgba(0, 0, 0, 0.65) !important;
      border-color: #3fb950 !important;
    }

    /* 真实生图模型名称标签：仅限在已经生好的图上悬停专属浮现 */
    .card-model-hover-pill {
      position: absolute;
      bottom: 8px;
      left: 8px;
      background: rgba(13, 17, 23, 0.92);
      color: #f2cc60;
      border: 1px solid rgba(240, 180, 0, 0.45);
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      font-size: 10px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 4px;
      opacity: 0.55;
      transform: translateY(0);
      transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      pointer-events: none;
      z-index: 20;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
white-space: nowrap;
      max-width: calc(100% - 20px);
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .is-card-ready:hover .card-model-hover-pill,
    [data-pbr-ready="1"]:hover .card-model-hover-pill,
    .render-card:hover .card-model-hover-pill {
      opacity: 1 !important;
      transform: translateY(0) !important;
    }

    /* 画廊卡片操作按钮与勾选框统一设计 (对齐原生生成卡片与回填导入卡片) */
    .render-card .card-btn-del {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 20px;
      height: 20px;
      box-sizing: border-box;
      border-radius: 50%;
      background: rgba(13, 17, 23, 0.88);
      color: rgba(240, 246, 252, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.35);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 30;
      font-size: 10px;
opacity: 0;
      transform: scale(0.9);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .render-card:hover .card-btn-del {
      opacity: 1 !important;
      transform: scale(1) !important;
    }

    .render-card .card-btn-del:hover {
      color: #ff7b72 !important;
      border-color: rgba(255, 123, 114, 0.6) !important;
      background: rgba(218, 54, 51, 0.25) !important;
      transform: scale(1.15) !important;
    }

    .render-card .card-select-chk,
    .render-card .card-batch-chk {
      position: absolute;
      top: 8px;
      left: 8px;
      width: 15px;
      height: 15px;
      accent-color: #388bfd;
      cursor: pointer;
      z-index: 30;
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .render-card:hover .card-select-chk,
    .render-card:hover .card-batch-chk,
    .render-card .card-select-chk:checked,
    .render-card .card-batch-chk:checked {
      opacity: 1 !important;
    }

    /* 画廊顶部参考图状态标签 */
    .gallery-ref-status-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 10.5px;
      font-weight: 600;
      color: #58a6ff;
      background: rgba(56, 139, 253, 0.12);
      border: 1px solid rgba(56, 139, 253, 0.35);
      padding: 2px 8px;
      border-radius: 4px;
      user-select: none;
    }

    /* 底图区鼠标悬停高清放大浮窗 */
    .slot-hover-preview {
      position: fixed;
      z-index: 10005;
      pointer-events: none;
      background: rgba(13, 18, 28, 0.96);
      border: 1px solid rgba(56, 139, 253, 0.45);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 6px;
      backdrop-filter: blur(12px);
      opacity: 0;
      transform: scale(0.96);
      transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
      max-width: 360px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .slot-hover-preview.active {
      opacity: 1;
      transform: scale(1);
    }

    .slot-hover-preview img {
      max-width: 340px;
      max-height: 480px;
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: 5px;
      display: block;
    }

    .slot-hover-preview-meta {
      font-size: 10px;
      color: #8b949e;
      font-family: ui-monospace, SFMono-Regular, monospace;
      display: flex;
      justify-content: space-between;
      padding: 2px 4px 0;
    }

    /* 已生成图 hover 放大预览浮层 */
    #gallery-hover-preview-el {
      position: fixed;
      z-index: 9999;
      pointer-events: none;
      display: none;
      background: rgba(13, 17, 23, 0.94);
      border: 1px solid rgba(56, 139, 253, 0.35);
      border-radius: 8px;
      padding: 6px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(6px);
    }
    #gallery-hover-preview-el img {
      display: block;
      max-width: 760px;
      max-height: 840px;
      border-radius: 4px;
      object-fit: contain;
    }
    #gallery-hover-preview-el .gallery-hover-dim {
      color: rgba(240, 246, 252, 0.7);
      font-size: 11px;
      margin-top: 4px;
      text-align: center;
      font-family: ui-monospace, SFMono-Regular, monospace;
    }

    /* 画廊区域拖拽导入参考图高亮样式与提示浮层 */
    .gallery-container {
      position: relative;
      transition: background 0.2s ease, border-color 0.2s ease;
    }
    .gallery-container.gallery-drag-over {
      outline: 2px dashed #388bfd !important;
      outline-offset: -8px;
      background: rgba(56, 139, 253, 0.08) !important;
    }
    .gallery-drop-indicator {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(13, 18, 28, 0.95);
      border: 1px solid #388bfd;
      color: #58a6ff;
      font-weight: 700;
      font-size: 12px;
      padding: 14px 28px;
      border-radius: 8px;
      pointer-events: none;
      z-index: 100;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
      display: none;
      align-items: center;
      gap: 10px;
      backdrop-filter: blur(10px);
    }
    .gallery-container.gallery-drag-over .gallery-drop-indicator {
      display: flex;
    }

/* ===== 以下由 index.html 内联样式抽离并入（UI-UX-PRO-MAX 设计系统） ===== */
    /* ==========================================================================
       1. UI-UX-PRO-MAX / IMPECCABLE DESIGN TOKENS (暗黑高质感变量系统)
       ========================================================================== */
    :root {
      --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

      /* 深度暗黑阶梯 (深邃、克制、低反射) */
      --bg-base: #06090e;
      --bg-surface: #0b0f17;
      --bg-surface-elevated: #0f1523;
      --bg-surface-hover: #141c2e;

      /* 精细 hairline 极细边框，去除厚重感 */
      --border-subtle: rgba(255, 255, 255, 0.05);
      --border-focus: rgba(56, 139, 253, 0.45);
      --border-highlight: rgba(255, 255, 255, 0.1);

      /* 文字层级与对比度 */
      --text-high: #f0f6fc;
      --text-medium: #8b949e;
      --text-low: #586069;
      --text-disabled: #3d444d;

      /* 品牌与功能强调色 (微调低饱和，克制优雅) */
      --brand-primary: #388bfd;
      --brand-primary-hover: #58a6ff;
      --brand-primary-glow: rgba(56, 139, 253, 0.18);
      --brand-accent-purple: #8b5cf6;
      --brand-accent-green: #2ea043;
      --brand-accent-amber: #d29922;
      --brand-accent-danger: #f85149;

      /* 物理动效与轻盈圆角 */
      --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
      --transition-fast: 0.15s var(--ease-spring);
      --transition-normal: 0.22s var(--ease-spring);
      --radius-sm: 6px;
      --radius-md: 9px;
      --radius-lg: 14px;
    }

    /* 全局排版与平滑渲染优化 */
    body {
      font-family: var(--font-sans) !important;
      background: radial-gradient(circle at 50% 30%, #151d2c 0%, #0a0e17 65%, #05070c 100%) !important;
      color: var(--text-high) !important;
      letter-spacing: -0.012em;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      min-height: 100vh;
    }

    code, kbd, samp, pre, select, textarea, input, .badge, .mono-font {
      font-family: var(--font-mono) !important;
    }

    /* ==========================================================================
       2. HEADER & BRAND AREA (极简轻盈顶栏 - 悬浮液态玻璃)
       ========================================================================== */
    .app-header {
      background: rgba(11, 16, 26, 0.65) !important;
      backdrop-filter: blur(24px) saturate(190%) !important;
      -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
      padding: 7px 16px !important;
      position: sticky;
      top: 0;
      z-index: 900;
    }

    .brand-mark {
      background: rgba(255, 255, 255, 0.06) !important;
      color: #58a6ff !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
font-family: var(--font-mono) !important;
      font-weight: 700;
      border-radius: var(--radius-sm) !important;
      font-size: 11px !important;
      padding: 2px 7px !important;
    }

    .brand-title {
      font-size: 12.5px !important;
      font-weight: 600 !important;
      letter-spacing: -0.015em;
      color: var(--text-high) !important;
    }

    .brand-sub {
      font-size: 10px !important;
      color: var(--text-low) !important;
      margin-top: 1px;
    }

    /* 顶部辅助按钮：液态玻璃胶囊 */
    .btn-sub, .btn-remote-lib {
      font-family: var(--font-sans) !important;
      font-size: 10.5px !important;
      font-weight: 500 !important;
      padding: 4px 10px !important;
      border-radius: var(--radius-sm) !important;
      background: rgba(255, 255, 255, 0.035) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.25) !important;
color: var(--text-medium) !important;
      transition: all var(--transition-fast) !important;
    }

    .btn-sub:hover, .btn-remote-lib:hover {
      background: rgba(255, 255, 255, 0.08) !important;
      border-color: rgba(255, 255, 255, 0.25) !important;
      box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 0, 0, 0.35) !important;
      color: var(--text-high) !important;
      transform: translateY(-0.5px);
    }

    /* ==========================================================================
       3. 左右布局容器与卡片质感 (LIQUID GLASS 液态拟真玻璃核心实现)
       ========================================================================== */
    .left-pane, .right-pane {
      background: rgba(10, 15, 25, 0.45) !important;
border-color: rgba(255, 255, 255, 0.08) !important;
    }

    .left-pane {
      padding: 6px 8px !important;
      gap: 5px !important;
    }

    .pane-title {
      font-size: 10px !important;
      font-weight: 600 !important;
      letter-spacing: 0.05em !important;
      text-transform: uppercase;
      color: var(--text-low) !important;
      padding-bottom: 2px !important;
      margin-bottom: 2px !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .badge {
      font-size: 8.5px !important;
      font-weight: 600 !important;
      letter-spacing: 0.04em !important;
      padding: 1.5px 6px !important;
      border-radius: 4px !important;
      background: rgba(255, 255, 255, 0.04) !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    }

    /* 核心：真·物理悬浮液态透镜玻璃面板 (Physical Liquid Lens Glass with Floor Shadow) */
    .section-box {
      /* 更高透光的晶莹基底，显露出底板反射与纵深 */
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 40%, rgba(255, 255, 255, 0.02) 100%), rgba(12, 17, 27, 0.5) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
      border-radius: var(--radius-sm) !important;
      padding: 4px 7px !important;
      margin-bottom: 5px !important;
/* 核心：精细微折射边缘 + 柔和多层悬浮阴影，消除原本生硬的白框感 */
      box-shadow: 
        /* 1. 迎光面顶部细致微高光（仅保留柔和的 1px 微发光线） */
        inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
        /* 2. 背光面底部微透内阴影 */
        inset 0 -1px 1px 0 rgba(0, 0, 0, 0.35),
        /* 3. 第一层地板投影：近距实体接触焦散深影（暗核） */
        0 3px 8px 0 rgba(0, 0, 0, 0.45),
        /* 4. 第二层地板投影：中距定向悬浮阴影 */
        0 10px 20px -3px rgba(0, 0, 0, 0.55),
        /* 5. 第三层地板投影：远距离环境大漫反射柔影 */
        0 18px 36px -6px rgba(0, 0, 0, 0.65) !important;
      transform: translateZ(0);
      transition: all var(--transition-fast) !important;
    }

    .section-box:hover {
      border-color: rgba(255, 255, 255, 0.16) !important;
      border-top-color: rgba(255, 255, 255, 0.32) !important;
      transform: translateY(-1.5px) !important;
      box-shadow: 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 1.5px 0 rgba(0, 0, 0, 0.3),
        0 6px 14px 0 rgba(0, 0, 0, 0.48),
        0 16px 28px -3px rgba(0, 0, 0, 0.62),
        0 26px 48px -6px rgba(0, 0, 0, 0.72) !important;
    }

    .section-box:focus-within {
      border-color: rgba(88, 166, 255, 0.45) !important;
      border-top-color: rgba(88, 166, 255, 0.65) !important;
      box-shadow: 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
        0 0 12px rgba(56, 139, 253, 0.2),
        0 10px 24px -3px rgba(0, 0, 0, 0.6) !important;
    }

    .section-header {
      font-size: 9.5px !important;
      font-weight: 600 !important;
      color: var(--text-high) !important;
      margin-bottom: 2px !important;
    }

    /* 统一指定的核心栏目标题：字号完全对齐室内人工光引入(12px/600)，统一高质感亮蓝色 */
    .title-blue-aligned,
    .section-box .section-header > span:first-child,
    .section-box .section-header > div > span:first-child,
    #lbl-indoor-light-title,
    #lbl-su-desc {
      font-size: 12px !important;
      font-weight: 600 !important;
      letter-spacing: -0.01em !important;
      color: #58a6ff !important;
    }

    /* 现代微型开关 Toggle Switch：透光玻璃胶囊槽与透镜水珠滑块 */
    .switch {
      position: relative;
      width: 32px !important;
      height: 18px !important;
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(255, 255, 255, 0.05) !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      border-radius: 18px !important;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3) !important;
      transition: all 0.22s var(--ease-spring) !important;
    }

    /* 水珠透镜滑块圆点 (14px，迎光高光与悬浮焦散) */
    .slider:before {
      position: absolute;
      content: "";
      height: 14px !important;
      width: 14px !important;
      left: 1px !important;
      bottom: 1px !important;
      background: linear-gradient(145deg, #a6b2c2 0%, #687280 100%) !important;
      border-radius: 50% !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.7),
        0 1px 3px rgba(0, 0, 0, 0.5) !important;
      transition: all 0.22s var(--ease-spring) !important;
    }

    .switch input:checked + .slider {
      background: rgba(31, 111, 235, 0.55) !important;
      border-color: rgba(88, 166, 255, 0.55) !important;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 0 10px rgba(56, 139, 253, 0.45) !important;
    }

    .switch input:checked + .slider:before {
      transform: translateX(14px) !important;
      background: linear-gradient(145deg, #ffffff 0%, #d8e5f7 100%) !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        0 2px 6px rgba(0, 0, 0, 0.45) !important;
    }

    /* ==========================================================================
       4. 表单组件与文字高度精准规范 (内嵌玻璃微凹槽)
       ========================================================================== */
    .custom-input, select, textarea {
      background: rgba(3, 6, 12, 0.48) !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      border-radius: var(--radius-sm) !important;
      color: var(--text-high) !important;
      font-size: 10.5px !important;
      padding: 5px 8px !important;
      transition: all var(--transition-fast) !important;
      outline: none !important;
      line-height: 1.5 !important;
      box-shadow: inset 0 1.5px 4px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

    .custom-input:focus, select:focus, textarea:focus {
      border-color: rgba(88, 166, 255, 0.5) !important;
      box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.35),
        0 0 0 1.5px rgba(56, 139, 253, 0.25) !important;
      background: rgba(5, 9, 18, 0.75) !important;
    }

    textarea::placeholder, input::placeholder {
      color: var(--text-disabled) !important;
      font-family: var(--font-sans) !important;
      font-size: 10px !important;
    }

    /* 光影、外景、人物下拉选择框字体变大且易读 */
    #sel-light, #sel-exterior, #sel-person {
      font-size: 12px !important;
      font-weight: 600 !important;
      padding: 6px 10px !important;
      color: #f0f6fc !important;
    }

    /* 氛围感描述输入框：精确锁定两行字高度 (line-height 1.5 * 2 + padding 10px + 边框 = 约 44px) */
    #txt-atmosphere {
      height: 44px !important;
      min-height: 44px !important;
      max-height: 120px;
      line-height: 1.5 !important;
      box-sizing: border-box !important;
    }

    /* 精确控制其他多行描述框为 3 行字高度：line-height 1.5 * 3 + padding 10px + 边框 = 约 58px */
    textarea.custom-input,
    #txt-su-desc,
    #txt-exterior,
    #txt-light-env,
    #txt-lamp-desc,
    #txt-person-custom {
      height: 58px !important;
      min-height: 58px !important;
      max-height: 160px;
      line-height: 1.5 !important;
      box-sizing: border-box !important;
    }

    /* 便签剪贴板是可缩放浮窗，输入框必须吃掉浮窗剩余高度（跟着窗口一起变大变小），
       不能被上面那条 58px / max-height:160px 的全局规则钉死；
       同时它也不能带全局 textarea 的边框/聚焦亮框，原来的便签就是一块无边框的深底编辑区 */
    #txt-clipboard-content {
      height: auto !important;
      min-height: 0 !important;
      max-height: none !important;
      flex: 1 1 auto !important;
      line-height: 1.45 !important;
      border: none !important;
      border-radius: 0 !important;
      padding: 8px 10px !important;
      font-size: 11px !important;
      background: #080c14 !important;
      box-shadow: none !important;
    }
    #txt-clipboard-content:focus {
      border: none !important;
      box-shadow: none !important;
      background: #060910 !important;
    }

    /* 提示词高亮层叠严格重合对齐 */
    .prompt-highlight-wrap {
      position: relative !important;
      width: 100% !important;
      flex: 1 !important;
      min-height: 140px !important;
      background: rgba(4, 7, 13, 0.55) !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      border-radius: var(--radius-sm) !important;
      overflow: hidden !important;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}

    .prompt-highlight-wrap:focus-within {
      border-color: rgba(88, 166, 255, 0.5) !important;
      box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.35),
        0 0 0 1.5px rgba(56, 139, 253, 0.25) !important;
    }

    /* 高亮层与输入框必须逐像素同一套度量，否则两层文字会叠出重影 */
    .prompt-highlight-layer,
    .prompt-editable {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      width: 100% !important;
      height: 100% !important;
      margin: 0 !important;
      padding: 8px !important;
      box-sizing: border-box !important;
      border: none !important;
      background: transparent !important;
      font-family: var(--font-mono) !important;
      font-size: 11px !important;
      line-height: 17px !important;
      letter-spacing: 0px !important;
      word-spacing: 0px !important;
      tab-size: 2 !important;
      white-space: pre-wrap !important;
      word-break: break-all !important;
      overflow-wrap: break-word !important;
      font-variant-ligatures: none !important;
      text-rendering: optimizeSpeed !important;
      outline: none !important;
      box-shadow: none !important;
      overflow-y: scroll !important;
      overflow-x: hidden !important;
    }

    /* 分层绘制：普通文字只由输入框画一次（清晰可读），高亮层只负责把【】叠成纯绿 */
    .prompt-highlight-layer {
      pointer-events: none !important;
      z-index: 2 !important;
      color: transparent !important;
      -webkit-text-fill-color: transparent !important;
    }

    .prompt-editable {
      z-index: 1 !important;
      color: #79c0ff !important;
      -webkit-text-fill-color: #79c0ff !important;
      caret-color: #f0f6fc !important;
      resize: none !important;
    }

    /* 编辑状态（光标在框内）维持同一柔和蓝，避免输入时颜色跳变 */
    .prompt-editable:focus {
      color: #79c0ff !important;
      -webkit-text-fill-color: #79c0ff !important;
    }

    /* 操作模式切换微型胶囊按钮 */
    .mode-toggle-group {
      background: rgba(255, 255, 255, 0.035) !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      border-radius: var(--radius-sm) !important;
      padding: 2px !important;
      gap: 2px !important;
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }

    .btn-mode-toggle {
      border: none !important;
      background: transparent !important;
      color: var(--text-low) !important;
      font-size: 10px !important;
      font-weight: 500 !important;
      padding: 2px 7px !important;
      border-radius: 4px !important;
      transition: all var(--transition-fast) !important;
    }

    .btn-mode-toggle:hover {
      color: var(--text-high) !important;
    }

    .btn-mode-toggle.active {
      background: rgba(255, 255, 255, 0.12) !important;
      color: #58a6ff !important;
      font-weight: 600 !important;
      box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.35) !important;
      backdrop-filter: blur(8px) !important;
    }

    /* 主操作按钮：玻璃流体晶体按钮 */
    .btn-primary {
      font-family: var(--font-sans) !important;
      font-weight: 600 !important;
      letter-spacing: -0.01em !important;
      border: 1px solid rgba(255, 255, 255, 0.22) !important;
      border-radius: var(--radius-sm) !important;
      background: linear-gradient(180deg, rgba(31, 111, 235, 0.85) 0%, rgba(22, 78, 168, 0.95) 100%) !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        0 4px 14px rgba(31, 111, 235, 0.32),
        0 1px 2px rgba(0, 0, 0, 0.4) !important;
      backdrop-filter: blur(12px) !important;
      color: #fff !important;
      cursor: pointer;
      transition: all var(--transition-fast) !important;
    }

    .btn-primary:hover {
      background: linear-gradient(180deg, rgba(56, 139, 253, 0.95) 0%, rgba(31, 111, 235, 0.95) 100%) !important;
      box-shadow: 
        inset 0 1px 1.5px rgba(255, 255, 255, 0.6),
        0 6px 20px rgba(56, 139, 253, 0.48),
        0 2px 4px rgba(0, 0, 0, 0.4) !important;
      transform: translateY(-0.5px);
    }

    .btn-primary:active {
      transform: translateY(0);
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }

    /* 单色高级钛灰玻璃操作按钮 */
    .btn-action-tab.active-purple,
    .btn-action-tab.active-green {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(20, 27, 40, 0.8) !important;
      border: 1px solid rgba(255, 255, 255, 0.16) !important;
      color: #e6edf3 !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.25),
        0 3px 10px rgba(0, 0, 0, 0.35) !important;
      backdrop-filter: blur(12px) !important;
    }

    .btn-action-tab.active-purple:hover,
    .btn-action-tab.active-green:hover {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%), rgba(30, 40, 58, 0.85) !important;
      border-color: rgba(255, 255, 255, 0.28) !important;
      color: #ffffff !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.45) !important;
      transform: translateY(-0.5px);
    }

    /* 停止任务胶囊按钮 */
    .btn-abort-global {
      background: rgba(248, 81, 73, 0.12) !important;
      border: 1px solid rgba(248, 81, 73, 0.35) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
      backdrop-filter: blur(8px) !important;
      color: #f85149 !important;
      border-radius: var(--radius-sm) !important;
      font-weight: 500 !important;
      transition: all var(--transition-fast) !important;
    }

    .btn-abort-global:hover {
      background: rgba(248, 81, 73, 0.25) !important;
      border-color: #f85149 !important;
      color: #fff !important;
    }

    /* ==========================================================================
       5. DROP ZONE & 画廊标签纯灰色 (绝无杂色与过度渲染)
       ========================================================================== */
    .drop-zone {
      background: rgba(5, 8, 15, 0.45) !important;
      border: 1px dashed rgba(255, 255, 255, 0.14) !important;
      border-radius: var(--radius-md) !important;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
transition: all var(--transition-normal) !important;
    }

    .drop-zone:hover {
      border-color: rgba(88, 166, 255, 0.45) !important;
      background: rgba(56, 139, 253, 0.03) !important;
    }

    .workspace-header {
      background: rgba(11, 16, 26, 0.65) !important;
      backdrop-filter: blur(20px) saturate(180%) !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
      padding: 6px 14px !important;
    }

    /* 顶部标签：纯正高级中性灰，无任何蓝色渗透与下划线 */
    .ws-tabs {
      display: flex;
      gap: 4px;
      align-items: center;
    }

    .ws-tabs .ws-tab-btn,
    .workspace-header .ws-tab-btn,
    button#tab-btn-gallery,
    button#tab-btn-swatch {
      color: #8b949e !important;
      font-size: 11px !important;
      font-weight: 500 !important;
      padding: 4px 10px !important;
      border: 1px solid transparent !important;
      border-radius: var(--radius-sm) !important;
      background: transparent !important;
      box-shadow: none !important;
      outline: none !important;
      transition: all var(--transition-fast) !important;
      position: relative;
    }

    .ws-tabs .ws-tab-btn::after,
    .ws-tabs .ws-tab-btn::before,
    button#tab-btn-gallery::after,
    button#tab-btn-gallery::before,
    button#tab-btn-swatch::after,
    button#tab-btn-swatch::before {
      display: none !important;
      content: none !important;
    }

    .ws-tabs .ws-tab-btn i,
    button#tab-btn-gallery i,
    button#tab-btn-swatch i {
      color: #8b949e !important;
      transition: color var(--transition-fast);
    }

    .ws-tabs .ws-tab-btn:hover,
    button#tab-btn-gallery:hover,
    button#tab-btn-swatch:hover {
      color: #e6edf3 !important;
      background: rgba(255, 255, 255, 0.05) !important;
      border-color: rgba(255, 255, 255, 0.15) !important;
    }

    .ws-tabs .ws-tab-btn:hover i,
    button#tab-btn-gallery:hover i,
    button#tab-btn-swatch:hover i {
      color: #e6edf3 !important;
    }

    /* 激活态：文字、图标、边框彻底清空蓝色，锁定在纯粹钛灰与浅灰玻璃外框 */
    .ws-tabs .ws-tab-btn.active,
    .ws-tabs .ws-tab-btn.active:hover,
    .ws-tabs .ws-tab-btn.active:focus,
    button#tab-btn-gallery.active,
    button#tab-btn-gallery.active:hover,
    button#tab-btn-gallery.active:focus,
    button#tab-btn-swatch.active,
    button#tab-btn-swatch.active:hover,
    button#tab-btn-swatch.active:focus {
      color: #e6edf3 !important; /* 纯净钛灰浅白 */
      background: rgba(255, 255, 255, 0.08) !important;
      border: 1px solid rgba(255, 255, 255, 0.28) !important;
      box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.4) !important;
      backdrop-filter: blur(16px) !important;
      outline: none !important;
    }

    .ws-tabs .ws-tab-btn.active i,
    .ws-tabs .ws-tab-btn.active:hover i,
    .ws-tabs .ws-tab-btn.active:focus i,
    button#tab-btn-gallery.active i,
    button#tab-btn-swatch.active i {
      color: #e6edf3 !important;
    }

    .ws-tab-badge {
      background: rgba(255, 255, 255, 0.08) !important;
      color: #8b949e !important;
      border-radius: 8px !important;
      font-size: 9px !important;
      padding: 0 5px !important;
      margin-left: 4px;
    }

    .ws-tabs .ws-tab-btn.active .ws-tab-badge,
    button#tab-btn-gallery.active .ws-tab-badge,
    button#tab-btn-swatch.active .ws-tab-badge {
      background: rgba(255, 255, 255, 0.16) !important;
      color: #e6edf3 !important;
    }

    /* 右侧反推词与生图词独立下拉条样式 */
    .standalone-selector-bar {
      display: flex;
      align-items: center;
      gap: 5px;
      background: rgba(255, 255, 255, 0.035);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: var(--radius-sm);
      padding: 3px 6px;
      margin-bottom: 4px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .standalone-selector-bar select {
      flex: 1;
      min-width: 0;
      height: 26px;
      padding: 2px 6px !important;
      font-size: 11px !important;
      border: 1px solid rgba(255, 255, 255, 0.1) !important;
      background: rgba(4, 7, 13, 0.6) !important;
      color: #e6edf3 !important;
    }

    .standalone-selector-bar .btn-sub {
      padding: 2px 6px !important;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 10px !important;
    }

    /* ==========================================================================
       6. 悬浮窗、弹窗与上下文菜单 (全透厚感悬浮玻璃)
       ========================================================================== */
    .remote-modal, .app-dialog-box, .material-modal-box, #card-context-menu, #slot-context-menu {
      background: rgba(12, 17, 28, 0.97) !important;
      backdrop-filter: blur(28px) saturate(190%) !important;
      -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      box-shadow: 
        inset 0 1px 1.5px rgba(255, 255, 255, 0.35),
        0 24px 60px -12px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.05) !important;
      border-radius: var(--radius-md) !important;
    }

    .ctx-menu-item {
      transition: all var(--transition-fast) !important;
      font-size: 10.5px !important;
    }

    .ctx-menu-item:hover {
      background: rgba(56, 139, 253, 0.18) !important;
      color: #fff !important;
    }

    .clipboard-float-window {
      background: rgba(12, 17, 28, 0.97) !important;
      backdrop-filter: blur(28px) saturate(190%) !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      border-radius: var(--radius-md) !important;
      box-shadow: 
        inset 0 1px 1.5px rgba(255, 255, 255, 0.3),
        0 20px 48px rgba(0, 0, 0, 0.75) !important;
    }

    /* 滚动条极细化 */
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.14);
      border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.25);
    }
  
