
@font-face{font-family:ParticleBrand;src:url("../assets/fonts/Particle-Regular-2.otf") format("opentype");font-display:swap}
* {margin:0;padding:0;box-sizing:border-box}
:root {color-scheme:dark;--bg:#120f0d;--panel:rgba(31,25,21,.82);--panel-strong:rgba(42,34,29,.96);--line:rgba(255,238,214,.14);--line-strong:rgba(255,222,184,.26);--text:#fff7ef;--muted:rgba(255,239,220,.66);--soft:rgba(255,239,220,.42);--accent:#f7b35c;--accent-2:#58d6bd;--blue:#8ab4ff;--danger:#ffb4ae;--shadow:0 22px 70px rgba(0,0,0,.32)}
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;background:linear-gradient(140deg,#100f12 0%,#1e1712 38%,#3c2015 68%,#15191f 100%);min-height:100vh;color:var(--text);overflow-x:hidden}
body::before {content:"";position:fixed;inset:0;pointer-events:none;background:linear-gradient(110deg,rgba(247,179,92,.18),transparent 34%,rgba(88,214,189,.08) 70%,rgba(138,180,255,.1));opacity:.86}
button, input, textarea, select {font:inherit}
button {letter-spacing:0}
.app {position:relative;z-index:1;min-height:100vh;width:min(1220px,calc(100% - 32px));margin:0 auto;padding:18px 0 72px}
.topbar {position:sticky;top:12px;z-index:80;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 12px;border:1px solid var(--line);background:rgba(18,15,13,.72);backdrop-filter:blur(22px);border-radius:8px;box-shadow:0 16px 44px rgba(0,0,0,.2)}
.brand {display:flex;align-items:center;gap:11px;min-width:0}
.brand-mark {width:36px;height:36px;border-radius:8px;display:grid;place-items:center;background:rgba(255,122,26,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 16px 24px -9px rgba(255,122,26,.8),0 22px 42px -18px rgba(255,122,26,.76);overflow:visible;flex:0 0 auto}
.brand-mark img {width:28px;height:28px;display:block;object-fit:contain}
.brand-text {min-width:0}
.brand-name {font-size:25px;font-weight:400;white-space:nowrap;display:inline-flex;align-items:center;gap:2px;line-height:1}
.brand-name-c {width:20px;height:20px;display:none;align-items:center;flex:0 0 auto}
.brand-name-c img {width:100%;height:100%;display:block;object-fit:contain}
.brand-name-dash, .brand-name-image {font-family:ParticleBrand,Inter,Arial,"Microsoft YaHei",sans-serif;font-weight:400;letter-spacing:0;text-transform:uppercase;line-height:1;background:linear-gradient(135deg,#fff3cf 0%,#f7b35c 54%,#ff7a1a 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
.brand-name-dash {transform:translateY(-.02em)}
.brand-sub {font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.nav-item, .notice-trigger, .history-btn, .debug-btn, .img-btn, .hp-btn, .save-btn, .canvas-close {height:38px;padding:0 13px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.055);color:var(--muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none;transition:transform .16s ease,border-color .16s ease,background .16s ease,color .16s ease}
.credits-status {height:38px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.055);color:var(--text);cursor:pointer;display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:850;white-space:nowrap;transition:transform .16s ease,border-color .16s ease,background .16s ease}
.credits-status:hover {transform:translateY(-1px);border-color:var(--line-strong);background:rgba(255,255,255,.085);box-shadow:0 14px 30px rgba(255,122,26,.16)}
.credits-status-dot {width:8px;height:8px;border-radius:50%;background:#ff8b21;box-shadow:0 0 0 3px rgba(255,139,33,.12)}
.credits-status-divider {width:1px;height:14px;background:var(--line)}
.credits-status strong {color:#ff7a1a}
.usage-query-btn {height:38px;padding:0 13px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.055);color:var(--text);cursor:pointer;display:none;align-items:center;gap:7px;font-size:13px;font-weight:850;white-space:nowrap;transition:transform .16s ease,border-color .16s ease,background .16s ease}
.usage-query-btn:hover {transform:translateY(-1px);border-color:var(--line-strong);background:rgba(255,255,255,.085);box-shadow:0 14px 30px rgba(255,122,26,.16)}
.usage-query-modal {position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:20px;background:rgba(7,10,15,.58)}
.usage-query-panel {width:min(760px,100%);max-height:min(680px,calc(100vh - 40px));overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel);box-shadow:0 28px 80px rgba(0,0,0,.38);padding:20px}
.usage-query-head {display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.usage-query-head h2 {margin:0;font-size:20px}
.usage-query-balance {margin-top:6px;color:var(--muted)}
.usage-query-balance b {color:var(--accent);font-size:17px}
.usage-query-table {width:100%;border-collapse:collapse}
.usage-query-table th, .usage-query-table td {padding:11px 8px;border-bottom:1px solid var(--line);text-align:left;font-size:13px}
.usage-query-table th {color:var(--muted);font-size:12px}
.usage-query-ok {color:#16803c;font-weight:800}
.usage-query-failed {color:var(--danger);font-weight:800}
@media(max-width:620px) {
.usage-query-btn {padding:0 10px}
.usage-query-panel {padding:16px}
.usage-query-table {display:block;overflow:auto;white-space:nowrap}
}
.nav-icon {width:16px;height:16px;display:inline-grid;place-items:center;flex:0 0 auto;font-size:14px;line-height:1;color:currentColor}
.theme-label {font-size:13px;font-weight:900}
.nav-item:hover, .notice-trigger:hover, .history-btn:hover, .debug-btn:hover, .img-btn:hover, .hp-btn:hover, .save-btn:hover, .canvas-close:hover {transform:translateY(-1px);border-color:var(--line-strong);background:rgba(255,255,255,.085);color:var(--text);box-shadow:0 14px 30px rgba(255,122,26,.16)}
.nav-item.active {background:linear-gradient(135deg,rgba(247,179,92,.28),rgba(88,214,189,.12));border-color:rgba(247,179,92,.38);color:var(--text);font-weight:900}
.nav-badge {min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--danger);color:#2c1110;font-size:11px;font-weight:900;line-height:18px;text-align:center}
.sidebar {display:contents}
.sidebar-header {display:none}
.sidebar-nav {display:flex;gap:8px}
.main {width:100%;padding-top:20px}
.page {display:none;width:100%}
.page.active {display:block}
.hero {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:end;margin:14px 0 14px}
.hero h1 {font-size:clamp(30px,4.8vw,52px);line-height:1;font-weight:950;letter-spacing:0;max-width:760px}
.hero p {margin-top:8px;color:var(--muted);font-size:14px;line-height:1.65;max-width:560px}
.hero-panel {min-width:270px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.055);padding:14px;color:var(--muted);box-shadow:var(--shadow)}
.hero-panel strong {display:block;color:var(--text);font-size:13px;margin-bottom:8px}
.hero-stats {display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.hero-stat {border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:9px;background:rgba(0,0,0,.16)}
.hero-stat b {display:block;color:var(--accent);font-size:16px}
.hero-stat span {font-size:11px;color:var(--soft)}
.system-announcement {margin:0 0 14px;padding:10px 14px;border:1px solid rgba(247,179,92,.22);border-radius:8px;background:linear-gradient(135deg,rgba(247,179,92,.16),rgba(88,214,189,.06));color:#ffe7c2;font-size:13px;font-weight:800;display:flex;align-items:center;gap:10px;overflow:hidden}
.system-announcement small {color:var(--muted);font-weight:700}
.workspace-grid {display:grid;grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);gap:18px;align-items:start}
.studio-column, .preview-column {min-width:0}
.preview-column {position:sticky;top:86px}
.card, .composer {border:1px solid rgba(255,255,255,.18);border-radius:8px;background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,.055));backdrop-filter:blur(28px) saturate(1.2);-webkit-backdrop-filter:blur(28px) saturate(1.2);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 24px 72px rgba(0,0,0,.28);padding:18px;margin-bottom:16px}
.composer {padding:0;overflow:hidden;background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.06));border-color:rgba(255,255,255,.22)}
.composer-inner {padding:12px}
.tabs {display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.tab {height:36px;padding:0 13px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.04);color:var(--muted);font-size:13px;font-weight:900}
.tab.active {color:#21140d;background:linear-gradient(135deg,#fff4d6,#f7b35c);border-color:transparent}
.composer-body {display:grid;gap:12px}
.upload-stack {display:grid;gap:8px}
.preview-grid, .ref-grid {display:flex;gap:10px;flex-wrap:wrap;min-height:74px;align-items:center}
.prompt-tools {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.prompt-count {font-size:12px;color:var(--soft)}
.prompt, textarea {width:100%;min-height:122px;border:1px solid rgba(255,238,214,.12);border-radius:8px;padding:14px 16px;background:rgba(0,0,0,.2);color:var(--text);font-size:15px;line-height:1.65;resize:vertical;outline:none;transition:border-color .2s,box-shadow .2s}
.prompt:focus, textarea:focus, .input:focus {border-color:rgba(247,179,92,.48);box-shadow:0 0 0 4px rgba(247,179,92,.08)}
textarea::placeholder, input::placeholder {color:rgba(255,239,220,.36)}
.masked-api-key::placeholder {color:var(--text);opacity:1}
.composer-footer {display:grid;gap:10px;padding:12px;border-top:1px solid rgba(255,255,255,.12);background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.035))}
.composer-control-bar {display:grid;grid-template-columns:minmax(190px,240px) minmax(0,1fr);gap:12px;align-items:stretch;padding:10px;border:1px solid rgba(255,255,255,.14);border-radius:8px;background:linear-gradient(135deg,rgba(255,255,255,.12),rgba(255,255,255,.045));box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.model-field {display:grid;gap:7px;align-content:start;min-width:0}
.model-field label, .control-section label {font-size:11px;color:var(--soft);font-weight:950;letter-spacing:0}
.glass-select {height:40px;width:100%;border:1px solid rgba(255,255,255,.18);border-radius:8px;background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,.055));color:var(--text);padding:0 34px 0 12px;outline:none;font-size:12px;font-weight:900;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 12px 28px rgba(0,0,0,.12)}
.glass-select:focus {border-color:rgba(247,179,92,.46);box-shadow:0 0 0 4px rgba(247,179,92,.08),inset 0 1px 0 rgba(255,255,255,.14)}
.glass-select option {background:#1d1714;color:#fff7ef}
.model-picker {width:100%}
.model-native-select {display:none}
.model-picker-trigger {height:44px;width:100%;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:0 14px;text-align:left;font-size:13px;font-weight:900;cursor:pointer}
.model-picker-menu {display:none;width:100%;margin-top:7px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel-strong);box-shadow:var(--shadow)}
.model-picker.open .model-picker-menu {display:grid;gap:6px}
.model-picker-option {display:grid;grid-template-columns:34px 1fr auto;gap:9px;align-items:center;width:100%;padding:9px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.model-picker-option:hover, .model-picker-option.active {border-color:rgba(242,92,13,.36);background:linear-gradient(135deg,rgba(242,92,13,.16),rgba(167,139,250,.08))}
.model-picker-icon {width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:linear-gradient(135deg,#f25c0d,#ff9a5c);color:#fff;font-weight:950}
.model-picker-name {font-size:13px;font-weight:900;display:block}
.model-picker-meta {font-size:11px;color:var(--soft);margin-top:2px;display:block}
.model-picker-cost {padding:5px 8px;border-radius:999px;background:rgba(242,92,13,.14);color:#ff9a5c;font-size:11px;font-weight:900;white-space:nowrap}
body.light-theme .model-picker-trigger {background:#fffaf6;color:#242424;border-color:rgba(255,122,26,.20)}
body.light-theme .model-picker-menu {background:#fff;border-color:#eadfd8;box-shadow:0 18px 40px rgba(15,23,42,.16)}
body.light-theme .model-picker-option {color:#242424}
body.light-theme .model-picker-meta {color:#8a8f9b}
body.light-theme .model-picker-cost {background:#f1ebff;color:#6d35df}
.model-picker {width:100%}
.model-native-select {display:none}
.model-picker-trigger {height:44px;width:100%;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:0 14px;text-align:left;font-size:13px;font-weight:900;cursor:pointer}
.model-picker-menu {display:none;width:100%;margin-top:7px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--panel-strong);box-shadow:var(--shadow)}
.model-picker.open .model-picker-menu {display:grid;gap:6px}
.model-picker-option {display:grid;grid-template-columns:34px 1fr auto;gap:9px;align-items:center;width:100%;padding:9px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.model-picker-option:hover, .model-picker-option.active {border-color:rgba(247,179,92,.42);background:linear-gradient(135deg,rgba(247,179,92,.18),rgba(255,122,26,.08))}
.model-picker-icon {width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:linear-gradient(135deg,#f7b35c,#ff7a1a);color:#25120a;font-weight:950}
.model-picker-name {font-size:13px;font-weight:900;display:block}
.model-picker-meta {font-size:11px;color:var(--soft);margin-top:2px;display:block}
.model-picker-cost {padding:5px 8px;border-radius:999px;background:rgba(247,179,92,.16);color:#f7b35c;font-size:11px;font-weight:900;white-space:nowrap}
body.light-theme .model-picker-trigger {background:#fffaf6;color:#242424;border-color:rgba(255,122,26,.20)}
body.light-theme .model-picker-menu {background:#fff;border-color:#eadfd8;box-shadow:0 18px 40px rgba(15,23,42,.16)}
body.light-theme .model-picker-option {color:#242424}
body.light-theme .model-picker-option:hover, body.light-theme .model-picker-option.active {border-color:rgba(242,92,13,.36);background:linear-gradient(135deg,#fbf8ff,#fff)}
body.light-theme .model-picker-icon {background:linear-gradient(135deg,#f25c0d,#ff9a5c);color:#fff}
body.light-theme .model-picker-meta {color:#8a8f9b}
body.light-theme .model-picker-cost {background:#f1ebff;color:#6d35df}
.inline-controls {display:grid;grid-template-columns:1.45fr .9fr .85fr;gap:10px;align-items:start;min-width:0}
.control-section {display:grid;gap:7px;min-width:0}
.btn-group {display:flex;gap:6px;flex-wrap:wrap}
.btn-opt {height:32px;padding:0 10px;border:1px solid rgba(255,255,255,.13);border-radius:8px;background:rgba(255,255,255,.055);color:var(--muted);cursor:pointer;font-size:12px;font-weight:900;transition:all .16s;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
.btn-opt:hover {border-color:var(--line-strong);color:var(--text);background:rgba(255,255,255,.085)}
.btn-opt.active {background:linear-gradient(135deg,#fff4d6,#f7b35c);color:#21140d;border-color:transparent;box-shadow:0 10px 24px rgba(247,179,92,.18)}
.composer-actions {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 10px 10px 12px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:rgba(0,0,0,.12)}
.selection-summary {min-width:0;display:grid;gap:7px;padding-right:12px;border-right:1px solid rgba(255,255,255,.12)}
.selection-label {font-size:11px;color:var(--soft);font-weight:950}
.meta-pills {display:flex;gap:7px;flex-wrap:wrap}
.meta-pill {min-height:28px;padding:6px 9px;border-radius:8px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);color:var(--soft);font-size:11px;font-weight:850}
.gen-btn {min-height:46px;padding:0 22px;border:none;border-radius:8px;background:linear-gradient(135deg,#ff9a5c 0%,#ff6a1a 60%,#f25c0d 100%);color:#fff;font-size:15px;font-weight:950;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:transform .16s,box-shadow .16s;box-shadow:0 16px 34px rgba(247,179,92,.22)}
.gen-btn:hover {transform:translateY(-1px);box-shadow:0 20px 42px rgba(247,179,92,.28)}
.gen-btn:disabled {opacity:.62;cursor:not-allowed;transform:none;box-shadow:none}
.card-title {font-size:14px;font-weight:950;color:var(--text);margin-bottom:14px;display:flex;align-items:center;gap:8px}
.card-title span {color:var(--muted);font-size:12px;font-weight:700}
.result-area {min-height:520px;display:flex;align-items:center;justify-content:center;position:relative;border:1px dashed rgba(255,238,214,.13);border-radius:8px;background:rgba(0,0,0,.16);overflow:hidden}
.result-viewer {height:clamp(260px,48vh,520px);display:flex;align-items:center;justify-content:center;border-radius:8px;background:rgba(0,0,0,.12);overflow:hidden}
.result-image {max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;box-shadow:0 20px 70px rgba(0,0,0,.35)}
.result-detail {margin-top:10px;text-align:left;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:rgba(255,255,255,.055);padding:10px}
.result-detail-title {font-size:12px;font-weight:950;color:var(--text);margin-bottom:7px}
.result-prompt {font-size:12px;line-height:1.65;color:var(--muted);max-height:105px;overflow:auto;white-space:pre-wrap;word-break:break-word}
.result-ref-row {display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.result-ref-thumb {width:52px;height:52px;border-radius:8px;object-fit:cover;border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.06)}
.result-ref-empty {font-size:12px;color:var(--soft);margin-top:8px}
.generation-duration {margin-top:8px;font-size:12px;font-weight:850;color:var(--accent);line-height:1.4}
.state {display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 20px;text-align:center}
.state-icon {font-size:36px;margin-bottom:13px}
.state-text {font-size:14px;color:var(--muted);line-height:1.65}
.state-error {color:var(--danger)}
.spinner {width:40px;height:40px;border:3px solid rgba(255,255,255,.16);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin-bottom:16px}
@keyframes spin{to{transform:rotate(360deg)}}
.progress-bar {width:240px;height:6px;background:rgba(255,255,255,.08);border-radius:999px;overflow:hidden;margin:12px 0}
.progress-fill {height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:999px;transition:width .3s}
.img-actions, .history-actions, .debug-actions {display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:10px}
.img-btn, .history-btn, .debug-btn, .hp-btn {font-size:12px}
.ref-section {margin:0}
.ref-header {display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.ref-count, .ref-hint, .hint {font-size:12px;color:var(--soft);line-height:1.6}
.ref-hint {margin-bottom:10px}
.ref-thumb {position:relative;width:80px;height:80px;border-radius:8px;overflow:hidden;border:1px solid var(--line);cursor:grab;user-select:none;transition:transform .15s,box-shadow .15s;touch-action:none;background:rgba(0,0,0,.22)}
.ref-thumb:active {cursor:grabbing}
.dragging-ghost {border-radius:8px;overflow:hidden;border:1px solid var(--accent);box-shadow:0 12px 26px rgba(0,0,0,.42)}
.ref-thumb.dragging {opacity:.4;transform:scale(.9)}
.ref-thumb.drag-over {border-color:var(--accent);box-shadow:0 0 0 2px rgba(247,179,92,.3);transform:scale(1.04)}
.ref-thumb img {width:100%;height:100%;object-fit:cover;pointer-events:none}
.ref-del {position:absolute;top:5px;right:5px;width:22px;height:22px;border-radius:999px;background:rgba(20,15,12,.84);color:#fff;border:1px solid rgba(255,255,255,.16);cursor:pointer;font-size:12px;display:flex;align-items:center;justify-content:center;line-height:1;z-index:2}
.ref-del:hover {background:rgba(255,95,86,.88)}
.ref-upload {width:80px;height:80px;border:1px dashed rgba(255,238,214,.24);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;font-size:24px;color:var(--muted);background:rgba(255,255,255,.035)}
.ref-upload:hover {border-color:var(--accent);color:var(--text);background:rgba(247,179,92,.08)}
.ref-upload span {font-size:10px;color:var(--soft);margin-top:2px}
.result-grid, .history-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px;width:100%;align-items:start}
.result-grid .result-grid-item, .history-card {position:relative;border-radius:8px;overflow:hidden;cursor:pointer;transition:transform .16s;background:rgba(255,255,255,.075);border:1px solid rgba(255,255,255,.14);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 18px 44px rgba(0,0,0,.2)}
.result-grid .result-grid-item:hover, .history-card:hover {transform:translateY(-2px)}
.result-grid .result-grid-item img, .history-card img {width:100%;aspect-ratio:1;object-fit:cover;display:block}
.result-grid .result-grid-item .result-grid-badge {position:absolute;top:7px;left:7px;background:rgba(0,0,0,.58);color:#fff;font-size:11px;padding:3px 8px;border-radius:8px}
.history-card-info {padding:10px 12px;font-size:12px;color:var(--muted);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.history-card-meta {position:absolute;top:8px;left:8px;display:flex;gap:6px;flex-wrap:wrap}
.history-card-meta span {min-height:22px;padding:3px 8px;border-radius:999px;background:rgba(0,0,0,.52);color:#fff;font-size:10px;font-weight:850}
.history-card-actions {display:flex;gap:6px;padding:0 10px 10px;flex-wrap:wrap}
.record-pending {min-height:245px;display:flex;flex-direction:column;justify-content:space-between;padding:12px;cursor:default}
.record-pending:hover {transform:none}
.record-pending-art {height:156px;border-radius:8px;border:1px dashed rgba(255,255,255,.18);background:linear-gradient(135deg,rgba(255,255,255,.1),rgba(255,255,255,.035));display:grid;place-items:center;position:relative;overflow:hidden}
.record-pending-art::before {content:"";position:absolute;inset:-45%;background:conic-gradient(from 0deg,transparent,rgba(247,179,92,.34),transparent 34%,rgba(88,214,189,.22),transparent 70%);animation:recordSpin 2.4s linear infinite}
.record-pending-ring {position:relative;width:42px;height:42px;border-radius:50%;border:3px solid rgba(255,255,255,.18);border-top-color:var(--accent);animation:spin .9s linear infinite}
.record-pending-title {font-size:13px;font-weight:950;color:var(--text);margin:11px 0 5px}
.record-pending-meta {font-size:12px;color:var(--muted);line-height:1.5}
@keyframes recordSpin{to{transform:rotate(360deg)}}
.record-pending-compact {min-height:0;padding:44px 12px 12px}
.record-pending-compact .record-pending-ring {width:28px;height:28px;display:inline-block;vertical-align:middle;margin-right:8px}
.record-pending-compact .record-pending-title {display:inline-block;margin:0 0 8px;vertical-align:middle}
.record-pending-compact .history-card-actions {padding:10px 0 0}
.task-board {margin-top:18px}
.task-board-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px}
.task-board-card {position:relative;overflow:hidden;aspect-ratio:3/4;border:1px solid rgba(255,122,26,.24);border-radius:8px;background:rgba(255,255,255,.045);padding:10px;display:flex;flex-direction:column;justify-content:space-between;box-shadow:0 16px 36px rgba(0,0,0,.18),0 0 30px rgba(255,122,26,.13)}
.task-board-liquid {position:absolute;inset:-18%;overflow:hidden;background:linear-gradient(115deg,rgba(255,236,202,.18),rgba(255,122,26,.38) 36%,rgba(180,64,9,.2) 70%,rgba(255,190,115,.26));filter:blur(10px);animation:taskAuroraFlow 7.5s ease-in-out infinite}
.task-board-liquid::before {content:"";position:absolute;inset:-20%;background:radial-gradient(ellipse at 20% 28%,rgba(255,238,205,.68),transparent 28%),radial-gradient(ellipse at 76% 36%,rgba(255,103,18,.7),transparent 32%),radial-gradient(ellipse at 42% 78%,rgba(255,184,92,.52),transparent 36%);mix-blend-mode:screen;animation:taskAuroraMorph 5.8s ease-in-out infinite}
.task-board-liquid::after {content:"";position:absolute;inset:-28%;background:linear-gradient(72deg,transparent 12%,rgba(255,247,230,.4) 34%,rgba(255,122,26,.24) 55%,transparent 78%);filter:blur(22px);mix-blend-mode:screen;animation:taskAuroraRibbon 4.8s ease-in-out infinite}
.task-board-card>*:not(.task-board-liquid) {position:relative;z-index:1}
.task-board-status {align-self:flex-start;min-height:24px;padding:4px 8px;border-radius:999px;background:rgba(0,0,0,.34);color:#fff;font-size:11px;font-weight:900;backdrop-filter:blur(10px)}
.task-board-dot {width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:rgba(255,122,26,.16);color:var(--accent);font-weight:950}
.task-board-title {font-size:13px;font-weight:950;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.task-board-meta {font-size:11px;color:var(--muted);margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.task-board-actions {display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
.task-board-actions .hp-btn {height:28px;padding:0 6px}
.task-board-empty {color:var(--muted);font-size:13px;text-align:center;padding:18px;border:1px dashed var(--line);border-radius:8px}
.home-history-collapsed {padding:10px 14px!important}
.home-history-collapsed>div:first-child {margin-bottom:0!important}
.home-history-collapsed .history-grid, .home-history-collapsed #home-history-empty {display:none!important}
.home-history-head {display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:10px;flex-wrap:wrap;cursor:pointer;border-radius:8px;transition:background .16s}
.home-history-head:hover {background:rgba(255,122,26,.06)}
.home-history-toggle {width:32px;height:32px;padding:0;border:0;background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;pointer-events:none}
.home-history-toggle b {width:18px;height:18px;font-size:0;position:relative;color:var(--muted);display:block}
.home-history-toggle b::before {content:"";position:absolute;left:5px;top:4px;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .16s,top .16s}
.home-history-card:not(.home-history-collapsed) .home-history-toggle b::before {top:7px;transform:rotate(225deg)}
body.light-theme .task-board-card {background:#fff;border-color:rgba(255,122,26,.18);box-shadow:0 18px 46px rgba(15,23,42,.08),0 0 34px rgba(255,122,26,.16)}
body.light-theme .task-board-status {background:rgba(255,122,26,.12);color:#c2410c}
body.light-theme .task-board-empty {background:#fff;color:#8a8f9b}
@keyframes taskAuroraFlow{0%,100%{transform:translate3d(-3%,2%,0) scale(1) rotate(-2deg);filter:blur(10px) hue-rotate(0deg)}50%{transform:translate3d(3%,-2%,0) scale(1.08) rotate(2deg);filter:blur(13px) hue-rotate(-8deg)}}
@keyframes taskAuroraMorph{0%,100%{transform:translate(-5%,3%) scale(1);opacity:.68}50%{transform:translate(6%,-4%) scale(1.12);opacity:.94}}
@keyframes taskAuroraRibbon{0%,100%{transform:translateX(-12%) rotate(-8deg);opacity:.42}50%{transform:translateX(12%) rotate(8deg);opacity:.82}}
@media (max-width:620px) {
.task-board-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
.task-board-actions .hp-btn {font-size:11px}
}
.result-batch-nav {display:flex;gap:6px;margin-top:10px;justify-content:center;align-items:center}
.result-batch-nav .batch-dot {width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,.2);cursor:pointer;transition:all .2s}
.result-batch-nav .batch-dot.active {background:var(--accent);width:24px;border-radius:999px}
.hp-batch-thumbs {display:flex;gap:4px;flex-shrink:0}
.hp-batch-thumbs .hp-thumb, .hp-batch-thumbs .hp-thumb-ph {width:44px;height:44px}
.loading-elapsed {font-size:13px;color:var(--accent);margin-top:8px;font-weight:700}
.debug-toolbar {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap}
.debug-log {width:100%;min-height:150px;max-height:280px;overflow:auto;background:#0c1118;color:#d4dde8;border:1px solid rgba(255,255,255,.08);border-radius:8px;padding:12px;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;font-family:Consolas,"SFMono-Regular",Menlo,Monaco,monospace}
.debug-empty {color:#8290a2}
.settings-group {margin-bottom:18px}
.input {width:100%;border:1px solid var(--line);border-radius:8px;padding:12px 14px;font-size:14px;outline:none;background:rgba(0,0,0,.2);color:var(--text);transition:border-color .2s,box-shadow .2s}
.save-btn {background:linear-gradient(135deg,#ff9a5c,#ff6a1a);color:#fff;border-color:transparent;font-weight:900}

@keyframes commerceLogSlideUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
/* ===== Debug Log FAB & Drawer（调试日志悬浮窗）===== */
#debug-log-fab {position:fixed;bottom:20px;right:78px;width:52px;height:52px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#ff7a1a);color:#fff;font-size:24px;display:grid;place-items:center;cursor:pointer;z-index:9999;box-shadow:0 4px 16px rgba(99,102,241,.45);transition:transform .2s,box-shadow .2s;user-select:none}
#debug-log-fab:hover {transform:scale(1.12);box-shadow:0 6px 24px rgba(99,102,241,.5)}
#debug-log-fab:active {transform:scale(.95)}
#debug-log-fab .dbg-badge {position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;border-radius:9px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;display:none;place-items:center;padding:0 4px;line-height:18px;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,.3)}
#debug-log-drawer {position:fixed;bottom:80px;right:24px;width:min(560px,calc(100vw - 48px));background:#fff;border:1px solid #e0e0e0;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.15);padding:14px;z-index:9998;animation:commerceLogSlideUp .2s ease-out}
body:not(.light-theme) #debug-log-drawer {background:#1e1e2e;border-color:#333}
body:not(.light-theme) #debug-log-drawer b {color:#ccc}
/* ===== Settings Page - New Layout ===== */
.settings-layout {display:flex;gap:0;border-radius:16px;overflow:hidden;min-height:560px}
/* Sidebar */
.settings-sidebar {width:220px;flex-shrink:0;background:rgba(15,18,28,.85);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:20px 0;overflow-y:auto}
.settings-sidebar-header {font-size:20px;font-weight:950;color:var(--text);padding:0 20px 16px;margin-bottom:4px}
.settings-nav-item {display:flex;align-items:flex-start;gap:10px;width:100%;padding:11px 20px;background:none;border:1px solid transparent;border-radius:0;color:var(--muted);cursor:pointer;text-align:left;font-size:13px;line-height:1.35;transition:all .2s;position:relative}
.settings-nav-item:hover {background:rgba(255,255,255,.04);color:var(--text)}
.settings-nav-item.active {background:linear-gradient(135deg,rgba(255,122,26,.16),rgba(255,181,96,.08));border-left:3px solid #ff7a1a;border-top-color:transparent;border-bottom-color:transparent;border-right-color:transparent;color:var(--text)}
.settings-nav-icon {font-size:17px;flex-shrink:0;margin-top:1px;width:22px;text-align:center}
.settings-nav-label {font-weight:800;display:block}
.settings-nav-desc {font-size:11px;color:var(--soft);display:block;margin-top:2px;font-weight:400}
/* Status footer in sidebar */
.settings-sidebar-footer {margin-top:auto;padding:20px;border-top:1px solid var(--line)}
.settings-status-dot {display:inline-block;width:8px;height:8px;border-radius:50%;background:#666;margin-right:6px;vertical-align:middle}
.settings-status-dot.connected {background:#4ade80;box-shadow:0 0 6px rgba(74,222,128,.4)}
.settings-status-dot.error {background:#f87171;box-shadow:0 0 6px rgba(248,113,113,.4)}
.settings-status-text {font-size:12px;color:var(--muted);vertical-align:middle}
.settings-status-time {font-size:11px;color:var(--soft);margin-top:4px;display:block}
.settings-retest-btn {margin-top:8px;padding:6px 14px;border:1px solid var(--line);border-radius:6px;background:rgba(255,255,255,.04);color:var(--muted);font-size:12px;cursor:pointer;transition:all .2s}
.settings-retest-btn:hover {border-color:var(--accent);color:var(--accent)}
/* Main content */
.settings-main {flex:1;padding:28px 32px;overflow-y:auto;min-width:0}
.settings-panel {display:none;animation:panelFadeIn .25s ease}
.settings-panel.active {display:block}

@keyframes panelFadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
/* Section */
.settings-section {margin-bottom:24px;padding:20px;border:1px solid var(--line);border-radius:12px;background:rgba(0,0,0,.12)}
.settings-section-head {display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}
.settings-section-num {width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,#ff9a5c,#ff6a1a);color:#fff;font-size:13px;font-weight:950;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px}
.settings-section-title {font-size:15px;font-weight:900;color:var(--text);margin:0 0 4px}
.settings-section-desc {font-size:12px;color:var(--soft);margin:0}
.saved-config-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-top:12px}
.saved-config-card {position:relative;min-height:130px;padding:16px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.045);cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.saved-config-card:hover {transform:translateY(-1px);border-color:var(--line-strong);box-shadow:0 14px 30px rgba(0,0,0,.16)}
.saved-config-card.active {border-color:#ff8a34;box-shadow:0 0 0 1px #ff8a34,0 16px 34px rgba(255,122,26,.18)}
.saved-config-top {display:flex;gap:12px;align-items:flex-start;padding-right:58px}
.saved-config-icon {width:46px;height:46px;border-radius:12px;display:grid;place-items:center;font-size:22px;font-weight:950;color:#fff;background:linear-gradient(135deg,#ff7a1a,#f7b35c);flex:0 0 auto}
.saved-config-name {font-size:14px;font-weight:950;color:var(--text);line-height:1.3;margin-top:4px;word-break:break-word}
.saved-config-meta {font-size:12px;color:var(--soft);margin-top:7px;display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.saved-config-dot {width:5px;height:5px;border-radius:50%;background:var(--soft)}
.saved-config-badge-row {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:20px}
.saved-config-badge {min-height:24px;padding:4px 10px;border-radius:999px;background:rgba(255,122,26,.16);color:var(--accent);font-size:12px;font-weight:900}
.saved-config-badge.active {background:rgba(74,222,128,.16);color:#86efac}
.saved-config-actions {position:absolute;right:12px;top:12px;display:flex;gap:6px}
.saved-config-mini {width:28px;height:28px;border:0;border-radius:8px;background:rgba(255,255,255,.08);color:var(--muted);cursor:pointer}
.saved-config-mini:hover {background:rgba(255,255,255,.14);color:var(--text)}
.saved-config-empty {padding:18px;border:1px dashed var(--line);border-radius:12px;color:var(--soft);font-size:13px;text-align:center}
.saved-config-toolbar {display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}
.saved-config-toolbar .input {max-width:260px}
.saved-config-add {min-height:130px;border:1px dashed rgba(255,238,214,.22);border-radius:12px;background:rgba(255,238,214,.04);color:var(--muted);display:grid;place-items:center;gap:8px;align-content:center;cursor:pointer;transition:transform .16s,border-color .16s,background .16s}
.saved-config-add:hover {transform:translateY(-1px);border-color:var(--accent);background:rgba(247,179,92,.08);color:var(--text)}
.saved-config-add b {font-size:22px;font-weight:500}
.settings-api-form {display:none}
.settings-api-form.open {display:block}
.settings-api-form-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}
.settings-api-form-head h3 {font-size:15px;margin:0}
.settings-api-form-head p {font-size:12px;color:var(--soft);margin:4px 0 0}
.settings-api-form-close {height:32px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.055);color:var(--muted);cursor:pointer}
/* Field */
.settings-field label {display:block;font-size:13px;font-weight:700;color:var(--text);margin-bottom:6px}
.settings-field .input {background:rgba(0,0,0,.25);border-color:var(--line)}
.settings-field .hint {margin-top:5px}
/* Row layout */
.settings-fields-row {display:grid;grid-template-columns:1fr 1fr;gap:16px}
.settings-fields-row .flex-1 {min-width:0}
.settings-fields-row .flex-2 {grid-column:1 / -1;min-width:0}
/* Valid icon */
.field-valid-icon {position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#4ade80;font-size:14px;pointer-events:none;opacity:0;transition:opacity .2s}
.field-valid-icon.show {opacity:1}
.valid-dot {display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--soft);vertical-align:middle;margin-right:4px}
.valid-dot.green {background:#4ade80}
.icon-btn {width:36px;height:36px;border:1px solid var(--line);border-radius:8px;background:rgba(0,0,0,.15);color:var(--muted);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s}
.icon-btn:hover {border-color:var(--accent);color:var(--accent)}
/* Toggle switch (small) */
.toggle-row {display:flex;align-items:center;gap:8px;cursor:pointer;user-select:none;margin-top:4px}
.toggle-label-sm {font-size:13px;color:var(--muted);font-weight:600}
.toggle-switch-sm {position:relative;width:38px;height:21px;background:rgba(120,130,150,.35);border-radius:999px;transition:background .2s;flex-shrink:0}
.toggle-switch-sm::after {content:'';position:absolute;top:2px;left:2px;width:17px;height:17px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.3)}
input[type="checkbox"]:checked + .toggle-switch-sm {background:linear-gradient(135deg,#f7b35c,#ff9a44)}
input[type="checkbox"]:checked + .toggle-switch-sm::after {transform:translateX(17px)}
/* Footer bar */
.settings-footer {position:sticky;bottom:0;display:flex;justify-content:flex-end;align-items:center;gap:16px;padding:16px 0 0;margin-top:8px;border-top:1px solid rgba(255,255,255,.06)}
.settings-footer-hint {font-size:12px;color:var(--muted)}
.footer-dot {display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
.footer-dot.unsaved {background:#f59e0b}
.footer-dot.saved {background:#4ade80}
.settings-save-btn {padding:10px 28px;font-size:14px;border-radius:999px}
/* Light theme overrides */
body.light-theme .settings-sidebar {background:#f8f7f5;border-color:rgba(17,24,39,.07)}
body.light-theme .settings-nav-item.active {background:linear-gradient(135deg,rgba(255,122,26,.1),rgba(255,181,96,.05));border-left-color:#ff7417}
body.light-theme .settings-section {background:rgba(255,255,255,.7);border-color:rgba(17,24,39,.07)}
body.light-theme .settings-field .input {background:rgba(255,255,255,.75);border-color:rgba(17,24,39,.09);color:#191919}
body.light-theme .settings-nav-item {border-left-color:transparent!important}
body.light-theme .toggle-switch-sm {background:rgba(120,130,150,.25)}
body.light-theme .icon-btn {background:rgba(0,0,0,.04);border-color:rgba(17,24,39,.1)}
body.light-theme .settings-footer {border-top-color:rgba(17,24,39,.06)}
/* Responsive */
@media (max-width:760px) {
  .settings-layout{flex-direction:column}
  .settings-sidebar{width:100%;flex-direction:row;flex-wrap:wrap;padding:12px;border-right:none;border-bottom:1px solid var(--line);gap:4px}
  .settings-sidebar-header{width:100%;padding:0 12px 8px;font-size:16px}
  .settings-nav-item{flex:1 1 auto;min-width:0;padding:8px 10px;flex-direction:column;align-items:center;text-align:center;border-left:none!important;border-bottom:2px solid transparent}
  .settings-nav-item.active{border-left:none!important;border-bottom-color:#f7b35c}
  .settings-nav-desc{display:none}
  .settings-nav-icon{width:auto;margin-top:0}
  .settings-sidebar-footer{display:none}
  .settings-main{padding:16px}
  .settings-fields-row{grid-template-columns:1fr}
}
.toast {position:fixed;top:20px;right:20px;padding:12px 16px;border-radius:8px;color:#111;font-size:14px;font-weight:850;z-index:9999;animation:fadeIn .3s;max-width:420px;box-shadow:0 18px 44px rgba(0,0,0,.25)}
.toast-success {background:#bff4c8}
.toast-error {background:#ffc3c0}
@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
/* Pending tasks (old - kept for compatibility) */
/* Sidebar pending tasks */
/* Pending tasks (old - kept for compatibility) */
.sp-item {background:#fff8e1;border:1px solid #ffe082;border-radius:8px;padding:10px;margin-bottom:8px}
.sp-prompt {font-size:12px;color:#555;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:4px}
.sp-meta {font-size:11px;color:#999;margin-bottom:6px}
.sp-status {display:inline-block;font-size:10px;padding:1px 6px;border-radius:3px;margin-left:4px}
.sp-status-waiting {background:#fff3e0;color:#e65100}
.sp-status-found {background:#e8f5e9;color:#2e7d32}
.sp-status-notfound {background:#fce4ec;color:#c62828}
.sp-actions {display:flex;gap:4px}
.sp-btn {padding:4px 8px;border:1px solid #e0e0e0;border-radius:5px;background:#fff;cursor:pointer;font-size:11px;transition:all .2s;white-space:nowrap}
.sp-btn:hover {border-color:#ff7a1a;color:#ff7a1a}
.sp-btn-primary {background:linear-gradient(135deg,#ff7a1a,#f25c0d);color:#fff;border-color:transparent}
.sp-btn-primary:hover {box-shadow:0 2px 6px rgba(255,122,26,0.4)}
.sp-clear {font-size:11px;color:#999;cursor:pointer;text-align:center;padding:4px;margin-top:4px}
.sp-clear:hover {color:#ff4d4f}
/* History pending cards */
.history-pending {margin-bottom:20px}
.hp-title {font-size:14px;font-weight:600;color:#e65100;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.hp-card {background:#fff8e1;border:1px solid #ffe082;border-radius:12px;padding:14px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.hp-thumb {width:56px;height:56px;border-radius:8px;object-fit:cover;flex-shrink:0;cursor:pointer;border:1px solid #ffe082}
.hp-thumb-ph {display:flex;align-items:center;justify-content:center;font-size:24px;background:#fff;cursor:default}
.hp-info {flex:1;min-width:0}
.hp-prompt {font-size:13px;color:#555;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hp-meta {font-size:11px;color:#999;margin-top:2px}
.hp-actions {display:flex;gap:6px;flex-shrink:0}
.hp-btn {padding:6px 12px;border:1px solid #e0e0e0;border-radius:6px;background:#fff;cursor:pointer;font-size:12px;transition:all .2s;white-space:nowrap}
.hp-btn:hover {border-color:#ff7a1a;color:#ff7a1a}
.hp-btn-primary {background:linear-gradient(135deg,#ff7a1a,#f25c0d);color:#fff;border-color:transparent}
.hp-btn-primary:hover {box-shadow:0 2px 8px rgba(255,122,26,0.4)}
.hp-title {color:var(--accent);font-weight:950}
.hp-card {background:rgba(255,255,255,.055);border-color:var(--line);border-radius:8px;color:var(--text)}
.hp-thumb {border-color:var(--line);background:rgba(0,0,0,.18)}
.hp-thumb-ph {background:rgba(255,255,255,.055);color:var(--accent)}
.hp-prompt {color:var(--text)}
.hp-meta {color:var(--muted)}
.hp-btn {border-color:var(--line);background:rgba(255,255,255,.055);color:var(--muted);border-radius:8px}
.hp-btn:hover {border-color:var(--line-strong);color:var(--text)}
.hp-btn-primary {background:linear-gradient(135deg,#fff4d6,#f7b35c);color:#21140d;border-color:transparent}
.history-card-actions {display:flex;gap:5px;padding:0 8px 8px;flex-wrap:nowrap}
.history-card-actions .hp-btn {height:28px;min-width:0;flex:1;padding:0 7px;border-radius:7px;font-size:11px;white-space:nowrap;background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.14);color:var(--muted);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.history-card-actions .hp-btn:hover {border-color:rgba(247,179,92,.34);background:rgba(255,255,255,.11);color:var(--text)}
.history-card-actions .hp-btn-primary {background:linear-gradient(135deg,rgba(247,179,92,.28),rgba(88,214,189,.13));border-color:rgba(247,179,92,.34);color:var(--text)}
.history-actions .history-btn.active {background:linear-gradient(135deg,#ff9a5c,#ff6a1a);color:#20130d;border-color:transparent}
.path-input-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.path-browse-btn {height:44px;padding:0 18px;margin:0;white-space:nowrap;font-weight:900}
.canvas-modal {position:fixed;inset:0;z-index:120;display:none;background:rgba(5,6,8,.7);backdrop-filter:blur(18px);padding:22px}
.canvas-modal.open {display:block}
.canvas-shell {height:100%;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:linear-gradient(180deg,rgba(248,250,252,.96),rgba(234,240,247,.96));color:#0f172a;display:grid;grid-template-columns:minmax(0,1fr) 320px;overflow:hidden;box-shadow:0 30px 90px rgba(0,0,0,.36)}
.canvas-stage {position:relative;overflow:auto;background:linear-gradient(90deg,rgba(15,23,42,.06) 1px,transparent 1px),linear-gradient(0deg,rgba(15,23,42,.06) 1px,transparent 1px);background-size:40px 40px;padding:28px}
.canvas-head {position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}
.canvas-title {font-size:22px;font-weight:950}
.canvas-sub {font-size:13px;color:#64748b;margin-top:4px}
.canvas-world {position:relative;min-height:620px}
.canvas-node {position:absolute;width:168px;border-radius:8px;overflow:hidden;background:#fff;border:1px solid rgba(15,23,42,.08);box-shadow:0 18px 42px rgba(15,23,42,.14);cursor:pointer;transition:transform .16s}
.canvas-node:hover {transform:translateY(-2px)}
.canvas-node img {width:100%;aspect-ratio:1;object-fit:cover;display:block}
.canvas-node p {padding:9px 10px;font-size:12px;line-height:1.4;color:#334155;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.canvas-panel {border-left:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.74);padding:18px;overflow:auto}
.canvas-panel h3 {font-size:16px;margin-bottom:10px}
.canvas-panel p {font-size:13px;line-height:1.7;color:#475569;margin-bottom:14px}
.canvas-close {background:#0f172a;color:#fff;border-color:transparent}
.canvas-empty {height:300px;display:grid;place-items:center;text-align:center;color:#64748b;font-weight:800}
@media (max-width:980px) {
.app {width:min(100% - 20px,1220px)}
.topbar {position:relative;top:0;align-items:flex-start;flex-direction:column}
.topbar-actions {width:100%;justify-content:flex-start}
.sidebar-nav {overflow:auto;max-width:100%;padding-bottom:2px}
.hero {grid-template-columns:1fr}
.hero-panel {min-width:0}
.workspace-grid {grid-template-columns:1fr}
.preview-column {position:static}
.result-area {min-height:380px}
.result-viewer {height:clamp(240px,52vh,500px)}
.canvas-shell {grid-template-columns:1fr}
.canvas-panel {display:none}
}
@media (max-width:760px) {
.composer-control-bar {grid-template-columns:1fr}
.inline-controls {grid-template-columns:1fr}
.composer-actions {grid-template-columns:1fr}
.selection-summary {border-right:0;border-bottom:1px solid rgba(255,255,255,.12);padding:0 0 10px}
.gen-btn {width:100%}
}
@media (max-width:620px) {
.app {width:100%;padding:10px 10px 48px}
.hero h1 {font-size:36px}
.hero p {font-size:14px}
.card, .composer {margin-bottom:12px}
.hp-card {align-items:flex-start;flex-direction:column}
.hp-actions {width:100%;flex-wrap:wrap}
.history-grid, .result-grid {grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.result-viewer {height:clamp(220px,46vh,420px)}
.canvas-modal {padding:8px}
.canvas-node {position:relative!important;left:auto!important;top:auto!important;margin:0 0 12px;width:100%}
.canvas-world {min-height:0}
}
center = preview {
  grid-template-columns:64px 320px minmax(620px,1fr) 320px!important;
  grid-template-rows:calc(100vh - 96px)!important;
  gap:10px!important;
  align-items:stretch!important;
}
/* Chat rows with avatar + bubble */
.chat-row {display:flex;gap:10px;align-items:flex-start}
.chat-row-user {flex-direction:row-reverse}
.chat-avatar {width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;flex-shrink:0}
.chat-avatar-user {background:linear-gradient(135deg,#ff7a1a,#ffb35c);color:#fff}
.chat-avatar-ai {background:linear-gradient(135deg,#6366f1,#818cf8);color:#fff}
.chat-bubble {max-width:80%;border-radius:16px;padding:12px 16px;line-height:1.7;font-size:14px;word-break:break-word}
.chat-bubble-user {background:linear-gradient(135deg,#ff7a1a,#ff9f3f);color:#fff;border-bottom-right-radius:4px}
.chat-bubble-ai {background:rgba(0,0,0,.06);color:var(--text);border:1px solid rgba(0,0,0,.06);border-bottom-left-radius:4px}
.chat-bubble-ai img {max-width:200px;max-height:200px;border-radius:8px;margin-top:4px}
.chat-bubble-user img {max-width:200px;max-height:200px;border-radius:8px;margin-top:4px}
.thinking-dots .dot1, .thinking-dots .dot2, .thinking-dots .dot3 {animation:blink 1.4s infinite both}
.thinking-dots .dot2 {animation-delay:.2s}
.thinking-dots .dot3 {animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:0}40%{opacity:1}}
.chat-tool-btn {width:36px;height:36px;border:0;border-radius:8px;background:rgba(255,255,255,.08);color:var(--muted);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.chat-tool-btn:hover {background:rgba(255,255,255,.15);color:var(--text)}
.chat-send-btn {height:36px;padding:0 16px;border:0;border-radius:8px;background:linear-gradient(135deg,#ff7417,#ffb35c);color:#fff;font-weight:800;font-size:13px;cursor:pointer}
.chat-send-btn:hover {opacity:.9}
body.light-theme .chat-bubble-ai {background:rgba(0,0,0,.03);border-color:rgba(0,0,0,.08);color:#191919}
body.light-theme .chat-bubble-user {background:linear-gradient(135deg,#ff7a1a,#ff9f3f);color:#fff}
body.light-theme .chat-tool-btn {background:rgba(0,0,0,.05);color:#666}
body.light-theme .chat-send-btn {color:#fff}
body.light-theme .nav-item {position:relative;height:44px;padding:0 17px;border-radius:999px;color:#242424}
body.light-theme .nav-item.active {background:#fff5ed;border-color:rgba(255,122,26,.22);color:#ff7417;box-shadow:0 12px 28px rgba(255,122,26,.1)}
body.light-theme .nav-item.active::after {content:"";position:absolute;left:18px;right:18px;bottom:-14px;height:3px;border-radius:999px;background:#ff7417;box-shadow:0 8px 18px rgba(255,122,26,.35)}
body.light-theme .notice-trigger, body.light-theme .theme-toggle {height:44px;border-radius:999px;color:#242424}
body.light-theme .credits-status {height:44px;border-color:rgba(17,24,39,.09);background:rgba(255,255,255,.82);color:#3b4048;box-shadow:0 8px 20px rgba(15,23,42,.04)}
body.light-theme .credits-status strong {color:#f25c0d}

@keyframes commerce-dialog-fade-in{from{opacity:0}to{opacity:1}}
#grid-cancel-btn {background:#f1efeb;color:#666}
#grid-cancel-btn:hover {background:#e5e2dc}
#grid-confirm-btn {background:linear-gradient(135deg,#ff7a1a,#ff8f2a);color:#fff;box-shadow:0 8px 20px rgba(255,122,26,.25)}
#grid-confirm-btn:hover {filter:brightness(1.05)}
center plans {
  grid-template-columns:330px minmax(560px,1fr) 330px!important;
  grid-template-rows:calc(100vh - 124px)!important;
  gap:16px!important;
}
body.light-theme .topbar {height:64px;top:10px;padding:0 18px;border-radius:10px;background:rgba(255,255,255,.94);border:1px solid rgba(17,24,39,.06);box-shadow:0 16px 42px rgba(15,23,42,.08),0 18px 46px rgba(255,122,26,.08);display:grid;grid-template-columns:190px minmax(0,1fr);align-items:center}
body.light-theme .brand {gap:10px}
body.light-theme .brand-mark {width:34px;height:34px;border-radius:8px;background:#fff4ec;box-shadow:0 10px 22px rgba(255,122,26,.18)}
body.light-theme .brand-mark img {width:26px;height:26px}
body.light-theme .brand-name {font-size:22px}
body.light-theme .brand-sub {display:none}
body.light-theme .topbar-actions {height:100%;display:flex;align-items:center;justify-content:flex-end;gap:24px;flex-wrap:nowrap}
body.light-theme .sidebar-nav {height:100%;display:flex;align-items:center;gap:24px}
body.light-theme .notice-trigger, body.light-theme .nav-item, body.light-theme .theme-toggle {height:100%;padding:0 2px;border:0;border-radius:0;background:transparent!important;box-shadow:none!important;color:#202020;font-size:14px;font-weight:900;gap:7px;position:relative;transform:none!important;white-space:nowrap}
body.light-theme .notice-trigger:hover, body.light-theme .nav-item:hover, body.light-theme .theme-toggle:hover {color:#ff7417;background:transparent!important;box-shadow:none!important}
body.light-theme .nav-icon {width:16px;height:16px;font-size:14px;color:currentColor}
body.light-theme .theme-label {font-size:14px;font-weight:900}
body.light-theme .nav-item.active {color:#ff7417;border:0;background:transparent!important;box-shadow:none!important}
body.light-theme .nav-item.active::after {content:"";position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:999px;background:#ff7417;box-shadow:0 8px 18px rgba(255,122,26,.34)}
body.light-theme .notice-trigger::after, body.light-theme .theme-toggle::after {display:none}
@media (max-width:980px) {
body.light-theme .topbar {grid-template-columns:1fr;height:auto;gap:10px;padding:12px 14px}
body.light-theme .topbar-actions {justify-content:flex-start;gap:14px;overflow:auto}
body.light-theme .sidebar-nav {gap:14px}
}
body.light-theme .topbar-actions {gap:34px}
body.light-theme .sidebar-nav {gap:34px}
body.light-theme .notice-trigger, body.light-theme .nav-item, body.light-theme .theme-toggle {font-size:15px;gap:9px}
body.light-theme .nav-icon {width:20px;height:20px;font-size:18px}
body.light-theme .theme-label {font-size:15px}
body.light-theme .brand-mark {width:40px;height:40px}
body.light-theme .brand-mark img {width:30px;height:30px}
body.light-theme .brand-name {font-size:24px}
@media (max-width:1320px) {
body.light-theme .topbar-actions, body.light-theme .sidebar-nav {gap:24px}
}
.nav-item, .theme-toggle, body.light-theme .notice-trigger, body.light-theme .nav-item, body.light-theme .theme-toggle, body:not(.light-theme) .notice-trigger, body:not(.light-theme) .nav-item, body:not(.light-theme) .theme-toggle {height:44px;padding:0 16px;border-radius:999px;border:1px solid transparent;background:rgba(255,255,255,.055);box-shadow:none}
.notice-trigger:hover, .nav-item:hover, .theme-toggle:hover, body.light-theme .notice-trigger:hover, body.light-theme .nav-item:hover, body.light-theme .theme-toggle:hover, body:not(.light-theme) .notice-trigger:hover, body:not(.light-theme) .nav-item:hover, body:not(.light-theme) .theme-toggle:hover {transform:translateY(-1px);box-shadow:0 14px 30px rgba(255,122,26,.16),0 0 26px rgba(255,122,26,.1)}
.nav-item.active, body.light-theme .nav-item.active, body:not(.light-theme) .nav-item.active {border-color:rgba(255,122,26,.28);background:linear-gradient(135deg,rgba(255,122,26,.14),rgba(255,181,96,.08));color:#ff7417;box-shadow:0 12px 28px rgba(255,122,26,.14),0 0 24px rgba(255,122,26,.12)}
.nav-item.active::after, body.light-theme .nav-item.active::after, body:not(.light-theme) .nav-item.active::after {display:none}
body.light-theme .notice-trigger, body.light-theme .nav-item, body.light-theme .theme-toggle {background:#fff;border-color:rgba(17,24,39,.06)}
body:not(.light-theme) .notice-trigger, body:not(.light-theme) .nav-item, body:not(.light-theme) .theme-toggle {background:rgba(255,255,255,.055);border-color:rgba(255,255,255,.08)}
/* Rebalance center: use right-side space {
  padding:16px 22px 92px!important;
}
.gen-btn, .gen-btn #gen-btn-icon, .gen-btn #gen-btn-text {
  color:#fff!important;
}
.gen-btn {
  border:0!important;
  border-radius:10px!important;
  background:linear-gradient(135deg,#ff7417 0%,#ff922f 58%,#ffb45f 100%)!important;
  color:#fff!important;
  box-shadow:0 14px 30px rgba(255,122,26,.24),inset 0 1px 0 rgba(255,255,255,.2)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease!important;
}
.gen-btn:hover {
  transform:translateY(-1px)!important;
  filter:saturate(1.04) brightness(1.02)!important;
  box-shadow:0 18px 38px rgba(255,122,26,.3),0 0 24px rgba(255,122,26,.12),inset 0 1px 0 rgba(255,255,255,.24)!important;
}
.gen-btn:active {
  transform:translateY(0)!important;
  box-shadow:0 10px 22px rgba(255,122,26,.22),inset 0 1px 0 rgba(255,255,255,.18)!important;
}
.btn-opt, .prompt-template-search-btn, .prompt-template-new {
  transition:transform .16s ease,border-color .16s ease,background .16s ease,color .16s ease,box-shadow .16s ease!important;
}
.btn-opt:hover, .prompt-template-search-btn:hover, .prompt-template-new:hover {
  transform:translateY(-1px)!important;
  border-color:rgba(255,122,26,.46)!important;
  box-shadow:0 12px 26px rgba(255,122,26,.14)!important;
}
advisor compresses chat {
  grid-template-columns:clamp(600px,43vw,660px) minmax(280px,300px) minmax(260px,1fr) 72px!important;
  grid-template-rows:calc(100vh - 118px)!important;
  gap:10px!important;
  align-items:stretch!important;
}
then three columns: workspace, advisor {
  grid-template-columns:clamp(620px,52vw,720px) 320px minmax(320px,1fr)!important;
  grid-template-rows:48px calc(100vh - 154px)!important;
  gap:10px!important;
  align-items:stretch!important;
}

@keyframes commerceAnalysisOrbitSpin{to{transform:rotate(360deg)}}

@keyframes commerceAnalysisCoreGlow{
  0%,100%{transform:scale(1);filter:brightness(1)}
  50%{transform:scale(1.055);filter:brightness(1.14)}
}

@keyframes commerceGeneratingAura{
  0%,100%{transform:translate3d(-4%,2%,0) rotate(0deg) scale(1);opacity:.72}
  50%{transform:translate3d(5%,-3%,0) rotate(18deg) scale(1.08);opacity:1}
}

@keyframes commercePurpleAura{
  0%{opacity:.95;transform:translate(-50%,-50%) scale(0)}
  65%{opacity:.72;transform:translate(-50%,-50%) scale(18)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(26)}
}
/* Detail page mode: 9:16 tall thumbnail — same as default {
  aspect-ratio:9/16!important;
}
single upload border {
  padding-top:18px!important;
  scroll-margin-top:18px!important;
}

@keyframes commerceAnalyzeGlow{
  from{transform:translate3d(-5%,0,0) scale(1)}
  to{transform:translate3d(5%,0,0) scale(1.06)}
}
/* Show draft-no, draft-title {
  display:flex!important;
  position:absolute!important;
  top:4px!important;
  left:4px!important;
  width:22px!important;
  height:22px!important;
  border-radius:5px!important;
  background:rgba(0,0,0,.65)!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:800!important;
  align-items:center!important;
  justify-content:center!important;
  z-index:2!important;
}
full-height preview {
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  align-items:center!important;
}
/* Awaiting-analysis uses a different page state {
  grid-template-columns:minmax(0,1fr) 316px!important;
}
/* ===== [2026-07-06 v10] 清晰度/数量改为滑块 + intake左360px固定 + 分屏1:1 + 大图max280px ===== */

/* ---- 整体比例缩小，100%缩放显示完整 ---- */
/* Desktop uses the same visual density as an 80% browser zoom, while retaining
   normal browser zoom controls for users who need a larger interface. */
html {zoom:.8}
@media (max-width:980px) {
html {zoom:1}
}
body.light-theme .app {width:min(1440px,calc(100% - 24px))!important;padding-top:10px!important}
.app {width:min(1140px,calc(100% - 32px))!important;padding:14px 0 56px!important}
/* 顶部导航条紧凑化 */
.topbar {padding:8px 10px!important;gap:10px!important}
body.light-theme .topbar {height:60px!important;padding:0 16px!important;grid-template-columns:180px minmax(0,1fr)!important}
body.light-theme .topbar-actions {gap:20px!important}
body.light-theme .sidebar-nav {gap:20px!important}
/* ---- 问题3：inline-controls 缩放时重叠修复 ---- */
/* 核心策略：三列按比例分配，尺寸~55%，清晰度~22%，数量~22%，竖排按钮给够宽度 */
.inline-controls {
  grid-template-columns:2.5fr 1fr 1fr!important;
  gap:10px!important;
  min-width:0!important;
}
/* 尺寸按钮网格 */
#size-group {
  grid-template-columns:repeat(6,minmax(34px,1fr))!important;
  gap:5px!important;
}
#size-group .btn-opt {
  height:46px!important;
  min-width:0!important;
  padding:3px 4px!important;
  font-size:11px!important;
  gap:2px!important;
}
#size-group .btn-opt::before {
  width:18px!important;
  height:13px!important;
}
#size-group .btn-opt[data-val="1:1"]::before {width:16px!important;height:16px!important}
#size-group .btn-opt[data-val="16:9"]::before {width:22px!important;height:12px!important}
#size-group .btn-opt[data-val="9:16"]::before {width:12px!important;height:22px!important}
#size-group .btn-opt[data-val="4:3"]::before {width:20px!important;height:14px!important}
#size-group .btn-opt[data-val="3:4"]::before {width:14px!important;height:20px!important}
/* 清晰度+数量：滑块选择器，省空间不溢出 */
.slider-group {
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:6px 10px!important;
  border:1px solid var(--line)!important;
  border-radius:8px!important;
  background:rgba(255,255,255,.035)!important;
  height:44px!important;
  width:auto!important;
  min-width:0!important;
}
body.light-theme .slider-group {
  background:rgba(255,255,255,.72)!important;
  border-color:rgba(17,24,39,.1)!important;
}
.slider-track {
  -webkit-appearance:none!important;
  appearance:none!important;
  width:100%!important;
  height:6px!important;
  border-radius:3px!important;
  background:rgba(255,122,26,.18)!important;
  outline:none!important;
  cursor:pointer!important;
  flex:1 1 auto!important;
  min-width:60px!important;
}
.slider-track::-webkit-slider-thumb {
  -webkit-appearance:none!important;
  appearance:none!important;
  width:18px!important;
  height:18px!important;
  border-radius:50%!important;
  background:var(--accent,#ff7a1a)!important;
  cursor:pointer!important;
  border:2px solid rgba(255,255,255,.3)!important;
  box-shadow:0 2px 6px rgba(255,122,26,.3)!important;
}
.slider-track::-moz-range-thumb {
  width:18px!important;
  height:18px!important;
  border-radius:50%!important;
  background:var(--accent,#ff7a1a)!important;
  cursor:pointer!important;
  border:2px solid rgba(255,255,255,.3)!important;
  box-shadow:0 2px 6px rgba(255,122,26,.3)!important;
}
.slider-val {
  font-size:14px!important;
  font-weight:850!important;
  color:var(--accent,#ff7a1a)!important;
  min-width:28px!important;
  text-align:center!important;
  flex:0 0 auto!important;
}
/* 分隔线微调 */

/* 中等屏幕适配 */
@media (max-width:1100px) {
  .inline-controls{gap:8px!important}
  #size-group .btn-opt{height:40px!important;font-size:10px!important}
  #size-group .btn-opt::before{width:15px!important;height:10px!important}
  #size-group .btn-opt[data-val="1:1"]::before{width:14px!important;height:14px!important}
  #size-group .btn-opt[data-val="16:9"]::before{width:18px!important;height:10px!important}
  #size-group .btn-opt[data-val="9:16"]::before{width:10px!important;height:18px!important}
  #size-group .btn-opt[data-val="4:3"]::before{width:17px!important;height:11px!important}
  #size-group .btn-opt[data-val="3:4"]::before{width:11px!important;height:17px!important}
  .slider-group{height:38px!important;padding:4px 8px!important}
  .slider-val{font-size:12px!important}
}
/* 窄屏时 inline-controls 变为堆叠布局 */
@media (max-width:860px) {
  .inline-controls{
    grid-template-columns:1fr!important;
    gap:10px!important;
  }
  .inline-controls .control-section:not(:first-child)::before{display:none!important}
  #size-group{grid-template-columns:repeat(6,1fr)!important}
}
/* 响应式断点补全 */
@media (max-width:1180px) {
  #page-commerce .commerce-page[data-phase="empty"],
  #page-commerce .commerce-page[data-phase="intake"],
  #page-commerce .commerce-page[data-phase="analyzing"],
  #page-commerce .commerce-page[data-phase="analyzed"]{
    grid-template-columns:1fr!important;
    grid-template-rows:auto!important;
  }
  #page-commerce .commerce-page[data-phase="empty"] .commerce-main,
  #page-commerce .commerce-page[data-phase="intake"] .commerce-main,
  #page-commerce .commerce-page[data-phase="analyzing"] .commerce-main,
  #page-commerce .commerce-page[data-phase="analyzed"] .commerce-main{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
  }
  #page-commerce .commerce-page[data-phase="empty"] .commerce-strategy,
  #page-commerce .commerce-page[data-phase="intake"] .commerce-strategy,
  #page-commerce .commerce-page[data-phase="analyzing"] .commerce-strategy,
  #page-commerce .commerce-page[data-phase="analyzed"] .commerce-strategy{
    height:auto!important;
  }
  #page-commerce .commerce-page[data-phase="preview"],
  #page-commerce .commerce-page[data-phase="detail"]{
    grid-template-columns:1fr!important;
    grid-template-rows:auto!important;
  }
  #page-commerce .commerce-page[data-phase="preview"] .commerce-preview-layout,
  #page-commerce .commerce-page[data-phase="detail"] .commerce-preview-layout{
    grid-template-columns:1fr!important;
  }
}
/* Final override: left = AI result/product info, center = plan display {
  grid-template-columns:330px minmax(560px,1fr) 330px!important;
  grid-template-rows:calc(100vh - 124px)!important;
  gap:16px!important;
}
body:not(.light-theme) .topbar .nav-item, body:not(.light-theme) .topbar .notice-trigger, body:not(.light-theme) .topbar .theme-toggle {
  color:#d6dee7!important;
  border-color:rgba(255,255,255,.11)!important;
  background:rgba(255,255,255,.045)!important;
}
body:not(.light-theme) .topbar .nav-item:hover, body:not(.light-theme) .topbar .notice-trigger:hover, body:not(.light-theme) .topbar .theme-toggle:hover {
  color:#fff6ed!important;
  border-color:rgba(255,142,61,.34)!important;
  background:rgba(255,122,26,.08)!important;
}
body:not(.light-theme) .topbar .nav-item.active {
  color:#ff8d3b!important;
  border-color:rgba(255,142,61,.30)!important;
  background:linear-gradient(135deg,rgba(255,122,26,.16),rgba(255,181,96,.08))!important;
}
/* The flow is a progress indicator {height:58px!important;padding:0 12px!important;gap:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
/* One shared canvas width for both themes. Older visual passes declared
   competing values; this final rule owns the layout contract. */
.app, body.light-theme .app, body:not(.light-theme) .app {width:min(1400px,calc(100% - 24px))!important}
/* White theme must use accessible ink {color:#5f6d79!important}
body.light-theme #page-generate .ref-stack-count {
  background:#111827!important;
  border:1px solid rgba(255,255,255,.9)!important;
  color:#fff!important;
  font-weight:900!important;
  box-shadow:0 3px 10px rgba(15,23,42,.2)!important;
}
body.light-theme #page-generate .ref-del {
  background:#111827!important;
  border-color:#fff!important;
  color:#fff!important;
  font-weight:900!important;
  box-shadow:0 2px 8px rgba(15,23,42,.28)!important;
}
body.light-theme #page-generate .ref-del:hover {
  background:linear-gradient(135deg,#f25c0d,#c2410c)!important;
}
/* Intake form: these selectors match the legacy dark rules exactly {
  color:#202b36!important;
  font-weight:900!important;
  opacity:1!important;
}
/* Image-generation resolution and count use the same violet slider system. */
body.light-theme #res-slider, body.light-theme #count-slider {
  -webkit-appearance:none!important;
  appearance:none!important;
  height:7px!important;
  border:0!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,#f25c0d,#ff9a5c)!important;
  accent-color:#f25c0d!important;
}
body.light-theme #res-slider::-webkit-slider-thumb, body.light-theme #count-slider::-webkit-slider-thumb {
  -webkit-appearance:none!important;
  appearance:none!important;
  width:18px!important;
  height:18px!important;
  border:3px solid #fff!important;
  border-radius:50%!important;
  background:#ff7a1a!important;
  box-shadow:0 4px 10px rgba(242,92,13,.34)!important;
  cursor:pointer!important;
}
body.light-theme #res-group .slider-val, body.light-theme #count-group .slider-val {
  background:linear-gradient(135deg,#f25c0d,#ff9a5c)!important;
  color:#fff!important;
  border-color:transparent!important;
  box-shadow:0 5px 12px rgba(242,92,13,.18)!important;
}
body.light-theme .topbar, body:not(.light-theme) .topbar {
  height:64px!important;
  min-height:64px!important;
  padding:0 20px!important;
  grid-template-columns:210px minmax(0,1fr)!important;
  align-items:center!important;
}
.topbar-actions, body.light-theme .topbar-actions, body:not(.light-theme) .topbar-actions, .sidebar-nav, body.light-theme .sidebar-nav, body:not(.light-theme) .sidebar-nav {
  height:100%!important;
  align-items:center!important;
  gap:24px!important;
}
.topbar .notice-trigger, .topbar .nav-item, .topbar .theme-toggle {
  height:64px!important;
  min-height:64px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
@media (max-width:980px) {
.topbar, body.light-theme .topbar, body:not(.light-theme) .topbar {height:auto!important;min-height:64px!important;padding:10px 14px!important}
.topbar .notice-trigger, .topbar .nav-item, .topbar .theme-toggle {height:42px!important;min-height:42px!important}
}
/* Top navigation stays lightweight: no large boxed buttons in either theme. */
.topbar .notice-trigger, .topbar .nav-item, .topbar .theme-toggle, body.light-theme .topbar .notice-trigger, body.light-theme .topbar .nav-item, body.light-theme .topbar .theme-toggle, body:not(.light-theme) .topbar .notice-trigger, body:not(.light-theme) .topbar .nav-item, body:not(.light-theme) .topbar .theme-toggle {
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
  box-shadow:none!important;
  transition:color .18s ease,transform .18s ease!important;
}
.topbar .notice-trigger:hover, .topbar .nav-item:hover, .topbar .theme-toggle:hover {
  transform:translateY(-1px)!important;
  background:transparent!important;
}
body:not(.light-theme) .topbar .notice-trigger:hover, body:not(.light-theme) .topbar .nav-item:hover, body:not(.light-theme) .topbar .theme-toggle:hover {color:#ff9a50!important}
body.light-theme .topbar .notice-trigger:hover, body.light-theme .topbar .nav-item:hover, body.light-theme .topbar .theme-toggle:hover {color:#7047d8!important}
/* Header follows the reference: independent pill controls, no enclosing bar. */
.topbar, body.light-theme .topbar, body:not(.light-theme) .topbar {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
.topbar .notice-trigger, .topbar .nav-item, .topbar .theme-toggle, body.light-theme .topbar .notice-trigger, body.light-theme .topbar .nav-item, body.light-theme .topbar .theme-toggle, body:not(.light-theme) .topbar .notice-trigger, body:not(.light-theme) .topbar .nav-item, body:not(.light-theme) .topbar .theme-toggle {
  height:42px!important;
  min-height:42px!important;
  padding:0 16px!important;
  border:1px solid rgba(148,163,184,.24)!important;
  border-radius:999px!important;
  background:rgba(15,23,42,.48)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 7px 18px rgba(0,0,0,.12)!important;
}
.topbar .nav-item.active::after {display:none!important}
.topbar .nav-item.active {color:#ff9a50!important;border-color:rgba(255,142,61,.45)!important;background:rgba(255,122,26,.14)!important}
body.light-theme .topbar .notice-trigger, body.light-theme .topbar .nav-item, body.light-theme .topbar .theme-toggle {
  background:rgba(255,255,255,.88)!important;
  border-color:#dde3ea!important;
  color:#536171!important;
  box-shadow:inset 0 1px 0 #fff,0 7px 18px rgba(15,23,42,.07)!important;
}
body.light-theme .topbar .nav-item.active {color:#c2410c!important;border-color:#ffd9c2!important;background:#fff1e8!important}
/* Keep node {
  height:96px!important;
  min-height:96px!important;
}
/* Step cards mirror the supplied reference: number medallion above {
  height:132px!important;
  min-height:132px!important;
  padding:6px 14px!important;
  gap:12px!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  background:transparent!important;
}
/* Reference-proportioned workflow tiles: squares {
  height:88px!important;
  min-height:88px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  padding:4px 10px!important;
}
/* Keep the compact workflow label below its number: no absolute positioning {
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
}
/* One continuous footer surface for attachment, count {
  background:#f3f5f7!important;
  border-radius:8px!important;
}
/* Two columns stay readable in the preview pane: compact visuals, dedicated
   text space {gap:10px!important;padding:14px!important}
/* ===== 2026-10-29 视觉统一:公告栏亮色可读性 / 滑块数值徽章 ===== */
body.light-theme .system-announcement {
  border-color: rgba(242, 92, 13, .18);
  background: linear-gradient(135deg, #fff7f1, #fffdf9);
  color: #7c4a24;
}
body.light-theme .system-announcement small { color: #9aa1ab; }
body.light-theme #res-group .slider-val, body.light-theme #count-group .slider-val {
  background: #fff !important;
  color: #f25c0d !important;
  border: 1.5px solid #ffd9c2 !important;
  box-shadow: none !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
}
body.light-theme #res-slider, body.light-theme #count-slider { margin-right: 2px !important; }

/* ===== 生成页芯片控件(参考即梦):模型/比例/清晰度/张数 ===== */
.gen-chip-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  flex-wrap: wrap;
  position: relative;
}
.gen-chip-label {
  flex: 0 0 auto;
  margin-right: 6px;
}
.gen-chip-wrap { position: relative; }
.gen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(17,24,39,.12);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text,#191919);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.gen-chip:hover { border-color: rgba(255,106,26,.45); }
.gen-chip-wrap.pop-open .gen-chip {
  border-color: #ff6a1a;
  box-shadow: 0 0 0 3px #fff1e8;
  color: #f25c0d;
}
.gen-chip-icon { width: 14px; height: 14px; color: #f25c0d; flex: 0 0 auto; }
.gen-chip-caret { font-size: 10px; color: #9aa1ab; }
.gen-chip b { font-weight: 600; }

.gen-pop {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 120;
  background: #fff;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(15,23,42,.16);
  padding: 14px;
  min-width: 240px;
}
.gen-pop.open { display: block; }
.gen-pop[hidden] { display: none !important; }
.gen-pop-title { font-size: 12px; font-weight: 700; color: #9aa1ab; margin-bottom: 10px; }
.gen-pop-body { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }

.gen-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-width: 260px;
}
.gen-ratio-grid button {
  border: 1px solid rgba(17,24,39,.1);
  background: #fafbfc;
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text,#191919);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all .12s;
}
.gen-ratio-grid button:hover { border-color: rgba(255,106,26,.5); background: #fff7f1; }
.gen-ratio-grid button.active { border-color: #ff6a1a; background: #fff1e8; color: #f25c0d; }
.ratio-ic { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: .8; }
.ic-11 { width: 16px; height: 16px; }
.ic-169 { width: 22px; height: 12px; }
.ic-916 { width: 12px; height: 22px; }
.ic-43 { width: 19px; height: 14px; }
.ic-34 { width: 14px; height: 19px; }
.ic-custom { border: 0; font-size: 16px; font-weight: 700; line-height: 22px; }

.gen-custom-row { display: flex; gap: 8px; margin-top: 10px; }
.gen-custom-row[hidden] { display: none !important; }
.gen-custom-row input {
  flex: 1;
  border: 1px solid rgba(17,24,39,.16);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}
.gen-custom-row input:focus { outline: none; border-color: #ff6a1a; box-shadow: 0 0 0 3px #fff1e8; }
.gen-custom-row button {
  border: 0;
  background: linear-gradient(135deg,#ff9a5c,#ff6a1a);
  color: #fff;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.gen-seg { display: flex; background: #f0f1f4; border-radius: 10px; padding: 3px; gap: 2px; }
.gen-seg button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #5c6470;
  cursor: pointer;
  font-family: inherit;
}
.gen-seg button.active { background: #fff; color: #f25c0d; box-shadow: 0 2px 8px rgba(15,23,42,.1); }

.gen-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.gen-model-item:hover { background: #fff7f1; }
.gen-model-item.active { background: #fff1e8; }
.gen-model-item.disabled { opacity: .45; cursor: not-allowed; }
.gen-model-item .gen-model-name, .gen-model-item button { font-weight: 600; color: var(--text,#191919); }
.gen-model-item button {
  border: 0; background: transparent; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: inherit; font-size: 13px;
  padding: 0;
}
.gen-model-cost { margin-left: auto; font-size: 11px; font-weight: 700; color: #f25c0d; background: #fff1e8; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* ===== 芯片栏布局:横排跨列 / 大生成按钮 / 摘要隐藏 / 旧框收敛 ===== */
#gen-chip-bar { grid-column: 1 / -1 !important; width: auto !important; }
.composer-control-bar { display: block !important; }
.composer-control-bar,
body:not(.light-theme) .composer-control-bar,
body.light-theme .composer-control-bar {
  margin: 0 !important;
  width: 100% !important;
  border: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 8px 12px !important;
}
body:not(.light-theme) .composer-control-bar {
  background: rgba(255,255,255,.035) !important;
  background-image: none !important;
  border-radius: 10px !important;
}
.composer-footer { display: block !important; padding: 0 !important; gap: 0 !important; border-top: 0 !important; }
.composer-actions {
  display: block !important;
  width: 100% !important;
  padding: 10px 12px 12px !important;
}
.selection-summary[hidden] { display: none !important; }
.gen-btn-big {
  width: 100% !important;
  min-height: 54px !important;
  font-size: 16.5px !important;
  border-radius: 12px !important;
  letter-spacing: 2px;
}
.gen-btn-big:active { transform: scale(.99); }

/* ===== 生成页分区标题统一(参考图片/图像描述/提示词模板库/生图参数/任务看板/生成结果) ===== */
#page-generate .card-title,
#page-generate .prompt-tools label,
#page-generate .prompt-library-toggle span,
#page-generate .ref-section > div:first-child label,
.gen-chip-label {
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}
#page-generate .card-title,
#page-generate .prompt-tools label,
#page-generate .ref-section > div:first-child label {
  color: var(--text) !important;
}
body:not(.light-theme) .gen-chip-label { color: var(--text, #fff7ef) !important; }
body.light-theme .gen-chip-label { color: #191919 !important; }

/* ===== 暗色模式:芯片与弹层 ===== */
body:not(.light-theme) .gen-chip {
  background: #26282d;
  border-color: #3a3d43;
  color: #e8eaed;
}
body:not(.light-theme) .gen-chip:hover { border-color: rgba(255,106,26,.65); }
body:not(.light-theme) .gen-chip-wrap.pop-open .gen-chip {
  border-color: #ff6a1a;
  box-shadow: 0 0 0 3px rgba(255,106,26,.16);
  color: #ff9a5c;
}
body:not(.light-theme) .gen-chip-caret { color: #8a8f98; }
body:not(.light-theme) .gen-pop {
  background: #1e2126;
  border-color: #33363c;
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
}
body:not(.light-theme) .gen-pop-title { color: #8a8f98; }
body:not(.light-theme) .gen-ratio-grid button {
  background: #26282d;
  border-color: #3a3d43;
  color: #e8eaed;
}
body:not(.light-theme) .gen-ratio-grid button:hover { border-color: rgba(255,106,26,.6); background: #2c231b; }
body:not(.light-theme) .gen-ratio-grid button.active { background: #3a2415; border-color: #ff6a1a; color: #ff9a5c; }
body:not(.light-theme) .gen-seg { background: #26282d; }
body:not(.light-theme) .gen-seg button { color: #a0a5ad; }
body:not(.light-theme) .gen-seg button.active { background: #3a3d43; color: #ff9a5c; box-shadow: none; }
body:not(.light-theme) .gen-model-item:hover { background: #2a2d33; }
body:not(.light-theme) .gen-model-item.active { background: #3a2415; }
body:not(.light-theme) .gen-model-item .gen-model-name,
body:not(.light-theme) .gen-model-item button { color: #e8eaed; }
body:not(.light-theme) .gen-model-cost { background: #3a2415; color: #ff9a5c; }
body:not(.light-theme) .gen-custom-row input { background: #26282d; border-color: #3a3d43; color: #e8eaed; }
body:not(.light-theme) .gen-custom-row button { color: #fff; }
