html[data-theme=gray]{--bg: #4e4e4e;--bg-panel: #383838;--bg-elevated: #434343;--bg-hover: #4d4d4d;--bg-active: #575757;--border: #5a5a5a;--text: #e2e2e2;--text-dim: #b0b0b0;--accent: #4c9ffe;--accent-dim: #2d6cb5;--danger: #e05c5c;--canvas-check-a: #4e4e4e;--canvas-check-b: #4b4b4b;--curve-bg: #2e2e2e;--curve-grid: #404040;--curve-rgb: #e2e2e2;--curve-hist: rgba(200, 200, 200, .16);--slider-thumb: #d9d9d9;color-scheme:dark}html[data-theme=dark]{--bg: #232323;--bg-panel: #1e1e1e;--bg-elevated: #2a2a2a;--bg-hover: #333333;--bg-active: #3c3c3c;--border: #3a3a3a;--text: #e8e8e8;--text-dim: #9d9d9d;--accent: #4c9ffe;--accent-dim: #2d6cb5;--danger: #e05c5c;--canvas-check-a: #232323;--canvas-check-b: #202020;--curve-bg: #171717;--curve-grid: #2d2d2d;--curve-rgb: #d7dbe0;--curve-hist: rgba(154, 160, 168, .18);--slider-thumb: #d7dbe0;color-scheme:dark}html[data-theme=light]{--bg: #b9b9b9;--bg-panel: #d2d2d2;--bg-elevated: #e0e0e0;--bg-hover: #eaeaea;--bg-active: #c9c9c9;--border: #a6a6a6;--text: #1f1f1f;--text-dim: #5a5a5a;--accent: #1567d3;--accent-dim: #3d7cc9;--danger: #c23434;--canvas-check-a: #b9b9b9;--canvas-check-b: #b5b5b5;--curve-bg: #efefef;--curve-grid: #c8c8c8;--curve-rgb: #3a3a3a;--curve-hist: rgba(0, 0, 0, .14);--slider-thumb: #4a4a4a;color-scheme:light}html[data-theme=light] .toast{background:#f3dede;color:#7a1f1f}html[data-theme=light] .toast.notice{background:#dfeafc;border-color:var(--accent-dim);color:#174a86}html[data-theme=light] .compare-label,html[data-theme=light] .zoom-indicator{background:#f0f0f0d9;color:#1f1f1f}html[data-theme=light] .header .logo{background:linear-gradient(120deg,#1d5da8,#a85f00);-webkit-background-clip:text;background-clip:text}:root{--bg: #111214;--bg-panel: #1a1c1f;--bg-elevated: #232529;--border: #2e3136;--text: #e8eaed;--text-dim: #9aa0a8;--accent: #4c9ffe;--accent-dim: #2d6cb5;--danger: #e05c5c;--radius: 10px;--panel-w: 300px;color-scheme:dark}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%;overflow:hidden}body{background:var(--bg);color:var(--text);font-family:Hiragino Kaku Gothic ProN,Yu Gothic UI,Segoe UI,system-ui,sans-serif;font-size:13px;-webkit-font-smoothing:antialiased;touch-action:manipulation}button{font:inherit;color:inherit;background:var(--bg-elevated);border:1px solid var(--border);border-radius:8px;padding:7px 12px;cursor:pointer;transition:background .15s;user-select:none;-webkit-user-select:none;white-space:nowrap}button:hover{background:var(--bg-hover, #2b2e33)}button:active{background:var(--bg-active, #34383e)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent-dim);border-color:var(--accent-dim)}button.primary:hover{background:var(--accent)}input[type=file]{display:none}select,input[type=number]{font:inherit;color:inherit;background:var(--bg-elevated);border:1px solid var(--border);border-radius:8px;padding:6px 8px;max-width:100%}input[type=number]{width:52px;text-align:center}input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:3px;background:var(--border);border-radius:2px;outline:none}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:var(--slider-thumb, #d7dbe0);border:none;box-shadow:0 1px 4px #00000080}input[type=range]::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:var(--slider-thumb, #d7dbe0);border:none}.app{display:flex;flex-direction:column;height:100%}.header{height:50px;display:flex;align-items:center;gap:7px;padding:0 10px;background:var(--bg-panel);border-bottom:1px solid var(--border);flex-shrink:0;overflow-x:auto;scrollbar-width:none}.header::-webkit-scrollbar{display:none}.header .logo{font-weight:700;font-size:15px;white-space:nowrap;background:linear-gradient(120deg,#6db4ff,#ff9db4);-webkit-background-clip:text;background-clip:text;color:transparent;margin-right:2px}.header .spacer{flex:1}.header .file-info{color:var(--text-dim);font-size:11px;white-space:nowrap}.main{flex:1;display:flex;min-height:0}.main.drag-over{outline:2px dashed var(--accent);outline-offset:-6px}.stage{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0}.grid-area{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:repeating-conic-gradient(var(--canvas-check-a, #17181b) 0% 25%,var(--canvas-check-b, #131417) 0% 50%) 0 0 / 24px 24px}.grid-canvas{position:relative;box-shadow:0 6px 32px #00000073;overflow:hidden}.grid-cell{position:absolute;overflow:hidden;background:#7f7f7f1f}.grid-cell.empty{outline:1.5px dashed rgba(127,127,127,.55);outline-offset:-1.5px}.grid-cell.drop-target{outline:2px solid var(--accent);outline-offset:-2px}.grid-cell-canvas{width:100%;height:100%;display:block;cursor:grab;touch-action:none}.grid-cell-canvas:active{cursor:grabbing}.grid-cell-add{position:absolute;inset:0;width:100%;height:100%;border:none;border-radius:0;background:transparent;color:var(--text-dim);font-size:26px}.grid-cell-add:hover{background:#4c9ffe1a;color:var(--accent)}.grid-cell-tools{position:absolute;top:4px;right:4px;display:flex;gap:3px;opacity:0;transition:opacity .12s}.grid-cell:hover .grid-cell-tools{opacity:1}.grid-cell-tools .tool{width:24px;height:24px;padding:0;display:flex;align-items:center;justify-content:center;font-size:12px;border-radius:6px;background:#141619cc;border:1px solid rgba(255,255,255,.18);color:#eee;cursor:pointer}.grid-cell-tools .tool:hover{background:#2d6cb5e6}.grid-cell-tools .tool.danger:hover{background:#a03232e6}.grid-cell-tools .tool.handle{cursor:grab}.grid-cell-zoom{position:absolute;left:6px;bottom:4px;font-size:10px;padding:1px 6px;border-radius:8px;background:#141619bf;color:#ddd;pointer-events:none}.grid-divider{position:absolute;z-index:5}.grid-divider.v{cursor:col-resize}.grid-divider.h{cursor:row-resize}.grid-divider:hover{background:#4c9ffe59;border-radius:3px}.tray{flex-shrink:0;display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--bg-panel);border-top:1px solid var(--border);overflow-x:auto}.tray-label{color:var(--text-dim);font-size:11px;white-space:nowrap}.tray-item{position:relative;flex-shrink:0;cursor:grab;border:1px solid var(--border);border-radius:8px;overflow:hidden;line-height:0}.tray-item canvas{width:56px;height:56px;display:block}.tray-remove{position:absolute;top:2px;right:2px;width:18px;height:18px;padding:0;font-size:10px;line-height:1;border-radius:50%;background:#141619cc;border:none;color:#eee}.side-panel{width:var(--panel-w);background:var(--bg-panel);border-left:1px solid var(--border);overflow-y:auto;flex-shrink:0}.section{border-bottom:1px solid var(--border)}.section-title{padding:11px 14px 2px;font-weight:600;font-size:12.5px}.section-body{padding:8px 14px 16px;display:flex;flex-direction:column;gap:10px}.template-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.template-grid button{padding:8px 0;font-size:11.5px}.field-row{display:grid;grid-template-columns:76px 1fr;align-items:center;gap:8px}.field-row label{font-size:12px;color:var(--text-dim);white-space:nowrap}.rc-inputs,.bg-row{display:flex;align-items:center;gap:6px}.bg-row input[type=color]{width:34px;height:26px;padding:0;border:1px solid var(--border);border-radius:6px;background:none}.bg-swatch{width:22px;height:22px;padding:0;border-radius:6px;border:1px solid var(--border)}.export-btn{width:100%}.hint{font-size:10.5px;color:var(--text-dim);line-height:1.6}.bridge-menu{font:inherit;font-size:12px;color:inherit;background:var(--bg-elevated);border:1px solid var(--border);border-radius:8px;padding:6px;cursor:pointer;flex-shrink:0;max-width:84px}.bridge-menu:disabled{opacity:.45;cursor:default}.toast{position:fixed;bottom:18px;left:50%;transform:translate(-50%);background:#3d1c1c;border:1px solid var(--danger);color:#ffd7d7;padding:10px 18px;border-radius:10px;font-size:12.5px;max-width:min(560px,92vw);z-index:30}.toast.notice{background:#16283d;border-color:var(--accent-dim);color:#cfe4ff}@media (max-width: 768px){.main{flex-direction:column}.side-panel{width:100%;border-left:none;border-top:1px solid var(--border);max-height:44%}.tray-item canvas{width:44px;height:44px}}.help-link{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border:1px solid var(--border);border-radius:50%;background:var(--bg-elevated);color:var(--text-dim);text-decoration:none;font-size:13px}.help-link:hover{color:var(--accent);border-color:var(--accent-dim)}
