:root { --ink:#202522; --muted:#778079; --line:#dfe5df; --soft:#f3f6f3; --paper:#fff; --accent:#7057c9; --accent-dark:#5943a7; --accent-soft:#f0edfb; --green:#26815d; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-width:320px; color:var(--ink); background:#f7f8f6; font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
button,input,textarea,select { font:inherit; }
.topbar { height:68px; display:flex; align-items:center; justify-content:space-between; padding:0 clamp(18px,5vw,72px); background:rgba(255,255,255,.94); border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:11px; color:var(--ink); text-decoration:none; font-size:14px; font-weight:750; }
.brand-mark { display:grid; place-items:center; width:28px; height:28px; color:#fff; background:var(--accent); border-radius:7px; font:800 16px Georgia,serif; }
.top-actions { display:flex; align-items:center; gap:13px; }
.api-state { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; }
.api-state i { width:7px; height:7px; display:block; border-radius:50%; background:#d5a334; box-shadow:0 0 0 4px #faf1d9; }
.api-state.ready i { background:#3f9b70; box-shadow:0 0 0 4px #e3f0e8; }
.last-sync { color:#a0a8a1; font-size:10px; white-space:nowrap; }
.refresh-btn { border:1px solid var(--line); border-radius:6px; padding:7px 10px; color:#626b64; background:#fff; font-size:11px; cursor:pointer; }
.shell { width:min(1200px,calc(100% - 40px)); margin:0 auto; padding:54px 0 35px; }
.intro { max-width:680px; margin-bottom:28px; }
.eyebrow,.panel-kicker { margin:0 0 10px; color:var(--accent); font-size:10px; font-weight:800; letter-spacing:.16em; }
h1 { margin:0 0 12px; font:700 clamp(32px,4.2vw,50px)/1.08 Georgia,"Songti SC",serif; letter-spacing:-.035em; }
.lede { max-width:600px; margin:0; color:var(--muted); font-size:14px; line-height:1.7; }
.stats { display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); border-radius:10px; background:#fff; margin-bottom:18px; overflow:hidden; }
.stat { min-height:91px; padding:18px 22px; border-right:1px solid var(--line); }
.stat:last-child { border-right:0; }
.stat-label { display:block; color:var(--muted); font-size:11px; margin-bottom:8px; }
.stat strong { display:block; color:var(--ink); font:700 19px Georgia,"Songti SC",serif; }
.stat small { display:block; margin-top:5px; color:#9aa39c; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workbench-tabs { display:flex; gap:8px; margin:0 0 18px; padding:5px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.workbench-tab { flex:1; min-height:40px; border:0; border-radius:6px; color:var(--muted); background:transparent; font-size:12px; font-weight:700; cursor:pointer; }
.workbench-tab span { display:inline-block; min-width:20px; margin-left:4px; padding:2px 6px; border-radius:99px; color:#89928b; background:#f0f3f0; font-size:10px; font-weight:600; }
.workbench-tab.active { color:var(--accent-dark); background:var(--accent-soft); }
.workbench-tab.active span { color:var(--accent); background:#fff; }
.history-workspace,.task-workspace { padding:26px; }
.history-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.history-head p:not(.panel-kicker) { margin:7px 0 0; color:var(--muted); font-size:11px; }
.clear-history { padding:8px 11px; border:1px solid #e6caca; border-radius:6px; color:#a24d4d; background:#fff; font-size:10px; cursor:pointer; }
.clear-history:disabled { opacity:.45; cursor:not-allowed; }
.history-filters { display:flex; gap:7px; margin:18px 0; }
.history-filters button { min-width:62px; height:34px; padding:0 12px; border:1px solid var(--line); border-radius:6px; color:var(--muted); background:#fff; font-size:10px; cursor:pointer; }
.history-filters button.active { color:var(--accent-dark); border-color:#ddd5f5; background:var(--accent-soft); font-weight:700; }
.history-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; min-height:300px; }
.history-empty { grid-column:1/-1; align-self:center; }
.history-item { min-width:0; overflow:hidden; padding:13px; border:1px solid var(--line); border-radius:7px; background:#fbfcfb; }
.history-item-top { display:flex; align-items:center; gap:7px; margin-bottom:10px; }
.history-type { flex:none; padding:3px 6px; border-radius:4px; color:var(--accent-dark); background:var(--accent-soft); font-size:9px; font-weight:700; }
.history-type.video { color:#1d6a50; background:#e4f1eb; }
.history-type.chat { color:#8b6420; background:#f6eedc; }
.history-item time { min-width:0; flex:1; overflow:hidden; color:#9aa39c; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.history-delete { flex:none; padding:3px 5px; border:0; color:#a16a6a; background:transparent; font-size:9px; cursor:pointer; }
.history-images { display:grid; grid-template-columns:repeat(2,1fr); gap:3px; overflow:hidden; border-radius:5px; aspect-ratio:1/1; background:#edf0ed; }
.history-images img { width:100%; height:100%; min-height:0; object-fit:cover; }
.history-item video { width:100%; aspect-ratio:16/9; border-radius:5px; background:#111; }
.history-chat,.history-no-media { max-height:150px; overflow:auto; padding:11px; border-radius:5px; color:#5b645d; background:#f0f3f0; font-size:10px; line-height:1.6; }
.history-no-media { display:grid; place-items:center; min-height:90px; color:#9aa39c; }
.history-item h3 { margin:11px 0 6px; overflow:hidden; color:#444c46; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.history-item>p { max-height:62px; overflow:hidden; margin:0; color:var(--muted); font-size:10px; line-height:1.55; }
.history-item-foot { display:flex; align-items:flex-end; justify-content:space-between; gap:8px; margin-top:11px; padding-top:9px; border-top:1px solid #e8ece8; }
.history-item-foot>span { color:#9aa39c; font-size:9px; }
.history-item-foot div { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.history-item-foot a { color:var(--accent); font-size:9px; font-weight:700; text-decoration:none; }
.task-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-height:300px; }
.task-empty { grid-column:1/-1; align-self:center; }
.task-item { min-width:0; padding:14px; border:1px solid var(--line); border-radius:7px; background:#fbfcfb; }
.task-item-head { display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.task-item-head time { min-width:0; flex:1; overflow:hidden; color:#9aa39c; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.task-kind,.task-status { flex:none; padding:3px 6px; border-radius:4px; font-size:9px; font-weight:700; }
.task-kind { color:var(--accent-dark); background:var(--accent-soft); }
.task-kind.video { color:#1d6a50; background:#e4f1eb; }
.task-status { color:#796c42; background:#f4eedb; }
.task-status.completed { color:#1d6a50; background:#e4f1eb; }
.task-status.failed,.task-status.interrupted { color:#9d4c4c; background:#f6e5e5; }
.task-status.partial { color:#8b6420; background:#f6eedc; }
.task-item video { width:100%; aspect-ratio:16/9; border-radius:5px; background:#111; }
.task-images { display:grid; grid-template-columns:repeat(2,1fr); gap:3px; overflow:hidden; border-radius:5px; aspect-ratio:2/1; background:#edf0ed; }
.task-images img { width:100%; height:100%; min-height:0; object-fit:cover; }
.task-progress { position:relative; height:74px; display:grid; place-items:center; overflow:hidden; border-radius:5px; background:#edf0ed; }
.task-progress>div { position:absolute; inset:0 auto 0 0; background:#e1dcf4; transition:width .25s; }
.task-progress span { position:relative; z-index:1; color:#71687d; font-size:11px; font-weight:700; }
.task-item h3 { margin:11px 0 6px; overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.task-item>p { max-height:48px; overflow:hidden; margin:0; color:var(--muted); font-size:10px; line-height:1.55; }
.task-id { margin-top:8px; overflow:hidden; color:#9aa39c; font:9px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; text-overflow:ellipsis; white-space:nowrap; }
.task-error { margin-top:8px; padding:7px; border-radius:4px; color:#9d4c4c; background:#f8eaea; font-size:9px; line-height:1.45; }
.task-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:7px; margin-top:11px; padding-top:9px; border-top:1px solid #e8ece8; }
.task-actions>span { min-width:0; flex:1; color:#9aa39c; font-size:9px; }
.task-actions button,.task-actions a { padding:4px 7px; border:1px solid var(--line); border-radius:4px; color:var(--accent); background:#fff; font-size:9px; font-weight:700; text-decoration:none; cursor:pointer; }
.toast-stack { position:fixed; z-index:50; right:18px; bottom:18px; width:min(320px,calc(100vw - 36px)); display:flex; flex-direction:column; gap:8px; }
.task-toast { width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:13px 14px; border:1px solid #dcd5f4; border-radius:7px; color:var(--ink); background:#fff; box-shadow:0 14px 38px rgba(32,37,34,.16); text-align:left; cursor:pointer; }
.task-toast strong { color:var(--accent-dark); font-size:12px; }
.task-toast span { max-width:100%; overflow:hidden; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.task-toast small { color:#929a94; font-size:9px; }
.workspace { display:grid; grid-template-columns:minmax(390px, .9fr) minmax(0,1.1fr); gap:18px; align-items:stretch; }
.panel { background:var(--paper); border:1px solid var(--line); border-radius:11px; box-shadow:0 10px 28px rgba(31,49,40,.035); }
.composer,.result { padding:26px; }
.panel-head { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:22px; }
h2 { margin:0; font-size:17px; letter-spacing:-.01em; }
.required { padding:5px 9px; color:var(--accent); background:var(--accent-soft); border-radius:99px; font-size:10px; font-weight:700; }
.field-label { display:block; margin-bottom:8px; font-size:12px; font-weight:700; }
.model-label-row { display:flex; align-items:baseline; justify-content:space-between; }
.model-label-row .field-label { margin-bottom:8px; }
.model-label-row span { color:#9aa39c; font-size:10px; }
.model-row .field input[type="search"] { height:35px; margin-bottom:7px; font-size:11px; }
.native-model-select { position:absolute; width:1px; height:1px; padding:0; border:0; opacity:0; pointer-events:none; }
.model-list { max-height:250px; overflow-y:auto; border:1px solid #cbd5ce; border-radius:7px; background:#fbfcfb; scrollbar-width:thin; }
.model-option { width:100%; min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 11px; border:0; border-bottom:1px solid #edf0ed; color:var(--ink); background:transparent; text-align:left; cursor:pointer; }
.model-option:last-child { border-bottom:0; }
.model-option:hover { background:#f2f0fb; }
.model-option.selected { color:var(--accent-dark); background:var(--accent-soft); font-weight:700; }
.model-option-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.model-option-price { flex:none; color:#8c958e; font-size:10px; font-weight:500; }
.model-option.selected .model-option-price { color:var(--accent); }
.model-list-empty { padding:18px 12px; color:#9aa39c; font-size:10px; text-align:center; }
.model-retry { margin-top:9px; padding:5px 9px; border:1px solid var(--line); border-radius:5px; color:var(--accent-dark); background:#fff; font-size:10px; cursor:pointer; }
.field-label em { margin-left:4px; color:#9ca49e; font-size:10px; font-style:normal; font-weight:500; }
textarea,input,select { width:100%; border:1px solid #cbd5ce; border-radius:7px; color:var(--ink); background:#fbfcfb; outline:0; transition:border .18s,box-shadow .18s; }
textarea { resize:vertical; min-height:120px; padding:13px 14px; font-size:13px; line-height:1.65; }
input,select { height:43px; padding:0 12px; font-size:12px; }
textarea:focus,input:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(112,87,201,.12); }
.field-foot { display:flex; justify-content:space-between; gap:12px; margin-top:7px; color:#9aa39c; font-size:10px; }
.form-row { display:flex; gap:13px; align-items:end; margin-top:21px; }
.grow { flex:1; }
.model-badge { min-width:100px; height:43px; display:flex; align-items:center; justify-content:center; padding:0 9px; border:1px solid #e3def5; border-radius:7px; color:var(--accent); background:var(--accent-soft); font-size:10px; font-weight:700; }
.model-description { min-height:18px; margin:8px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.two-col { align-items:flex-start; }
.two-col .field:first-child { flex:1; }
.format-field { width:100px; }
.segmented { display:flex; height:43px; border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#fbfcfb; }
.segmented button { flex:1; min-width:38px; border:0; border-right:1px solid var(--line); color:var(--muted); background:transparent; font-size:11px; cursor:pointer; }
.segmented button:last-child { border-right:0; }
.segmented button.active { color:var(--accent); background:var(--accent-soft); font-weight:700; }
.reference-field { margin-top:21px; }
.reference-label { display:flex; justify-content:space-between; align-items:baseline; }
.reference-label>span:last-child { color:#9aa39c; font-size:10px; }
.upload-zone { position:relative; min-height:70px; display:flex; align-items:center; gap:11px; padding:13px; border:1px dashed #c8d0ca; border-radius:7px; background:#fbfcfb; cursor:pointer; }
.upload-zone.compact { min-height:62px; padding:9px; }
.upload-zone:hover { border-color:var(--accent); background:#fcfbff; }
.upload-zone input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.upload-icon { display:grid; place-items:center; width:32px; height:32px; color:var(--accent); background:var(--accent-soft); border-radius:7px; font-size:22px; }
.upload-zone strong,.upload-zone span { display:block; }
.upload-zone strong { font-size:11px; }
.upload-zone span { margin-top:3px; color:var(--muted); font-size:10px; }
.reference-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:8px; }
.ref-chip { position:relative; width:54px; height:54px; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:#f1f3f1; }
.ref-chip img { width:100%; height:100%; object-fit:cover; }
.ref-chip button { position:absolute; top:2px; right:2px; width:17px; height:17px; padding:0; border:0; border-radius:50%; color:#fff; background:rgba(20,24,21,.72); font-size:12px; line-height:17px; cursor:pointer; }
.media-reference-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:21px; }
.media-reference { min-width:0; }
.media-reference .reference-label { min-height:25px; }
.media-reference .remote-row { margin-top:7px; }
.media-reference .remote-row input { min-width:0; padding-left:9px; padding-right:9px; font-size:10px; }
.media-reference .remote-row button { width:43px; font-size:10px; }
.media-chip { width:100%; height:32px; display:flex; align-items:center; padding:0 25px 0 8px; }
.media-chip span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:9px; }
.chat-workspace .result-canvas { min-height:520px; }
.chat-transcript { flex:1; min-height:520px; overflow:auto; padding:15px; border:1px dashed #d2dad3; border-radius:8px; background:#f3f5f3; }
.chat-message { display:flex; align-items:flex-start; gap:9px; margin-bottom:13px; }
.chat-message.user { flex-direction:row-reverse; }
.chat-role { flex:none; width:27px; height:27px; display:grid; place-items:center; border-radius:50%; color:#fff; background:var(--accent); font-size:10px; font-weight:700; }
.chat-message.assistant .chat-role { color:var(--green); background:#e4f1eb; }
.chat-content { max-width:82%; padding:10px 12px; border-radius:8px; color:#39423c; background:#fff; box-shadow:0 4px 12px rgba(31,49,40,.04); font-size:12px; line-height:1.65; word-break:break-word; }
.chat-message.user .chat-content { color:#fff; background:var(--accent); }
.remote-url-label { display:block; margin:12px 0 7px; color:var(--muted); font-size:10px; }
.remote-row { display:flex; gap:7px; }
.remote-row input { flex:1; }
.remote-row button { width:53px; border:1px solid var(--line); border-radius:7px; color:#626b64; background:#fff; font-size:11px; cursor:pointer; }
.field-note { margin:7px 0 0; color:#a0a8a1; font-size:10px; line-height:1.45; }
.option-note { margin-top:8px; }
.generate { width:100%; height:46px; display:flex; justify-content:center; align-items:center; gap:10px; margin-top:22px; border:0; border-radius:7px; color:#fff; background:var(--accent); font-size:13px; font-weight:750; cursor:pointer; transition:.18s; }
.generate:hover { background:var(--accent-dark); transform:translateY(-1px); }
.generate:disabled { opacity:.58; cursor:wait; transform:none; }
.generate b { font-size:18px; line-height:0; }
.privacy { margin:12px 0 0; color:#9aa39c; font-size:10px; text-align:center; }
.result { display:flex; flex-direction:column; min-height:690px; }
.result-status { color:var(--muted); font-size:11px; }
.result-canvas { flex:1; min-height:520px; display:grid; place-items:center; overflow:hidden; padding:20px; border:1px dashed #d2dad3; border-radius:8px; background:#f3f5f3; }
.result-canvas img { display:block; max-width:100%; max-height:570px; object-fit:contain; border-radius:3px; box-shadow:0 15px 35px rgba(24,37,29,.15); }
.result-gallery { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-self:start; }
.result-gallery.single { grid-template-columns:1fr; align-self:center; }
.result-gallery figure { position:relative; min-width:0; margin:0; overflow:hidden; border-radius:6px; background:#e9ede9; aspect-ratio:1/1; }
.result-gallery img { width:100%; height:100%; max-height:none; object-fit:contain; box-shadow:none; }
.result-gallery figcaption { position:absolute; left:7px; bottom:7px; padding:4px 7px; border-radius:4px; color:#fff; background:rgba(24,30,26,.72); font-size:9px; }
.empty { display:flex; flex-direction:column; align-items:center; gap:7px; color:var(--muted); text-align:center; font-size:11px; }
.empty strong { color:#58605a; font-size:13px; }
.empty-icon { display:grid; place-items:center; width:45px; height:45px; margin-bottom:5px; color:var(--accent); background:var(--accent-soft); border-radius:10px; font-size:22px; }
.result-meta { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:15px; color:var(--muted); font-size:10px; }
.result-meta span { margin-right:10px; }
.result-meta a { color:var(--accent); font-weight:700; text-decoration:none; font-size:11px; }
.download-links { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.raw-response { margin-top:15px; border-top:1px solid var(--line); padding-top:12px; color:var(--muted); font-size:10px; }
.raw-response summary { cursor:pointer; }
.raw-response pre { max-height:180px; overflow:auto; margin:10px 0 0; padding:10px; background:#f7f8f7; border-radius:6px; color:#5b645d; font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; word-break:break-word; }
.footer-note { margin:20px 0 0; color:#9aa29b; font-size:10px; text-align:center; }
@media (max-width:820px) { .workspace { grid-template-columns:1fr; } .result { min-height:560px; } .result-canvas { min-height:410px; } .media-reference-grid { grid-template-columns:1fr; } .history-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .shell { width:calc(100% - 24px); padding-top:37px; } .topbar { padding:0 14px; } .brand { font-size:12px; } .top-actions { gap:8px; } .api-state span { display:none; } .refresh-btn { padding:6px 8px; } .stats { grid-template-columns:1fr; } .stat { min-height:75px; border-right:0; border-bottom:1px solid var(--line); } .stat:last-child { border-bottom:0; } .composer,.result,.history-workspace,.task-workspace { padding:20px; } .form-row.two-col { flex-direction:column; gap:15px; } .format-field { width:100%; } .segmented button { min-width:0; } .workbench-tabs { display:grid; grid-template-columns:repeat(2,1fr); gap:4px; } .workbench-tab { font-size:10px; } .workbench-tab span { display:none; } .history-list,.task-list { grid-template-columns:1fr; } .result-gallery { grid-template-columns:1fr; } }
