/* WB-UI-02 visual layer.
 *
 * Scope: presentation only. Every selector that existed before is still here
 * with the same name, so no markup contract, id, form name, event binding or
 * route changes. New rules are additive: design tokens, the inline icon sizing
 * contract (.ico), and a few layout wrappers used by the cards.
 */

:root{
  --bg:#f4f5f8;
  --surface:#ffffff;
  --surface-2:#fbfbfd;
  --text:#171a21;
  --secondary:#5b6472;
  --muted:#8a92a2;
  --border:#e7e9ef;
  --border-2:#eef0f5;
  --primary:#4f46e5;
  --primary-ink:#4338ca;
  --soft:#eef0ff;
  --soft-2:#f4f5f9;
  --ok:#0b7a45;
  --danger:#b32318;
  --radius:12px;
  --radius-sm:9px;
  --radius-xs:7px;
  --shadow-1:0 1px 2px rgba(16,24,40,.05);
  --shadow-2:0 10px 28px -14px rgba(16,40,64,.30);
  --ring:0 0 0 3px rgba(79,70,229,.16);
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font:14px/1.6 'Microsoft YaHei','Segoe UI',sans-serif;min-width:1100px}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}

/* ---- inline icon contract: one size, one weight, always currentColor ---- */
.ico{display:block;flex:0 0 auto}

.app{display:flex;min-height:100vh}
.sidebar{width:236px;flex:0 0 236px;background:var(--surface);border-right:1px solid var(--border);position:sticky;top:0;height:100vh;display:flex;flex-direction:column}
.brand{padding:18px 18px 14px;border-bottom:1px solid var(--border)}
.brand h1{font-size:14.5px;margin:0;letter-spacing:-.01em}
.brand p{margin:4px 0 0;color:var(--muted);font-size:11.5px}

nav{padding:10px 12px 6px;display:flex;flex-direction:column;gap:2px}
.nav-group{font-size:11px;font-weight:600;letter-spacing:.05em;color:var(--muted);padding:14px 10px 6px}
.nav-group:first-child{padding-top:4px}
.nav-item{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:0;border-radius:var(--radius-sm);text-align:left;background:transparent;color:var(--secondary);margin:0;font-size:13.5px;line-height:1.4;text-decoration:none;transition:background .14s ease,color .14s ease}
.nav-item .ico{color:#98a0b0;transition:color .14s ease}
.nav-item:hover{background:var(--soft-2);color:var(--text)}
.nav-item:hover .ico{color:var(--secondary)}
.nav-item.active{background:var(--soft);color:var(--primary-ink);font-weight:600}
.nav-item.active .ico{color:var(--primary)}
.nav-item:focus-visible{outline:none;box-shadow:var(--ring)}

.sidebar-foot{margin-top:auto;padding:14px 16px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:12px}

main{flex:1;min-width:0}
header{position:sticky;top:0;z-index:15;background:var(--surface);padding:14px 24px;border-bottom:1px solid var(--border);display:flex;gap:12px;align-items:center}
header strong{font-size:16px;letter-spacing:-.01em}
#save-state{color:var(--secondary);font-size:12px}
.spacer{flex:1}
.content{max-width:1600px;padding:20px 24px 64px}
.intro{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:18px}
h2{font-size:19px;margin:0 0 4px;letter-spacing:-.01em}
.intro p{margin:0;color:var(--secondary);font-size:13px}

.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-1)}
.card-h{display:flex;align-items:center;gap:9px;padding:12px 16px;border-bottom:1px solid var(--border-2);background:var(--surface-2);border-radius:calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0}
.card-h h3{font-size:13.5px;margin:0;font-weight:600;letter-spacing:.01em}
.card-h .ico{color:var(--muted)}
.card-b{padding:16px}
.workspace{display:grid;grid-template-columns:minmax(460px,1fr) minmax(300px,.8fr);gap:16px}

