:root{--bg: #0c0d10;--fg: #e7ecf3;--accent: #7fd1ff;--panel: #11131a;--border: #1f2330;--shadow: 0 10px 30px rgba(0, 0, 0, .35);--font: "Inter", system-ui, -apple-system, sans-serif;--sidebar-width: 500px;--sidebar-current-width: var(--sidebar-width)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font);height:100vh;display:flex;flex-direction:column;overflow:hidden}.topbar{display:grid;grid-template-columns:auto 1fr auto;align-items:center;padding:12px 16px;background:var(--panel);border-bottom:1px solid var(--border);box-shadow:var(--shadow);gap:12px}.topbar-left{display:flex;align-items:center;gap:12px}.topbar-actions{display:flex;align-items:center;gap:10px}.topbar-center{display:flex;align-items:center;gap:10px;justify-content:center;width:100%;overflow-x:auto;padding:6px 8px;border-radius:10px;background:#11131acc;border:1px solid rgba(127,209,255,.12)}.topbar-center::-webkit-scrollbar{display:none}.brush-type-buttons{display:flex;align-items:center;gap:8px}.brush-type-btn{min-width:42px;height:38px;border-radius:10px;border:1px solid var(--border);color:var(--fg);font-weight:600;cursor:pointer;background:#ffffff0d;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}.brush-type-btn:hover{transform:translateY(-1px);border-color:var(--accent);box-shadow:0 8px 18px #0006}.brush-type-btn.active,.topbar-center .ghost-btn.active{border-color:var(--accent);box-shadow:0 0 0 1px #7fd1ff73}.brush-size-group{display:flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--border);border-radius:10px;background:#ffffff0a}.brush-size-label{font-size:.9rem;color:#d0d6e0;min-width:80px;text-align:center}.brush-flow{display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:10px;border:1px solid var(--border);background:#ffffff0a}.brush-flow-label{font-size:.9rem;color:#d0d6e0}.brush-flow input[type=range]{--brush-fill: 0%;width:150px;height:10px;padding:0;border-radius:999px;border:1px solid var(--border);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--brush-fill),rgba(255,255,255,.16) var(--brush-fill),rgba(255,255,255,.08) 100%);-webkit-appearance:none;-moz-appearance:none;appearance:none}.brush-flow input[type=range]::-webkit-slider-runnable-track{height:10px;background:transparent}.brush-flow input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:18px;height:18px;border-radius:50%;background:#0c0d10;border:2px solid var(--accent);box-shadow:0 0 0 2px #7fd1ff4d;margin-top:-4px;cursor:pointer}.brush-flow input[type=range]::-moz-range-track{height:10px;background:transparent;border:none}.brush-flow input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#0c0d10;border:2px solid var(--accent);box-shadow:0 0 0 2px #7fd1ff4d;cursor:pointer}.ghost-btn{background:transparent;color:var(--fg);border:1px solid var(--border);padding:6px 10px;border-radius:6px;cursor:pointer;transition:border-color .15s ease,color .15s ease,transform .15s ease}.ghost-btn:hover{border-color:var(--accent);color:var(--accent);transform:translateY(-1px)}.toolbar-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;height:44px;min-width:118px;padding:10px 14px;background:linear-gradient(180deg,#ffffff14,#ffffff08);border:1px solid rgba(127,209,255,.25);border-radius:10px;box-shadow:0 8px 18px #00000057;font-weight:700;line-height:1}.toolbar-btn .btn-icon{margin:0;width:20px}.toolbar-btn .btn-label{display:inline-flex;align-items:center;justify-content:center}.toolbar-btn .btn-icon svg{width:20px;height:20px}.topbar-center .toolbar-btn.active{border-color:var(--accent);box-shadow:0 0 0 1px #7fd1ff73,0 10px 22px #0006}.brand{font-weight:700;letter-spacing:.02em}.status{font-size:.9rem;color:var(--accent)}main{flex:1;display:grid;grid-template-columns:minmax(320px,var(--sidebar-current-width)) 1fr;grid-template-rows:1fr;min-height:0;transition:grid-template-columns .28s ease}.sidebar{position:relative;background:radial-gradient(circle at 0% 0%,#1c2131,#0f1119 55%);border-right:1px solid var(--border);box-shadow:var(--shadow);padding:28px 18px 18px;display:flex;flex-direction:column;overflow:hidden;height:100%;overflow-x:hidden;width:var(--sidebar-current-width);max-width:var(--sidebar-current-width);min-width:0;transition:width .28s ease,max-width .28s ease,opacity .22s ease,transform .22s ease,padding .22s ease,border-color .22s ease;will-change:width,opacity,transform;scrollbar-width:none}.sidebar::-webkit-scrollbar{display:none}.panel-content{display:flex;flex-direction:column;gap:14px;transition:opacity .18s ease,transform .18s ease;overflow-y:auto;overflow-x:hidden;padding-right:6px;flex:1;scrollbar-width:none}.panel-content::-webkit-scrollbar{display:none}body.sidebar-hidden{--sidebar-current-width: 0px}body.sidebar-hidden .sidebar{opacity:0;transform:translate(-14px);padding-left:0;padding-right:0;border-right-color:transparent;pointer-events:none}body.sidebar-hidden .panel-content{opacity:0;transform:translate(-10px);pointer-events:none}.panel-title{font-weight:700;letter-spacing:.02em;color:var(--accent);padding-bottom:4px;border-bottom:1px solid rgba(127,209,255,.2)}.collapse-toggle{width:46px;height:46px;border-radius:14px;background:radial-gradient(circle at 30% 20%,#7fd1ff2e,#101624f2);border:1px solid rgba(127,209,255,.45);display:grid;place-items:center;cursor:pointer;box-shadow:0 10px 22px #00000073,0 0 0 1px #7fd1ff40;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease,background .3s ease}.collapse-toggle:hover{transform:translateY(-1px) scale(1.03);box-shadow:0 16px 30px #0000008c,0 0 12px #7fd1ff66;border-color:#7fd1ffb3}.collapse-icon{position:relative;width:18px;height:14px;display:block;animation:pulse-glow 2.4s ease-in-out infinite}.collapse-line{position:absolute;left:0;width:100%;height:3px;border-radius:3px;background:linear-gradient(90deg,#9fd5ff,#6fb6ff);transition:transform .25s ease,opacity .2s ease,width .25s ease}.collapse-line.top{top:0}.collapse-line.middle{top:50%;transform:translateY(-50%)}.collapse-line.bottom{bottom:0}body.sidebar-hidden .collapse-line.top{transform:translateY(6px) rotate(45deg)}body.sidebar-hidden .collapse-line.bottom{transform:translateY(-6px) rotate(-45deg)}body.sidebar-hidden .collapse-line.middle{opacity:0;transform:translateY(-50%) scaleX(.2)}@keyframes pulse-glow{0%,to{filter:drop-shadow(0 0 0px rgba(127,209,255,.55))}50%{filter:drop-shadow(0 0 6px rgba(127,209,255,.7))}}.viewport-wrap{position:relative;background:#07080d;min-height:0}canvas#viewport{width:100%;height:100%;display:block;background:radial-gradient(circle at 30% 30%,#151826,#0c0d10 55%)}canvas#viewport.brush-mode{cursor:none}.brush-cursor{position:absolute;top:0;left:0;width:40px;height:40px;border-radius:50%;border:2px solid var(--accent);pointer-events:none;transform:translate(-50%,-50%);opacity:0;transition:opacity .12s ease,border-color .12s ease,box-shadow .12s ease;box-shadow:0 0 0 2px #7fd1ff40;z-index:2}.brush-cursor.visible{opacity:1}.radius-visual{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;display:none;z-index:2}.radius-visual.visible{display:block}.radius-ring{position:absolute;top:50%;left:50%;border-radius:50%;transform:translate(-50%,-50%);box-sizing:border-box}.radius-ring.outer{border:2px dashed rgba(127,209,255,.9);background:#7fd1ff14}.radius-ring.inner{border:2px dashed rgba(255,142,142,.9);background:#ff8e8e0f}.overlay{position:absolute;top:12px;right:12px;padding:10px 12px;background:#11131abf;border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);font-size:.9rem;line-height:1.2}.corner-zoom{position:absolute;right:12px;bottom:12px;display:flex;gap:8px}.corner-zoom .ghost-btn{width:44px;height:44px;font-size:1.15rem;font-weight:700;border-radius:10px;background:#1a1d27e6}.modal{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:none;align-items:center;justify-content:center;padding:16px;z-index:10}.modal.open{display:flex}.modal-sheet{background:var(--panel);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);max-width:520px;width:min(520px,100%);padding:18px 20px 16px;color:var(--fg);line-height:1.5}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.modal h2{margin:0;font-size:1.1rem}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.control-line{display:flex;align-items:center;gap:10px;width:100%;min-width:0}.control-line button,.control-line .file-label{flex:1 1 0}.control-slider,.control-select,.control-number{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0}.control-name{flex:0 0 150px;white-space:nowrap}.control-value{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;flex:0 0 80px;text-align:right}.control-checkbox{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.control-checkbox .control-name{flex:1 1 auto}.control-checkbox input[type=checkbox]{flex:0 0 auto}.control-slider input[type=range]{flex:1 1 200px;min-width:140px;width:100%}.control-select select{flex:1 1 0;width:100%}.matrix-header-row,.matrix-stack,.matrix-editor,.matrix-footer-row,.type-list,.type-row,.type-row .type-name,.type-row .type-stepper,.type-row .type-stepper input{min-width:0}.control-number input[type=number]{width:120px;height:44px;font-size:1rem;padding:8px 12px}.number-stepper,.type-stepper{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}.number-stepper input,.type-stepper input{text-align:center;height:34px;padding:6px 8px}.type-stepper{justify-content:flex-end;gap:6px;min-width:0}.type-stepper input{width:80px;max-width:100%}.step-btn{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:#161922;border:1px solid var(--border);color:var(--fg);font-weight:700;cursor:pointer;transition:transform .12s ease,border-color .12s ease,color .12s ease}.step-btn:hover{border-color:var(--accent);color:var(--accent);transform:translateY(-1px)}.step-btn:active{transform:translateY(0)}.control-checkbox{display:flex;align-items:center;gap:10px}button,select,input[type=range],input[type=checkbox],input[type=number]{background:#1a1d27;color:var(--fg);border:1px solid var(--border);border-radius:6px;padding:6px 10px;font:inherit}.btn-icon{display:inline-block;width:18px;margin-right:6px;line-height:0}.btn-icon svg{width:18px;height:18px;display:block}.btn-label{vertical-align:middle}input[type=range]{width:150px}input[type=number]{width:100%;-moz-appearance:textfield}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.matrix-header-row{align-items:stretch}.type-list{display:flex;flex-direction:column;gap:10px}.type-row{display:grid;grid-template-columns:22px minmax(90px,120px) 1fr;column-gap:10px;align-items:center;padding:6px 8px;border:1px solid var(--border);border-radius:8px;background:#1a1d278c}.type-name{font-weight:600;color:var(--fg);white-space:nowrap}.type-swatch{width:18px;height:18px;border-radius:50%;border:1px solid rgba(255,255,255,.2);box-shadow:inset 0 0 0 1px #00000059}.matrix-stack{display:flex;flex-direction:column;gap:10px}.matrix-section-title{font-weight:700;color:var(--fg);letter-spacing:.01em}.matrix-legend{font-size:.9rem;color:#c3c8d4}.matrix-editor{display:grid;grid-template-columns:16px 1fr;grid-template-rows:16px 1fr;gap:6px;align-items:start;padding:6px;border:1px solid var(--border);border-radius:10px;background:radial-gradient(circle at 30% 20%,#ffffff0a,#00000059 55%)}.matrix-top{grid-column:2;display:flex;gap:4px;height:16px;align-items:stretch}.matrix-left{grid-row:2;display:flex;flex-direction:column;gap:4px;width:16px;height:100%}.matrix-grid{grid-column:2;grid-row:2;display:grid;gap:4px}.matrix-band{width:100%;height:100%;border-radius:6px;border:none;box-shadow:none}.matrix-top .matrix-band,.matrix-left .matrix-band{flex:1 1 0%}.matrix-footer-row{justify-content:center;padding-top:4px}.matrix-footer-row button{padding:8px 14px}.matrix-cell{width:100%;aspect-ratio:1;border:1px solid rgba(255,255,255,.05);border-radius:4px;padding:0;cursor:pointer;transition:transform .08s ease,border-color .12s ease}.matrix-cell:hover{transform:translateY(-1px);border-color:#ffffff26}.matrix-cell:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@media (max-width: 900px){:root{--sidebar-width: 100%;--sidebar-current-width: var(--sidebar-width)}main{grid-template-columns:var(--sidebar-current-width) 1fr;grid-template-rows:auto 1fr}.sidebar{border-right:none;border-bottom:1px solid var(--border)}body.sidebar-hidden{--sidebar-current-width: 0px}body.sidebar-hidden .panel-content{display:none}.overlay{left:12px;right:auto}}.file-label{border:1px dashed var(--border);padding:6px 10px;border-radius:6px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}.file-label input[type=file]{display:none}
