
:root{font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:#dce5ee;background:#10151c;font-size:14px;color-scheme:dark;--line:#2b3542;--muted:#8e9daf;--accent:#91e4b8}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{border:1px solid #354151;background:#232d39;color:#dce5ee;border-radius:6px;padding:8px 12px;cursor:pointer;white-space:nowrap}button:hover{background:#344355;border-color:#7b99af}button:disabled{opacity:.35;cursor:default}.primary,button.active{background:var(--accent);color:#122b24;border-color:var(--accent);font-weight:650}input,select,textarea{width:100%;border:1px solid #384452;background:#121a23;color:#eef5fc;border-radius:5px;padding:8px}input:focus,select:focus,textarea:focus{outline:2px solid #6cbaa2;outline-offset:1px}input[type=checkbox]{width:auto;accent-color:var(--accent)}label{display:block;color:#a8b6c5;font-size:14px;margin:10px 0}label input,label select,label textarea{margin-top:5px}header{height:78px;border-bottom:1px solid var(--line);display:flex;gap:20px;align-items:center;padding:0 22px;background:#171e27}.brand{display:flex;gap:12px;align-items:center;min-width:225px}.brand-icon{background:var(--accent);color:#173b2b;font-weight:900;font-size:24px;padding:7px 12px;border-radius:7px}.brand strong{font-size:17px;letter-spacing:1px}.brand strong span{color:#8e9daf;font-size:13px}.brand small{display:block;color:var(--muted);margin-top:4px}#stage-title{max-width:320px;background:transparent;border-color:transparent;font-size:16px}#stage-title:hover{border-color:var(--line)}.badge{font-size:12px;color:var(--accent);white-space:nowrap}.header-actions{margin-left:auto;display:flex;gap:8px}main{display:grid;grid-template-columns:218px minmax(350px,1fr) 300px;height:calc(100dvh - 78px)}aside{background:#171e27;padding:18px;overflow:auto}.library{display:flex;flex-direction:column;border-right:1px solid var(--line)}.section-title{display:flex;justify-content:space-between;font-weight:650;align-items:center;gap:5px}.section-title span{font-size:10px;color:#71859b;letter-spacing:1px}.spaced{margin-top:27px;margin-bottom:12px}#palette{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}#palette button{height:77px;text-align:left;padding:10px;background:#202a36}#palette b{display:block;font-size:23px;color:var(--accent);font-weight:400;line-height:27px}#palette small{display:block;color:#aab8c7;font-size:13px;margin-top:5px}#objects{flex:1;min-height:100px;overflow:auto}#objects button{width:100%;display:flex;gap:8px;text-align:left;align-items:center;margin:3px 0;border-color:transparent;background:transparent;white-space:normal;overflow-wrap:anywhere;font-size:13px}#objects button.selected{border-color:#477763;background:#223d34;color:var(--accent)}.library-footer{padding-top:16px;border-top:1px solid var(--line)}.library-footer button{padding:7px;font-size:12px}.library-footer p{font-size:11px;line-height:1.8;color:#74879c}.viewport{display:flex;min-width:0;flex-direction:column;background:#111923;overflow:hidden}.toolbar{height:57px;display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--line);background:#19222d;flex-shrink:0}.toolbar button{font-size:12px;padding:7px 10px}.toolbar label{font-size:12px;white-space:nowrap;display:flex;align-items:center;gap:5px}.toolbar label input{margin:0}.segmented{display:flex;gap:3px}.spacer{flex:1}#canvas-host{position:relative;flex:1;min-height:250px}canvas{display:block;width:100%;height:100%;touch-action:none}.view-label{position:absolute;top:20px;left:20px;pointer-events:none}.view-label span{font-weight:650;font-size:12px;color:#c7d8e7;display:block}.view-label small{font-size:11px;color:#7790a6;display:block;margin-top:6px}.view-help{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);background:#101a26dd;border:1px solid #344457;border-radius:6px;padding:8px 12px;white-space:nowrap;color:#afc1d2;font-size:12px;pointer-events:none}.playbar{display:flex;align-items:center;gap:8px;padding:11px 16px;border-top:1px solid var(--line);background:#19222d;flex-wrap:wrap}.playbar button{font-size:12px}.playbar span{font-size:11px;color:#8296aa}#status{padding:9px 16px;font-size:12px;min-height:34px;border-top:1px solid var(--line);color:#9db3c7}#status.error{color:#ffb49e;background:#3b2423}.inspector{border-left:1px solid var(--line)}#properties{margin-top:18px}.empty{color:#8196ab;line-height:1.9;padding:25px 0;font-size:14px}.field-row{display:flex;gap:8px}.field-row label{flex:1;min-width:0}.check{display:flex;align-items:center;gap:7px}.check input{margin:0}.wide{width:100%;margin-top:12px}.actions{display:flex;gap:8px;margin:12px 0}.actions button{flex:1}.subheading{font-size:12px;color:var(--accent);margin:22px 0 10px;letter-spacing:.5px}.port{border:1px solid var(--line);border-radius:7px;padding:10px;margin-top:10px}.port .field-row label{font-size:12px}.port button{font-size:11px;padding:5px 8px}.stage-settings{border-top:1px solid var(--line);margin-top:24px;padding-top:18px}summary{cursor:pointer;color:#bac9d8}.hint{font-size:12px;line-height:1.7;color:#8499ad}dialog{background:#202b38;border:1px solid #526477;color:#dce5ee;border-radius:12px;max-width:450px;padding:26px}dialog::backdrop{background:#0009}dialog p{line-height:1.8;color:#aebfd0}dialog div{display:flex;justify-content:flex-end;gap:10px}#webgl-error{position:absolute;z-index:3;padding:40px;color:#ffb49e;background:#17202c;inset:0}@media(max-width:1100px){main{grid-template-columns:180px minmax(300px,1fr) 260px}aside{padding:12px}header{padding:0 12px;gap:10px}.brand{min-width:180px}.toolbar{gap:5px;padding:8px}.view-help{font-size:10px}.toolbar label{display:none}.badge{display:none}}@media(max-width:780px){header{height:auto;min-height:75px;flex-wrap:wrap;padding:10px}.brand{min-width:160px}#stage-title{width:150px}.header-actions{margin-left:0}main{height:auto;grid-template-columns:140px minmax(0,1fr)}.viewport{height:72dvh}.inspector{grid-column:1/-1;max-height:none}.toolbar{flex-wrap:wrap;height:auto}#palette{grid-template-columns:1fr}#palette button{height:52px;display:flex;gap:8px;align-items:center}.view-help{white-space:normal;width:90%;text-align:center}#properties form{max-width:580px}.library{max-height:72dvh}}

.transform-field{border-bottom:1px solid var(--line);padding-bottom:8px}.transform-field label{display:flex;align-items:center;justify-content:space-between;gap:8px}.transform-field input[type=number]{width:100px}.transform-field input[type=range]{padding:0;accent-color:var(--accent);cursor:ew-resize}.edit-tools{height:auto;flex-wrap:wrap}.edit-tools label{display:flex!important}.view-help{white-space:normal;width:max-content;max-width:95%;text-align:center}

.ruler-panel{margin-top:14px;border-bottom:1px solid var(--line);padding-bottom:10px}#ruler-list{max-height:230px;overflow:auto}.ruler-row{display:flex;align-items:center;gap:6px}.ruler-row label{flex:1;font-size:12px}.ruler-row button{font-size:11px;padding:4px 7px}

.ruler-row.selected{background:#203e43;outline:1px solid #91f6ff;border-radius:5px}.ruler-row .check{flex:0;margin:8px 4px}.ruler-row .ruler-select{flex:1;text-align:left;white-space:normal;border-color:transparent;background:transparent}canvas:focus{outline:none}

.wall-editor{width:min(960px,96vw);max-width:960px;max-height:92dvh;padding:20px;overflow:auto}.wall-editor .wall-heading{display:flex;justify-content:space-between;align-items:center}.wall-heading h2{margin:0 0 14px}.wall-editor .wall-layout{display:grid;grid-template-columns:minmax(200px,1fr) 290px;gap:22px}.wall-editor .wall-layout>div{display:block}.wall-front{display:block;width:100%;height:440px;background:#152330;border:1px solid #425161;border-radius:8px;touch-action:none}.wall-fields{max-height:65dvh;overflow:auto;padding-right:8px}.wall-fields label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.wall-fields input[type=number]{width:110px}.wall-fields input[type=range]{padding:0;accent-color:#91e4b8}.wall-fields [data-fields]{display:block}.wall-fields [data-error]{color:#ffb49e;font-size:12px;min-height:18px}.wall-editor .actions{justify-content:flex-start}.wall-editor .actions button{padding:8px;font-size:12px}@media(max-width:650px){.wall-editor .wall-layout{grid-template-columns:1fr}.wall-front{height:230px}.wall-fields{max-height:40dvh}}
.wall-fields label{white-space:nowrap}.wall-fields label select{width:190px;min-width:0}.wall-fields label input{flex-shrink:0}

#palette button{height:auto;min-height:115px;padding:5px;overflow:hidden}#palette img{display:block;width:100%;height:70px;object-fit:contain;border-radius:5px}#palette strong{display:block;font-size:13px;margin-top:4px}#palette small{font-size:10px;line-height:1.4;white-space:normal;margin-bottom:4px}#objects button img{width:40px;height:34px;object-fit:contain;flex-shrink:0;border-radius:4px}.asset-hero{display:flex;align-items:center;gap:10px;margin:10px 0 14px}.asset-hero img{width:100px;height:80px;object-fit:contain;border-radius:8px}.asset-hero small{display:block;font-size:11px;line-height:1.6;color:var(--muted);margin-top:5px}.asset-variants{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:12px 0 18px}.asset-variants button{white-space:normal;padding:5px;font-size:11px}.asset-variants img{width:100%;height:70px;object-fit:contain;display:block;border-radius:4px}.asset-variants span{display:block;padding:5px 0}#asset-variants summary{font-size:12px}@media(max-width:780px){#palette button{display:block;min-height:110px}#palette img{height:65px}}
#palette strong{white-space:normal;overflow-wrap:anywhere;line-height:1.4}

.path-editor [data-edges]{display:block;max-height:230px;overflow-y:auto;overflow-x:hidden;border:1px solid #425161;border-radius:6px;padding:8px}.path-editor [data-edges] .check{display:flex;justify-content:flex-start;white-space:normal;padding:8px;margin:4px 0;background:#172330;border-radius:4px;min-height:36px}.path-editor [data-edges] input{width:18px;height:18px;flex-shrink:0}.path-editor .wall-fields{min-width:0}.path-editor .wall-front{height: min(62dvh,590px)}.path-editor .wall-fields .actions{flex-wrap:wrap}.path-editor .wall-fields .actions button{white-space:normal}

.path-editor [data-segment-menu]{display:block;background:#34413b;border:1px solid #faff74;border-radius:6px;padding:10px;margin:10px 0}.path-editor [data-segment-menu][hidden]{display:none}.path-editor [data-segment-menu] p{margin:0 0 8px}.path-editor .wall-front:focus{outline:2px solid #86cdb8;outline-offset:2px}

#palette button{cursor:grab;user-select:none}#palette button:active{cursor:grabbing}.asset-drop-active{outline:2px solid #91e4b8;outline-offset:-3px}

#stage-library{width:min(860px,92vw);max-height:85vh;overflow:auto} .library-heading{display:flex;align-items:center;justify-content:space-between} #library-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:16px} #library-list article{background:#192e3b;border:1px solid #42645f;border-radius:12px;padding:18px} #library-list strong{font-size:19px;color:#9ce7bd} #library-list p{font-size:13px;line-height:1.6} #library-list article button{width:100%;margin-top:10px}
#stage-library{max-width:92vw}