label{display:block;font-size:12.5px;font-weight:600;margin:14px 0 6px;color:#333a47}
label:first-child{margin-top:0}
input:not([type=file]),select,textarea{width:100%;padding:9px 11px;border:1px solid var(--border);border-radius:var(--radius-sm);background:#fcfcfd;font-size:13.5px}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);background:#fff;box-shadow:var(--ring)}
textarea{resize:vertical}
.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);padding:8px 13px;color:var(--secondary);font-size:13px;line-height:1.35;transition:background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease}
.btn .ico{color:#98a0b0}
.btn:hover{background:var(--soft-2);color:var(--text);border-color:#d9dce5}
.btn:hover .ico{color:var(--secondary)}
.btn:focus-visible{outline:none;box-shadow:var(--ring)}
.btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)}
.btn.primary .ico{color:#fff}
.btn.primary:hover{background:var(--primary-ink);border-color:var(--primary-ink);color:#fff}
.btn.primary:hover .ico{color:#fff}
.btn-sm{padding:5px 10px;font-size:12px;border-radius:var(--radius-xs);gap:6px}
button:disabled{opacity:.5;cursor:not-allowed}
.actions{display:flex;gap:9px;margin-top:20px;flex-wrap:wrap}

.chip{display:inline-flex;align-items:center;gap:5px;font-size:11px;line-height:1.7;border-radius:999px;padding:1px 9px;background:var(--soft);color:var(--primary-ink);border:1px solid #e2e3fb}
.required{color:#d92d20}
.hint{margin:7px 0;color:var(--muted);font-size:12px}

.result{min-height:320px}
.empty{display:block;text-align:center;color:var(--muted);padding:40px 12px;font-size:13px}
.empty .ico{display:block;margin:0 auto 10px;color:#c3c9d8}
.empty h3{font-size:15px;color:var(--secondary);margin:0 0 4px}
.empty p{margin:0}
.outline{display:flex;justify-content:center;margin-bottom:8px;color:#c8ccdd}

.history{margin-top:20px}
.draft-entry{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border-2)}
.draft-entry:last-child{border-bottom:0}
.draft-entry small{display:block;color:var(--muted);font-size:12px}
.image-list{display:flex;gap:10px;flex-wrap:wrap}
.image-item{width:110px;position:relative}
.image-item img{width:110px;height:100px;object-fit:contain;background:#fafbfc;border:1px solid var(--border);border-radius:var(--radius-sm)}
.image-item button{position:absolute;right:3px;top:3px;border:1px solid var(--border);background:#fff;border-radius:6px;line-height:1.2;padding:1px 6px}
.image-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.prompt-card{margin-top:16px}
pre{padding:14px 16px;white-space:pre-wrap;overflow-wrap:anywhere;font:12.5px/1.7 Consolas,'Microsoft YaHei',monospace;background:var(--surface-2);margin:0;border-radius:0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px)}
#notice:not(:empty){padding:10px 14px;border-radius:var(--radius-sm);margin-bottom:14px;background:#e9f7ef;color:var(--ok);border:1px solid #cfeadc;font-size:13px}
#notice.error{background:#fdeceb;color:var(--danger);border-color:#f6d4d1}

[hidden]{display:none!important}
[type=checkbox]{width:auto}
.check{display:flex;align-items:flex-start;gap:8px;font-weight:400}
dialog{border:1px solid var(--border);border-radius:var(--radius);padding:24px;max-width:600px;box-shadow:var(--shadow-2)}
dialog::backdrop{background:#1b1f2760}
.generated-image{display:block;width:100%;max-height:460px;object-fit:contain;margin:12px 0}

.job-item{padding:12px 0;border-bottom:1px solid var(--border-2)}
.job-item:last-child{border-bottom:0}
.job-item>strong{display:block;font-size:13px;margin-bottom:2px}
.job-item p{white-space:pre-wrap;overflow-wrap:anywhere;margin:2px 0}
.job-error{color:var(--danger);font-size:12.5px}
.job-meta{font-size:12px;color:var(--muted)}

#generation-plan{white-space:pre-wrap;max-height:240px;overflow:auto}
.check input[type=checkbox]{width:auto;flex:0 0 auto;margin:4px 0;padding:0}

#data-jobs details{padding:9px 0;border-top:1px solid var(--border-2)}
#data-jobs summary{cursor:pointer;font-size:13px;color:var(--secondary)}
#data-jobs details>div{padding:4px 12px;overflow-wrap:anywhere}
#data-history .job-item div{padding:3px 0}
.data-cover{display:block;max-width:240px;max-height:240px;object-fit:contain;margin:10px 0;background:#fafbfc;border:1px solid var(--border);border-radius:var(--radius-sm)}
.picture-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px;margin:16px 0}.picture-card{padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}.picture-thumb{display:block;width:100%;height:210px;object-fit:contain;background:var(--surface-2);border-radius:8px}
.safe-preview-banner{padding:10px 24px;background:#fff4da;color:#805b18;font-size:12px}
.link-out{display:inline-flex;align-items:center;gap:5px;color:var(--primary);text-decoration:none;font-size:13px}
.link-out:hover{text-decoration:underline}
.link-out .ico{color:currentColor}

/* ---- settings dock stays pinned to the bottom of the sidebar ---- */
.settings-dock{position:relative;z-index:20}
.settings-toggle{padding:6px 9px;font-size:12px;gap:6px;border-radius:var(--radius-xs)}
.settings-toggle .ico{color:var(--muted)}
.settings-toggle.active{color:var(--primary-ink);background:var(--soft);border-color:#e2e3fb}
.settings-toggle.active .ico{color:var(--primary)}
.settings-menu{position:absolute;right:0;bottom:100%;width:190px;margin-bottom:10px;padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-2);display:flex;flex-direction:column;gap:2px}
.settings-workspace{grid-template-columns:minmax(460px,800px)}

/* ---- overview metric cards ---- */
.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(200px,1fr));gap:14px;margin:16px 0}
.metric-card{padding:15px 16px}
.metric-head{display:flex;align-items:center;gap:8px;color:var(--secondary)}
.metric-head .ico{color:var(--muted)}
.metric-card small{font-size:12px;font-weight:600;letter-spacing:.01em}
.metric-card strong{display:block;font-size:26px;line-height:1.15;margin:6px 0 2px;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.metric-card .hint{margin:0;font-size:11.5px;color:var(--muted)}

/* ---- data cards ---- */
.data-grid{display:grid;grid-template-columns:repeat(2,minmax(340px,1fr));grid-auto-rows:8px;gap:16px;margin:16px 0;align-items:start}
.data-grid>.card{width:100%;margin:0;box-sizing:border-box;align-self:start}
.data-grid>.empty{grid-column:1/-1}
.query-record-dialog{width:min(960px,90vw);max-height:85vh;overflow:auto;border:1px solid #e5e7eb;border-radius:16px;padding:20px;color:inherit}
.query-record-dialog::backdrop{background:rgba(20,30,50,.3)}
.review-task-link{display:block;padding:0;margin-top:8px;border:0;background:none;color:#2563eb;font:inherit;font-size:12px;cursor:pointer;text-align:left}
.review-task-link:hover{text-decoration:underline}
.review-task-link:focus-visible{outline:2px solid #2563eb;outline-offset:3px}
.query-record-dialog>.btn{float:right;margin-bottom:12px}
.query-record-dialog>.card{clear:both;margin:0}
.watch-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.watch-panels>.card{margin:0;min-width:0}
.watch-panels .card-h .btn{margin-left:auto}
@media(max-width:900px){.watch-panels{grid-template-columns:minmax(0,1fr)}}
.data-grid>.card:only-child,.data-grid>.live-card{grid-column:1/-1}
body:has(#data-form){min-width:0}
#watch-form fieldset{border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 12px;margin:12px 0}
#watch-form fieldset legend{font-size:12px;color:var(--secondary);padding:0 4px}
#watch-form fieldset .check{display:inline-flex;align-items:center;gap:6px;margin:4px 18px 4px 0}
body:has(#data-form) header{flex-wrap:wrap}
body:has(#data-form) header strong,body:has(#data-form) header .btn,body:has(#data-form) header .chip{white-space:nowrap;flex-shrink:0}
body:has(#data-form) .data-grid{grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr))}
@media(max-width:740px){body:has(#data-form) .sidebar{width:180px;flex-basis:180px}body:has(#data-form) .content{padding-left:12px;padding-right:12px}}
.live-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;min-width:0}
.live-layout>*{grid-column:1/-1;min-width:0;margin:0}
.live-layout>.live-metric-section{grid-column:auto;padding:16px;border:1px solid var(--border,#e5e7eb);border-radius:12px}
.live-metric-section h3{margin:0 0 16px}
.live-layout table{border-collapse:collapse;text-align:left}
.live-layout th,.live-layout td{padding:10px 12px;border-bottom:1px solid #eceef5;vertical-align:top;overflow-wrap:anywhere}
@media(max-width:900px){.live-layout{grid-template-columns:minmax(0,1fr)}.live-layout>.live-metric-section{grid-column:1/-1}}
.card-meta{display:flex;align-items:center;gap:6px;margin:0 0 10px;color:var(--muted);font-size:11.5px}
.card-meta .ico{color:#aab1c0}
.data-tile{padding:13px 0;border-bottom:1px solid var(--border-2)}
.data-tile:last-child{border-bottom:0;padding-bottom:0}
.data-tile>strong{display:block;font-size:13px;font-weight:600;margin-bottom:4px}
.tile-metrics{display:grid;grid-template-columns:repeat(3,minmax(85px,1fr));gap:10px 12px;margin:10px 0 0}
.tile-metrics small{display:block;color:var(--muted);font-size:11px;margin-bottom:2px}
.tile-metrics strong{display:block;font-size:15px;font-variant-numeric:tabular-nums}
.card-h h3{min-width:0;overflow-wrap:anywhere;flex:1}
.type-badge{font-size:11px;padding:3px 8px;border-radius:20px;white-space:nowrap;align-self:center}
.type-note{background:#fff0db;color:#924900}.type-unknown{background:#edf0f5;color:#566274}
.shop-trend{margin:0 0 16px}.shop-trend .actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.shop-trend select{width:auto;max-width:100%;min-width:100px}.shop-trend select[aria-label="趋势商品与数据口径"]{max-width:420px}.trend-chart{width:100%;height:auto;max-height:300px;display:block;background:#fff}.daily-track-control{display:inline-flex;flex-direction:column;vertical-align:top;align-items:flex-start;gap:4px;margin:0}.daily-track-control small{font-size:11px;margin:0}.trend-chart circle:focus{outline:2px solid #222}
.card-action-row{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px;margin-top:10px}.card-action-row .btn{margin:0;min-height:28px}.card-action-row>.link-out{display:inline-flex;align-items:center;min-height:28px}.card-b>.daily-track-control{display:flex;margin:10px 0}
.product-panel{width:min(900px,92vw);max-height:88vh;overflow:auto}.product-panel-head{display:flex;justify-content:space-between;align-items:center;gap:16px}.product-panel-head h3{margin:0}.product-panel-item{padding:12px 0;border-bottom:1px solid var(--border-2)}.product-panel form{margin-top:16px}.product-panel label{display:block;margin:10px 0}.product-panel label select,.product-panel label input{display:block;width:100%;margin-top:5px}.product-panel .data-cover{max-height:320px;max-width:100%;object-fit:contain}
.data-tile>.type-badge{display:inline-block;margin:0 6px 10px 0}
.type-live{background:#e5f5ed;color:#247449}.type-video{background:#f0eafe;color:#7050b7}.type-product{background:#e8f1fc;color:#3269aa}.type-author,.type-shop{background:#edf0f5;color:#566274}
.record-details{margin-top:12px;padding-top:8px;border-top:1px solid var(--border-2);font-size:12px;color:var(--secondary)}
.record-details>summary{cursor:pointer;width:fit-content;padding:4px 0}
.record-details div,.record-details pre{max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.7}
.tile-metrics>div{min-width:0;overflow-wrap:anywhere}
.history-table{width:100%;border-collapse:collapse;font-size:12px;margin:12px 0}
.history-table th,.history-table td{text-align:left;padding:10px;border-bottom:1px solid var(--border-2);vertical-align:top;overflow-wrap:anywhere}
.history-table th{color:var(--muted);font-weight:500}.change-up{color:#247449}.change-down{color:#b14c4c}.change-flat{color:var(--muted)}

/* ---- collapsible query settings: one CSS chevron, no image request ---- */
.query-settings{margin:8px 0 16px;color:var(--secondary);font-size:12.5px}
.query-settings>summary{display:flex;align-items:center;gap:7px;width:fit-content;cursor:pointer;padding:6px 10px 6px 6px;border-radius:var(--radius-xs);list-style:none;transition:background .14s ease,color .14s ease}
.query-settings>summary::-webkit-details-marker{display:none}
.query-settings>summary::before{content:'';width:6px;height:6px;margin:0 3px 0 4px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform .16s ease}
.query-settings[open]>summary::before{transform:rotate(45deg)}
.query-settings>summary:hover{background:var(--soft-2);color:var(--text)}
.query-settings>summary:focus-visible{outline:none;box-shadow:var(--ring)}
.query-settings>.card{max-width:820px;margin-top:12px;color:var(--text);font-size:14px}
#overview-choices,#refresh-choices{padding:6px 0 12px}
.card-more{margin:6px 0 10px;border-top:1px solid var(--border-2)}
.card-more>summary{display:flex;align-items:center;justify-content:flex-end;gap:7px;cursor:pointer;list-style:none;color:var(--secondary);font-size:11.5px;padding:7px 0}
.card-more>summary::-webkit-details-marker{display:none}
.card-more>summary::after{content:'';width:6px;height:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg);margin-right:4px}
.card-more[open]>summary::after{transform:rotate(225deg)}
.card-more>summary:hover{color:var(--primary)}
.card-more>summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:4px}
.refresh-category{padding:7px 0;border-bottom:1px solid var(--border)}.refresh-category>summary{cursor:pointer}.refresh-category>summary .check{display:inline-flex;margin:0}.refresh-category small{font-weight:400;color:var(--muted)}.refresh-targets{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:6px 12px;padding:12px 22px}.refresh-targets .check{margin:2px 0}.refresh-targets .btn{padding:4px 10px;justify-self:start}
.video-type-tabs{display:flex;gap:10px;margin-bottom:18px}.required-video-fields{padding:14px 0}.required-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:12px;margin:12px 0}.required-metric{padding:14px;background:var(--surface-2);border:1px solid var(--border);border-radius:9px}.required-metric small{display:block;margin-bottom:8px;color:var(--secondary)}.required-metric strong{font-size:20px}.field-unavailable{color:#986c27;font-size:12px}
.data-tile .author-name-badge{display:inline-block;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;font-weight:600;max-width:100%;white-space:normal;overflow-wrap:anywhere;margin:0 0 10px;padding:4px 9px}
.product-trend{margin-top:12px;border-top:1px solid #e0e5ed;padding-top:12px}.product-trend>small{display:block;margin-top:4px}.product-trend .trend-chart text{font-size:24px;fill:#49556c}
#watch-form fieldset label:has(input[type="checkbox"]){display:inline-flex;align-items:center;gap:6px;margin-right:18px}
#watch-form fieldset label:has(input[type="checkbox"]) input{width:auto}
.draft-entry.watch-brand{display:block;padding:14px 0}
.watch-brand-header{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.watch-brand-header strong{min-width:0;overflow-wrap:anywhere}
.watch-children{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.watch-child{display:flex;align-items:center;gap:12px;margin:0;min-width:0;font-size:12px;line-height:1.5}
.watch-child span{min-width:0;overflow-wrap:anywhere}
.watch-child .btn{flex-shrink:0}
.shop-preview{display:block;width:fit-content;margin-top:8px;color:var(--primary,#5145e8);font-size:12px}
.shop-preview[hidden]{display:none}
.watch-optional{margin:12px 0;color:var(--muted);font-size:12px}
.watch-optional>summary{cursor:pointer;width:fit-content;padding:6px 0}
.watch-optional[open]>summary{margin-bottom:8px}
.watch-optional input{font-size:14px}
.update-dialog{width:min(560px,calc(100vw - 48px));max-height:80vh;padding:28px;border:1px solid var(--border,#e4e7f0);border-radius:16px;color:var(--text,#17223a);overflow:auto}
.update-dialog::backdrop{background:rgba(23,34,58,.35)}
.update-dialog h2{margin:0 0 12px;font-size:20px}
.update-dialog h3{font-size:16px;margin:20px 0 8px}
.update-dialog p{line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.update-dialog input[type=file]{display:block;margin-top:10px;max-width:100%}
.update-dialog section{border-top:1px solid var(--border,#e4e7f0);margin-top:18px}
.update-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}
.update-dialog .muted{color:var(--muted,#7d8ba5);font-size:12px}
.update-dialog details{margin-top:20px}
.update-dialog progress{width:100%;height:14px;accent-color:var(--primary,#5046e5)}
.update-dialog [data-queue]{padding-left:22px;font-size:13px;line-height:1.8;overflow-wrap:anywhere}
/* Main-photo composer follows the existing light workbench controls. */
.drawing-mode-tabs{display:flex;gap:8px;margin-bottom:16px}.reference-add{font-size:30px;min-width:64px;min-height:64px}.tryon-toolbar{display:flex;align-items:end;gap:14px;flex-wrap:wrap}.tryon-toolbar label{margin:0;min-width:90px}.image-item select{font-size:12px;max-width:100%}.tryon-composer{display:grid;grid-template-columns:112px minmax(0,1fr);gap:10px 18px}.tryon-composer>*{grid-column:1/-1}.tryon-composer #image-list{display:flex;flex-wrap:wrap;gap:10px}.tryon-composer #add-reference{grid-column:1;width:80px}.tryon-composer #prompt{min-height:120px}.tryon-composer .image-item{width:104px}.tryon-composer #tryon-settings{border-top:1px solid var(--border,#e4e7f0);padding-top:12px}.tryon-composer [hidden]{display:none!important}
.tryon-main{display:grid;grid-template-columns:180px minmax(0,1fr);gap:20px;background:var(--bg,#f6f7fb);border:1px solid var(--border,#e4e7f0);border-radius:12px;padding:18px}.tryon-main[hidden]{display:none}.tryon-references #image-list{max-height:280px;overflow:auto}.tryon-prompt textarea{height:100%;min-height:200px;box-sizing:border-box}.tryon-prompt{display:flex;flex-direction:column}.tryon-toolbar>div{min-width:180px;flex:1}@media(max-width:700px){.tryon-main{grid-template-columns:1fr}}
.workspace.tryon-workspace{grid-template-columns:minmax(0,1fr)}.tryon-workspace .tryon-main{grid-template-columns:160px minmax(0,1fr)}.tryon-workspace #notes{min-height:60px}
body:has(.tryon-workspace){min-width:0}.tryon-workspace .card,.tryon-workspace .tryon-main,.tryon-workspace .tryon-toolbar,.tryon-prompt{min-width:0}.tryon-toolbar select{max-width:100%}@media(max-width:900px){.tryon-workspace .tryon-main{grid-template-columns:110px minmax(0,1fr)}}
/* A single quiet input surface, matching the reference's visual hierarchy. */
body:has(.unified-composer){min-width:0}.workspace:has(.unified-composer){grid-template-columns:minmax(0,1fr)}.card:has(>.unified-composer){border:0;background:transparent;box-shadow:none}.card:has(>.unified-composer)>.card-h{display:none}
.unified-composer{background:var(--surface,#fff);border:1px solid var(--border,#e4e7f0);border-radius:20px;padding:18px 22px!important;display:block!important}.unified-composer .drawing-mode-tabs{margin:0 0 10px;gap:16px}.unified-composer .drawing-mode-tabs .btn{border:0;background:transparent;box-shadow:none;border-radius:0;padding:6px 0}.unified-composer .drawing-mode-tabs .primary{color:var(--primary,#5046e5);border-bottom:2px solid currentColor}
.unified-composer .tryon-main{background:transparent;border:0;padding:8px 0;grid-template-columns:116px minmax(0,1fr);gap:16px}.unified-composer #reference-label,.unified-composer label[for=prompt]{display:none}.unified-composer .tryon-prompt textarea{background:transparent;border:0;box-shadow:none;outline-offset:4px;min-height:130px;height:150px;padding:8px 0;resize:vertical;font-size:14px;line-height:1.8}.unified-composer #add-reference{min-height:64px;width:64px;border:1px dashed var(--border,#e4e7f0);background:var(--bg,#f6f7fb);border-radius:10px}.unified-composer #image-list{max-height:210px}.unified-composer>.hint{margin:4px 0;font-size:11px}.unified-composer .tryon-toolbar{border:0;padding:8px 0 0;gap:10px;align-items:center}.unified-composer .tryon-toolbar>label{min-width:64px;font-size:0}.unified-composer .tryon-toolbar select{background:transparent;border:0;max-width:260px;padding:6px;font-size:13px}.unified-composer .tryon-toolbar>div{display:flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0;flex-wrap:wrap}.unified-composer .tryon-toolbar>div>label{display:none}.unified-composer #model{max-width:240px}.unified-composer #generate{margin-left:auto;border-radius:10px}.unified-composer #detect-image-models,.unified-composer #tryon-preset{border:0;background:transparent;font-size:12px;padding:6px}.unified-composer .drawing-extra{margin-top:10px;font-size:12px;color:var(--muted,#7d8ba5)}.drawing-extra>summary{cursor:pointer}.drawing-extra textarea{margin-top:8px}.unified-composer>.actions:empty{display:none}.unified-composer .drawing-extra .row{display:block}.unified-composer .tryon-toolbar [hidden]{display:none!important}
@media(max-width:700px){.unified-composer .tryon-main{grid-template-columns:80px minmax(0,1fr)}.unified-composer{padding:14px!important}.unified-composer #model{max-width:160px}}
.unified-composer.tryon-composer #tryon-settings{border:0;padding-top:8px}.unified-composer .tryon-prompt textarea{min-height:100px;height:115px}.unified-composer .tryon-toolbar #model{width:auto;min-width:120px;max-width:230px}.unified-composer .tryon-toolbar>div{flex-wrap:nowrap}.unified-composer #image-model-detection:not(:empty){max-width:230px}.unified-composer #image-model-detection:empty{display:none}.unified-composer .tryon-toolbar{flex-wrap:wrap}
.drawing-history{margin-top:28px}.drawing-history-heading{display:flex;align-items:center;gap:12px;margin-bottom:14px}.drawing-history-heading h3{margin:0;font-size:16px}.drawing-history-entry{padding:0;margin:0 0 22px;border:0}.drawing-history-prompt{font-size:14px;line-height:1.8;margin:0 0 5px;white-space:pre-wrap;overflow-wrap:anywhere}.drawing-history-meta{color:var(--muted,#7d8ba5);font-size:12px;margin:0 0 12px}.drawing-history-images{display:flex;gap:8px;overflow:auto;margin:0 0 12px}.drawing-history-images img{display:block;max-height:460px;max-width:100%;width:auto;object-fit:contain;border-radius:8px}.drawing-history-entry>.actions{margin-top:8px}.drawing-history-entry>.actions .btn{font-size:12px;padding:7px 12px}.history-downloads{font-size:12px;color:var(--muted,#7d8ba5);margin-top:8px}.history-downloads>summary,.draft-archive>summary{cursor:pointer}.draft-archive{font-size:12px;color:var(--muted,#7d8ba5);margin:18px 0}.drawing-preset-editor{width:min(560px,calc(100vw - 48px));border:1px solid var(--border,#e4e7f0);border-radius:16px;padding:24px;color:var(--text,#192335);background:var(--surface,#fff)}.drawing-preset-editor::backdrop{background:#1f293766}.drawing-preset-editor input,.drawing-preset-editor textarea{box-sizing:border-box;width:100%;margin:8px 0}.unified-composer #drawing-preset{max-width:170px;font-size:13px}.unified-composer #edit-drawing-preset,.unified-composer #edit-drawing-preset+.btn{font-size:12px}.unified-composer .tryon-toolbar>.btn:not(.primary){border:0;background:transparent;padding:6px}
/* Keep constraints and advanced fields out of the compact composer. */
.unified-composer>.hint:not(#generation-cost-hint),#image-model-detection,.drawing-extra{display:none!important}.drawing-history-images img{width:calc((100% - (var(--image-count,1) - 1)*8px)/var(--image-count,1));flex:0 0 auto}.unified-composer #image-count{width:auto;min-width:58px}.unified-composer #generation-cost-hint{margin-top:8px;font-size:11px}
.drawing-history-heading-row{display:flex;align-items:flex-end;gap:10px;margin-bottom:10px}.drawing-history-copy{min-width:0;flex:1;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:23px}.drawing-history-copy .drawing-history-prompt{display:inline;white-space:normal;font-size:13px;line-height:23px;margin:0}.drawing-history-copy .drawing-history-meta{display:inline;margin:0 0 0 12px;font-size:12px;white-space:nowrap;line-height:23px}.history-info{border:0;background:transparent;color:var(--muted,#7d8ba5);font-size:12px;white-space:nowrap;padding:0;line-height:23px}.drawing-history-images{justify-content:flex-start;align-items:flex-start}.drawing-history-images img{width:auto;max-width:100%;max-height:440px;flex:0 1 auto;object-fit:contain;object-position:left top}.drawing-history-images:has(img:nth-child(2)) img{max-width:calc((100% - (var(--image-count,1) - 1)*8px)/var(--image-count,1))}.drawing-history-entry>.actions{display:flex;align-items:center;gap:6px}.drawing-history-entry>.actions .btn{display:inline-flex;align-items:center;gap:6px}.history-more{position:relative;font-size:13px}.history-more>summary{list-style:none;cursor:pointer;padding:5px 11px;border-radius:7px;background:var(--surface,#fff);border:1px solid var(--border,#e4e7f0);font-size:20px;line-height:20px}.history-more>summary::-webkit-details-marker{display:none}.history-more .history-delete{position:absolute;bottom:calc(100% + 6px);left:0;white-space:nowrap;box-shadow:0 4px 18px #19233518;z-index:2;color:var(--text,#192335);background:var(--surface,#fff);padding:10px 14px!important}.history-info-dialog p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8}

/* Reference fan: quiet thumbnails at rest, complete controls on hover/focus. */
.unified-composer .tryon-references{position:relative;display:flex;align-items:flex-start;gap:10px;width:96px;min-height:90px;z-index:2}
.unified-composer .tryon-references #image-list{order:1;max-height:none;overflow:visible}
.unified-composer .tryon-references #add-reference{order:2;flex:none}
.unified-composer .tryon-references.has-images #image-list{position:relative;width:88px;height:90px;display:block}
.unified-composer .tryon-references.has-images .image-item{position:absolute;left:calc(min(var(--reference-index),3)*5px);top:calc(min(var(--reference-index),3)*2px);width:64px;transform:rotate(-7deg);z-index:calc(10 - var(--reference-index))}
.unified-composer .tryon-references.has-images .image-item img{display:block;width:64px;height:76px;object-fit:cover;border:2px solid white;border-radius:5px;box-shadow:0 2px 6px #23304722}
.unified-composer .tryon-references.has-images #add-reference{position:absolute;right:3px;top:57px;z-index:20;min-height:28px;width:28px;height:28px;padding:0;border:1px solid var(--border);border-radius:50%;font-size:20px;background:var(--surface,#fff)}
.unified-composer .tryon-references .image-item button,.unified-composer .tryon-references .image-item select{visibility:hidden;opacity:0}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within){width:max-content;max-width:min(65vw,580px);background:var(--surface,#fff);border-radius:8px;padding:4px}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) #image-list{position:relative;display:flex;flex-wrap:wrap;gap:12px;width:auto;height:auto;max-width:min(52vw,480px);max-height:240px;overflow:auto;padding:6px}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) .image-item{position:relative;left:auto;top:auto;transform:none;flex:none;width:76px}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) .image-item img{width:76px;height:90px}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) #add-reference{position:static;margin-top:6px;min-height:76px;height:76px;width:55px;border-radius:7px;border-style:dashed;font-size:26px}
.unified-composer .tryon-references:is(:hover,:focus-within) .image-item button,.unified-composer .tryon-references:is(:hover,:focus-within) .image-item select{visibility:visible;opacity:1}
.unified-composer .tryon-references .image-item select{width:80px;font-size:11px;padding:3px 0;margin-top:4px}
.unified-composer .tryon-references .image-item button{right:-4px;top:-5px;width:19px;height:19px;border-radius:50%;padding:0;z-index:2}
@media(hover:none){.unified-composer .tryon-references .image-item button{visibility:visible;opacity:1}}
@media(prefers-reduced-motion:no-preference){.tryon-references .image-item{transition:transform .15s ease}}
.unified-composer .tryon-references.has-images #add-reference{min-width:28px}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) #image-list{flex:none;width:max-content;overflow-x:hidden}
.unified-composer .tryon-references.has-images:is(:hover,:focus-within) #add-reference{min-width:55px}
.unified-composer .tryon-references.has-images{height:90px;overflow:visible}
/* The reference fan overlays the prompt; neither grid tracks nor row height change. */
.drawing-preset-editor .preset-parameters{display:flex;gap:14px;flex-wrap:wrap;margin:14px 0}.drawing-preset-editor .preset-parameters label{display:flex;flex:1;min-width:100px;flex-direction:column;gap:6px}.drawing-preset-editor .preset-parameters select{width:100%}
.drawing-preset-editor .preset-parameters{align-items:flex-start}.drawing-preset-editor .preset-parameters label{margin:0}
.unified-composer.reference-dragging{outline:2px dashed var(--primary,#5046e5);outline-offset:4px;background:#f3f1ff}
/* Drawing notifications stay as quiet text, including failure explanations. */
body:has(#draft-form) #notice:not(:empty){padding:0;margin:0 0 14px;border:0;border-radius:0;background:transparent;color:var(--muted);box-shadow:none;font-size:13px;line-height:1.6}

/* Independent local API accounting page. */
.usage-summary{display:flex;gap:16px;flex-wrap:wrap;margin:18px 0}.usage-summary article{flex:1;min-width:230px;background:var(--surface,#fff);border:1px solid var(--border);border-radius:12px;padding:18px}.usage-summary strong{display:block;font-size:23px;margin:8px 0}.usage-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.usage-table-wrap{overflow:auto;background:var(--surface,#fff);border-radius:12px}#usage-table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:13px}#usage-table th,#usage-table td{padding:13px 16px;text-align:left;border-bottom:1px solid var(--border)}#usage-table th{color:var(--muted);font-weight:500}#usage-status{margin:14px 0}
.usage-actions{margin-top:14px}.usage-controls label{margin:0;min-width:180px}.usage-controls select{width:100%}

.usage-balance{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid var(--border);border-radius:12px;padding:22px 24px;margin-bottom:20px}.usage-balance-label{display:block;font-size:14px;font-weight:600;color:#475569}.usage-balance strong{display:inline-block;font-size:30px;line-height:1.5;color:#263448;font-weight:650;margin:5px 16px 0 0;font-variant-numeric:tabular-nums}.usage-balance-yuan{font-size:20px;color:#475569}.usage-balance-observed{font-size:13px;line-height:1.8;color:#64748b}.usage-balance-observed small{display:block;font-size:12px}.usage-evidence{white-space:normal!important;min-width:280px;max-width:380px;line-height:1.7}.usage-evidence strong,.usage-evidence span{display:block}.usage-evidence strong{font-size:12px;font-weight:500;color:#805b3c}.usage-evidence span{font-size:12px;color:#7b8495}

#usage-table{table-layout:fixed;white-space:normal;min-width:880px}#usage-table th,#usage-table td{padding:12px 10px;overflow-wrap:anywhere;vertical-align:top}#usage-table th:nth-child(1){width:14%}#usage-table th:nth-child(2){width:10%}#usage-table th:nth-child(3){width:17%}#usage-table th:nth-child(4){width:7%}#usage-table th:nth-child(5){width:8%}#usage-table th:nth-child(6){width:13%}#usage-table th:nth-child(7){width:31%}#usage-table .usage-evidence{min-width:0;max-width:none}

.drawing-image-hover-preview{position:fixed;inset:auto;margin:0;padding:0;border:0;border-radius:10px;overflow:hidden;z-index:2147483647;pointer-events:none;box-shadow:0 10px 40px #18213938;background:repeating-conic-gradient(#e4e7ed 0% 25%,#f6f7fa 0% 50%) 0/16px 16px}
.drawing-image-hover-preview[hidden]{display:none}.drawing-image-hover-preview.light-artwork{background:#17191d}
.drawing-image-hover-preview>img,.drawing-image-hover-preview>canvas{display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;margin:0}
.drawing-image-hover-preview::backdrop{background:transparent;pointer-events:none}

/* Generation cost and call details are shown in the confirmation dialog. */
#the-draft-form #generation-cost-hint, #generation-cost-hint{display:none!important;}

dialog.price-editor{width:min(360px,calc(100vw - 32px));max-width:360px;padding:20px;border:1px solid #e2e5ee;border-radius:12px}dialog.price-editor .price-editor-line{display:flex;align-items:center;gap:10px}dialog.price-editor .price-editor-line input{width:0;min-width:0;flex:1;margin:0}dialog.price-editor .price-editor-line span{white-space:nowrap;font-weight:600}dialog.price-editor .price-editor-line button{flex:none;margin:0}dialog.price-editor p{margin:10px 0 0;font-size:12px}

.drawing-image-hover-preview,.drawing-image-hover-preview>canvas{transition:none!important;animation:none!important;clip-path:none!important}

.drawing-image-hover-preview[data-quality]:not([data-quality=""])::after{content:attr(data-quality);position:absolute;bottom:8px;left:8px;padding:4px 8px;border-radius:5px;background:#fffE;color:#52617b;font:12px Arial;pointer-events:none}
