.sidebar-tabs{display:flex;gap:5px;margin-top:13px}.panel-title .sidebar-tabs button{margin:0;flex:1;width:auto;padding:calc(7px * var(--ui-density, 1)) calc(6px * var(--ui-density, 1))}.sidebar-tabs button.active{color:var(--accent);border-color:#6aa38e;background:#274139}.show-resources .search-wrap,.show-resources .filters,.show-resources .tree-hint,.show-resources #elementList,.show-resources .left-bottom,.show-resources #uploadBtn,.show-resources #reanalyzeBtn,.show-resources .reset-hint{display:none}#resourceBrowser{flex:1;overflow:auto;min-height:0;padding:0 12px 15px}#resourceBrowser[hidden]{display:none}.resource-tools{display:grid;grid-template-columns:1fr auto;gap:7px}.resource-tools input{grid-column:1/-1}.resource-tools select{min-width:0;padding:calc(6px * var(--ui-density, 1))}.resource-tools button{padding:calc(6px * var(--ui-density, 1)) calc(8px * var(--ui-density, 1));font-size:calc(11px * var(--ui-density, 1))}.resource-hint{font-size:calc(10px * var(--ui-density, 1));color:#91a9ab;line-height:1.8;overflow-wrap:anywhere}.resource-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.resource-card{padding:6px;min-width:0;white-space:normal;text-align:left;background:#172126}.resource-card img{width:100%;height:76px;object-fit:contain;display:block;background:repeating-conic-gradient(#304047 0% 25%,#243139 0% 50%) 50%/12px 12px;border-radius:4px}.resource-card strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(10px * var(--ui-density, 1));margin-top:5px;font-weight:400}.resource-card small{color:#8aa6a8;font-size:calc(9px * var(--ui-density, 1))}.resource-card.selected{border-color:var(--accent)}.resource-properties{border-top:1px solid #3b514e;margin-top:16px;padding-top:10px}.resource-properties h3{font-size:calc(13px * var(--ui-density, 1));color:#b5ddd0;margin:0 0 12px}.resource-properties select,.radial-options select{display:block;width:100%;margin-top:7px}.resource-properties .field{margin-bottom:12px}.resource-action-row{display:flex;gap:5px;flex-wrap:wrap}.resource-action-row button{font-size:calc(10px * var(--ui-density, 1));padding:calc(6px * var(--ui-density, 1)) calc(7px * var(--ui-density, 1))}.resource-properties details{margin-top:16px;padding-top:10px;border-top:1px solid var(--line)}.resource-properties summary{cursor:pointer;font-size:calc(12px * var(--ui-density, 1));color:#b6cfca;margin-bottom:10px}.slice-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.slice-grid label{font-size:calc(11px * var(--ui-density, 1));color:#9ab0b2}.slice-grid input{margin-top:4px;padding:calc(6px * var(--ui-density, 1))}.slice-sync{display:flex;gap:6px;align-items:flex-end;margin-top:8px;flex-wrap:wrap}.slice-sync label{flex:1 1 66px;min-width:58px;font-size:calc(11px * var(--ui-density, 1));color:#9ab0b2}.slice-sync input{margin-top:4px;padding:calc(6px * var(--ui-density, 1))}.slice-sync button{padding:calc(6px * var(--ui-density, 1)) calc(7px * var(--ui-density, 1));font-size:calc(10.5px * var(--ui-density, 1));white-space:nowrap}.state-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:10px 0}.state-tabs button{padding:calc(7px * var(--ui-density, 1)) calc(5px * var(--ui-density, 1));font-size:calc(11px * var(--ui-density, 1))}.state-tabs .active{background:#29483c;border-color:var(--accent);color:var(--accent)}.state-row{display:flex;align-items:center;justify-content:space-between;margin:7px 0;font-size:calc(11px * var(--ui-density, 1))}.state-row input{width:calc(70px * var(--ui-density, 1));height:calc(30px * var(--ui-density, 1));padding:calc(3px * var(--ui-density, 1))}.resource-dialog-image{display:block;width:100%;height:190px;object-fit:contain;background:repeating-conic-gradient(#34444b 0% 25%,#233239 0% 50%) 50%/16px 16px;border:1px solid var(--line);border-radius:8px;margin-bottom:16px}#resourceUseList{max-height:160px;overflow:auto;display:flex;gap:5px;flex-wrap:wrap}#resourceUseList button{font-size:calc(10px * var(--ui-density, 1));white-space:normal}#resourceDialog{max-width:620px}#resourceDialog .dialog-actions{flex-wrap:wrap;gap:7px}#resourceDialog .dialog-actions button{font-size:calc(12px * var(--ui-density, 1))}#nineSliceCanvas{width:100%;height:auto;touch-action:none;border:1px solid #4f6666;border-radius:5px;cursor:crosshair;background:repeating-conic-gradient(#34444b 0% 25%,#233239 0% 50%) 50%/12px 12px}.radial-options{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}.resource-properties [hidden],.radial-options [hidden]{display:none!important}#interactionPreviewBtn.active{color:#8fe4cc;background:#2b4c3e;border-color:#69ac94}

.show-resources .panel-title h2{display:none}.show-resources #autoSplitBtn{display:none}

.resource-dedup-tools{border:1px solid var(--line);border-radius:6px;padding:8px;margin:10px 0}.resource-dedup-tools>button{width:100%;margin-top:7px;font-size:calc(11px * var(--ui-density, 1));padding:calc(7px * var(--ui-density, 1))}.resource-scan-row{display:flex;gap:5px;align-items:center;margin-top:10px}.resource-scan-row label{font-size:calc(10px * var(--ui-density, 1));color:#a6bfba}.resource-scan-row input{width:calc(46px * var(--ui-density, 1));padding:calc(5px * var(--ui-density, 1)) calc(2px * var(--ui-density, 1));display:inline}.resource-scan-row button{font-size:calc(10px * var(--ui-density, 1));padding:calc(6px * var(--ui-density, 1)) calc(4px * var(--ui-density, 1))}.resource-danger{color:#f6b2a2;border-color:#925f54}.resource-entry{position:relative;min-width:0}.resource-entry .resource-card{width:100%;height:100%}.resource-select{position:absolute;top:9px;left:9px;background:#172126c9;border-radius:calc(3px * var(--ui-density, 1));line-height:0;padding:calc(2px * var(--ui-density, 1));cursor:pointer}.resource-select input{width:calc(15px * var(--ui-density, 1));height:calc(15px * var(--ui-density, 1));margin:0;accent-color:#7cd8bd;cursor:pointer}#resourceSimilarityResults{border-top:1px solid var(--line);margin:12px 0;padding-top:8px}#resourceSimilarityResults h3{font-size:calc(12px * var(--ui-density, 1));color:#acdacd}.resource-similar-group{border:1px solid #3a5650;border-radius:6px;padding:8px;margin:9px 0}.resource-similar-group strong{font-size:calc(11px * var(--ui-density, 1))}.resource-similar-group>button{width:100%;font-size:calc(11px * var(--ui-density, 1))}.resource-similar-strip{display:flex;overflow:auto;gap:5px;margin-top:7px}.resource-similar-strip img{width:58px;height:54px;object-fit:contain;background:#24353d;flex-shrink:0}#resourceMergeDialog{width:min(900px,94vw);max-width:900px}#resourceMergeDialog h2{font-size:calc(20px * var(--ui-density, 1))}#resourceKeepChoice{width:100%;margin:8px 0 14px}.resource-merge-candidates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-height:45vh;overflow:auto;padding:3px}.resource-merge-choice{position:relative;white-space:normal;display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:9px}.resource-merge-choice img{width:100%;height:110px;object-fit:contain;background:repeating-conic-gradient(#35464d 0% 25%,#24343b 0% 50%) 50%/12px 12px}.resource-merge-choice strong{font-size:calc(12px * var(--ui-density, 1));overflow-wrap:anywhere}.resource-merge-choice small{font-size:calc(10px * var(--ui-density, 1));color:#acc1ba}.resource-merge-choice.keep{border-color:#83e2bd;background:#274739;box-shadow:0 0 0 1px #83e2bd}.resource-keep-badge{font-size:calc(12px * var(--ui-density, 1));color:#edb7a5}.resource-merge-choice.keep .resource-keep-badge{color:#a0f1ce}#resourceMergeSummary{font-size:calc(13px * var(--ui-density, 1));color:#d8e9e1;line-height:1.7}#resourceMergeDialog .dialog-actions{flex-wrap:wrap;gap:10px}@media(max-width:700px){.resource-merge-candidates{grid-template-columns:repeat(2,minmax(0,1fr))}}



#resourceMergeError{color:#ffc1b1;background:#4d2a26;border:1px solid #a56d5f;border-radius:5px;padding:10px;font-size:calc(13px * var(--ui-density, 1));line-height:1.6}#resourceMergeError[hidden]{display:none}

#resourceMergeFields{border:0;padding:0;margin:0;min-width:0}.resource-merge-item{min-width:0;display:flex;flex-direction:column;gap:6px}.resource-merge-item .resource-merge-choice{width:100%;flex:1}.resource-exclude-button{width:100%;font-size:calc(11px * var(--ui-density, 1));padding:calc(7px * var(--ui-density, 1));color:#c4d8d0}#resourceExcludedCandidates{border:1px dashed #596d69;border-radius:6px;padding:8px 10px;margin-top:12px;max-height:160px;overflow:auto}#resourceExcludedCandidates[hidden]{display:none}.resource-excluded-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:calc(12px * var(--ui-density, 1));color:#acbeb6;padding:5px 0}.resource-excluded-row button{font-size:calc(11px * var(--ui-density, 1));padding:calc(5px * var(--ui-density, 1)) calc(10px * var(--ui-density, 1));flex-shrink:0}

.resource-atlas-tree{grid-column:1/-1;border:1px solid #5c9180;border-radius:6px;padding:8px;background:#1c302b;margin:5px 0}.resource-atlas-tree summary{cursor:pointer;font-size:calc(12px * var(--ui-density, 1));color:#b9e8d5;line-height:1.7;overflow-wrap:anywhere}.resource-atlas-cover{display:block;width:100%;height:110px;object-fit:contain;margin:8px 0;background:repeating-conic-gradient(#35464d 0% 25%,#24343b 0% 50%) 50%/12px 12px}.resource-atlas-tree>button{width:100%;font-size:calc(11px * var(--ui-density, 1));margin-bottom:8px}.resource-atlas-sprites{padding-left:8px;border-left:2px solid #496d60}.resource-atlas-tree:not([open])>img,.resource-atlas-tree:not([open])>button,.resource-atlas-tree:not([open])>.resource-grid{display:none}

.atlas-sprite-descriptions{margin:12px 0}.atlas-sprite-descriptions summary{cursor:pointer;font-weight:600}.atlas-sprite-description{display:flex;gap:10px;align-items:flex-start;border-top:1px solid var(--line);padding:12px 0}.atlas-sprite-description>img{width:64px;height:64px;object-fit:contain;background:repeating-conic-gradient(#35464d 0% 25%,#24343b 0% 50%) 50%/12px 12px}.atlas-sprite-description>.field{flex:1;min-width:0}.atlas-sprite-description textarea{width:100%;resize:vertical}#atlasSpriteDescriptions{max-height:440px;overflow:auto}

/* Full-width Sprite editing and detail preview. */
.atlas-sprite-selection{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;border-top:1px solid var(--line);margin-top:18px}.atlas-sprite-selection>p{flex:1 1 100%;margin:0;font-size:calc(13px * var(--ui-density, 1));color:#bfe9dd}.atlas-sprite-selection .dialog-actions{margin:0;flex-wrap:wrap}
.atlas-sprite-descriptions{width:100%;margin:0 0 20px}.atlas-sprite-descriptions>summary{padding:calc(12px * var(--ui-density, 1)) 0}.atlas-sprite-descriptions #atlasSpriteDescriptions{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;max-height:none;overflow:visible}
.atlas-sprite-descriptions .atlas-sprite-description{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:14px;border:1px solid var(--line);border-radius:8px;background:#1b292e;min-width:0}.atlas-sprite-description>.field{width:100%;display:flex;flex-direction:column;gap:9px}.atlas-sprite-description textarea{min-height:calc(150px * var(--ui-density, 1));resize:vertical}.atlas-sprite-description .check{display:flex;align-items:center;gap:8px}.atlas-sprite-thumbnail{width:100%;height:132px;padding:10px;display:flex;align-items:center;justify-content:center;cursor:zoom-in;background:repeating-conic-gradient(#35464d 0% 25%,#24343b 0% 50%) 50%/12px 12px}.atlas-sprite-thumbnail>img{width:100%;height:100%;object-fit:contain}
.sprite-zoom-dialog{width:min(1100px,94vw);max-width:1100px;padding:20px;border:1px solid var(--line);border-radius:10px;background:#1c292f;color:var(--text,#e5f2ef)}.sprite-zoom-dialog::backdrop{background:#061014d9}.sprite-zoom-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.sprite-zoom-heading h2{font-size:calc(18px * var(--ui-density, 1));margin:0;overflow-wrap:anywhere}.sprite-zoom-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:14px 0}.sprite-zoom-tools label{display:flex;align-items:center;gap:8px;font-size:calc(12px * var(--ui-density, 1))}.sprite-zoom-tools input{width:calc(150px * var(--ui-density, 1));margin:0}#spriteZoomViewport{height:65vh;overflow:auto;padding:24px;background:repeating-conic-gradient(#35464d 0% 25%,#24343b 0% 50%) 50%/16px 16px;border:1px solid var(--line)}#spriteZoomImage{display:block;max-width:none;max-height:none;image-rendering:pixelated;margin:0 auto}
@media(max-width:650px){.atlas-sprite-descriptions #atlasSpriteDescriptions{grid-template-columns:1fr}.sprite-zoom-dialog{padding:12px}.atlas-sprite-selection .dialog-actions{width:100%}}

.resource-context-menu{position:fixed;z-index:9999;display:flex;flex-direction:column;min-width:190px;padding:5px;background:#243447;border:1px solid #3d5067;border-radius:9px;box-shadow:0 10px 28px rgba(0,0,0,.45)}
.resource-context-menu button{background:none;border:none;color:#d9e4ef;text-align:left;padding:calc(7px * var(--ui-density, 1)) calc(11px * var(--ui-density, 1));font-size:calc(12px * var(--ui-density, 1));border-radius:calc(6px * var(--ui-density, 1));cursor:pointer;white-space:nowrap}
.resource-context-menu button:hover:not(:disabled){background:#31445c}
.resource-context-menu button:disabled{opacity:.4;cursor:not-allowed}
.resource-context-menu button.danger{color:#ff9c9c}
.resource-context-menu .resource-context-menu-title{padding:5px 11px 3px;font-size:calc(11px * var(--ui-density, 1));font-weight:600;color:#8fa3b8;border-bottom:1px solid #3d5067;margin-bottom:4px;white-space:nowrap}
.resource-context-menu .resource-context-menu-separator{height:1px;background:#3d5067;margin:4px 6px;opacity:.6}

.direct-edit-stage{position:relative;display:block;width:100%;max-width:520px;margin:0 auto;background:repeating-conic-gradient(#18242f 0% 25%,#0f1922 0% 50%) 0 0/14px 14px;border:1px solid #2b3d50;border-radius:8px;overflow:hidden}
.direct-edit-stage canvas{display:block;width:100%;height:auto}
#directEditOverlay{position:absolute;inset:0;cursor:crosshair;touch-action:none}
.direct-edit-tools{align-items:center;flex-wrap:wrap}
.direct-edit-tools button.active{color:#ffd9a8;background:#4a3a22;border-color:#c79a52}
.direct-edit-tools label{display:flex;align-items:center;gap:4px;font-size:calc(11px * var(--ui-density, 1));color:var(--muted,#8fa5b8)}
.direct-edit-tools input{width:calc(64px * var(--ui-density, 1));padding:calc(3px * var(--ui-density, 1)) calc(5px * var(--ui-density, 1))}

/* ===== 资源浏览：来源徽标 + 通用素材卡片 + 所属/类型筛选布局 ===== */
.resource-tools{grid-template-columns:1fr 1fr}
.resource-tools input{grid-column:1/-1}
.resource-tools #resourceOwner{grid-column:1/-1}
.resource-badge{display:inline-block;margin-top:3px;padding:0 4px;border-radius:3px;font-size:calc(9px * var(--ui-density, 1));line-height:calc(14px * var(--ui-density, 1));white-space:nowrap}
.resource-badge.slice{background:#2b3f39;color:#8fd6bf;border:1px solid #3f6155}
.resource-badge.kit{background:#3a2f1f;color:#f0c489;border:1px solid #6a5330}
.resource-card.from-kit{background:#1a1f26}
.resource-card.from-kit:hover{border-color:#c9a05e}
.resource-card.from-kit.selected{border-color:#e8c48c}

.right-panel.resource-detail-active>#emptyInspector,.right-panel.resource-detail-active>#inspector,.right-panel.resource-detail-active>#pendingLayerInspector{display:none!important}
.right-panel #resourceDialog{position:static;display:block;width:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:visible}
.right-panel #resourceDialog[hidden],#resourceSheetControls[hidden]{display:none!important}
.right-panel #resourceDialog .resource-dialog-image{display:block;max-width:100%;max-height:260px;object-fit:contain;margin:12px auto}
#resourceSheetList{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}

.right-panel #resourceDialog .dialog-actions{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap;gap:7px}.right-panel #resourceDialog .dialog-actions>button{margin:0}

.resource-batch-previews{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:12px 0}.resource-batch-previews img{width:100%;height:58px;object-fit:contain;background:var(--checker);border:1px solid var(--line);border-radius:5px}.resource-tags{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:12px}.resource-tags p{font-size:calc(11px * var(--ui-density, 1));line-height:1.5;color:var(--muted)}#resourceBatchDetails[hidden],#resourceSingleDetails[hidden]{display:none!important}
.image-reference-row{display:grid;grid-template-columns:var(--property-label-width,44%) minmax(0,1fr);align-items:center;gap:4px;min-height:20px;margin:2px 0;font-size:12px}
body #instanceResourceControls .image-reference-slot{display:flex;align-items:center;gap:4px;box-sizing:border-box;min-width:0;width:100%;height:20px!important;min-height:20px!important;max-height:20px!important;padding:0 3px!important;border:1px solid var(--line,#3d4a58);border-radius:2px;background:var(--field,#18212c);color:var(--text,#d0dce8);text-align:left}
body #instanceResourceControls .image-reference-locate{display:flex;align-items:center;gap:4px;flex:1;min-width:0;height:18px!important;min-height:18px!important;max-height:18px!important;padding:0!important;margin:0!important;border:0;background:transparent;color:inherit;text-align:left;overflow:hidden}
.image-reference-slot img{display:block;flex:0 0 18px;width:18px;height:18px;object-fit:contain;background:repeating-conic-gradient(#35404b 0% 25%,#202a34 0% 50%) 0 0/8px 8px}
.image-reference-slot #resourceRefName{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
body #instanceResourceControls .image-reference-pick{display:grid;place-items:center;flex:0 0 18px;width:18px;height:18px!important;min-height:18px!important;max-height:18px!important;padding:0!important;margin:0!important;border:0;border-left:1px solid var(--line,#3d4a58);background:transparent;font-size:14px!important;color:var(--muted,#97aabd);line-height:16px!important}
.image-reference-slot button:hover{background:var(--theme-selected,#304252)}
body #instanceResourceControls .image-native-row{display:flex;justify-content:space-between;align-items:center;gap:4px;margin:2px 0;min-height:20px}
body #instanceResourceControls .image-native-row .check{display:flex;align-items:center;gap:4px;margin:0;white-space:nowrap}
body #instanceResourceControls #setNativeSizeBtn{height:20px!important;min-height:20px!important;max-height:20px!important;padding:0 6px!important;font-size:11px;white-space:nowrap}
.image-scale-properties{margin-top:4px;padding-top:4px;border-top:1px solid var(--line,#344352)}
.retired-nine-slice-controls[hidden]{display:none!important}
body dialog.resource-picker{width:min(760px,94vw);height:min(560px,85vh);max-height:85vh;padding:0;overflow:hidden;background:var(--panel,#202b38);color:var(--text,#d0dce8);border:1px solid var(--line,#4a5a6b);border-radius:5px}
.resource-picker[open],.resource-picker>.dialog-body{display:flex;flex-direction:column;min-height:0}
.resource-picker>.dialog-body{flex:1;overflow:hidden;padding:10px;gap:8px}
.resource-picker .dialog-top{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;flex:none}
.resource-picker .dialog-top h2{margin:0;font-size:13px}
.resource-picker-search{flex:none;margin:8px 10px;box-sizing:border-box;width:calc(100% - 20px)}
.resource-picker .dialog-body>.resource-picker-search{margin:0;width:100%}
.resource-picker-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(170px,30%);gap:10px;flex:1;min-height:0;padding:0 10px}
.resource-picker .dialog-body>.resource-picker-content{padding:0}
.resource-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));align-content:start;gap:6px;overflow:auto;min-height:0;padding:2px}
body .resource-picker-item{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-height:116px!important;height:auto!important;max-height:none!important;padding:5px!important;text-align:left;background:var(--field,#18212c);border:1px solid var(--line,#344453);border-radius:3px;color:inherit;overflow:hidden}
.resource-picker-item[aria-selected=true]{border-color:var(--accent,#7ed6c2);box-shadow:inset 0 0 0 1px var(--accent,#7ed6c2)}
.resource-picker-item img{width:100%;height:78px;object-fit:contain;background:repeating-conic-gradient(#35404b 0% 25%,#202a34 0% 50%) 0 0/12px 12px}
.resource-picker-item span{font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.resource-picker-item small{font-size:10px;color:var(--muted,#97aabd)}
.resource-picker-preview{margin:0;display:flex;flex-direction:column;min-width:0;min-height:0;gap:8px}
.resource-picker-preview img{width:100%;height:0;flex:1;min-height:0;object-fit:contain;background:repeating-conic-gradient(#35404b 0% 25%,#202a34 0% 50%) 0 0/16px 16px;border:1px solid var(--line,#344453)}
.resource-picker-preview figcaption{font-size:11px;overflow-wrap:anywhere;line-height:1.5}
.resource-picker-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;flex:none;font-size:11px}
.resource-picker .dialog-body>.resource-picker-footer{padding:0}
.resource-picker-footer span{min-width:0;overflow-wrap:anywhere;color:var(--muted,#97aabd)}
@media(max-width:520px){.resource-picker-content{grid-template-columns:minmax(0,1fr) 130px}.resource-picker-grid{grid-template-columns:repeat(auto-fill,minmax(76px,1fr))}}
