:root { color-scheme: dark; --bg: #0b0d10; --panel: #14171b; --panel-2: #20252c; --line: rgba(236,242,247,.1); --line-strong: rgba(236,242,247,.19); --text: #f3f5f7; --muted: #98a2ae; --accent: #52d3b2; --danger: #f05f6b; --global-nav-height: 64px; }
* { box-sizing: border-box; }
body.canvas-page { width: 100%; height: 100%; margin: 0; overflow: hidden; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.canvas-app { display: grid; grid-template-rows: 62px 1fr; width: 100%; height: 100%; }
.infinite-canvas-mode { position: relative; height: min(76vh, 900px); min-height: 680px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.canvas-app.embedded { position: relative; grid-template-rows: 54px 1fr; min-height: 0; }
.canvas-app.embedded .canvas-topbar { gap: 12px; padding: 0 14px; }
.canvas-app.embedded .canvas-brand, .canvas-app.embedded .product-nav { display: none; }
.canvas-app.embedded .document-controls { margin-left: 0; }
.canvas-app.embedded .account-controls { display: none; }
.canvas-app.embedded .history-panel { position: absolute; top: 66px; bottom: 14px; left: 72px; }
.canvas-app.embedded .canvas-login-gate { position: absolute; inset: 54px 0 0; }
.workspace-head-actions { display: flex; align-items: center; gap: 12px; }
.workspace-mode-switch { display: inline-flex; gap: 3px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.workspace-mode-switch button { min-height: 32px; padding: 0 14px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; }
.workspace-mode-switch button.active { color: #071511; font-weight: 800; background: var(--accent); }
.workspace-mode-switch button:disabled { cursor: not-allowed; opacity: .38; }
#canvas[data-active-workspace="canvas"] #workspace { display: none !important; }
#canvas[data-active-workspace="standard"] #infiniteCanvasMode { display: none !important; }
body[data-workspace-mode="canvas"] { height: 100dvh; overflow: hidden; }
body[data-workspace-mode="canvas"] .site-shell { height: 100dvh; min-height: 0; overflow: hidden; }
body[data-workspace-mode="canvas"] .nav { grid-template-columns: 1fr auto 1fr; width: min(100% - 32px, 1600px); }
body[data-workspace-mode="canvas"] .nav-links { visibility: hidden; pointer-events: none; }
body[data-workspace-mode="canvas"] .page { width: 100%; }
body[data-workspace-mode="canvas"] .hero,
body[data-workspace-mode="canvas"] #promptLibrary,
body[data-workspace-mode="canvas"] #history,
body[data-workspace-mode="canvas"] #admin,
body[data-workspace-mode="canvas"] #canvas > .section-head { display: none !important; }
body[data-workspace-mode="canvas"] #canvas { height: calc(100dvh - var(--global-nav-height)); padding: 0; border: 0; }
body[data-workspace-mode="canvas"] #infiniteCanvasMode { width: 100%; height: calc(100dvh - var(--global-nav-height)); min-height: 0; border: 0; border-radius: 0; }
body[data-workspace-mode="canvas"] #loginGate { height: calc(100dvh - var(--global-nav-height)); min-height: 0; border-width: 1px 0 0; border-radius: 0; }
.nav-primary { display: flex; align-items: center; min-width: 0; gap: 14px; white-space: nowrap; }
.nav-primary .brand, .nav-primary .nav-links { flex: 0 0 auto; white-space: nowrap; }
.nav-primary .nav-links a { white-space: nowrap; }
.nav:has(.top-workspace-switch) { grid-template-columns: 1fr auto 1fr; gap: 14px; }
.top-workspace-switch { justify-self: center; }
.nav > .nav-actions { justify-self: end; }
.canvas-topbar { z-index: 20; display: flex; align-items: center; gap: 22px; min-width: 0; padding: 0 18px; background: rgba(10,10,10,.96); border-bottom: 1px solid var(--line); }
.canvas-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; white-space: nowrap; }
.canvas-brand-mark { display: block; width: 30px; height: 30px; background: transparent; border-radius: 8px; mix-blend-mode: screen; }
.brand-spark { color: var(--accent); font-size: 24px; }
.product-nav { display: flex; align-self: stretch; gap: 4px; }
.product-nav a { position: relative; display: grid; place-items: center; padding: 0 13px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.product-nav a.active { color: var(--text); }
.product-nav a.active::after { position: absolute; right: 12px; bottom: 0; left: 12px; height: 2px; content: ""; background: var(--accent); }
.document-controls { display: flex; align-items: center; gap: 7px; min-width: 0; margin-left: auto; }
.canvas-title { width: 150px; min-height: 34px; padding: 0 10px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 7px; }
.canvas-title:hover, .canvas-title:focus { outline: none; background: var(--panel); border-color: var(--line); }
.top-icon, .tool-button, .zoom-controls button, .history-head button { display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 7px; }
.top-icon { width: 34px; height: 34px; font-size: 20px; }
.top-icon:hover, .tool-button:hover { color: var(--text); background: var(--panel); border-color: var(--line); }
.save-status { display: inline-flex; align-items: center; gap: 7px; margin-left: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-status i { width: 7px; height: 7px; background: #22c55e; border-radius: 50%; }
.save-status.saving i { background: #f59e0b; }
.save-status.error i { background: var(--danger); }
.account-controls { display: flex; align-items: center; gap: 10px; margin-left: 6px; white-space: nowrap; }
.credit-pill, .user-pill { padding: 8px 11px; color: var(--muted); font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.credit-pill strong { color: var(--text); }
.canvas-layout { display: grid; grid-template-columns: 64px minmax(0,1fr) 320px; min-height: 0; }
.tool-rail { z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 9px; background: #101010; border-right: 1px solid var(--line); }
.tool-button { width: 44px; height: 44px; font-size: 19px; }
.tool-button.active { color: var(--accent); background: rgba(57,208,195,.09); border-color: rgba(57,208,195,.38); }
.canvas-viewport { position: relative; min-width: 0; overflow: hidden; outline: none; cursor: default; background-color: #0d0d0d; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 18px 18px; }
.canvas-viewport.is-long-pressing { cursor: grab; }
.canvas-viewport.is-panning { cursor: grabbing; }
.canvas-world { position: absolute; top: 0; left: 0; width: 1px; height: 1px; transform-origin: 0 0; will-change: transform; }
.edge-layer, .node-layer { position: absolute; top: 0; left: 0; overflow: visible; }
.edge-layer { width: 1px; height: 1px; pointer-events: none; }
.edge-path { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .76; vector-effect: non-scaling-stroke; }
.canvas-node { position: absolute; overflow: hidden; color: var(--text); background: rgba(23,23,23,.97); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 18px 48px rgba(0,0,0,.34); }
.canvas-node.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(57,208,195,.12), 0 18px 48px rgba(0,0,0,.38); }
.canvas-node.frame-node { z-index: -1; background: rgba(255,255,255,.018); border-style: dashed; box-shadow: none; }
.node-header { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 13px; border-bottom: 1px solid var(--line); cursor: grab; }
.node-header small { color: var(--muted); }
.node-body { padding: 14px; }
.prompt-copy { display: -webkit-box; min-height: 76px; overflow: hidden; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.prompt-copy.empty { color: var(--muted); }
.node-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.node-tags span, .status-pill { padding: 5px 8px; color: var(--muted); font-size: 11px; background: #101010; border: 1px solid var(--line); border-radius: 6px; }
.node-generate { width: 100%; min-height: 40px; color: #111; font-weight: 800; background: #fafaf9; border: 0; border-radius: 7px; }
.reference-media { position: relative; }
.reference-image { width: 100%; height: 220px; object-fit: contain; background: #0d0d0d; border-radius: 6px; }
.reference-extract-button { position: absolute; right: 10px; bottom: 10px; min-height: 36px; padding: 0 12px; color: var(--text); font-size: 12px; font-weight: 800; background: rgba(13,13,13,.9); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: 0 8px 24px rgba(0,0,0,.38); backdrop-filter: blur(8px); }
.reference-extract-button:not(:disabled):hover { color: #071511; background: var(--accent); border-color: var(--accent); }
.reference-extract-button:disabled { cursor: wait; opacity: .88; }
.reference-extract-button.completed:disabled { cursor: default; }
.reference-extract-button.failed { color: #fecaca; border-color: rgba(240,95,107,.55); }
.result-images { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.result-images img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #0d0d0d; border-radius: 6px; }
.result-message { display: grid; place-items: center; min-height: 180px; color: var(--muted); text-align: center; }
.result-message.processing::before { width: 28px; height: 28px; margin-bottom: 12px; content: ""; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.port { position: absolute; top: 50%; width: 14px; height: 14px; background: #111; border: 2px solid var(--accent); border-radius: 50%; transform: translateY(-50%); }
.port.input { left: -8px; } .port.output { right: -8px; }
.empty-hint { position: absolute; top: 50%; left: 50%; display: grid; gap: 7px; padding: 24px 28px; color: var(--muted); text-align: center; background: rgba(23,23,23,.9); border: 1px dashed var(--line-strong); border-radius: 9px; transform: translate(-50%,-50%); pointer-events: none; }
.empty-hint strong { color: var(--text); }
.zoom-controls { position: absolute; bottom: 18px; left: 50%; display: flex; align-items: center; gap: 2px; padding: 5px; background: rgba(20,20,20,.95); border: 1px solid var(--line); border-radius: 9px; transform: translateX(-50%); box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.zoom-controls button { width: 36px; height: 34px; font-size: 18px; }
.zoom-controls strong { min-width: 62px; color: var(--muted); font-size: 13px; text-align: center; }
.minimap { position: absolute; right: 18px; bottom: 18px; width: 180px; height: 110px; overflow: hidden; background: rgba(17,17,17,.94); border: 1px solid var(--line-strong); border-radius: 8px; }
.minimap-node { position: absolute; min-width: 5px; min-height: 4px; background: rgba(57,208,195,.25); border: 1px solid rgba(57,208,195,.55); }
.node-inspector { z-index: 13; min-width: 0; overflow-y: auto; background: #121212; border-left: 1px solid var(--line); }
.inspector-tabs { display: flex; align-items: center; gap: 26px; height: 58px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.inspector-tabs strong { height: 58px; padding-top: 20px; border-bottom: 2px solid var(--accent); }
.inspector-tabs span { color: var(--muted); }
.inspector-empty { display: grid; gap: 8px; padding: 36px 20px; color: var(--muted); text-align: center; }
.inspector-form { display: grid; gap: 14px; padding: 18px; }
.inspector-head { display: flex; align-items: center; justify-content: space-between; }
.inspector-form label { display: grid; gap: 7px; }
.inspector-form label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.inspector-form input, .inspector-form textarea, .inspector-form select { width: 100%; min-height: 39px; padding: 9px 10px; color: var(--text); outline: none; background: #0b0b0b; border: 1px solid var(--line); border-radius: 7px; }
.inspector-form textarea { resize: vertical; line-height: 1.6; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inspector-form output { color: var(--muted); font-size: 12px; }
.cost-box { display: flex; align-items: center; justify-content: space-between; padding: 12px; color: var(--muted); background: #0b0b0b; border: 1px solid var(--line); border-radius: 7px; }
.cost-box strong { color: var(--text); }
.generate-button { min-height: 44px; color: #111; font-weight: 800; background: #fafaf9; border: 0; border-radius: 7px; }
.reverse-prompt-button { min-height: 44px; color: #071511; font-weight: 800; background: var(--accent); border: 0; border-radius: 7px; }
.reverse-prompt-button:disabled { color: var(--muted); cursor: wait; background: #202020; }
.reverse-prompt-status { margin: 0; padding: 11px 12px; line-height: 1.55; background: #0b0b0b; border: 1px solid var(--line); border-radius: 7px; }
.reverse-prompt-status.processing { color: #99f6e4; border-color: rgba(82,211,178,.34); }
.reverse-prompt-status.completed { color: #bbf7d0; border-color: rgba(34,197,94,.34); }
.reverse-prompt-status.failed { color: #fecaca; border-color: rgba(240,95,107,.38); }
.danger-button { padding: 6px 9px; color: #fca5a5; background: transparent; border: 1px solid rgba(239,68,68,.28); border-radius: 6px; }
.generic-inspector { display: grid; gap: 14px; padding: 18px; color: var(--muted); }
.generic-inspector img { width: 100%; max-height: 240px; object-fit: contain; background: #0b0b0b; border-radius: 7px; }
.history-panel { position: fixed; z-index: 30; top: 74px; bottom: 18px; left: 78px; width: 330px; overflow: hidden; background: #151515; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.history-head div { display: grid; gap: 4px; }
.history-head span { color: var(--muted); font-size: 12px; }
.history-head button { width: 32px; height: 32px; font-size: 22px; }
.history-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: calc(100% - 72px); padding: 12px; overflow-y: auto; }
.history-item { padding: 0; overflow: hidden; background: #0d0d0d; border: 1px solid var(--line); border-radius: 7px; }
.history-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #090b0d; }
.history-empty { grid-column: 1 / -1; padding: 30px 12px; color: var(--muted); text-align: center; }
.canvas-login-gate { position: fixed; z-index: 100; inset: 62px 0 0; display: grid; place-items: center; background: rgba(10,10,10,.92); backdrop-filter: blur(8px); }
.canvas-login-gate > div { display: grid; justify-items: center; max-width: 430px; padding: 38px; text-align: center; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; }
.canvas-login-gate h1 { margin: 12px 0 4px; }
.canvas-login-gate p { color: var(--muted); }
.canvas-login-gate a { margin-top: 12px; padding: 11px 18px; color: #111; font-weight: 800; text-decoration: none; background: #fafaf9; border-radius: 7px; }
.canvas-toast { position: fixed; z-index: 120; right: 22px; bottom: 22px; max-width: 360px; padding: 12px 15px; background: #202020; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.42); }
@media (max-width: 1080px) { .product-nav a { padding: 0 7px; font-size: 12px; } .save-status { display: none; } .canvas-layout { grid-template-columns: 56px minmax(0,1fr) 286px; } }
@media (max-width: 1180px) { .nav-primary { gap: 8px; } .nav-primary .nav-links a { padding-right: 6px; padding-left: 6px; font-size: 13px; } }
@media (max-width: 980px) { .nav { grid-template-columns: 1fr auto max-content; gap: 10px; } .nav-primary .nav-links { display: none; } }
@media (max-width: 520px) { .nav-primary .brand > span:last-child { display: none; } .top-workspace-switch { padding: 3px; } .workspace-mode-switch button { min-height: 32px; padding: 0 8px; } }
@media (max-width: 760px) { .workspace-head-actions { align-items: flex-end; flex-direction: column; } .workspace-mode-switch button { padding: 0 10px; } .infinite-canvas-mode { min-height: 720px; border-radius: 12px; } .canvas-app { grid-template-rows: 54px 1fr; } .canvas-topbar { gap: 10px; padding: 0 10px; } .product-nav a:not(.active), .document-controls .top-icon, .user-pill { display: none; } .canvas-title { width: 110px; } .canvas-layout { grid-template-columns: 50px minmax(0,1fr); } .node-inspector { position: fixed; z-index: 40; right: 0; bottom: 0; left: 50px; max-height: 48vh; border-top: 1px solid var(--line-strong); border-left: 0; } .canvas-app.embedded .node-inspector { position: absolute; } .canvas-viewport { padding-bottom: 48vh; } .minimap { display: none; } .canvas-app.embedded .history-panel { right: 10px; left: 58px; width: auto; } }
