
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0a0a0a; color: #e0e0e0; height: 100vh; display: flex; overflow: hidden; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Layout */
.app { display: flex; width: 100%; height: 100vh; }
.panel { display: flex; flex-direction: column; overflow: hidden; }
.panel-left { width: 55%; min-width: 520px; background: #0d0d0d; border-right: 1px solid #1e1e1e; }
.panel-right { flex: 1; min-width: 400px; background: #0f0f0f; }

/* Divider */
.divider { width: 4px; cursor: col-resize; background: #1a1a1a; flex-shrink: 0; transition: background .15s; position: relative; z-index: 10; }
.divider:hover, .divider.active { background: #8b5cf6; }

/* ===== LEFT PANEL LAYOUT ===== */
.left-layout { display: flex; height: 100%; }

/* Sidebar */
.sidebar { width: 260px; min-width: 180px; max-width: 420px; background: #111; border-right: none; display: flex; flex-direction: column; flex-shrink: 0; }
.left-main { flex: 1; min-width: 320px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.sidebar-header { padding: 16px 16px; border-bottom: 1px solid #1e1e1e; display: flex; align-items: center; justify-content: space-between; }
.sidebar-header h1 { font-size: 17px; font-weight: 700; background: linear-gradient(135deg, #8b5cf6, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-header .hd-btns { display: flex; gap: 6px; }
.sidebar-header .hd-btns button { background: #8b5cf6; border: none; color: #fff; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; font-size: 16px; line-height: 1; transition: opacity .2s; display: flex; align-items: center; justify-content: center; }
.sidebar-header .hd-btns button:hover { opacity: .8; }
.sidebar-header .hd-btns .btn-gpt { background: #10b981; }

.sidebar-tabs { display: flex; border-bottom: 1px solid #1e1e1e; background: #111; }
.sidebar-tab { flex: 1; padding: 10px 0; text-align: center; font-size: 13px; cursor: pointer; color: #555; transition: all .2s; border-bottom: 2px solid transparent; user-select: none; }
.sidebar-tab:hover { color: #888; }
.sidebar-tab.active { color: #8b5cf6; border-bottom-color: #8b5cf6; }

.sidebar-content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.model-section { margin-bottom: 6px; }
.model-section-title { padding: 8px 16px; font-size: 11px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .5px; }
.model-item { padding: 10px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background .15s; border-left: 3px solid transparent; }
.model-item:hover { background: #1a1a1a; }
.model-item.active { background: #1a1a1a; border-left-color: #8b5cf6; }
.model-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.model-item .dot.chat { background: #8b5cf6; }
.model-item .dot.image { background: #10b981; }
.model-item .dot.video { background: #f59e0b; }
.model-item .name { font-size: 13px; color: #ccc; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-item .del { color: #555; cursor: pointer; font-size: 15px; padding: 0 4px; opacity: 0; transition: opacity .2s; }
.model-item:hover .del { opacity: 1; }
.model-item .del:hover { color: #ef4444; }

/* Conversation history */
.conv-toolbar { padding: 10px 12px; border-bottom: 1px solid #1e1e1e; flex-shrink: 0; }
.conv-toolbar button {
  width: 100%;
  padding: 8px 0;
  border: 1px dashed #333;
  border-radius: 6px;
  background: none;
  color: #888;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}
.conv-toolbar button:hover { border-color: #8b5cf6; color: #8b5cf6; }
.conv-item { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .15s; border-left: 3px solid transparent; }
.conv-item:hover { background: #1a1a1a; }
.conv-item.active { background: #1a1a1a; border-left-color: #8b5cf6; }
.conv-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.conv-item .dot.chat { background: #8b5cf6; }
.conv-item .dot.image { background: #10b981; }
.conv-item .dot.video { background: #f59e0b; }
.conv-item .conv-info { flex: 1; overflow: hidden; min-width: 0; }
.conv-item .conv-name { font-size: 13px; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .conv-meta { font-size: 11px; color: #555; display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.conv-item .conv-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.conv-item:hover .conv-actions { opacity: 1; }
.conv-item .conv-actions span { color: #555; cursor: pointer; font-size: 13px; padding: 0 3px; transition: color .2s; }
.conv-item .conv-actions span:hover { color: #ef4444; }
.conv-item .conv-actions .rename-btn:hover { color: #f59e0b; }
.conv-item .conv-actions .note-btn:hover { color: #10b981; }
.conv-item .conv-note { font-size: 11px; color: #f59e0b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; margin-top: 2px; }
.ep-group { margin-bottom: 10px; border: 1px solid #222; border-radius: 10px; overflow: hidden; background: #101010; }
.ep-group.collapsed .ep-group-items { display: none; }
.ep-group-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #161616; border-bottom: 1px solid #222; cursor: pointer; user-select: none; }
.ep-group.collapsed .ep-group-head { border-bottom: none; }
.ep-group-toggle { width: 22px; height: 22px; border: none; background: #222; color: #aaa; border-radius: 6px; cursor: pointer; flex-shrink: 0; font-size: 10px; line-height: 1; padding: 0; }
.ep-group-toggle:hover { background: #333; color: #fff; }
.ep-group-name { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #e8e8e8; font-size: 12px; font-weight: 600; padding: 4px 8px; outline: none; font-family: inherit; }
.ep-group-name[readonly] { cursor: pointer; }
.ep-group-name:not([readonly]) { cursor: text; border-color: #8b5cf6; background: #111; }
.ep-group-name:focus { border-color: #8b5cf6; background: #111; }
.ep-group-count { font-size: 10px; color: #666; flex-shrink: 0; }
.tree-name-edit {
  width: 22px; height: 22px; border: none; border-radius: 6px; font-size: 11px; cursor: pointer;
  flex-shrink: 0; opacity: 0; transition: opacity .15s;
}
.tree-name-edit { background: #1a1a22; color: #c4b5fd; }
.tree-name-edit:hover { background: #8b5cf622; color: #ddd; }
.ep-group-head:hover .tree-name-edit,
.series-node-head:hover .tree-name-edit { opacity: 1; }
.btn-generate .cost-badge,
.action-btn .cost-badge,
.conv-toolbar button .cost-badge,
.input-toolbar button .cost-badge,
.composer-actions-right .tool-btn .cost-badge,
.video-tool-group .parse-btn .cost-badge,
.send-btn .cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  line-height: 1;
  flex-shrink: 0;
}
.btn-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.composer-actions-right .tool-btn .btn-label,
.video-tool-group .parse-btn .btn-label,
.send-btn .btn-label,
.conv-toolbar button .btn-label,
.btn-generate .btn-label {
  line-height: 1;
}
.cost-badge .cost-num,
.cost-badge .cost-unit {
  color: #888;
  line-height: 1;
}
.composer-actions-right .tool-btn .cost-badge .cost-num,
.video-tool-group .parse-btn .cost-badge .cost-num,
.send-btn .cost-badge .cost-num {
  font-size: 12px;
  font-weight: 500;
}
.composer-actions-right .tool-btn .cost-badge .cost-unit,
.video-tool-group .parse-btn .cost-badge .cost-unit,
.send-btn .cost-badge .cost-unit {
  font-size: 12px;
  font-weight: 400;
}
.cost-badge .cost-num {
  font-size: 11px;
  font-weight: 500;
}
.cost-badge .cost-unit {
  font-size: 9px;
  font-weight: 400;
}
.chat-header .actions .wallet-points-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 7px 12px;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  background: #141414;
  line-height: 1;
  flex-shrink: 0;
}
.wallet-points-num {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}
.wallet-points-unit {
  font-size: 10px;
  font-weight: 500;
  color: #666;
}
.model-item { position: relative; }
.model-item .series-del {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: #1a1010;
  color: #ef4444;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.model-item:hover .series-del { opacity: 1; }
.model-item .name { padding-right: 28px; }

.account-plan-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .account-plan-grid { grid-template-columns: 1fr; } }
.account-plan-card { position: relative; }
.account-btn-plan {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid #333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #ddd;
  font-size: 12px;
  cursor: pointer;
}
.account-btn-plan:hover { background: #2563eb; border-color: #2563eb; color: #fff; }

.ep-group-items .conv-item { border-radius: 0; }
.asset-meta { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }

/* Main chat area */
.chat-header { padding: 14px 18px; border-bottom: 1px solid #1e1e1e; display: flex; align-items: center; justify-content: space-between; background: #0d0d0d; flex-shrink: 0; }
.upload-item video { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; }
.chat-header .info { font-size: 13px; color: #666; }
.chat-header .info strong { color: #8b5cf6; font-weight: 500; }
.chat-header .actions { display: flex; gap: 8px; position: relative; }
.chat-header .actions button { background: none; border: 1px solid #2a2a2a; color: #888; padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: all .2s; }
.chat-header .actions button:hover { border-color: #8b5cf6; color: #ccc; }
.chat-header .actions .btn-danger:hover { border-color: #ef4444; color: #ef4444; }
.chat-header .actions .action-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.chat-header .actions .action-btn.active { border-color: #8b5cf6; color: #8b5cf6; background: #8b5cf611; }

/* System prompt popover */
.system-prompt-popover { position: absolute; top: calc(100% + 8px); right: 0; width: min(430px, calc(100vw - 36px)); display: none; flex-direction: column; gap: 10px; padding: 12px; background: rgba(20,20,24,.97); border: 1px solid #2a2a2a; border-radius: 16px; color: #e0e0e0; box-shadow: 0 22px 54px rgba(0,0,0,.36); backdrop-filter: blur(18px); z-index: 72; }
.system-prompt-popover.open { display: flex; animation: popIn .16s cubic-bezier(.4,0,.2,1); }
.system-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.system-prompt-title { font-size: 13px; font-weight: 700; color: #e0e0e0; }
.system-prompt-close { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; color: #666; cursor: pointer; font-size: 14px; transition: all .15s; }
.system-prompt-close:hover { background: #1a1a1a; color: #ccc; border-color: #2a2a2a; }
.system-prompt-textarea { width: 100%; min-height: 150px; max-height: 38vh; resize: vertical; border: 1px solid #2a2a2a; border-radius: 12px; background: #141414; color: #e0e0e0; padding: 11px 12px; font-size: 13px; line-height: 1.65; outline: none; font-family: inherit; }
.system-prompt-textarea:focus { border-color: #8b5cf6; }
.system-prompt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.system-prompt-actions button { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid #2a2a2a; background: #141414; color: #888; cursor: pointer; transition: all .15s; }
.system-prompt-actions button:hover { background: #1a1a1a; color: #ccc; border-color: #333; }
.system-prompt-actions .primary { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.system-prompt-actions .primary:hover { opacity: .92; color: #fff; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Asset Library Panel */
.asset-panel { position: absolute; right: 12px; top: 58px; bottom: 16px; z-index: 60; width: 280px; max-width: calc(100% - 24px); display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(17,17,20,.97); border: 1px solid #2a2a2a; box-shadow: 0 22px 58px rgba(0,0,0,.42); backdrop-filter: blur(20px); overflow: hidden; transform: translateX(16px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease, transform .16s ease, visibility .16s ease; }
.asset-panel.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
.asset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-title { font-size: 13px; font-weight: 700; color: #e0e0e0; }
.asset-mini-btn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid #2a2a2a; background: #141414; color: #888; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all .15s; flex-shrink: 0; }
.asset-mini-btn:hover { border-color: #8b5cf6; color: #ccc; background: #1a1a1a; }
.asset-mini-btn.asset-io-btn { font-size: 15px; letter-spacing: 0; }
.asset-category-row { display: flex; align-items: center; gap: 6px; }
.asset-category-select { flex: 1; min-width: 0; height: 34px; border-radius: 10px; border: 1px solid #2a2a2a; background: #141414; color: #ccc; padding: 0 10px; font-size: 12px; outline: none; }
.asset-category-select:focus { border-color: #8b5cf6; }
.asset-drop-hint { font-size: 11px; color: #555; line-height: 1.4; padding: 0 2px; }
.asset-grid { min-height: 0; flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; padding-right: 2px; }
.asset-item { min-width: 0; border-radius: 12px; border: 1px solid #2a2a2a; background: #141414; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.asset-item:hover { border-color: #8b5cf6; transform: translateY(-1px); }
.asset-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #0d0d0d; }
.asset-thumb-lazy { background: linear-gradient(135deg, #141414, #1f1f1f); }
.asset-meta { display: flex; align-items: center; gap: 4px; padding: 6px; min-width: 0; }
.asset-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #888; }
.asset-del { width: 22px; height: 22px; border: none; border-radius: 6px; background: transparent; color: #555; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.asset-del:hover { background: #2a1a1a; color: #ef4444; }
.asset-empty { grid-column: 1/-1; min-height: 100px; display: flex; align-items: center; justify-content: center; text-align: center; color: #555; font-size: 12px; line-height: 1.5; border: 1px dashed #2a2a2a; border-radius: 14px; background: #111; padding: 14px; }
.chat-header .actions .action-btn.active-asset { border-color: #10b981; color: #10b981; background: #10b98111; }

/* Messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 100%; padding: 10px 18px; font-size: 14px; line-height: 1.7; word-break: break-word; }
.msg.user .bubble { background: #1a1a2e; border: 1px solid #252540; border-radius: 12px 12px 4px 12px; padding: 12px 16px; display: inline-block; max-width: 100%; }
.msg.assistant .bubble { background: #141414; border: 1px solid #1e1e1e; border-radius: 12px 12px 12px 4px; padding: 12px 16px; display: inline-block; max-width: 100%; white-space: pre-wrap; }
.msg.episode-detail .bubble { display: block; width: 100%; box-sizing: border-box; }
.msg .label { font-size: 11px; color: #555; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.msg .label .tag { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.msg .label .tag.chat { background: #8b5cf622; color: #8b5cf6; }
.msg .label .tag.image { background: #10b98122; color: #10b981; }
.msg .label .tag.video { background: #f59e0b22; color: #f59e0b; }
.msg .content { white-space: pre-wrap; word-break: break-word; }
.msg img.gen-image { max-width: 100%; max-height: 300px; border-radius: 8px; margin-top: 8px; cursor: pointer; border: 1px solid #2a2a2a; }
.msg video.gen-video { max-width: 100%; max-height: 300px; border-radius: 8px; margin-top: 8px; border: 1px solid #2a2a2a; }
.msg .ref-images { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.msg .ref-image { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid #2a2a2a; opacity: .7; }
.msg .loading { display: flex; align-items: center; gap: 8px; color: #666; font-size: 13px; }
.msg .loading .spinner { width: 16px; height: 16px; border: 2px solid #333; border-top-color: #8b5cf6; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg .error-msg { color: #ef4444; font-size: 13px; }
.msg .video-progress { font-size: 12px; color: #f59e0b; }
.msg .msg-actions { margin-top: 8px; display: flex; gap: 6px; }
.msg .msg-actions a { padding: 4px 10px; border-radius: 4px; font-size: 12px; text-decoration: none; background: #1e1e1e; color: #888; border: 1px solid #2a2a2a; transition: all .2s; }
.msg .msg-actions a:hover { border-color: #8b5cf6; color: #ccc; }
.msg .content pre { background: #0d0d0d; border: 1px solid #1e1e1e; border-radius: 8px; padding: 12px; overflow-x: auto; margin: 8px 0; }
.msg .content code { font-family: 'JetBrains Mono', 'Cascadia Code', monospace; font-size: 13px; }
.msg .reasoning-block { background: #0d0d0d; border-left: 3px solid #8b5cf6; padding: 8px 12px; margin: 8px 0; border-radius: 4px; font-size: 12px; color: #666; }
.msg .episode-prompts { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.msg .episode-prompt-block { display: flex; flex-direction: column; gap: 6px; }
.msg .episode-prompt-block label { font-size: 11px; font-weight: 600; color: #8b5cf6; letter-spacing: .02em; }
.msg .episode-prompt-block textarea {
  width: 100%; min-height: 160px; max-height: 50vh; resize: vertical; border: 1px solid #2a2a2a; border-radius: 10px;
  background: #0d0d0d; color: #e8e8e8; padding: 10px 12px; font-size: 13px; line-height: 1.65; outline: none; font-family: inherit;
}
.msg .episode-prompt-block textarea:focus { border-color: #8b5cf6; }
.msg .btn-save-episode-prompts {
  align-self: flex-start; padding: 8px 16px; border-radius: 8px; border: 1px solid #8b5cf6; background: #8b5cf622;
  color: #c4b5fd; font-size: 13px; cursor: pointer; transition: all .2s;
}
.msg .btn-save-episode-prompts:hover:not(:disabled) { background: #8b5cf644; color: #e9d5ff; }
.msg .btn-save-episode-prompts:disabled { opacity: .6; cursor: wait; }

/* Input / Composer */
.input-area { border-top: 0; padding: 10px 18px 16px; background: linear-gradient(to top, #0d0d0d 82%, rgba(13,13,13,0)); flex-shrink: 0; }
.composer { background: rgba(20,20,24,.94); border: 1px solid #2a2a2a; border-radius: 18px; box-shadow: 0 14px 36px rgba(0,0,0,.28); padding: 8px; display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(14px); overflow: hidden; }
.composer-body { flex: 1 1 auto; min-height: 92px; max-height: min(52vh, 520px); min-width: 0; border: 1px solid transparent; background: #111; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; transition: border-color .2s, background .2s, max-height .2s; }
.composer-body:focus-within { border-color: #333; background: #121218; }
.composer-body.has-overflow { overflow: auto; }
.composer-body.expanded { max-height: min(65vh, 680px); }
.composer-body textarea {
  width: 100%; flex: 1 1 auto; min-height: 44px; max-height: min(48vh, 480px); resize: none; outline: none; border: 0;
  padding: 2px; font-size: 14px; line-height: 1.55; background: transparent; color: #e0e0e0; font-family: inherit; overflow-y: auto;
}
.composer-body textarea::placeholder { color: #555; }
.composer-inside-foot { display: flex; align-items: end; justify-content: space-between; gap: 10px; overflow: visible; flex: 0 0 auto; }
.composer-actions-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.video-tool-group { display: inline-flex; gap: 0; padding: 0; border-radius: 12px; background: #141414; border: 1px solid #2a2a2a; overflow: hidden; flex-shrink: 0; }
.video-tool-group .upload-btn { width: 38px; height: 38px; border-radius: 0; border: none; border-right: 1px solid #2a2a2a; margin: 0; background: #141414; color: #888; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.video-tool-group .upload-btn:hover { background: #1a1a1a; color: #ccc; }
.video-tool-group .parse-btn {
  height: 38px;
  border-radius: 0;
  border: none;
  margin: 0;
  padding: 0 12px;
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  color: #aaa;
  background: #161616;
}
.composer-actions-right .tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 42px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-size: 12px;
  white-space: nowrap; transition: all .15s; border: 1px solid #2a2a2a; background: #141414; color: #888;
  line-height: 1;
}
.composer-actions-right .tool-btn:hover { border-color: #444; color: #ccc; background: #1a1a1a; transform: translateY(-1px); }
.composer-actions-right .scripts-btn {
  border-color: #8b5cf6; color: #c4b5fd; background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(168,85,247,.12));
  font-weight: 600; box-shadow: 0 0 0 1px rgba(139,92,246,.15);
}
.composer-actions-right .scripts-btn:hover {
  border-color: #a78bfa; color: #ede9fe; background: linear-gradient(135deg, rgba(139,92,246,.28), rgba(168,85,247,.18));
}
.composer-actions-right .parse-btn { color: #aaa; background: #161616; }
.composer-actions-right .parse-btn:hover { border-color: #555; color: #ddd; }
.composer-actions-right .parse-btn:hover .cost-badge .cost-num,
.composer-actions-right .parse-btn:hover .cost-badge .cost-unit { color: #aaa; }
.send-btn { width: auto; min-width: 56px; height: 42px; padding: 0 14px; border-radius: 13px; border: none; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; background: #8b5cf6; color: #fff; cursor: pointer; transition: opacity .15s, transform .15s; flex: 0 0 auto; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; }
.send-btn:hover { transform: translateY(-1px); opacity: .92; }
.send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.left-tools { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; overflow: visible; }
.input-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.input-toolbar button { background: #141414; border: 1px solid #2a2a2a; color: #888; padding: 0 10px; height: 36px; border-radius: 12px; cursor: pointer; font-size: 12px; transition: all .15s; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.input-toolbar button:hover { border-color: #444; color: #ccc; background: #1a1a1a; transform: translateY(-1px); }
.input-toolbar button.active { border-color: #8b5cf6; color: #8b5cf6; background: #8b5cf611; }
.input-toolbar .upload-btn { width: 36px; padding: 0; justify-content: center; font-size: 16px; }
.input-toolbar .model-select { background: #141414; border: 1px solid #2a2a2a; color: #ccc; padding: 0 10px; height: 36px; border-radius: 12px; font-size: 12px; outline: none; cursor: pointer; flex: 1; max-width: 180px; }
.input-toolbar .model-select:focus { border-color: #8b5cf6; }
.input-toolbar .skill-select { background: #141414; border: 1px solid #2a2a2a; color: #ccc; padding: 0 10px; height: 36px; border-radius: 12px; font-size: 12px; outline: none; cursor: pointer; min-width: 120px; max-width: 180px; }
.input-toolbar .skill-select:focus { border-color: #8b5cf6; }
.input-toolbar .inline-select { background: #141414; border: 1px solid #2a2a2a; color: #ccc; padding: 0 8px; height: 36px; border-radius: 12px; font-size: 12px; outline: none; }
.input-toolbar .inline-select:focus { border-color: #8b5cf6; }
.input-toolbar .inline-num { width: 50px; background: #141414; border: 1px solid #2a2a2a; color: #ccc; padding: 0 8px; height: 36px; border-radius: 12px; font-size: 12px; outline: none; }
.input-toolbar .inline-num:focus { border-color: #8b5cf6; }
.input-toolbar .label-sm { color: #555; font-size: 12px; }

/* Upload preview - multi image */
.upload-previews { display: none; flex-direction: column; gap: 6px; padding: 0 2px; }
.upload-previews.show { display: flex; }
.upload-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: #141414; border: 1px solid #2a2a2a; border-radius: 8px; font-size: 12px; color: #888; }
.upload-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .weight-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.upload-item .weight-wrap input[type=range] { width: 60px; height: 3px; accent-color: #8b5cf6; }
.upload-item .weight-wrap .wl { font-size: 10px; color: #666; min-width: 18px; text-align: center; }
.upload-item .remove { color: #555; cursor: pointer; padding: 2px 6px; font-size: 15px; flex-shrink: 0; }
.upload-item .remove:hover { color: #ef4444; }

/* ========== RIGHT PANEL: Studio ========== */
.studio-tabs { display: flex; border-bottom: 1px solid #1e1e1e; background: #0d0d0d; flex-shrink: 0; }
.studio-tab { flex: 1; padding: 10px 0; text-align: center; font-size: 13px; cursor: pointer; color: #555; transition: all .2s; border-bottom: 2px solid transparent; user-select: none; }
.studio-tab:hover { color: #888; }
.studio-tab.active { color: #8b5cf6; border-bottom-color: #8b5cf6; }
.studio-content { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.studio-section { background: #121212; border: 1px solid #1e1e1e; border-radius: 10px; padding: 16px; }
.studio-section-title { font-size: 12px; font-weight: 600; color: #888; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .4px; }
.studio-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.studio-section-title-inline { margin-bottom: 0; }
.prompt-fav-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.prompt-fav-chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid #2a2a2a; background: #181818;
  color: #999; font-size: 11px; cursor: pointer; transition: all .18s; font-weight: 600;
}
.prompt-fav-chip:hover { border-color: #8b5cf6; color: #ddd; background: #1c1c24; }
.prompt-fav-chip-accent { border-color: #8b5cf644; color: #c4b5fd; background: linear-gradient(135deg, #8b5cf618, #a855f710); }
.prompt-fav-chip-accent:hover { border-color: #8b5cf6; color: #fff; background: linear-gradient(135deg, #8b5cf633, #a855f722); }

.prompt-fav-picker {
  position: absolute; inset: 0; z-index: 85; display: none; align-items: center; justify-content: center;
  padding: 14px; background: rgba(0,0,0,.62); backdrop-filter: blur(8px);
}
.prompt-fav-picker.open { display: flex; }
.prompt-fav-inner {
  width: min(400px, 100%); max-height: calc(100% - 24px); display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 16px; background: rgba(17,17,20,.98); border: 1px solid #2a2a2a;
  box-shadow: 0 22px 58px rgba(0,0,0,.42); overflow: hidden;
}
.prompt-fav-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prompt-fav-title { font-size: 14px; font-weight: 700; color: #eee; }
.prompt-fav-sub { font-size: 11px; color: #666; margin-top: 3px; }
.prompt-fav-group-bar { display: flex; align-items: center; gap: 6px; }
.prompt-fav-groups {
  flex: 1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin;
}
.prompt-fav-groups::-webkit-scrollbar { height: 4px; }
.prompt-fav-groups::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.prompt-fav-group-tab {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid #2a2a2a; background: #141414;
  color: #888; font-size: 11px; cursor: pointer; transition: all .15s; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prompt-fav-group-tab:hover { border-color: #8b5cf6; color: #ccc; }
.prompt-fav-group-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #a855f7); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(139,92,246,.28);
}
.prompt-fav-icon-btn {
  width: 30px; height: 30px; border-radius: 10px; border: 1px dashed #3a3a3a; background: #141414;
  color: #888; cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; transition: all .15s;
}
.prompt-fav-icon-btn:hover { border-color: #8b5cf6; color: #c4b5fd; background: #1a1a22; }
.prompt-fav-group-ops { display: flex; gap: 8px; }
.prompt-fav-ghost-btn {
  padding: 4px 10px; border-radius: 8px; border: 1px solid #252525; background: transparent;
  color: #666; font-size: 11px; cursor: pointer; transition: all .15s;
}
.prompt-fav-ghost-btn:hover { border-color: #444; color: #aaa; }
.prompt-fav-ghost-btn.prompt-fav-danger:hover { border-color: #ef4444; color: #f87171; }
.prompt-fav-list {
  flex: 1; min-height: 180px; max-height: min(460px, 58vh); overflow-y: auto; display: flex;
  flex-direction: column; gap: 8px; padding-right: 2px;
}
.prompt-fav-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #555; font-size: 12px; text-align: center; padding: 28px 12px; border: 1px dashed #2a2a2a;
  border-radius: 12px; background: #101010;
}
.prompt-fav-empty-icon { font-size: 28px; opacity: .7; }
.prompt-fav-card {
  border: 1px solid #252525; border-radius: 12px; background: linear-gradient(180deg, #161616, #121212);
  padding: 12px; cursor: pointer; transition: all .18s; position: relative;
}
.prompt-fav-card:hover { border-color: #8b5cf6; background: linear-gradient(180deg, #1a1824, #14121a); transform: translateY(-1px); }
.prompt-fav-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.prompt-fav-card-title { font-size: 13px; font-weight: 600; color: #e8e8e8; line-height: 1.35; }
.prompt-fav-card-del {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: #666; cursor: pointer; font-size: 12px; flex-shrink: 0; transition: all .15s;
}
.prompt-fav-card-del:hover { border-color: #ef4444; color: #f87171; background: #ef444414; }
.prompt-fav-card-edit {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid #2a2a2a; background: #181818;
  color: #888; font-size: 12px; cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.prompt-fav-card-edit:hover { border-color: #8b5cf6; color: #c4b5fd; background: #8b5cf614; }
.prompt-fav-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.prompt-fav-edit-modal { width: min(520px, 94vw); }
.prompt-fav-edit-textarea { min-height: 180px; resize: vertical; font-size: 12px; line-height: 1.55; }
.prompt-fav-confirm-text { font-size: 13px; color: #bbb; line-height: 1.6; margin: 0; white-space: pre-wrap; }
.prompt-fav-card-snippet {
  font-size: 11px; color: #777; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px;
}
.prompt-fav-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prompt-fav-card-meta { font-size: 10px; color: #555; }
.prompt-fav-card-use {
  padding: 4px 10px; border-radius: 999px; border: none; background: #8b5cf622; color: #c4b5fd;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.prompt-fav-card:hover .prompt-fav-card-use { background: #8b5cf6; color: #fff; }

.prompt-fav-save-modal {
  background: #141414; border: 1px solid #2a2a2a; border-radius: 16px; padding: 0; width: min(440px, 92vw);
  max-height: 86vh; overflow: hidden; display: flex; flex-direction: column;
}
.prompt-fav-save-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 20px 12px; border-bottom: 1px solid #1e1e1e;
}
.prompt-fav-save-head h3 { font-size: 16px; font-weight: 700; color: #eee; margin: 0; }
.prompt-fav-save-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.prompt-fav-field-label { font-size: 11px; color: #777; font-weight: 600; letter-spacing: .3px; }
.prompt-fav-select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2a2a; background: #181818;
  color: #ccc; font-size: 13px; outline: none;
}
.prompt-fav-select:focus { border-color: #8b5cf6; }
.prompt-fav-preview-wrap { margin-top: 4px; }
.prompt-fav-preview {
  max-height: 120px; overflow-y: auto; padding: 10px 12px; border-radius: 8px; border: 1px solid #252525;
  background: #0f0f0f; color: #888; font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.prompt-fav-modal-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px; margin-top: 0; border-top: 1px solid #1e1e1e; flex-shrink: 0;
}
.prompt-fav-modal-actions-split { justify-content: space-between; }
.pf-actions-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pf-btn {
  min-width: 88px; height: 36px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  font-family: inherit; line-height: 1; white-space: nowrap;
}
.pf-btn-cancel { background: #1c1c1c; border-color: #333; color: #aaa; }
.pf-btn-cancel:hover { background: #262626; border-color: #444; color: #e5e5e5; }
.pf-btn-primary { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.pf-btn-primary:hover { background: #7c4fee; border-color: #7c4fee; }
.pf-btn-danger { background: #1a1010; border-color: #ef444455; color: #f87171; min-width: 72px; }
.pf-btn-danger:hover { background: #2a1515; border-color: #ef4444; color: #fca5a5; }
.pf-btn-danger-solid { background: #ef4444; border-color: #ef4444; color: #fff; }
.pf-btn-danger-solid:hover { background: #dc2626; border-color: #dc2626; }
#promptFavSaveModal.show,
#promptFavGroupModal.show,
#promptFavEditModal.show,
#promptFavConfirmModal.show { display: flex; }

.sidebar-tree-head { padding: 10px 14px 0; flex-shrink: 0; }
.sidebar-tree-label { font-size: 12px; color: #666; font-weight: 600; letter-spacing: .2px; }
.sidebar-series-tree { padding: 8px 10px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.series-node { margin-bottom: 8px; border: 1px solid #222; border-radius: 10px; overflow: hidden; background: #101010; }
.series-node.active { border-color: #8b5cf644; }
.series-node.collapsed .series-children { display: none; }
.series-node-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #161616; cursor: pointer; user-select: none; }
.series-node.active .series-node-head { background: #1a1824; }
.series-toggle { width: 22px; height: 22px; border: none; background: #222; color: #aaa; border-radius: 6px; cursor: pointer; flex-shrink: 0; font-size: 10px; line-height: 1; padding: 0; }
.series-toggle:hover { background: #333; color: #fff; }
.series-name { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #e8e8e8; font-size: 12px; font-weight: 600; padding: 4px 8px; outline: none; font-family: inherit; }
.series-name[readonly] { cursor: pointer; }
.series-name:not([readonly]) { cursor: text; border-color: #8b5cf6; background: #111; }
.series-name:focus { border-color: #8b5cf6; background: #111; }
.series-children { padding: 8px; border-top: 1px solid #222; background: #0d0d0d; }
.series-empty-eps { padding: 12px 8px; color: #555; font-size: 12px; text-align: center; line-height: 1.6; }
.series-children .ep-group { margin-bottom: 8px; }
.series-children .ep-group:last-child { margin-bottom: 0; }

.upload-area { border: 2px dashed #2a2a2a; border-radius: 8px; padding: 24px; text-align: center; cursor: pointer; transition: all .2s; position: relative; }
.upload-area:hover { border-color: #8b5cf6; background: #14141e; }
.upload-area.has-file { border-color: #8b5cf6; padding: 6px; }
.upload-area input[type="file"] { display: none; }
.upload-area .studio-previews { display: none; flex-wrap: wrap; gap: 6px; width: 100%; justify-content: center; }
.upload-area .studio-previews .preview-item { position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; flex-shrink: 0; border: 1px solid #333; }
.upload-area .studio-previews .preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; max-height: none; }
.upload-area .studio-previews .preview-item .remove { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; border: none; border-radius: 50%; background: rgba(239,68,68,.85); color: #fff; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.upload-area.has-file .upload-hint { display: none; }
.upload-area.has-file .studio-previews { display: flex; }
.upload-hint { color: #555; font-size: 12px; }
.upload-hint .icon { font-size: 24px; display: block; margin-bottom: 4px; }
.upload-clear { position: absolute; top: 8px; right: 8px; background: #ef4444; color: #fff; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: 14px; display: none; align-items: center; justify-content: center; }
.upload-area.has-file .upload-clear { display: flex; }
.upload-area.drag-over { border-color: #8b5cf6; background: #1e1e2e; }

.studio-input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2a2a; background: #181818; color: #e0e0e0; font-size: 13px; outline: none; transition: border-color .2s; font-family: inherit; }
.studio-input:focus { border-color: #8b5cf6; }
.studio-textarea { resize: vertical; min-height: 160px; max-height: 42vh; line-height: 1.65; }
.size-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.size-picker { display: flex; flex-direction: column; gap: 10px; }
.size-picker-row { display: flex; align-items: flex-start; gap: 10px; }
.size-picker-label { width: 36px; flex-shrink: 0; font-size: 11px; color: #666; line-height: 28px; }
.size-picker-row .size-grid { flex: 1; }
.size-btn { padding: 6px 12px; border-radius: 5px; border: 1px solid #2a2a2a; background: #181818; color: #888; cursor: pointer; font-size: 11px; transition: all .2s; }
.size-btn:hover { border-color: #8b5cf6; color: #ccc; }
.size-btn.active { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.studio-slider-row { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.studio-slider-row label { font-size: 11px; color: #666; }
.studio-slider-row input[type="range"] { flex: 1; accent-color: #8b5cf6; height: 4px; }
.studio-slider-row .val { font-size: 12px; color: #aaa; min-width: 20px; text-align: center; }
.studio-video-opts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.studio-video-opts select, .studio-video-opts input { background: #181818; border: 1px solid #2a2a2a; color: #ccc; padding: 6px 8px; border-radius: 5px; font-size: 12px; outline: none; }
.studio-video-opts select:focus, .studio-video-opts input:focus { border-color: #8b5cf6; }
.studio-video-opts label { font-size: 11px; color: #666; }

.studio-ref-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.studio-ref-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid #2a2a2a; background: #181818; color: #888; cursor: pointer; font-size: 12px; transition: all .15s; }
.studio-ref-btn:hover { border-color: #8b5cf6; color: #ccc; background: #1a1a1a; }
.panel-right { position: relative; }
.studio-asset-picker { position: absolute; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.62); backdrop-filter: blur(8px); }
.studio-asset-picker.open { display: flex; }
.studio-asset-picker-inner { width: min(360px, 100%); max-height: calc(100% - 32px); display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(17,17,20,.98); border: 1px solid #2a2a2a; box-shadow: 0 22px 58px rgba(0,0,0,.42); overflow: hidden; }
.studio-asset-picker-inner .asset-grid { max-height: min(420px, 55vh); }
.asset-item .asset-thumb-video { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #0d0d0d; }
.asset-hover-preview {
  position: fixed; z-index: 10050; pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .12s ease, visibility .12s ease; display: none;
}
.asset-hover-preview.show { opacity: 1; visibility: visible; display: block; }
.asset-hover-preview img,
.asset-hover-preview video {
  display: block; max-width: min(420px, 52vw); max-height: min(560px, 72vh);
  border-radius: 12px; border: 2px solid #8b5cf6; box-shadow: 0 22px 58px rgba(0,0,0,.55);
  background: #0d0d0d; object-fit: contain;
}
.asset-hover-preview-name {
  margin-top: 8px; max-width: min(420px, 52vw); font-size: 12px; color: #ccc;
  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.btn-generate { width: 100%; padding: 12px; border: none; border-radius: 8px; background: linear-gradient(135deg, #8b5cf6, #a855f7); color: #fff; font-size: 14px; cursor: pointer; font-weight: 600; transition: opacity .2s; display: inline-flex; align-items: center; justify-content: center; gap: 4px; line-height: 1; }
.btn-generate:hover { opacity: .9; }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; }

.vid-tasks-panel { width: 100%; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.vid-job-row { background: #141414; border: 1px solid #2a2a2a; border-radius: 8px; padding: 10px; text-align: left; }
.vid-job-title { font-size: 11px; color: #888; margin-bottom: 8px; }
.vid-job-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80px; }
.vid-job-body .spinner-lg { width: 28px; height: 28px; margin-bottom: 6px; }

.result-area { min-height: 180px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #555; font-size: 13px; }
.result-area img { max-width: 100%; max-height: 360px; border-radius: 8px; }
.result-area video { max-width: 100%; max-height: 360px; border-radius: 8px; }
.result-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: center; flex-wrap: wrap; }
.result-actions button { padding: 6px 14px; border-radius: 5px; border: 1px solid #2a2a2a; background: #181818; color: #aaa; cursor: pointer; font-size: 12px; transition: all .2s; }
.result-actions button:hover { border-color: #8b5cf6; color: #ccc; }
.result-actions .btn-download { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }
.result-actions .btn-download:hover { opacity: .85; }
.spinner-lg { width: 36px; height: 36px; border: 3px solid #2a2a2a; border-top-color: #8b5cf6; border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #141414; border: 1px solid #2a2a2a; border-radius: 16px; padding: 28px; width: 440px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal h2 { font-size: 18px; margin-bottom: 20px; }
.modal label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; margin-top: 12px; }
.modal label:first-of-type { margin-top: 0; }
.modal input, .modal select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a2a2a; background: #1a1a1a; color: #e0e0e0; font-size: 13px; outline: none; transition: border-color .2s; }
.modal input:focus, .modal select:focus { border-color: #8b5cf6; }
.modal .modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.modal .modal-actions button { padding: 8px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; transition: opacity .2s; }
.modal .modal-actions .btn-cancel { background: #2a2a2a; color: #888; }
.modal .modal-actions .btn-cancel:hover { opacity: .8; }
.modal .modal-actions .btn-confirm { background: #8b5cf6; color: #fff; }
.modal .modal-actions .btn-confirm:hover { opacity: .85; }

/* Toast */
.toast { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); background: #1a1a1a; border: 1px solid #2a2a2a; color: #ccc; padding: 10px 22px; border-radius: 8px; font-size: 13px; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.9); z-index: 10000; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 6px; }

@media (max-width: 860px) { .panel-left { width: 100% !important; min-width: 0; } .panel-right { display: none; } }

/* 火了吗扩展 */
.workflow-bar{display:flex;gap:8px;align-items:center;padding:12px 16px;border-bottom:1px solid #1e1e1e;background:#0d0d0d;flex-wrap:wrap;}
.workflow-bar select,.workflow-bar input{height:34px;border-radius:10px;border:1px solid #2a2a2a;background:#141414;color:#ccc;padding:0 10px;font-size:12px;outline:none;}
.workflow-bar input{flex:1;min-width:120px;}
.prompt-panel{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;}
.prompt-block{background:#121212;border:1px solid #1e1e1e;border-radius:10px;padding:14px;}
.prompt-block h4{font-size:12px;color:#888;margin-bottom:8px;text-transform:uppercase;letter-spacing:.4px;}
.prompt-block textarea{width:100%;min-height:88px;background:#0f0f0f;border:1px solid #2a2a2a;border-radius:8px;color:#ccc;padding:10px;font-size:12px;line-height:1.6;resize:vertical;font-family:inherit;outline:none;}
.prompt-block textarea:focus{border-color:#8b5cf6;}
.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px;}
.action-row button{padding:8px 14px;border-radius:10px;border:1px solid #2a2a2a;background:#181818;color:#ccc;font-size:12px;cursor:pointer;transition:opacity .15s;}
.action-row button.primary{background:linear-gradient(135deg,#8b5cf6,#a855f7);border:none;color:#fff;font-weight:600;}
.action-row button:disabled{opacity:.45;cursor:not-allowed;}
.wallet-pill{font-size:11px;color:#888;padding:4px 10px;border:1px solid #2a2a2a;border-radius:999px;white-space:nowrap;}
.wallet-pill strong{color:#10b981;}
.popover-panel{position:absolute;top:calc(100% + 6px);right:0;width:300px;display:none;flex-direction:column;gap:8px;padding:14px;background:rgba(20,20,24,.98);border:1px solid #2a2a2a;border-radius:14px;z-index:90;box-shadow:0 20px 50px rgba(0,0,0,.4);}
.popover-panel.open{display:flex;}
.empty-hint{text-align:center;color:#555;padding:36px 16px;font-size:13px;line-height:1.7;}
.ref-thumb{width:52px;height:52px;object-fit:cover;border-radius:8px;border:1px solid #333;}
.log-msg{padding:10px 16px;font-size:13px;color:#888;border-bottom:1px solid #141414;}
.log-msg.success{color:#10b981;}
.log-msg.error{color:#ef4444;}
