:root { color-scheme: dark; --bg:#111418; --panel:#1a1e24; --panel2:#20252d; --line:#303640; --text:#e8edf3; --muted:#87919e; --accent:#55d6be; --accent2:#2ba991; --measure:#ffd166; }
* { box-sizing:border-box; }
html,body { margin:0; width:100%; height:100%; overflow:hidden; font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif; background:var(--bg); color:var(--text); }
button,.button { font:inherit; }
.topbar { height:56px; display:flex; align-items:center; gap:24px; padding:0 18px; background:#181c22; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:10px; min-width:174px; font-weight:650; letter-spacing:.2px; }
.brand-mark { display:grid; place-items:center; width:28px; height:28px; color:#101514; background:var(--accent); border-radius:7px; font-weight:900; }
.mode-switch { display:flex; padding:3px; border:1px solid #343b46; border-radius:8px; background:#11151a; }.mode-button { height:27px; padding:0 13px; border:0; border-radius:5px; background:transparent; color:#818c98; font-size:12px; cursor:pointer; }.mode-button.active { color:#071411; background:var(--accent); font-weight:700; }body[data-mode="preview"] .edit-only { display:none !important; }
.file-actions { display:flex; gap:8px; }
.button { display:inline-flex; align-items:center; justify-content:center; height:34px; padding:0 14px; border:1px solid #3b424d; border-radius:7px; background:#252a32; color:var(--text); cursor:pointer; text-decoration:none; }
.button:hover { background:#303640; }.button:disabled { opacity:.4; cursor:not-allowed; }.button.primary { color:#0a1513; background:var(--accent); border-color:var(--accent); font-weight:700; }.button.primary:hover { background:#71e4cf; }.button.large { height:42px; padding:0 22px; }.save-button:not(:disabled) { color:var(--accent); border-color:#38776c; }
.file-name { margin-left:auto; max-width:35vw; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.workspace { display:grid; grid-template-columns:68px minmax(0,1fr) 272px; height:calc(100vh - 56px); }
.toolbar { z-index:2; padding:10px 8px; overflow-y:auto; overflow-x:hidden; background:var(--panel); border-right:1px solid var(--line); }
.tool { width:50px; height:52px; margin-bottom:5px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; border:1px solid transparent; border-radius:7px; color:#aeb7c1; background:transparent; cursor:pointer; }
.tool span { font-size:20px; line-height:20px; }.tool small { font-size:10px; }.tool:hover { background:#272c34; color:#fff; }.tool.active { color:var(--accent); border-color:#345d58; background:#20312f; }
.tool-separator { margin:10px 8px; height:1px; background:var(--line); }
.viewer { position:relative; min-width:0; background:#0b0e12; overflow:hidden; }
#canvas { display:block; width:100%; height:100%; cursor:grab; }.viewer.measuring #canvas { cursor:crosshair; }.viewer.dragging #canvas { cursor:grabbing; }
.empty-state { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 45%,#17212a 0,#0b0e12 55%); pointer-events:none; }
.empty-state.drag { background:#102621; outline:2px dashed var(--accent); outline-offset:-18px; }.empty-state.hidden { display:none; }.empty-state .button { pointer-events:auto; }
.file-icon { width:84px; height:100px; display:grid; place-items:center; margin-bottom:20px; border:2px solid #51606f; border-radius:10px; color:var(--accent); font-weight:800; letter-spacing:2px; box-shadow:inset 0 0 30px #1c2d32; }
.empty-state h1 { margin:0 0 8px; font-size:22px; }.empty-state p { margin:0 0 24px; color:var(--muted); font-size:14px; }
.hint,.coordinates { position:absolute; bottom:12px; padding:6px 9px; border:1px solid #2d343e; border-radius:5px; color:#9aa5b1; background:#171b21dd; font-size:11px; pointer-events:none; }.hint { left:12px; }.coordinates { right:12px; font-family:Consolas,monospace; }
.snap-label { color:#0b1714; background:var(--accent); border-radius:3px; padding:2px 5px; font:10px "Microsoft YaHei",sans-serif; }
.panel { overflow-y:auto; background:var(--panel); border-left:1px solid var(--line); }
.panel section { padding:18px; border-bottom:1px solid var(--line); }.panel-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; color:#cbd3dc; font-size:12px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.stats { margin:0; }.stats div { display:flex; justify-content:space-between; gap:12px; margin:10px 0; font-size:12px; }.stats dt { color:var(--muted); }.stats dd { margin:0; text-align:right; color:#d6dce3; }
.layer-summary,.panel-title em { color:var(--muted); font-size:10px; font-style:normal; font-weight:500; letter-spacing:0; text-transform:none; }
.layer-controls { margin-bottom:10px; }.layer-search { width:100%; height:32px; padding:0 10px; outline:0; border:1px solid #343b46; border-radius:6px; background:#11151a; color:var(--text); font-size:12px; }.layer-search:focus { border-color:var(--accent2); box-shadow:0 0 0 2px #2ba99122; }.layer-search::placeholder { color:#67717d; }
.layer-actions { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; margin-top:7px; }.mini-button { height:27px; border:1px solid #343b46; border-radius:5px; background:#242931; color:#b9c2cd; font-size:11px; cursor:pointer; }.mini-button:hover { border-color:#4a5664; color:#fff; background:#2c323b; }
.layers { display:flex; flex-direction:column; gap:3px; max-height:38vh; overflow:auto; }.layer { display:grid; grid-template-columns:18px 22px minmax(0,1fr) auto 27px; align-items:center; gap:5px; min-height:34px; padding:4px 4px; border:1px solid transparent; border-radius:6px; font-size:12px; }.layer:hover { background:#242a32; }.layer.is-hidden { opacity:.52; }.layer-eye { display:grid; place-items:center; cursor:pointer; }.layer-eye input { position:absolute; opacity:0; pointer-events:none; }.eye-icon { width:15px; height:10px; border:1.5px solid #aab4bf; border-radius:50% 50%; position:relative; }.eye-icon::after { content:''; position:absolute; left:4px; top:2px; width:4px; height:4px; border-radius:50%; background:#aab4bf; }.layer.is-hidden .eye-icon { border-color:#606a75; }.layer.is-hidden .eye-icon::before { content:''; position:absolute; left:-2px; top:3px; width:18px; height:1px; background:#77818c; transform:rotate(-35deg); }
.color-input { width:18px; height:18px; padding:0; border:0; border-radius:50%; overflow:hidden; background:transparent; cursor:pointer; }.color-input::-webkit-color-swatch-wrapper { padding:0; }.color-input::-webkit-color-swatch { border:1px solid #65707d; border-radius:50%; }.layer-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:default; }.layer-entities { color:#737e8b; font-size:10px; font-variant-numeric:tabular-nums; }.isolate-button { width:27px; height:24px; padding:0; border:0; border-radius:4px; background:transparent; color:#7f8a97; cursor:pointer; font-size:10px; }.isolate-button:hover,.isolate-button.active { color:var(--accent); background:#233934; }.no-layer-result { padding:12px 4px; color:var(--muted); font-size:11px; }.muted { color:var(--muted); font-size:12px; }
.measure-result { min-height:52px; font-size:12px; }.result-main { color:var(--measure); font-size:22px; font-weight:650; font-variant-numeric:tabular-nums; }.result-label { margin-bottom:6px; color:var(--muted); }.result-sub { margin-top:7px; color:#9fa9b5; }
.property-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }.property-grid label { display:grid; grid-template-columns:18px 1fr; align-items:center; gap:4px; color:#8f9aa6; font-size:11px; }.property-grid input { width:100%; height:30px; padding:0 7px; border:1px solid #39424d; border-radius:5px; outline:0; background:#11151a; color:#e8edf3; font:11px Consolas,monospace; }.property-grid input:focus { border-color:var(--accent2); }.lock-ratio { display:flex; align-items:center; gap:6px; margin:10px 0; color:#8f9aa6; font-size:11px; }.lock-ratio input { accent-color:var(--accent); }.property-apply { width:100%; height:30px; border:1px solid #397268; border-radius:5px; background:#213832; color:var(--accent); font-size:11px; cursor:pointer; }.property-apply:disabled { opacity:.4; cursor:not-allowed; }.property-group-title { margin:15px 0 7px; color:#7e8995; font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }.icon-button-grid { display:grid; gap:5px; }.align-grid { grid-template-columns:repeat(3,1fr); }.distribute-grid { grid-template-columns:1fr 1fr; margin-top:5px; }.boolean-grid { grid-template-columns:repeat(3,1fr); }.icon-button-grid button { min-height:28px; padding:3px; border:1px solid #37404b; border-radius:5px; background:#242a32; color:#b5bec8; font-size:10px; cursor:pointer; }.icon-button-grid button:hover:not(:disabled) { border-color:#4f786f; color:var(--accent); }.icon-button-grid button:disabled { opacity:.35; cursor:not-allowed; }
.layer.current { border-color:#36766b; background:#20322f; }
.context-menu { position:fixed; z-index:50; min-width:176px; padding:6px; border:1px solid #3b4450; border-radius:8px; background:#1d2229f2; box-shadow:0 14px 35px #0009; backdrop-filter:blur(12px); }.context-menu[hidden] { display:none; }.context-item { display:flex; align-items:center; justify-content:space-between; width:100%; height:32px; padding:0 10px; border:0; border-radius:5px; background:transparent; color:#d4dbe3; font-size:12px; text-align:left; cursor:pointer; }.context-item:hover { background:#2d353f; color:#fff; }.context-item.danger { color:#ff8585; }.context-separator { height:1px; margin:5px 4px; background:#343b46; }.shortcut { margin-left:20px; color:#737f8b; font-size:10px; }
.modal-backdrop { position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:20px; background:#05070a99; backdrop-filter:blur(4px); }.modal-backdrop[hidden] { display:none; }.modal { width:min(420px,100%); padding:20px; border:1px solid #3c4653; border-radius:12px; background:#1c2128; box-shadow:0 24px 70px #000c; }.modal-title { margin-bottom:10px; font-size:16px; font-weight:700; }.modal-message { color:#aeb7c2; font-size:13px; line-height:1.6; white-space:pre-wrap; }.modal-input { width:100%; height:38px; margin-top:14px; padding:0 11px; outline:0; border:1px solid #3b4551; border-radius:7px; background:#101419; color:#fff; font:13px inherit; }.modal-input:focus { border-color:var(--accent); box-shadow:0 0 0 2px #55d6be22; }.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
.clear-selection { margin-left:7px; padding:0; border:0; background:transparent; color:var(--accent); font-size:10px; cursor:pointer; }.clear-selection:disabled { display:none; }

/* Scalable application layout */
.workspace { --panel-width:300px; display:grid; grid-template-columns:minmax(0,1fr) 5px var(--panel-width); grid-template-rows:68px minmax(0,1fr); grid-template-areas:"toolbar toolbar toolbar" "viewer resizer panel"; height:calc(100vh - 56px); }
.toolbar { grid-area:toolbar; display:flex; align-items:center; gap:3px; padding:7px 12px; overflow-x:auto; overflow-y:hidden; border-right:0; border-bottom:1px solid var(--line); background:linear-gradient(180deg,#1d2229,#181c22); scrollbar-width:thin; }
.tool { flex:0 0 54px; width:54px; height:52px; margin:0; }.tool-separator { flex:0 0 1px; width:1px; height:42px; margin:0 7px; background:#353c46; }.tool-group-label { flex:0 0 auto; align-self:stretch; display:flex; align-items:flex-end; padding:0 5px 3px; color:#65717e; border-right:1px solid #2b323b; font-size:9px; letter-spacing:.04em; white-space:nowrap; }
.viewer { grid-area:viewer; }.panel { grid-area:panel; min-width:0; border-left:0; box-shadow:-6px 0 20px #0002; }.panel-resizer { grid-area:resizer; z-index:8; position:relative; background:#222831; cursor:col-resize; }.panel-resizer::after { content:''; position:absolute; left:2px; top:calc(50% - 24px); width:1px; height:48px; background:#596573; }.panel-resizer:hover,.workspace.resizing .panel-resizer { background:var(--accent2); }.workspace.resizing,.workspace.resizing * { cursor:col-resize!important; user-select:none!important; }
.snap-control { position:absolute; z-index:12; right:178px; bottom:12px; display:flex; height:27px; border:1px solid #303944; border-radius:5px; background:#171b21ee; box-shadow:0 4px 15px #0004; }.snap-master { display:flex; align-items:center; gap:5px; padding:0 7px; color:#aeb8c3; font-size:11px; cursor:pointer; }.snap-master input { width:12px; height:12px; margin:0; accent-color:var(--accent); }.snap-master:has(input:checked) { color:var(--accent); background:#20322f; }.snap-menu-button { width:24px; padding:0; border:0; border-left:1px solid #303944; background:transparent; color:#8995a2; cursor:pointer; }.snap-menu-button:hover,.snap-menu-button.active { color:var(--accent); background:#263039; }
.snap-menu { position:absolute; right:0; bottom:34px; width:210px; padding:8px; border:1px solid #3b4652; border-radius:8px; background:#1d232af5; box-shadow:0 14px 35px #000a; backdrop-filter:blur(12px); }.snap-menu[hidden] { display:none; }.snap-menu-title { display:flex; justify-content:space-between; padding:5px 6px 9px; border-bottom:1px solid #343c47; color:#d5dce4; font-size:11px; font-weight:700; }.snap-menu-title span { color:#77838f; font-size:9px; font-weight:400; }.snap-menu label { display:grid; grid-template-columns:18px 18px 1fr; align-items:center; min-height:31px; padding:0 6px; border-radius:5px; color:#b4bec9; font-size:11px; cursor:pointer; }.snap-menu label:hover { background:#29313a; }.snap-menu input { margin:0; accent-color:var(--accent); }.snap-symbol { display:block; width:9px; height:9px; border:1.5px solid var(--accent); }.snap-symbol.triangle { clip-path:polygon(50% 0,100% 100%,0 100%); }.snap-symbol.circle { border-radius:50%; }.snap-symbol.diamond { transform:rotate(45deg); }.snap-symbol.cross,.snap-symbol.near { border:0; position:relative; }.snap-symbol.cross::before,.snap-symbol.cross::after,.snap-symbol.near::before,.snap-symbol.near::after { content:''; position:absolute; left:0; top:4px; width:11px; height:1.5px; background:var(--accent); transform:rotate(45deg); }.snap-symbol.cross::after,.snap-symbol.near::after { transform:rotate(-45deg); }.snap-symbol.dot { width:7px; height:7px; margin-left:1px; border-radius:50%; background:var(--accent); }.snap-symbol.near { transform:rotate(45deg); }
.snap-control.disabled { opacity:.55; }.snap-control.disabled .snap-master { color:#7b8793; background:transparent; }
@media (max-width:800px) { .workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:62px minmax(0,1fr); grid-template-areas:"toolbar" "viewer"; }.panel,.panel-resizer { display:none; }.toolbar { padding-left:6px; padding-right:6px; }.file-name { display:none; }.snap-control { right:12px; bottom:46px; }.coordinates { right:12px; } }
