:root{
  color-scheme:dark;
  --bg:#0b0d10;
  --surface:#111419;
  --surface-2:#171b21;
  --surface-3:#1d222a;
  --line:#292f38;
  --line-soft:#20252d;
  --text:#f2f4f7;
  --muted:#8e96a3;
  --muted-2:#626b78;
  --accent:#ff5c4d;
  --accent-2:#ff796d;
  --green:#54d49a;
  --blue:#73a7ff;
  --amber:#f5be5b;
  --danger:#ff6969;
  --shadow:0 24px 70px rgba(0,0,0,.36);
  font-family:Inter,"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{height:100vh;overflow:hidden}
button,input,select,textarea{font:inherit}
button{color:inherit}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid rgba(115,167,255,.7);outline-offset:2px}
.hidden{display:none!important}
.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;border-bottom:1px solid var(--line-soft);background:rgba(11,13,16,.94);backdrop-filter:blur(18px);position:relative;z-index:5}
.brand{display:flex;align-items:center;gap:12px}
.brand-mark{width:38px;height:38px;border-radius:12px;background:linear-gradient(145deg,#ff806f,#c9362e);display:grid;place-items:center;box-shadow:0 8px 28px rgba(255,92,77,.22)}
.brand-mark span{width:14px;height:18px;border:2px solid #fff;border-radius:50% 50% 42% 42%;position:relative}
.brand-mark span:after{content:"";position:absolute;left:4px;right:4px;bottom:-6px;height:4px;border-radius:99px;background:#fff}
.brand h1{font-size:16px;line-height:1.2;margin:0;font-weight:680;letter-spacing:.01em}
.brand p{font-size:11px;color:var(--muted);margin:4px 0 0}
.top-actions{display:flex;align-items:center;gap:10px}
.usage-pill{height:30px;display:flex;align-items:center;padding:0 10px;border:1px solid rgba(115,167,255,.2);border-radius:99px;background:rgba(115,167,255,.06);color:#a8c9ff;font-size:9.5px}
.logout-btn{color:var(--muted)}
.model-pill{height:36px;padding:0 13px;border:1px solid var(--line);border-radius:99px;background:var(--surface);display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}
.model-pill i{width:7px;height:7px;border-radius:50%;background:var(--amber);box-shadow:0 0 0 4px rgba(245,190,91,.09)}
.model-pill.online i{background:var(--green);box-shadow:0 0 0 4px rgba(84,212,154,.09)}
.model-pill.offline i{background:var(--danger);box-shadow:0 0 0 4px rgba(255,105,105,.09)}
.model-pill.offline strong{color:#ffb7b7}
.model-pill strong{color:var(--text);font-weight:650}
.workspace{height:calc(100vh - 72px);display:grid;grid-template-columns:334px minmax(0,1fr)}
.control-panel{border-right:1px solid var(--line-soft);background:var(--surface);overflow-y:auto;padding:18px 18px 28px}
.control-panel::-webkit-scrollbar,.asset-list::-webkit-scrollbar,.queue-list::-webkit-scrollbar{width:6px;height:6px}
.control-panel::-webkit-scrollbar-thumb,.asset-list::-webkit-scrollbar-thumb,.queue-list::-webkit-scrollbar-thumb{background:#303640;border-radius:99px}
.panel-section{padding:17px 0;border-bottom:1px solid var(--line-soft)}
.panel-section:first-child{padding-top:3px}
.panel-section:last-child{border-bottom:0}
.section-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}
.section-head.compact{margin-bottom:13px}
.eyebrow{display:block;font-size:9px;line-height:1;text-transform:uppercase;letter-spacing:.14em;color:var(--muted-2);font-weight:700;margin-bottom:7px}
h2,h3,p{margin-top:0}
.section-head h2,.stage-toolbar h2{font-size:14px;margin:0;font-weight:650}
.text-btn{border:0;background:none;padding:2px;font-size:11px;color:var(--muted);cursor:pointer}
.text-btn:hover{color:var(--text)}
.text-btn.danger:hover{color:var(--danger)}
.drop-zone{width:100%;min-height:126px;border:1px dashed #3a424e;border-radius:13px;background:linear-gradient(145deg,#14181e,#101318);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:.2s ease}
.drop-zone:hover,.drop-zone.dragging{border-color:var(--accent);background:linear-gradient(145deg,rgba(255,92,77,.08),#111419);transform:translateY(-1px)}
.drop-icon{width:34px;height:34px;border:1px solid var(--line);border-radius:10px;display:grid;place-items:center;background:var(--surface-2)}
.drop-icon svg{width:17px;fill:none;stroke:var(--text);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.drop-zone strong{font-size:12px;font-weight:620}
.drop-zone small{font-size:9.5px;color:var(--muted-2)}
.file-summary{display:flex;justify-content:space-between;font-size:9.5px;color:var(--muted-2);margin-top:8px}
.color-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}
.color-chip{border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:8px 4px;display:flex;align-items:center;justify-content:center;gap:5px;cursor:pointer;font-size:10px;transition:.15s ease}
.color-chip:hover{border-color:#47515f;background:var(--surface-3)}
.color-chip.active{border-color:rgba(255,92,77,.85);box-shadow:inset 0 0 0 1px rgba(255,92,77,.22);background:rgba(255,92,77,.08)}
.color-chip i{width:10px;height:10px;background:var(--swatch);border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.08)}
.color-chip i.white{border:1px solid #8f98a4}
.field-row{margin-top:10px;display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted)}
.hex-control{display:flex;align-items:center;gap:6px}
.hex-control input[type=color]{width:27px;height:27px;border:1px solid var(--line);padding:2px;background:var(--surface-2);border-radius:7px}
.hex-control input[type=text]{width:78px}
.field-block{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.field-block:first-of-type{margin-top:0}
.field-block>span{font-size:9.5px;color:var(--muted)}
.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
input[type=text],select,textarea{width:100%;border:1px solid var(--line);background:var(--surface-2);color:var(--text);border-radius:8px;padding:9px 10px;font-size:10.5px;transition:.15s ease}
input[type=text]:hover,select:hover,textarea:hover{border-color:#3a424e}
input[type=text]:focus,select:focus,textarea:focus{border-color:var(--blue)}
input:disabled{opacity:.68;cursor:not-allowed;color:var(--muted)}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,#7c8591 50%),linear-gradient(135deg,#7c8591 50%,transparent 50%);background-position:calc(100% - 14px) 50%,calc(100% - 10px) 50%;background-size:4px 4px,4px 4px;background-repeat:no-repeat;padding-right:28px}
.oauth-note{display:flex;align-items:flex-start;gap:9px;margin-top:12px;padding:10px;border:1px solid rgba(84,212,154,.18);background:rgba(84,212,154,.05);border-radius:9px}
.oauth-note i{font-style:normal;color:var(--green);font-size:11px;width:18px;height:18px;border-radius:50%;border:1px solid rgba(84,212,154,.35);display:grid;place-items:center}
.oauth-note p{font-size:9.5px;line-height:1.55;color:var(--muted);margin:0}
.oauth-note strong{color:#b7e8d3;font-weight:600}
.stage-panel{min-width:0;display:grid;grid-template-rows:68px minmax(250px,1fr) auto 190px;background:radial-gradient(circle at 65% 35%,rgba(43,51,63,.22),transparent 45%),var(--bg)}
.stage-toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 24px;border-bottom:1px solid var(--line-soft)}
.toolbar-actions{display:flex;gap:9px}
.ghost-btn,.secondary-btn,.primary-btn{border-radius:8px;padding:9px 13px;border:1px solid var(--line);background:var(--surface-2);font-size:10.5px;cursor:pointer;transition:.15s ease}
.ghost-btn:hover,.secondary-btn:hover{background:var(--surface-3);border-color:#3b4552}
.primary-btn{border-color:transparent;background:linear-gradient(135deg,var(--accent),#e64437);color:#fff;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:650;box-shadow:0 8px 24px rgba(255,92,77,.15)}
.primary-btn:hover{background:linear-gradient(135deg,var(--accent-2),#ed5145);transform:translateY(-1px)}
.primary-btn:disabled,.ghost-btn:disabled{opacity:.35;cursor:not-allowed;transform:none}
.primary-btn svg{width:14px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.primary-btn.full{width:100%;margin-top:17px}
.stage-content{min-height:0;padding:18px 24px;display:flex;align-items:stretch;justify-content:center}
.empty-state{margin:auto;max-width:440px;text-align:center}
.empty-state h3{font-size:19px;margin:18px 0 8px;font-weight:650}
.empty-state p{font-size:11px;color:var(--muted);line-height:1.7;margin:0 auto 18px}
.empty-orbit{width:84px;height:84px;margin:auto;border:1px solid #2e3540;border-radius:50%;display:grid;place-items:center;position:relative}
.empty-orbit:before,.empty-orbit:after{content:"";position:absolute;border:1px solid #242a33;border-radius:50%;inset:11px}
.empty-orbit:after{inset:23px}
.empty-orbit span{width:13px;height:18px;border:2px solid var(--accent);border-radius:50% 50% 45% 45%;box-shadow:0 0 22px rgba(255,92,77,.35);z-index:2}
.empty-orbit i{position:absolute;width:7px;height:7px;border-radius:50%;background:var(--blue);top:9px;left:13px;box-shadow:0 0 16px var(--blue)}
.editor-view{width:100%;height:100%;display:grid;grid-template-columns:1fr 1fr;gap:14px;min-height:0}
.preview-card{border:1px solid var(--line-soft);border-radius:13px;background:rgba(17,20,25,.82);display:flex;flex-direction:column;min-width:0;overflow:hidden}
.preview-label{height:38px;padding:0 13px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line-soft);font-size:10px}
.preview-label em{font-style:normal;color:var(--muted-2);font-size:9px;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.result-card .preview-label span{color:#b7e8d3}
.image-frame{min-height:0;flex:1;display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(#11151a 0 25%,#0f1216 0 50%) 50%/18px 18px;position:relative;overflow:hidden}
.image-frame img{width:100%;height:100%;object-fit:contain;cursor:zoom-in}
.result-placeholder{text-align:center;color:var(--muted-2);display:flex;flex-direction:column;align-items:center;gap:5px}
.result-placeholder strong{font-size:11px;color:var(--muted);font-weight:600;margin-top:7px}
.result-placeholder small{font-size:9px}
.result-actions{position:absolute;right:11px;bottom:11px;display:flex;gap:7px;padding:5px;border:1px solid rgba(255,255,255,.09);border-radius:9px;background:rgba(10,13,17,.8);backdrop-filter:blur(10px)}
.result-actions button,.result-actions a{border:1px solid var(--line);border-radius:6px;background:var(--surface-2);color:var(--text);padding:6px 9px;font-size:9px;text-decoration:none;cursor:pointer}
.result-actions button:hover,.result-actions a:hover{border-color:#485361;background:var(--surface-3)}
.mini-orbit{width:39px;height:39px;border:1px solid #35404c;border-radius:50%;position:relative}
.mini-orbit:after{content:"";position:absolute;inset:11px;border-radius:50%;background:var(--accent);box-shadow:0 0 20px rgba(255,92,77,.35)}
.asset-strip{height:88px;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;padding:8px 14px;gap:6px;background:rgba(17,20,25,.65)}
.asset-list{display:flex;gap:8px;overflow-x:auto;height:70px;padding:2px}
.asset-item{width:93px;min-width:93px;height:62px;border:1px solid var(--line);background:var(--surface-2);border-radius:8px;padding:3px;cursor:pointer;position:relative;overflow:hidden}
.asset-item.active{border-color:var(--accent);box-shadow:0 0 0 1px rgba(255,92,77,.2)}
.asset-item img{width:100%;height:100%;object-fit:cover;border-radius:5px}
.asset-item .asset-state{position:absolute;right:5px;top:5px;width:7px;height:7px;border-radius:50%;background:#68717e;box-shadow:0 0 0 2px rgba(0,0,0,.5)}
.asset-item .asset-state.running{background:var(--blue)}
.asset-item .asset-state.completed{background:var(--green)}
.asset-item .asset-state.failed{background:var(--danger)}
.strip-scroll{width:25px;height:40px;border:0;background:transparent;color:var(--muted);font-size:20px;cursor:pointer}
.strip-scroll:hover{color:var(--text)}
.queue-panel{min-height:0;padding:14px 24px 18px;background:rgba(14,16,20,.72)}
.queue-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.queue-head h3{font-size:12px;margin:0}
.queue-counter{font-size:9.5px;color:var(--muted);padding:4px 8px;border:1px solid var(--line);border-radius:99px}
.queue-empty{height:88px;border:1px dashed var(--line);border-radius:10px;display:grid;place-items:center;color:var(--muted-2);font-size:10px}
.queue-list{max-height:122px;overflow-y:auto;display:flex;flex-direction:column;gap:6px}
.queue-item{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:10px;border:1px solid var(--line-soft);background:var(--surface);border-radius:9px;padding:7px 9px}
.queue-thumb{width:32px;height:32px;border-radius:6px;object-fit:cover;background:var(--surface-3)}
.queue-info{min-width:0}
.queue-info strong{font-size:10px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.queue-info small{font-size:8.5px;color:var(--muted-2)}
.status-badge{font-size:8.5px;padding:4px 8px;border-radius:99px;background:#262c35;color:var(--muted)}
.status-badge.running{background:rgba(115,167,255,.1);color:#a8c9ff}
.status-badge.completed{background:rgba(84,212,154,.1);color:#a9e9cf}
.status-badge.failed{background:rgba(255,105,105,.1);color:#ffabab}
.modal{border:0;padding:0;background:transparent;color:var(--text);max-width:none}
.modal::backdrop{background:rgba(0,0,0,.7);backdrop-filter:blur(5px)}
.modal-card{width:min(680px,calc(100vw - 40px));border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:var(--shadow);padding:20px}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.modal-head h3{font-size:15px;margin:0}
.icon-btn{border:0;background:transparent;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}
.modal textarea{height:280px;resize:vertical;font-size:10.5px;line-height:1.7}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.command-card{width:min(520px,calc(100vw - 40px));text-align:center;padding:28px}
.success-mark{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;margin:0 auto 14px;border:1px solid rgba(84,212,154,.32);background:rgba(84,212,154,.08);color:var(--green);font-size:20px}
.command-card h3{font-size:17px;margin:0 0 8px}
.command-card p{font-size:10.5px;line-height:1.65;color:var(--muted);margin:0 auto 15px}
.command-card>small{font-size:9px;color:var(--muted-2)}
.command-box{display:flex;align-items:center;gap:8px;background:#0c0f13;border:1px solid var(--line);border-radius:9px;padding:9px 9px 9px 12px;text-align:left;margin-bottom:10px}
.command-box code{flex:1;font:10.5px/1.5 Consolas,monospace;color:#c9d9ef;word-break:break-all}
.command-box button{border:1px solid var(--line);border-radius:6px;background:var(--surface-2);padding:6px 9px;font-size:9px;cursor:pointer}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#20252d;border:1px solid #39424e;border-radius:8px;padding:9px 13px;font-size:10px;box-shadow:var(--shadow);transition:.2s ease;z-index:99}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.error{border-color:rgba(255,105,105,.55);color:#ffc0c0}

.preset-stack{display:flex;flex-direction:column;gap:8px}
.preset-card{width:100%;min-height:62px;display:grid;grid-template-columns:28px minmax(0,1fr) 43px 17px;align-items:center;gap:8px;padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);text-align:left;cursor:pointer;transition:.17s ease}
.preset-card:hover{border-color:#414a57;background:var(--surface-3);transform:translateY(-1px)}
.preset-card.active{border-color:rgba(255,92,77,.63);background:linear-gradient(135deg,rgba(255,92,77,.08),var(--surface-2));box-shadow:inset 0 0 0 1px rgba(255,92,77,.08)}
.preset-letter{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:#232933;border:1px solid #343c48;font-size:11px;font-weight:750;color:#cbd1d9}
.preset-card.active .preset-letter{background:var(--accent);border-color:var(--accent);color:white}
.preset-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.preset-copy strong{font-size:10.5px;font-weight:650}
.preset-copy small{font-size:8.5px;color:var(--muted-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preset-check{width:15px;height:15px;border-radius:50%;display:grid;place-items:center;border:1px solid #3b434f;color:transparent;font-size:8px}
.preset-card.active .preset-check{color:#fff;background:var(--green);border-color:var(--green)}
.preset-visual{width:41px;height:28px;border-radius:7px;border:1px solid rgba(255,255,255,.08);overflow:hidden;position:relative;background:#101318}
.preset-a{background:linear-gradient(135deg,#f6af47 0 24%,#45d4d7 47%,#4b7ce8 68%,#d757bc 100%)}
.preset-a i,.preset-b i{position:absolute;inset:5px 10px;border-radius:50%;background:rgba(255,255,255,.52);filter:blur(4px)}
.preset-b{background:linear-gradient(135deg,#f165ae 0 27%,#e7d64d 42%,#56d167 60%,#35c6ea 77%,#335cda 100%)}
.preset-c{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:3px;background:#101318}
.preset-c i{border-radius:2px;background:var(--c,#f66)}
.preset-c i:nth-child(1){--c:#ef76aa}.preset-c i:nth-child(2){--c:linear-gradient(135deg,#f3b83f,#41d6c3,#925bd5)}.preset-c i:nth-child(3){--c:#e2c348}.preset-c i:nth-child(4){--c:#4679e6}.preset-c i:nth-child(5){--c:#4acb70}.preset-c i:nth-child(6){--c:#9a62dc}
.preset-summary{display:flex;align-items:center;justify-content:space-between;margin-top:9px;font-size:8.8px;color:var(--muted-2)}
.preset-summary strong{font-weight:600;color:#b8c0ca}
.legend-section{display:flex;flex-direction:column;gap:8px}
.legend-row{display:grid;grid-template-columns:30px 1fr;gap:8px;font-size:9px;color:var(--muted);line-height:1.55}
.legend-row b{width:27px;height:19px;border-radius:5px;display:grid;place-items:center;background:#232933;color:#d2d8e0;font-size:8px}
.result-head{height:46px;padding:0 10px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line-soft)}
.result-head>em{font-style:normal;color:var(--muted);font-size:8.5px;white-space:nowrap}
.result-tabs{display:flex;align-items:center;gap:5px}
.result-tab{height:29px;border:1px solid transparent;border-radius:7px;background:transparent;padding:0 7px;display:flex;align-items:center;gap:5px;color:var(--muted);font-size:8.5px;cursor:pointer;position:relative}
.result-tab b{font-size:9px;color:#c4cbd4}
.result-tab i{width:5px;height:5px;border-radius:50%;background:#4d5663}
.result-tab i.queued{background:var(--amber)}.result-tab i.running{background:var(--blue);box-shadow:0 0 8px rgba(115,167,255,.6)}.result-tab i.completed{background:var(--green)}.result-tab i.failed{background:var(--danger)}
.result-tab:hover{background:var(--surface-3)}
.result-tab.active{border-color:#3a424e;background:#222832;color:#fff}
.result-tab.active b{color:var(--accent)}
.result-tab.not-selected{opacity:.4}
.asset-progress{position:absolute;left:5px;bottom:4px;padding:1px 4px;border-radius:4px;background:rgba(0,0,0,.66);font-size:7px;color:#dfe5ec}
.queue-item{grid-template-columns:32px minmax(0,1fr) auto auto auto}
.queue-actions{display:flex;gap:5px}
.queue-actions a{padding:4px 7px;border:1px solid var(--line);border-radius:6px;color:#c9d6e7;text-decoration:none;font-size:8px;background:var(--surface-2)}
.queue-actions a:hover{border-color:#495462;background:var(--surface-3)}
.scheme-badge{width:22px;height:22px;border-radius:6px;display:grid;place-items:center;font-size:8px;font-weight:750;border:1px solid var(--line);background:#242a33}
.scheme-a{color:#eab4dc;background:linear-gradient(135deg,rgba(246,175,71,.12),rgba(82,104,225,.16))}
.scheme-b{color:#a7e6d6;background:linear-gradient(135deg,rgba(242,101,174,.12),rgba(53,198,234,.16))}
.scheme-c{color:#f0c67f;background:rgba(240,198,127,.1)}

@media(max-width:980px){body{overflow:auto;height:auto}.topbar{position:sticky;top:0}.model-pill span,.usage-pill{display:none}.workspace{height:auto;grid-template-columns:1fr}.control-panel{border-right:0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.panel-section{padding:15px 0}.stage-panel{min-height:760px}.editor-view{grid-template-columns:1fr}.top-actions .ghost-btn{display:none}.queue-item{grid-template-columns:32px minmax(0,1fr) auto auto}.queue-actions{grid-column:2/-1}}
@media(max-width:640px){.topbar{padding:0 14px}.brand p{display:none}.model-pill{padding:0 9px}.workspace{display:block}.control-panel{display:block;padding:16px}.stage-toolbar{padding:0 14px}.stage-toolbar .ghost-btn{display:none}.stage-content{padding:14px}.editor-view{grid-template-columns:1fr}.queue-panel{padding:14px}.top-actions{gap:6px}.toolbar-actions .primary-btn span{font-size:0}.toolbar-actions .primary-btn span:after{content:"提交";font-size:10px}}
