:host{font:13px/1.6 Inter,"Microsoft YaHei",sans-serif;color:#45414c}
*{box-sizing:border-box}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}
button{color:inherit;background:#fff;border:1px solid #e3ddea;border-radius:9px;padding:6px 10px;cursor:pointer}
button:hover:not(:disabled){background:#f4f1f8}button:disabled{opacity:.4;cursor:default}
button:focus-visible,a:focus-visible{outline:2px solid #aa8dcd;outline-offset:2px}
input,textarea,select{min-width:0;color:#45414c;background:#fff;border:1px solid #e3ddea;border-radius:9px;padding:9px;outline:none}
input:focus,textarea:focus,select:focus{border-color:#e3ddea}textarea{resize:vertical;min-height:90px}a{color:#45414c}
.panel{position:fixed;z-index:170;left:var(--media-panel-left,5px);top:var(--media-panel-top,5px);bottom:auto;width:var(--media-panel-width,400px);height:var(--media-panel-height,calc(100dvh - 89px));display:flex;flex-direction:column;background:#fff;border:1px solid #e3ddea;border-radius:20px;box-shadow:0 12px 40px #29213318;overflow:hidden;contain:layout style}
[hidden]{display:none!important}.head{display:flex;align-items:center;gap:12px;padding:15px 16px 11px}.head h2{font-size:21px;line-height:30px;margin:0;flex:1;color:#45414c}.back{background:none;border:0;font-size:24px;padding:0 5px}.upload{font-weight:600;color:#77608d}
.tabs{display:flex;gap:5px;padding:0 16px 12px}.tabs button{flex:1;color:#45414c;border-color:transparent}.tabs button[aria-selected=true]{background:#eee8f6;color:#77608d;border-color:#c7b6df}
.tools{padding:0 16px}.search{width:100%;border-radius:20px;padding:8px 13px;background:#fff}.meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;font-size:11px;color:#857b91}.meta a{white-space:nowrap}.status{padding:8px 16px;font-size:11px;color:#857b91;white-space:pre-wrap;overflow-wrap:anywhere}.status.error{color:#b45e6a}
.scroll{min-height:0;flex:1;overflow-y:auto;padding:0 16px 18px;scrollbar-width:thin;scrollbar-color:#c9bfd6 transparent}.folder{display:flex;align-items:center;gap:7px;padding:6px 10px;width:100%;background:none;border-color:transparent;text-align:left;font-weight:600;color:#45414c}.folder.active{background:#eee8f6;color:#77608d}.folder .name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder small{color:#857b91;font-size:10px}.folderline{display:flex;align-items:center;margin:2px 0}.folderline .folder{min-width:0}.folderedit{border:0;background:none;padding:4px 6px;font-size:10px;color:#45414c}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:10px;margin:10px 0 15px}.card{min-width:0;border:1px solid #e3ddea;border-radius:12px;background:#fff;overflow:hidden}.picture{display:block;width:100%;padding:0;border:0;background:#fff;border-radius:0;aspect-ratio:1;overflow:hidden}.picture img{display:block;width:100%;height:100%;object-fit:contain}.title{display:block;padding:7px 8px 1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#45414c}.card small{display:block;padding:0 8px;color:#857b91;font-size:10px}.actions{display:flex;gap:4px;flex-wrap:wrap;padding:7px}.actions button{font-size:10px;padding:3px 6px;flex:1;white-space:nowrap}.empty{padding:22px 10px;text-align:center;font-size:12px;color:#857b91}.empty p{margin:5px 0}.footer{padding:10px 16px;border-top:1px solid #e3ddea;display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:10px;color:#857b91}.footer button{font-size:10px}.more{display:block;width:100%;margin:12px 0}.tag{color:#77608d}
.overlay{position:fixed;inset:0;z-index:180;display:grid;place-items:center;background:#28233055;padding:18px;backdrop-filter:none}.dialog{width:min(510px,100%);max-height:calc(100dvh - 36px);overflow:auto;background:#fff;border:1px solid #e3ddea;border-radius:17px;padding:20px;box-shadow:0 20px 80px #29213318}.dialog h3{font-size:17px;margin:0 0 6px;color:#45414c}.dialog p{font-size:11px;color:#45414c;margin:8px 0}.dialog label{display:block;margin:12px 0 0;font-size:12px}.dialog input:not([type=file]),.dialog textarea,.dialog select{display:block;width:100%;margin-top:5px}.dialog input[type=file]{display:block;width:100%;font-size:12px;margin-top:5px}.dialog .buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.primary{background:#e8def4;color:#77608d;border-color:#c7b6df}.primary:hover:not(:disabled){background:#e8def4}.preview{display:block;max-width:100%;max-height:260px;margin:15px auto 8px;object-fit:contain;border-radius:10px}.formerror{color:#b45e6a;font-size:12px;white-space:pre-wrap}.description{white-space:pre-wrap;font-size:12px;overflow-wrap:anywhere}.dialog .stats{color:#45414c;font-size:10px}.check{font-size:11px!important}.check input{width:auto!important;display:inline!important;margin-right:6px!important}.foldertitle{color:#45414c;font-size:11px;margin:11px 8px 5px}
@media(max-height:650px){.panel{bottom:auto}.head{padding-top:10px;padding-bottom:7px}.tabs{padding-bottom:7px}.status{padding-top:4px;padding-bottom:5px}}
@media(max-width:480px){.panel{bottom:auto}.dialog{padding:16px}.grid{gap:8px}}

/* Stable loading area and fixed-size thumbnails prevent list flicker. */
.status{min-height:31px}.picture{position:relative}.picture img:not([src]){visibility:hidden}.thumbnail-placeholder{position:absolute;inset:0;display:grid;place-items:center;padding:10px;color:#857b91;font-size:11px;pointer-events:none}.card{contain:layout style}

/* Four sides and corners resize the fixed panel while keeping card nodes alive. */
.head,.tabs,.tools,.status,.footer{flex-shrink:0}
.footer{padding-bottom:19px;flex-wrap:wrap}.footer>span{flex:1;min-width:120px}
.resize-handle{position:absolute;z-index:3;display:flex;align-items:center;justify-content:center;touch-action:none;outline:none}
.resize-handle span{display:grid;place-items:center;width:6px;height:46px;border:1px solid #e3ddea;border-radius:6px;background:#fff;color:#45414c;font-size:15px;line-height:1;pointer-events:none}
.resize-handle[data-resize=e],.resize-handle[data-resize=w]{top:22px;bottom:22px;width:13px;cursor:ew-resize}
.resize-handle[data-resize=e]{right:0}.resize-handle[data-resize=w]{left:0}
.resize-handle[data-resize=n],.resize-handle[data-resize=s]{left:22px;right:22px;height:13px;cursor:ns-resize}
.resize-handle[data-resize=n]{top:0}.resize-handle[data-resize=s]{bottom:0}
.resize-handle[data-resize=n] span,.resize-handle[data-resize=s] span{width:46px;height:6px;font-size:13px;line-height:0}
.resize-handle[data-resize=ne],.resize-handle[data-resize=nw],.resize-handle[data-resize=se],.resize-handle[data-resize=sw]{width:22px;height:22px;z-index:4}
.resize-handle[data-resize=ne]{right:0;top:0;cursor:nesw-resize}.resize-handle[data-resize=nw]{left:0;top:0;cursor:nwse-resize}
.resize-handle[data-resize=se]{right:0;bottom:0;cursor:nwse-resize}.resize-handle[data-resize=sw]{left:0;bottom:0;cursor:nesw-resize}
.resize-handle[data-resize=ne] span,.resize-handle[data-resize=nw] span,.resize-handle[data-resize=se] span,.resize-handle[data-resize=sw] span{width:8px;height:8px;border-width:0 2px 2px 0;border-radius:0;background:transparent;font-size:0}
.resize-handle[data-resize=ne] span{transform:rotate(-90deg)}.resize-handle[data-resize=nw] span{transform:rotate(180deg)}.resize-handle[data-resize=sw] span{transform:rotate(90deg)}
.resize-handle:hover span,.resize-handle:focus-visible span{background:#f4f1f8;border-color:#e3ddea;color:#45414c}
.resize-handle:focus-visible{background:#fff;outline:1px solid #aa8dcd;outline-offset:-2px;border-radius:8px}
:host([data-resizing]) .panel{user-select:none;cursor:var(--media-resize-cursor,ew-resize)}
:host([data-resizing]) .picture{pointer-events:none}
@media(pointer:coarse){.resize-handle[data-resize=e],.resize-handle[data-resize=w]{width:17px}.resize-handle[data-resize=n],.resize-handle[data-resize=s]{height:17px}}

.scene-product-link{margin:0 14px 8px;padding:10px 12px;border:1px solid #c7b6df;border-radius:10px;background:#eee8f6;color:#77608d}
.scene-product-link label{display:flex;gap:7px;align-items:center;font-size:12px;cursor:pointer}.scene-product-link input{accent-color:#a58ac8}.scene-product-link small{display:block;margin-top:5px;font-size:10px;line-height:1.7;color:#77608d;overflow-wrap:anywhere}
.actions [data-replace-scene]{color:#45414c;border-color:#e3ddea}

[data-white-create]{grid-column:1/-1;color:#45414c!important;background:#fff!important;border-color:#e3ddea!important}
[data-color-replace]{grid-column:1/-1;color:#45414c!important;background:#fff!important;border-color:#e3ddea!important}
[data-subject-color]{grid-column:1/-1;color:#45414c!important;background:#fff!important;border-color:#e3ddea!important}

.resize-handle span{background:#c8b6df;border-color:#bda4d7}.resize-handle:hover span,.resize-handle:focus-visible span{background:#aa8dcb}
