:root {
  color-scheme: dark;
  --bg: #090a0e;
  --surface: #111219;
  --surface-2: #171820;
  --surface-3: #20212b;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f5f8;
  --muted: #90919c;
  --accent: #8b6cff;
  --accent-2: #5c9dff;
  --cyan: #61ddff;
  --danger: #ff667d;
  --green: #53d695;
  --panel-left: 286px;
  --panel-right: 304px;
  --rail: 66px;
  --top: 62px;
  --status: 27px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { user-select: none; }
button, input { font: inherit; }
button { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: var(--rail) var(--panel-left) minmax(340px, 1fr) var(--panel-right);
  grid-template-rows: var(--top) minmax(0, 1fr) var(--status);
  width: 100%; height: 100%;
  background: var(--bg);
}

.topbar {
  position: relative; z-index: 40;
  grid-column: 1 / -1; grid-row: 1;
  display: grid; grid-template-columns: 250px 1fr auto; align-items: center;
  gap: 18px; padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 13, 18, 0.94);
  backdrop-filter: blur(20px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; width: max-content; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand b { font-size: 17px; letter-spacing: .08em; font-weight: 650; }
.brand small { margin-top: 5px; color: #777985; font-size: 8px; letter-spacing: .19em; }
.brand-mark { position: relative; display: grid; place-items: center; width: 31px; height: 34px; flex: 0 0 31px; background: linear-gradient(145deg,#a88cff,#5c7cff); clip-path: polygon(50% 0,94% 25%,94% 75%,50% 100%,6% 75%,6% 25%); filter: drop-shadow(0 0 10px rgba(128,104,255,.25)); }
.brand-mark::before { content: ""; position: absolute; inset: 2px; background: #111219; clip-path: inherit; }
.brand-mark b { position: relative; z-index: 1; color: #f5f1ff; font-size: 16px; font-weight: 700; letter-spacing: 0; }

.project-title { justify-self: center; display: flex; align-items: center; gap: 9px; min-width: 0; }
.project-title input { width: min(290px, 34vw); border: 1px solid transparent; border-radius: 7px; background: transparent; color: #d4d4db; text-align: center; padding: 7px 10px; outline: none; font-size: 13px; }
.project-title input:hover, .project-title input:focus { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(83,214,149,.5); }
.save-dot.dirty { background: #ffba55; box-shadow: 0 0 10px rgba(255,186,85,.5); }

.top-actions { display: flex; align-items: center; gap: 5px; }
.tool-btn, .primary-btn, .canvas-btn, .close-panel, .scene-actions button, .join-grid button, .wide-action {
  border: 0; cursor: pointer; outline: none;
}
.tool-btn { height: 34px; border-radius: 8px; background: transparent; color: #a9aab3; }
.tool-btn:hover { background: rgba(255,255,255,.065); color: #fff; }
.tool-btn:disabled { opacity: .28; cursor: not-allowed; }
.tool-btn.quick-delete:not(:disabled) { color: #ff8798; }
.tool-btn.quick-delete:not(:disabled):hover { background: rgba(255,102,125,.11); color: #ffb2bd; }
.icon-btn { display: grid; place-items: center; width: 34px; padding: 0; }
.text-btn { padding: 0 11px; font-size: 12px; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 35px; padding: 0 15px; border-radius: 8px; background: linear-gradient(135deg, #9273ff, #6652df); color: white; font-size: 12px; font-weight: 600; box-shadow: 0 5px 20px rgba(109,81,225,.22), inset 0 1px rgba(255,255,255,.24); }
.primary-btn:hover { filter: brightness(1.1); }
.primary-btn svg { width: 16px; }

.tool-rail {
  position: relative; z-index: 35;
  grid-column: 1; grid-row: 2;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 7px 9px;
  border-right: 1px solid var(--line); background: #0e0f14;
}
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 50px; height: 55px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #777985; cursor: pointer; font-size: 9px; }
.rail-btn:hover { color: #dddde3; background: rgba(255,255,255,.045); }
.rail-btn.active { color: #c9bfff; background: rgba(139,108,255,.12); }
.rail-btn.active::before { content: ""; position: absolute; left: -7px; width: 2px; height: 25px; border-radius: 2px; background: #9273ff; box-shadow: 0 0 12px #8b6cff; }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn kbd { position: absolute; right: 3px; top: 3px; color: #555762; font: 7px ui-monospace, monospace; }
.rail-divider { width: 30px; height: 1px; margin: 4px 0; background: var(--line); }
.rail-spacer { flex: 1; }

.library-panel, .inspector-panel {
  position: relative; z-index: 30; min-height: 0; overflow: hidden;
  background: rgba(18, 19, 26, .98); transition: width .25s ease, transform .25s ease;
}
.library-panel { grid-column: 2; grid-row: 2; border-right: 1px solid var(--line); padding: 19px 15px 16px; }
.inspector-panel { grid-column: 4; grid-row: 2; border-left: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #343642 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 16px; }
.panel-heading h1, .panel-heading h2 { margin: 3px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.panel-heading h1 small { display: inline-grid; place-items: center; min-width: 24px; height: 16px; margin-left: 5px; padding: 0 5px; border-radius: 9px; background: rgba(139,108,255,.13); color: #a898f7; font-size: 8px; vertical-align: 3px; }
.eyebrow { margin: 0; color: #62646e; font-size: 8px; letter-spacing: .2em; }
.close-panel { display: none; width: 29px; height: 29px; border-radius: 7px; background: transparent; color: #8d8e98; font-size: 23px; line-height: 1; }
.close-panel:hover { background: rgba(255,255,255,.06); color: white; }

.search-box { display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #0d0e13; color: #656771; }
.search-box:focus-within { border-color: rgba(139,108,255,.55); box-shadow: 0 0 0 3px rgba(139,108,255,.08); }
.search-box svg { width: 15px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.search-box input::placeholder { color: #565863; }
.category-tabs { display: flex; gap: 4px; margin: 13px 0 12px; overflow-x: auto; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { flex: 0 0 auto; height: 26px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #747681; cursor: pointer; font-size: 10px; }
.category-tabs button:hover { color: #c8c9d0; }
.category-tabs button.active { border-color: rgba(139,108,255,.22); background: rgba(139,108,255,.1); color: #c5b9ff; }
.shape-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; max-height: calc(100% - 141px); padding: 1px 2px 65px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #32333d transparent; }
.shape-card { position: relative; display: grid; grid-template-rows: 63px auto; min-height: 91px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #15161d; color: #bdbec7; cursor: grab; text-align: left; }
.shape-card:hover { border-color: rgba(139,108,255,.42); background: #1b1b25; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.shape-card:active { cursor: grabbing; transform: scale(.98); }
.shape-card .shape-visual { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 55%, rgba(129,99,255,.13), transparent 63%); }
.shape-visual::after { content: ""; position: absolute; left: 17%; right: 17%; bottom: 7px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(5px); }
.shape-glyph { position: relative; z-index: 1; color: #a692ff; font-family: Georgia, serif; font-size: 35px; line-height: 1; text-shadow: 2px 2px 0 rgba(85,60,180,.35), 0 0 18px rgba(139,108,255,.22); transform: rotate(-7deg); }
.shape-card:nth-child(3n+2) .shape-glyph { color: #67c8ff; text-shadow: 2px 2px 0 rgba(35,103,155,.35), 0 0 18px rgba(75,177,255,.22); }
.shape-card:nth-child(3n) .shape-glyph { color: #ea83c8; text-shadow: 2px 2px 0 rgba(139,48,112,.35), 0 0 18px rgba(232,92,183,.22); }
.shape-card .card-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 7px; border-top: 1px solid rgba(255,255,255,.045); font-size: 10px; }
.shape-card .card-label i { color: #50525c; font-style: normal; font-size: 13px; }
.shape-card:hover .card-label i { color: #a998ff; }
.library-tip { position: absolute; z-index: 2; left: 15px; right: 15px; bottom: 11px; margin: 0; padding: 9px 10px; border: 1px solid rgba(139,108,255,.15); border-radius: 8px; background: rgba(20,20,29,.94); color: #686a75; font-size: 9px; line-height: 1.5; backdrop-filter: blur(10px); }
.library-tip span { margin-right: 5px; color: #aa9bff; }

.workspace { position: relative; z-index: 1; grid-column: 3; grid-row: 2; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(240px, 1fr) 178px; background: #0b0c11; }
.viewport-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 35%, #20212b 0, #111218 42%, #090a0e 100%); }
.viewport { position: absolute; inset: 0; outline: none; cursor: grab; }
.viewport:active { cursor: grabbing; }
.viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.viewport-wrap.drag-over::after { content: "释放以生成模型"; position: absolute; inset: 18px; display: grid; place-items: center; border: 1px dashed rgba(151,126,255,.85); border-radius: 14px; background: rgba(91,67,177,.13); color: #ddd6ff; letter-spacing: .08em; font-size: 13px; pointer-events: none; }

.viewport-toolbar { position: absolute; z-index: 5; top: 13px; left: 13px; display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(15,16,22,.82); box-shadow: 0 9px 28px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.canvas-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 6px; background: transparent; color: #777986; }
.canvas-btn:hover { background: rgba(255,255,255,.07); color: white; }
.canvas-btn.active { background: rgba(139,108,255,.16); color: #b9aaff; }
.canvas-btn svg { width: 16px; height: 16px; }
.toolbar-separator { width: 1px; height: 19px; margin: 0 4px; background: var(--line); }
.snap-toggle { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 2px; color: #797b86; cursor: pointer; font-size: 9px; }
.snap-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.snap-toggle span { position: relative; width: 24px; height: 13px; border-radius: 10px; background: #343641; transition: .2s; }
.snap-toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #898b95; transition: .2s; }
.snap-toggle input:checked + span { background: rgba(139,108,255,.44); }
.snap-toggle input:checked + span::after { left: 13px; background: #c6bcff; }
.snap-toggle em { font-style: normal; }
.precision-select, .space-toggle { height: 25px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: #12131a; color: #858793; font-size: 8px; }
.precision-select { width: 47px; padding: 0 3px; }
.precision-select:focus { border-color: rgba(139,108,255,.5); }
.space-toggle { padding: 0 7px; cursor: pointer; }
.space-toggle:hover { color: #c6baff; border-color: rgba(139,108,255,.35); }
.pro-toolbar { position: absolute; z-index: 5; top: 57px; left: 13px; display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(15,16,22,.84); box-shadow: 0 9px 28px rgba(0,0,0,.2); backdrop-filter: blur(14px); }
.pro-toolbar > span { width: 1px; height: 20px; margin: 0 2px; background: var(--line); }
.edit-mode-group, .boolean-group { display: flex; gap: 3px; }
.pro-toolbar button, .pro-toolbar select { height: 27px; border: 0; border-radius: 5px; background: transparent; color: #777986; cursor: pointer; font-size: 8px; }
.pro-toolbar button { padding: 0 8px; }
.pro-toolbar button:hover:not(:disabled) { background: rgba(255,255,255,.065); color: #fff; }
.pro-toolbar button.active { background: rgba(139,108,255,.17); color: #c5b9ff; }
.pro-toolbar button:disabled { opacity: .3; cursor: not-allowed; }
.pro-toolbar kbd { margin-right: 3px; color: #585a65; font: 7px ui-monospace,monospace; }
.pro-toolbar select { width: 77px; padding: 0 4px; outline: none; background: #12131a; border: 1px solid rgba(255,255,255,.06); }

.view-gizmo { position: absolute; z-index: 5; top: 14px; right: 15px; display: grid; justify-items: center; gap: 2px; opacity: .82; }
.view-gizmo .gizmo-row { display: flex; gap: 2px; }
.view-gizmo button { display: grid; place-items: center; width: 30px; height: 24px; padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; background: rgba(15,16,22,.75); color: #787a84; cursor: pointer; font-size: 8px; backdrop-filter: blur(8px); }
.view-gizmo button:hover { border-color: rgba(139,108,255,.45); color: white; background: rgba(80,62,148,.42); }
.view-gizmo > button:first-child, .view-gizmo > button:last-child { width: 34px; }

.canvas-hint { position: absolute; z-index: 3; left: 50%; top: 50%; width: 300px; transform: translate(-50%,-50%); text-align: center; pointer-events: none; transition: opacity .35s, transform .35s; }
.canvas-hint.hidden { opacity: 0; transform: translate(-50%,-45%) scale(.95); }
.canvas-hint b { display: block; margin-top: 16px; color: #c8c8d0; font-size: 13px; font-weight: 500; }
.canvas-hint p { margin: 7px 0 0; color: #5f616c; font-size: 10px; }
.hint-orbit { position: relative; display: inline-block; width: 68px; height: 68px; border: 1px solid rgba(143,118,255,.2); border-radius: 50%; box-shadow: 0 0 40px rgba(111,80,232,.08); }
.hint-orbit::before { content: ""; position: absolute; inset: 19px; border: 1px solid #8d76ee; transform: rotate(30deg) skewY(-30deg) scaleY(.86); }
.hint-orbit::after { content: ""; position: absolute; left: -7px; top: 31px; width: 80px; height: 13px; border-top: 1px solid rgba(113,208,255,.56); border-radius: 50%; transform: rotate(-12deg); }

.selection-pill { position: absolute; z-index: 5; left: 50%; bottom: 14px; display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 0 11px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 20px; background: rgba(14,15,20,.82); color: #bfc0c8; font-size: 9px; backdrop-filter: blur(10px); }
.selection-color { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.selection-pill b { font-weight: 500; }
.selection-pill > span:last-child { color: #696b76; }
.component-pill { position: absolute; z-index: 5; right: 16px; bottom: 14px; display: grid; grid-template-columns: 7px auto; column-gap: 7px; align-items: center; min-height: 38px; padding: 6px 11px; border: 1px solid rgba(255,177,87,.2); border-radius: 7px; background: rgba(17,18,24,.88); backdrop-filter: blur(12px); }
.component-pill > span { grid-row: 1 / 3; width: 7px; height: 7px; border-radius: 50%; background: #ffad57; box-shadow: 0 0 10px rgba(255,173,87,.7); }
.component-pill b { color: #dfc49f; font-size: 9px; font-weight: 500; }
.component-pill small { color: #656771; font-size: 7px; }

.generation-ring { position: absolute; z-index: 4; left: 50%; top: 50%; width: 160px; height: 74px; transform: translate(-50%,-12%); opacity: 0; pointer-events: none; }
.generation-ring i { position: absolute; inset: 0; border: 1px solid #9274ff; border-radius: 50%; transform: scale(.2); }
.generation-ring.active { opacity: 1; }
.generation-ring.active i { animation: generate-ring .8s cubic-bezier(.2,.7,.2,1) forwards; }
.generation-ring.active i:nth-child(2) { animation-delay: .09s; }
.generation-ring.active i:nth-child(3) { animation-delay: .18s; }
@keyframes generate-ring { to { opacity: 0; transform: scale(1.5); } }

.scene-strip { min-width: 0; overflow: hidden; border-top: 1px solid var(--line); background: #101117; }
.scene-strip-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 12px 0 14px; border-bottom: 1px solid rgba(255,255,255,.045); }
.scene-strip-head > div { display: flex; align-items: center; gap: 7px; }
.scene-strip-head b { color: #aeafb8; font-size: 10px; font-weight: 500; }
.scene-strip-head small { color: #575963; font-size: 8px; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(83,214,149,.55); }
.scene-actions { gap: 2px !important; }
.scene-actions button { height: 24px; padding: 0 8px; border-radius: 5px; background: transparent; color: #656772; font-size: 9px; }
.scene-actions button:hover:not(:disabled) { background: rgba(255,255,255,.06); color: #dddde3; }
.scene-actions button:disabled { opacity: .35; cursor: not-allowed; }
.scene-actions .danger-text:hover:not(:disabled) { color: #ff8294; }
.scene-actions .clear-scene { margin-left: 3px; border-left: 1px solid var(--line); border-radius: 0 5px 5px 0; }
.object-list { display: flex; align-items: center; gap: 7px; height: 76px; padding: 8px 14px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #32333d transparent; }
.empty-list { width: 100%; margin: 0; color: #4f515a; text-align: center; font-size: 9px; }
.object-card { position: relative; flex: 0 0 130px; display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 8px; height: 58px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #15161d; color: #8d8f99; cursor: pointer; text-align: left; }
.object-card:hover { border-color: rgba(255,255,255,.16); color: #d0d1d7; }
.object-card.selected { border-color: rgba(139,108,255,.58); background: rgba(139,108,255,.09); box-shadow: inset 0 0 0 1px rgba(139,108,255,.08); color: #eeeaff; }
.object-card .mini-shape { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 6px; background: linear-gradient(145deg, color-mix(in srgb, var(--object-color) 24%, #14151c), #101116); color: var(--object-color); font: 21px Georgia, serif; text-shadow: 0 0 12px var(--object-color); }
.object-card .object-meta { min-width: 0; }
.object-card b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; font-weight: 500; }
.object-card small { display: block; margin-top: 4px; color: #555762; font-size: 7px; text-transform: uppercase; }
.object-card .visible-toggle { position: absolute; right: 5px; top: 4px; width: 13px; height: 13px; padding: 0; border: 0; background: transparent; color: #5d5f69; cursor: pointer; font-size: 10px; }
.object-card .visible-toggle.off { opacity: .35; }
.object-card .lock-toggle { position: absolute; right: 19px; top: 4px; width: 13px; height: 13px; padding: 0; border: 0; background: transparent; color: #555762; cursor: pointer; font-size: 8px; }
.object-card .lock-toggle.locked { color: #ffb45d; }
.timeline { display: grid; grid-template-columns: auto 70px minmax(100px,1fr) auto auto; align-items: center; gap: 8px; height: 63px; padding: 0 13px; border-top: 1px solid rgba(255,255,255,.05); background: #0d0e13; }
.timeline-controls { display: flex; gap: 3px; }
.timeline button { height: 27px; border: 1px solid transparent; border-radius: 5px; background: #181920; color: #6f717b; cursor: pointer; font-size: 8px; }
.timeline button:hover:not(:disabled) { border-color: var(--line); color: #d2d3d9; }
.timeline button:disabled { opacity: .35; cursor: not-allowed; }
.timeline-controls button { width: 28px; padding: 0; }
.timeline-controls button.playing { background: rgba(139,108,255,.17); color: #c5b9ff; }
.frame-number { display: flex; align-items: center; color: #555762; font: 8px ui-monospace,monospace; }
.frame-number input { width: 39px; height: 26px; padding: 0 4px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: #121319; color: #aaaab3; text-align: center; font: 9px ui-monospace,monospace; }
.timeline-track { position: relative; height: 28px; display: flex; align-items: center; }
.timeline-track::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: #282a33; }
.timeline-track input { position: relative; z-index: 2; width: 100%; margin: 0; accent-color: var(--accent); }
.key-markers { position: absolute; z-index: 1; inset: 0 7px; pointer-events: none; }
.key-markers i { position: absolute; top: 10px; width: 6px; height: 6px; margin-left: -3px; background: #ffb25c; transform: rotate(45deg); box-shadow: 0 0 6px rgba(255,178,92,.4); }
.timeline .key-btn { padding: 0 9px; border-color: rgba(139,108,255,.15); background: rgba(139,108,255,.08); color: #a698e6; }
.timeline .key-btn.ghost { border-color: transparent; background: transparent; color: #666873; }

.inspector-heading { padding: 19px 16px 15px; border-bottom: 1px solid var(--line); }
.inspector-empty { display: grid; justify-items: center; padding: 74px 26px; text-align: center; }
.inspector-empty b { margin-top: 25px; color: #9697a1; font-size: 11px; font-weight: 500; }
.inspector-empty p { margin: 9px 0; color: #565861; font-size: 9px; line-height: 1.7; }
.empty-cube { width: 50px; height: 50px; border: 1px solid #3c3e48; transform: rotate(30deg) skewY(-30deg) scaleY(.86); opacity: .7; }
.inspector-content { padding-bottom: 25px; }
.object-title-row { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.object-title-row input { min-width: 0; flex: 1; height: 31px; border: 1px solid transparent; border-radius: 6px; outline: none; background: transparent; color: #e1e1e6; padding: 0 7px; font-size: 11px; font-weight: 500; }
.object-title-row input:hover, .object-title-row input:focus { border-color: var(--line); background: rgba(255,255,255,.025); }
.object-title-row span { padding: 3px 6px; border-radius: 4px; background: rgba(139,108,255,.1); color: #9c88fb; font: 7px ui-monospace, monospace; }
.property-section { border-bottom: 1px solid var(--line); }
.section-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 38px; padding: 0 16px; border: 0; background: transparent; color: #a2a3ad; cursor: pointer; font-size: 10px; font-weight: 500; text-align: left; }
.section-toggle:hover { color: white; }
.section-toggle span { color: #5c5e68; font-size: 15px; font-weight: 300; }
.section-body { padding: 2px 14px 14px; }
.section-toggle[aria-expanded="false"] + .section-body { display: none; }
.vector-row { display: grid; grid-template-columns: 42px repeat(3, minmax(0,1fr)); gap: 5px; align-items: center; margin: 7px 0; }
.vector-row label { color: #656772; font-size: 9px; }
.vector-row input, .param-control input[type="number"] { min-width: 0; height: 28px; padding: 0 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 5px; outline: none; background: #0e0f14; color: #b8b9c1; font: 9px ui-monospace, monospace; text-align: center; }
.vector-row input:focus, .param-control input[type="number"]:focus { border-color: rgba(139,108,255,.5); }
.axis-labels { display: grid; grid-template-columns: 42px repeat(3, minmax(0,1fr)); gap: 5px; margin: -4px 0 0; text-align: center; }
.axis-labels i { color: #535560; font: 7px ui-monospace, monospace; }
.axis-labels i:nth-child(2) { color: #ff7385; }.axis-labels i:nth-child(3) { color: #6bd99e; }.axis-labels i:nth-child(4) { color: #6faaff; }
.dimension-row { padding-top: 6px; border-top: 1px solid rgba(255,255,255,.05); }
.dimension-row input { border-color: rgba(139,108,255,.17); color: #c8bdff; }
.precision-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 9px; }
.precision-actions button { min-height: 27px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 5px; background: #15161d; color: #6f717c; cursor: pointer; font-size: 8px; }
.precision-actions button:hover { border-color: rgba(139,108,255,.35); background: rgba(139,108,255,.09); color: #c6baff; }
.param-controls { display: grid; gap: 9px; }
.param-control { display: grid; grid-template-columns: 68px 1fr 48px; gap: 8px; align-items: center; }
.param-control label { color: #666873; font-size: 9px; }
.param-control input[type="range"] { width: 100%; height: 3px; accent-color: var(--accent); }
.material-controls { display: grid; gap: 14px; }
.color-control { display: grid; grid-template-columns: 62px 35px 1fr; align-items: center; gap: 8px; color: #686a75; font-size: 9px; }
.color-control input { width: 34px; height: 25px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: #0d0e13; cursor: pointer; }
.color-control b { color: #777985; font: 8px ui-monospace, monospace; font-weight: 400; }
.range-control { display: grid; gap: 7px; }
.range-control span { display: flex; justify-content: space-between; color: #686a75; font-size: 9px; }
.range-control b { color: #8d8f99; font-weight: 400; }
.range-control input { width: 100%; height: 3px; accent-color: var(--accent); }
.switch-control { display: flex; justify-content: space-between; align-items: center; color: #686a75; font-size: 9px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; }
.switch-control i { position: relative; width: 28px; height: 15px; border-radius: 12px; background: #30323b; transition: .2s; }
.switch-control i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #777985; transition: .2s; }
.switch-control input:checked + i { background: rgba(139,108,255,.45); }
.switch-control input:checked + i::after { left: 15px; background: #c4b9ff; }
.join-section p { margin: 1px 0 10px; color: #686a74; font-size: 9px; line-height: 1.55; }
.join-section .align-title { margin: 11px 0 6px; color: #595b65; font-size: 8px; }
.align-grid button { font-size: 8px; }
.join-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.join-grid button, .wide-action { height: 28px; border-radius: 5px; background: #20212a; color: #898b96; font-size: 9px; }
.join-grid button:hover, .wide-action:hover { background: rgba(139,108,255,.16); color: #c4b8ff; }
.wide-action { width: 100%; margin-top: 7px; border: 1px solid rgba(139,108,255,.18); background: rgba(139,108,255,.08); }
.modifier-select { display: grid; grid-template-columns: 55px 1fr; align-items: center; gap: 8px; color: #686a75; font-size: 9px; }
.modifier-select select { height: 28px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: #0e0f14; color: #999ba5; padding: 0 5px; font-size: 9px; }
.modifier-amount { margin-top: 12px; }
.normal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.normal-actions button { height: 27px; border: 1px solid var(--line); border-radius: 5px; background: #15161d; color: #70727d; cursor: pointer; font-size: 8px; }
.normal-actions button:hover { border-color: rgba(139,108,255,.3); color: #c2b7fa; }
.modifier-section p { margin: 9px 0 0; color: #52545e; font-size: 8px; line-height: 1.5; }

.statusbar { position: relative; z-index: 40; grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-top: 1px solid var(--line); background: #0d0e12; color: #54565f; font-size: 8px; }
.status-stats b { color: #797b85; font-weight: 400; }

.menu-popover { position: fixed; z-index: 100; width: 220px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(25,26,34,.98); box-shadow: 0 20px 50px rgba(0,0,0,.46); backdrop-filter: blur(20px); }
.export-popover button, .export-popover label { display: grid; width: 100%; gap: 3px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #bcbdc5; text-align: left; cursor: pointer; }
.export-popover button:hover, .export-popover label:hover { background: rgba(255,255,255,.055); }
.export-popover b { font-size: 10px; font-weight: 500; }
.export-popover span { color: #686a74; font-size: 8px; }
.export-popover input { display: none; }
.popover-line { display: block; height: 1px; margin: 5px 3px; background: var(--line); }

dialog { width: min(580px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: #171820; color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(3,4,7,.72); backdrop-filter: blur(5px); }
dialog form { padding: 21px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; }
.dialog-head h2 { margin: 4px 0 0; font-size: 19px; }
.dialog-head button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #7d7f89; cursor: pointer; font-size: 23px; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.shortcut-grid > div { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #13141a; }
.shortcut-grid kbd, .mouse-icon { display: grid; place-items: center; flex: 0 0 49px; height: 31px; border: 1px solid #363844; border-bottom-width: 3px; border-radius: 6px; background: #1d1e26; color: #a5a6ae; font: 9px ui-monospace, monospace; }
.shortcut-grid p { display: grid; gap: 4px; margin: 0; }
.shortcut-grid b { color: #bcbcc4; font-size: 10px; font-weight: 500; }
.shortcut-grid small { color: #5f616b; font-size: 8px; }
.dialog-confirm { width: 100%; }

.toast-stack { position: fixed; z-index: 200; right: 16px; bottom: 43px; display: grid; gap: 7px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 210px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(25,26,34,.96); color: #c6c7ce; box-shadow: 0 14px 35px rgba(0,0,0,.4); font-size: 10px; animation: toast-in .25s ease both; }
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 9px var(--danger); }
.toast.out { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

.loading-screen { position: fixed; z-index: 500; inset: 0; display: flex; align-items: center; justify-content: center; gap: 25px; background: #090a0e; transition: opacity .45s, visibility .45s; }
.loading-screen.done { opacity: 0; visibility: hidden; }
.loading-screen > div { display: grid; gap: 6px; }
.loading-screen b { color: #d8d8df; font-size: 13px; font-weight: 500; }
.loading-screen span { color: #555762; font-size: 9px; }
.loader-cube { position: relative; width: 42px; height: 45px; transform-style: preserve-3d; animation: loader-spin 2s ease-in-out infinite; }
.loader-cube i { position: absolute; width: 31px; height: 31px; border: 1px solid rgba(151,126,255,.85); background: rgba(114,84,231,.06); }
.loader-cube i:nth-child(1) { transform: rotate(30deg) skewY(-30deg) scaleY(.86); }
.loader-cube i:nth-child(2) { transform: translate(15px,9px) rotate(30deg) skewY(-30deg) scaleY(.86); opacity: .55; }
.loader-cube i:nth-child(3) { transform: translate(7px,17px) rotate(30deg) skewY(-30deg) scaleY(.86); opacity: .3; }
@keyframes loader-spin { 50% { transform: translateY(-5px) rotate(8deg); } }

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: var(--rail) minmax(0,1fr); }
  .library-panel, .inspector-panel { position: fixed; top: var(--top); bottom: var(--status); width: 286px; box-shadow: 20px 0 50px rgba(0,0,0,.42); }
  .library-panel { left: var(--rail); transform: translateX(-110%); }
  .library-panel.open { transform: translateX(0); }
  .inspector-panel { right: 0; width: 304px; transform: translateX(110%); box-shadow: -20px 0 50px rgba(0,0,0,.42); }
  .inspector-panel.open { transform: translateX(0); }
  .workspace { grid-column: 2; }
  .close-panel { display: block; }
}

@media (max-width: 720px) {
  :root { --top: 56px; --rail: 54px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 8px 0 11px; }
  .brand small, .brand > span:last-child { display: none; }
  .brand-mark { transform: scale(.82); }
  .project-title { justify-self: stretch; }
  .project-title input { width: 100%; font-size: 11px; }
  .top-actions { gap: 2px; }
  .top-actions .text-btn, .mobile-hide { display: none; }
  .primary-btn { width: 37px; padding: 0; font-size: 0; }
  .primary-btn svg { width: 17px; }
  .tool-rail { padding-left: 4px; padding-right: 4px; }
  .rail-btn { width: 45px; height: 51px; }
  .rail-btn.active::before { left: -4px; }
  .workspace { grid-template-rows: minmax(230px, 1fr) 152px; }
  .library-panel { left: var(--rail); width: min(286px, calc(100vw - var(--rail))); }
  .inspector-panel { width: min(304px, calc(100vw - var(--rail))); }
  .viewport-toolbar { top: 8px; left: 8px; }
  .snap-toggle, .precision-select, .space-toggle, .toolbar-separator, .view-gizmo { display: none; }
  .selection-pill { bottom: 9px; }
  .component-pill { right: 8px; bottom: 8px; }
  .pro-toolbar { top: 51px; left: 8px; right: 8px; max-width: calc(100% - 16px); overflow-x: auto; scrollbar-width: none; }
  .pro-toolbar::-webkit-scrollbar { display: none; }
  .pro-toolbar > span { flex: 0 0 1px; }
  .pro-toolbar button, .pro-toolbar select { flex: 0 0 auto; }
  .scene-strip-head { padding: 0 8px; }
  .scene-actions button { padding: 0 5px; font-size: 8px; }
  .object-list { height: 58px; padding: 5px 8px; }
  .object-card { flex-basis: 112px; height: 52px; grid-template-columns: 31px 1fr; }
  .object-card .mini-shape { width: 30px; height: 30px; }
  .timeline { grid-template-columns: auto 56px minmax(80px,1fr) auto; height: 56px; padding: 0 7px; gap: 4px; }
  .timeline .key-btn { padding: 0 6px; font-size: 0; }
  .timeline .key-btn::first-letter { font-size: 9px; }
  .timeline .key-btn.ghost { display: none; }
  .shortcut-grid { grid-template-columns: 1fr; max-height: 55vh; overflow-y: auto; }
  .status-stats { display: none; }
  .toast-stack { left: 65px; right: 10px; }
  .toast { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
