:root {
  --ink: #172033;
  --muted: #7b8497;
  --line: #dce2eb;
  --panel: #ffffff;
  --canvas: #f7f8fb;
  --purple: #6c4cff;
  --purple-dark: #5538e8;
  --purple-soft: #f0edff;
  --mint: #20b486;
  --mint-soft: #eaf9f4;
  --amber: #d59a37;
  --amber-soft: #fff9e9;
  --rose: #e66e87;
  --shadow: 0 20px 50px rgba(39, 45, 74, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; min-width: 1180px; color: var(--ink); background: #f7f8fc; overflow: hidden; font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; }
#app { width: 100%; height: 100%; overflow: hidden; }
button, textarea { font: inherit; }
input { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(108, 76, 255, .22); outline-offset: 2px; }
.hidden { display: none !important; }

.topbar {
  height: 68px; display: flex; align-items: center; padding: 0 24px 0 28px;
  background: rgba(255,255,255,.94); border-bottom: 1px solid #e8ebf1; position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 0; font-weight: 760; font-size: 18px; cursor: pointer; }
.brand em { font-style: normal; color: var(--purple); background: var(--purple-soft); font-size: 11px; border-radius: 6px; padding: 4px 6px; letter-spacing: .04em; }
.brand-mark { position: relative; width: 28px; height: 28px; display: inline-block; transform: rotate(-7deg); }
.brand-mark i { position: absolute; width: 14px; height: 7px; border-radius: 10px; background: var(--purple); left: 7px; }
.brand-mark i:nth-child(1) { top: 3px; transform: rotate(30deg); }
.brand-mark i:nth-child(2) { top: 10px; transform: rotate(-30deg); background: #9a88ff; }
.brand-mark i:nth-child(3) { top: 17px; transform: rotate(30deg); background: #cabfff; }
.topbar-center { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 650; font-size: 14px; color: #565e70; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.account-controls { display: flex; align-items: center; gap: 7px; margin-right: 5px; padding-right: 12px; border-right: 1px solid #e7e9ee; }
.account-controls span { max-width: 120px; overflow: hidden; color: #596275; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.account-controls button { height: 29px; padding: 0 9px; border: 1px solid #e1e4ea; border-radius: 7px; background: white; color: #81899a; font-size: 9px; cursor: pointer; }
.account-controls button:hover { border-color: #c8c0ef; color: #6652cb; }
.auth-mode .save-state, .auth-mode .icon-button, .auth-mode .secondary-button, .auth-mode .primary-button,
.dashboard-mode .save-state, .dashboard-mode .icon-button, .dashboard-mode .secondary-button, .dashboard-mode .primary-button { display: none; }
.save-state { font-size: 12px; color: #8a93a3; margin-right: 8px; }
.icon-button, .secondary-button, .primary-button { border-radius: 9px; height: 36px; border: 1px solid #e0e4eb; background: white; cursor: pointer; }
.icon-button { width: 36px; font-size: 20px; color: #626b7e; }
.secondary-button { padding: 0 14px; font-size: 13px; font-weight: 600; }
.primary-button { padding: 0 18px; background: var(--ink); color: white; border-color: var(--ink); font-size: 13px; font-weight: 650; }

.auth-view { position: relative; height: calc(100vh - 68px); display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg,#f8f7ff 0%,#f4f7fb 48%,#f3faf8 100%); }
.auth-view::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#d9dce8 1px,transparent 1px); background-size: 24px 24px; opacity: .42; mask-image: radial-gradient(circle at center,black,transparent 72%); }
.auth-glow { position: absolute; width: 540px; height: 540px; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.auth-glow-one { left: 4%; top: -290px; background: radial-gradient(circle,rgba(142,115,255,.22),transparent 68%); }
.auth-glow-two { right: -80px; bottom: -310px; background: radial-gradient(circle,rgba(52,201,158,.16),transparent 68%); }
.auth-card { position: relative; z-index: 1; width: 420px; padding: 34px 38px 29px; border: 1px solid rgba(220,219,235,.9); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 28px 80px rgba(47,43,82,.14); backdrop-filter: blur(14px); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 25px; }
.auth-brand strong { font-size: 16px; }
.auth-brand em { margin-left: 4px; padding: 3px 5px; border-radius: 5px; background: var(--purple-soft); color: var(--purple); font-size: 9px; font-style: normal; }
.auth-copy { text-align: center; }
.auth-copy > span { color: #705bd4; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.auth-copy h1 { margin: 8px 0 8px; font-size: 28px; letter-spacing: -.025em; }
.auth-copy p { margin: 0 0 24px; color: #8a92a2; font-size: 11px; line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form label > span { display: block; margin: 0 0 7px 2px; color: #60697b; font-size: 10px; font-weight: 650; }
.auth-form input { width: 100%; height: 43px; padding: 0 13px; border: 1px solid #dfe2e9; border-radius: 10px; background: #fbfbfd; color: #293246; font-size: 12px; transition: .18s; }
.auth-form input:focus { border-color: #9f91e8; background: white; outline: 3px solid rgba(108,76,255,.1); }
.auth-error { padding: 9px 10px; border: 1px solid #f1c8d1; border-radius: 8px; background: #fff5f7; color: #bd526a; font-size: 10px; }
.auth-submit { height: 44px; margin-top: 2px; border: 0; border-radius: 11px; background: linear-gradient(120deg,#6546eb,#7b5af7); color: white; font-size: 12px; font-weight: 700; box-shadow: 0 9px 24px rgba(91,64,226,.24); cursor: pointer; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-switch { display: block; margin: 16px auto 0; border: 0; background: transparent; color: #8a92a2; font-size: 10px; cursor: pointer; }
.auth-switch strong { color: #6753d3; }
.auth-note { display: block; margin-top: 20px; padding-top: 16px; border-top: 1px solid #ececf2; color: #a0a7b5; font-size: 8px; text-align: center; }

.welcome { height: calc(100vh - 68px); position: relative; overflow-x: hidden; overflow-y: auto; background: linear-gradient(180deg,#fbfbfe 0%,#f5f6fb 100%); }
.welcome::before { content:""; position:absolute; inset:0; background-image: radial-gradient(#dce0e9 1px, transparent 1px); background-size: 24px 24px; opacity:.42; mask-image: linear-gradient(to bottom, black, transparent 76%); }
.welcome-glow { position: absolute; border-radius: 50%; filter: blur(8px); opacity: .55; }
.glow-one { width: 540px; height: 540px; background: radial-gradient(circle, rgba(164,141,255,.22), transparent 68%); top: -210px; left: 18%; }
.glow-two { width: 500px; height: 500px; background: radial-gradient(circle, rgba(72,211,171,.13), transparent 69%); right: -140px; bottom: -220px; }
.welcome-inner { width: min(960px, calc(100% - 80px)); margin: 0 auto; padding: 68px 0 42px; position: relative; z-index: 2; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: white; border: 1px solid #e5e2fb; border-radius: 99px; color: #6656b9; padding: 7px 12px; font-size: 12px; font-weight: 650; box-shadow: 0 6px 18px rgba(63,50,133,.06); }
.eyebrow span { color: #9a6fff; }
.eyebrow i { font-style: normal; margin-left: 4px; padding-left: 9px; border-left: 1px solid #e7e3f7; color: #8d95a3; font-size: 9px; }
.eyebrow i.connected { color: #26936f; }
.eyebrow i.offline { color: #b57825; }
h1 { margin: 20px 0 14px; font-size: 52px; line-height: 1.15; letter-spacing: -.045em; font-weight: 810; }
h1 span { background: linear-gradient(100deg,#6848f5 20%,#9b5bdd 60%,#a25cb4); -webkit-background-clip: text; color: transparent; }
.lead { margin: 0 auto 28px; max-width: 650px; color: #747d90; font-size: 16px; line-height: 1.75; }
.composer { text-align: left; background: white; border: 1px solid #dedff0; border-radius: 18px; padding: 7px; box-shadow: 0 18px 55px rgba(50,45,88,.12), 0 0 0 4px rgba(108,76,255,.04); transition: .2s; }
.composer:focus-within { border-color: #a99bf7; box-shadow: 0 20px 60px rgba(75,57,155,.15), 0 0 0 4px rgba(108,76,255,.08); transform: translateY(-1px); }
.composer textarea { display: block; width: 100%; resize: none; border: 0; padding: 20px 21px 8px; color: #273044; line-height: 1.65; font-size: 15px; background: transparent; }
.composer textarea::placeholder { color: #a4abbb; }
.composer textarea:focus { outline: 0; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; padding: 6px 7px 7px 16px; }
.composer-hint { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #a0a7b5; }
kbd { min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e0e3e9; background: #f7f8fa; border-radius: 5px; box-shadow: 0 1px 1px #dfe2e9; }
.composer-hint span { margin-left: 4px; }
.generate-button { border: 0; height: 44px; border-radius: 12px; padding: 0 18px 0 20px; color: white; background: linear-gradient(120deg,#6848ee,#7c5bfa); cursor: pointer; font-weight: 680; display: flex; align-items: center; gap: 16px; box-shadow: 0 8px 22px rgba(91,64,226,.27); }
.generate-button:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(91,64,226,.34); }
.generate-button b { font-size: 19px; font-weight: 400; }
.starter-row { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 17px; }
.starter-row > span { font-size: 11px; color: #a1a8b6; margin-right: 2px; }
.starter-row button { border: 1px solid #e3e6ed; background: rgba(255,255,255,.72); border-radius: 99px; padding: 7px 11px; color: #70798b; font-size: 11px; cursor: pointer; }
.starter-row button:hover { border-color: #bbb0f2; color: #6352c9; background: white; }
.recent-section { margin-top: 28px; text-align: left; }
.recent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 2px; }
.recent-head strong { font-size: 12px; }
.recent-head span { color: #9ba2b0; font-size: 10px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recent-card { position: relative; border: 1px solid #e2e5ec; background: rgba(255,255,255,.78); border-radius: 11px; padding: 0; min-height: 92px; transition: .18s; overflow: hidden; }
.recent-card:hover { transform: translateY(-2px); background: white; border-color: #c4baf2; box-shadow: 0 9px 24px rgba(50,45,88,.08); }
.recent-card-open { display: block; width: 100%; padding: 13px 42px 13px 13px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.recent-card strong, .recent-card small { display: block; }
.recent-card strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-card small { color: #979ead; font-size: 9px; margin: 6px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-card .recent-meta { display: flex; align-items: center; justify-content: space-between; color: #8d95a3; font-size: 8px; }
.recent-card .recent-meta b { color: #6753d3; }
.recent-card-delete { position: absolute; right: 9px; top: 9px; width: 25px; height: 25px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #a1a7b3; font-size: 15px; cursor: pointer; }
.recent-card-delete:hover { border-color: #efc8d0; background: #fff3f5; color: #d25f76; }
.quality-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 40px; text-align: left; }
.quality-strip div { position: relative; min-height: 86px; background: rgba(255,255,255,.6); border: 1px solid rgba(225,228,236,.8); border-radius: 13px; padding: 17px 16px 14px 56px; }
.quality-strip span { position: absolute; left: 16px; top: 17px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f1efff; color: #725dde; font-size: 10px; font-weight: 700; }
.quality-strip strong, .quality-strip small { display: block; }
.quality-strip strong { font-size: 13px; margin-bottom: 6px; }
.quality-strip small { font-size: 11px; color: #929aaa; }

.workspace { height: calc(100vh - 68px); min-height: 0; display: grid; grid-template-columns: 350px minmax(0,1fr); overflow: hidden; background: #f5f6fa; }
.canvas-shell { min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.canvas-shell::after, .ai-panel::after { content: ""; position: absolute; inset: 0; z-index: 40; border: 2px solid transparent; pointer-events: none; transition: border-color .16s, box-shadow .16s; }
.canvas-shell.pane-active::after, .ai-panel.pane-active::after { border-color: rgba(108,76,255,.28); box-shadow: inset 0 0 0 1px rgba(108,76,255,.05); }
.canvas-toolbar { height: 60px; background: white; border-bottom: 1px solid #e4e7ed; display: flex; align-items: center; justify-content: space-between; padding: 0 18px 0 22px; position: relative; z-index: 10; }
.canvas-title { display: flex; align-items: center; gap: 10px; }
.canvas-title strong, .canvas-title small { display: block; }
.canvas-title strong { font-size: 14px; }
.canvas-title small { margin-top: 3px; color: #9aa1ae; font-size: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #21b98b; box-shadow: 0 0 0 4px #e3f7f1; }
.canvas-toolbar-actions { display: flex; align-items: center; gap: 9px; }
.prototype-manager-button { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #dcd6f8; border-radius: 8px; background: #f7f5ff; color: #6652cb; font-size: 10px; font-weight: 650; cursor: pointer; }
.prototype-manager-button:hover { border-color: #b9adf0; background: #efecff; }
.prototype-manager-button span { font-size: 13px; }
.prototype-manager-button b { min-width: 28px; padding: 3px 5px; border-radius: 99px; background: white; color: #7c6bd3; font-size: 8px; text-align: center; }
.prototype-manager-button:disabled { opacity: .5; cursor: not-allowed; }
.zoom-controls { display: flex; align-items: center; border: 1px solid #e2e5eb; background: #fafbfc; border-radius: 8px; overflow: hidden; height: 32px; }
.zoom-controls button { border: 0; background: transparent; min-width: 32px; height: 100%; color: #697285; cursor: pointer; font-size: 12px; }
.zoom-controls button:last-child { border-left: 1px solid #e2e5eb; padding: 0 10px; }
.zoom-controls span { width: 48px; text-align: center; font-size: 11px; color: #6e7687; }
.canvas-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; overscroll-behavior: contain; background-color: var(--canvas); background-image: radial-gradient(#d7dbe4 .8px, transparent .8px); background-size: 22px 22px; cursor: default; }
.canvas-stage { width: 1700px; height: 980px; position: relative; transform-origin: 0 0; }
.edge-layer { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#nodeLayer { position: absolute; inset: 0; z-index: 3; }
.edge-path { fill: none; stroke: #98a2b3; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; shape-rendering: geometricPrecision; }
.edge-label { font-size: 9px; font-weight: 650; fill: #667085; }
.flow-node { width: 176px; position: absolute; transform: translate(-50%,-50%); cursor: grab; user-select: none; z-index: 3; }
.flow-node:active { cursor: grabbing; }
.node-card { min-height: 72px; background: white; border: 1px solid #dfe3ea; border-radius: 9px; box-shadow: 0 4px 12px rgba(44,50,72,.05); padding: 11px 12px; position: relative; transition: box-shadow .18s, transform .18s; }
.actor-system:not(.node-decision):not(.node-page):not(.node-subflow) .node-card { background: #f7f8fa; border-color: #d9dee7; }
.actor-invitee:not(.node-decision):not(.node-page):not(.node-subflow) .node-card { background: #fcf9ff; border-color: #e3d9eb; }
.flow-node:hover .node-card { box-shadow: 0 9px 24px rgba(44,50,72,.12); transform: translateY(-2px); }
.node-actions { position: absolute; right: -10px; top: -12px; display: none; gap: 4px; z-index: 8; }
.flow-node:hover .node-actions { display: flex; }
.node-actions button { width: 24px; height: 24px; border: 1px solid #dedfe8; border-radius: 7px; background: white; color: #70798b; box-shadow: 0 4px 12px rgba(35,40,58,.11); cursor: pointer; line-height: 1; }
.node-actions button:hover { color: #6551d3; border-color: #bdb4ef; }
.node-actions .delete-node:hover { color: #d45f78; border-color: #edb5c1; }
.node-index { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 16px; border-radius: 4px; background: #f2f3f7; color: #8a91a0; font-size: 8px; font-weight: 700; margin-bottom: 6px; }
.node-meta { min-height: 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.node-meta .node-index { margin-bottom: 0; }
.node-role, .subflow-mark, .reference-mark { display: inline-flex; align-items: center; min-height: 16px; border-radius: 4px; padding: 0 5px; font-size: 7px; font-weight: 650; white-space: nowrap; }
.node-role { color: #687184; background: #f1f3f7; }
.role-system { color: #377c96; background: #e9f7fb; }
.role-invitee { color: #8a629e; background: #f6edfa; }
.role-shared { color: #7967bf; background: #f0edff; }
.subflow-mark { margin-left: auto; color: #6652ce; background: #ece9ff; }
.reference-mark { margin-left: auto; color: #4778aa; background: #e8f2ff; }
.node-card strong { display: block; font-size: 12px; line-height: 1.32; }
.node-card small { display: block; color: #9198a7; margin-top: 4px; font-size: 9px; line-height: 1.4; }
.node-note { border-top: 1px dashed #e4e7ed; margin-top: 9px; padding-top: 7px; font-size: 9px; color: #858d9c; line-height: 1.45; }
.node-start .node-card { border-color: #9bcee4; background: linear-gradient(145deg,#f6fcff,#eef9fd); }
.node-start .node-index { background: #def2fa; color: #3985a6; }
.node-end .node-card { border-color: #a9d9c3; background: linear-gradient(145deg,#f6fff9,#edf9f2); }
.node-end .node-index { background: #dcf4e7; color: #2b8d63; }
.node-pending .node-card::after { content:"待确认"; position:absolute; right:9px; top:9px; padding:3px 5px; border-radius:5px; font-size:8px; color:#b47a1f; background:#fff4d7; }
.node-decision { width: 124px; height: 124px; }
.node-decision .node-card { position: absolute; width: 88px; height: 88px; min-height: 0; left: 18px; top: 18px; padding: 0; border-radius: 6px; transform: rotate(45deg); background: #fffcf2; border-color: #d9aa58; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(132,92,28,.06); }
.node-decision:hover .node-card { transform: rotate(45deg) translate(-2px,-2px); }
.decision-content { transform: rotate(-45deg); width: 82px; padding: 6px; text-align: center; }
.decision-content strong { font-size: 10px; line-height: 1.24; }
.decision-content small { font-size: 7px; margin-top: 3px; }
.node-decision .node-index { display: none; }
.node-decision .node-actions { right: -5px; top: -3px; }
.node-decision > .node-role { display: none; }
.node-subflow { width: 184px; }
.node-subflow .node-card { min-height: 84px; border: 2px solid #9e91e6; background: linear-gradient(145deg,#fbfaff,#f3f0ff); box-shadow: inset 4px 0 0 #d9d2ff, 0 5px 14px rgba(74,58,154,.07); }
.node-subflow .node-index { background: #e9e5ff; color: #6752ce; }
.node-reference { width: 164px; }
.node-reference .node-card { min-height: 60px; padding: 9px 10px; border: 1.5px dashed #7fa5d8; background: #f4f8ff; box-shadow: none; }
.node-reference .node-index { display: none; }
.node-reference .node-role { display: none; }
.node-reference .node-meta { min-height: 16px; margin-bottom: 5px; }
.node-reference .node-card strong { color: #416f9f; font-size: 11px; }
.node-reference .node-card small { color: #8097af; font-size: 8px; }
.node-page { width: 190px; }
.node-page .node-card { min-height: 82px; border-color: #aaa0e2; background: linear-gradient(145deg,#fcfbff,#f5f2ff); }
.prototype-shell { --prototype-scale: 1; position: absolute; left: 50%; top: calc(100% + 9px); width: calc(320px * var(--prototype-scale)); transform: translateX(-50%); z-index: 4; }
.prototype-shell.is-empty { width: 160px; }
.prototype-attachment { position: relative; width: 100%; height: calc(360px * var(--prototype-scale)); border: 1px solid #dddfe7; border-radius: 7px; overflow: hidden; background: white; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 11px rgba(41,46,65,.06); cursor: zoom-in; }
.prototype-attachment.is-empty { height: 34px; border-style: dashed; background: #fbfbfe; box-shadow: none; cursor: pointer; }
.prototype-shell::before { content: ""; position: absolute; left: 50%; top: -12px; width: 1px; height: 11px; background: #cfd3db; }
.prototype-attachment img { width: 100%; height: 100%; object-fit: contain; background: white; }
.prototype-attachment > b { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 5px; background: rgba(31,39,53,.78); color: white; font-size: 7px; font-weight: 600; }
.prototype-attachment.is-empty > b, .prototype-attachment.is-empty .shot-placeholder i { display: none; }
.prototype-attachment.is-empty .shot-placeholder { font-size: 9px; }
.prototype-attachment:hover { border-color: #9f91e7; box-shadow: 0 7px 18px rgba(72,57,144,.12); }
.prototype-inline-controls { position: absolute; left: 50%; top: calc(360px * var(--prototype-scale) + 6px); height: 27px; display: flex; align-items: center; gap: 3px; padding: 3px; transform: translateX(-50%); border: 1px solid #dddfe7; border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 5px 14px rgba(41,46,65,.09); white-space: nowrap; }
.prototype-inline-controls button { min-width: 25px; height: 21px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; color: #626c7d; cursor: pointer; font-size: 11px; }
.prototype-inline-controls button:hover { background: #f0edff; color: #6652ce; }
.prototype-inline-controls span { min-width: 35px; color: #848c9b; font-size: 8px; text-align: center; }
.shot-placeholder { text-align: center; color: #9ba3b1; font-size: 10px; }
.shot-placeholder i { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; margin: 0 auto 7px; font-style: normal; font-size: 17px; color: #7867d9; background: #ece9ff; }
.canvas-legend { position: absolute; left: 18px; bottom: 16px; z-index: 9; display: flex; gap: 14px; align-items: center; padding: 9px 12px; border: 1px solid #e1e4ea; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-radius: 9px; box-shadow: 0 5px 16px rgba(42,47,67,.06); }
.canvas-legend span { display: flex; gap: 6px; align-items: center; color: #848c9b; font-size: 9px; }
.canvas-legend i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid #cfd4dd; background: white; }
.canvas-legend .legend-decision { transform: rotate(45deg); border-color: #d1a250; background: #fff9e8; border-radius: 2px; }
.canvas-legend .legend-page { background: #f0edff; border-color: #aea3ee; }
.canvas-legend .legend-subflow { background: #eeeaff; border: 2px solid #9688e3; }
.canvas-legend .legend-reference { background: #edf5ff; border: 1px dashed #6f9bce; }
.canvas-legend .legend-pending { background: #fff2cf; border-color: #efd494; }

.ai-panel { width: 350px; height: 100%; order: -1; border-right: 1px solid #e0e4eb; background: white; display: grid; grid-template-rows: 68px auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; position: relative; z-index: 20; box-shadow: 8px 0 22px rgba(35, 41, 60, .035); }
.ai-panel-head { height: 68px; padding: 0 17px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #eceef3; }
.ai-avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg,#6c4cff,#9b78ff); display: grid; place-items: center; color: white; box-shadow: 0 6px 14px rgba(102,74,231,.23); }
.ai-panel-head div:nth-child(2) { flex: 1; }
.ai-panel-head strong, .ai-panel-head span { display: block; }
.ai-panel-head strong { font-size: 13px; }
.ai-panel-head span { margin-top: 3px; font-size: 9px; color: #969ead; }
.panel-menu { border: 0; background: transparent; color: #929aa8; cursor: pointer; letter-spacing: 1px; }
.progress-card { margin: 14px 14px 0; padding: 13px; background: #f8f8fd; border: 1px solid #ebeaf5; border-radius: 11px; }
.progress-top { display: flex; justify-content: space-between; font-size: 10px; color: #7d8595; }
.progress-top strong { color: #6651d5; font-size: 12px; }
.progress-track { height: 5px; background: #e7e4f5; border-radius: 99px; margin: 9px 0 7px; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#7c61ee,#6ed1b1); border-radius: inherit; transition: width .5s ease; }
.progress-card small { color: #a0a6b2; font-size: 9px; }
.score-details-toggle { width: 100%; margin-top: 9px; padding: 8px 0 0; border: 0; border-top: 1px solid #e8e6f2; background: transparent; color: #6d61ac; display: flex; align-items: center; justify-content: space-between; font-size: 9px; cursor: pointer; }
.score-details-toggle span { transition: transform .18s; }
.score-details-toggle.open span { transform: rotate(180deg); }
.intent-details-toggle { width: 100%; margin-top: 9px; padding: 8px 0 0; border: 0; border-top: 1px solid #e8e6f2; background: transparent; color: #3f7f72; display: flex; align-items: center; justify-content: space-between; font-size: 9px; cursor: pointer; }
.intent-details-toggle span { transition: transform .18s; }
.intent-details-toggle.open span { transform: rotate(180deg); }
.score-breakdown { margin-top: 10px; max-height: 330px; overflow-y: auto; }
.intent-breakdown { margin-top: 10px; max-height: min(56vh, 560px); overflow-y: auto; padding-right: 4px; }
.intent-audit-head { display: flex; justify-content: space-between; gap: 8px; padding: 7px; border-radius: 7px; background: #eaf8f3; color: #327c65; font-size: 8px; }
.intent-audit-head span { color: #6f8e84; }
.intent-scope { margin: 7px 0; padding: 7px; border-radius: 7px; background: white; color: #6f7787; font-size: 8px; line-height: 1.45; }
.intent-group { padding: 7px 2px; border-top: 1px solid #eceaf4; }
.intent-group > b { display: block; margin-bottom: 5px; color: #596172; font-size: 8px; }
.intent-group > div { display: flex; gap: 6px; padding: 4px 0; }
.intent-group > div > span { width: 14px; height: 14px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e6f6ef; color: #2f8b69; font-size: 8px; font-weight: 700; }
.intent-group p { margin: 0; color: #606879; font-size: 8px; line-height: 1.4; }
.intent-group p small { display: block; margin-top: 2px; color: #999fad; font-size: 7px; }
.intent-warning > div > span { color: #aa7428; background: #fff2d7; }
.intent-risk > div > span { color: #be5f74; background: #fdebf0; }
.thinking-stage { margin-top: 9px; border: 1px solid #e7e8ee; border-radius: 9px; background: white; overflow: hidden; }
.thinking-stage > header { display: flex; align-items: center; gap: 7px; padding: 9px; border-bottom: 1px solid #edf0f3; background: #fbfcfd; }
.thinking-stage > header > i { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e8f6ef; color: #318669; font-style: normal; font-size: 9px; font-weight: 750; }
.thinking-stage > header > div { min-width: 0; flex: 1; }
.thinking-stage > header strong, .thinking-stage > header small { display: block; }
.thinking-stage > header strong { color: #3c4556; font-size: 9px; }
.thinking-stage > header small { margin-top: 2px; color: #9aa1ad; font-size: 7px; }
.thinking-stage > header > b { flex: 0 0 auto; color: #3a8b70; font-size: 7px; font-weight: 650; }
.thinking-block { padding: 8px 9px; border-top: 1px solid #f0f1f4; }
.thinking-block:first-of-type { border-top: 0; }
.thinking-block > label { display: block; margin-bottom: 6px; color: #87909f; font-size: 7px; font-weight: 650; }
.thinking-block p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.thinking-chip { padding: 3px 6px; border-radius: 99px; color: #477562; background: #edf8f3; font-size: 7px; }
.thinking-item { padding: 5px 0; border-top: 1px dashed #edf0f3; }
.thinking-item:first-of-type { border-top: 0; }
.thinking-item strong, .thinking-item small { display: block; }
.thinking-item strong { color: #535c6d; font-size: 8px; line-height: 1.4; }
.thinking-item small { margin-top: 2px; color: #9a7a48; font-size: 7px; }
.thinking-empty { color: #a3a8b2; font-size: 7px; }
.thinking-block ol { margin: 0; padding-left: 17px; }
.thinking-block li { padding: 2px 0; color: #61697a; font-size: 8px; line-height: 1.4; }
.thinking-block li small { margin-left: 5px; color: #a0a6b1; font-size: 7px; }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 8px; gap: 6px; }
.design-grid > div { padding: 7px; border-radius: 7px; background: #f7f7fb; }
.design-grid dt { color: #959ca9; font-size: 7px; }
.design-grid dd { margin: 3px 0 0; color: #565f71; font-size: 8px; line-height: 1.35; }
.main-path-preview { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.main-path-preview span { flex: 0 0 auto; max-width: 105px; padding: 4px 6px; border-radius: 5px; background: #f1effd; color: #6253ae; font-size: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-path-preview i { color: #b3b7c0; font-size: 8px; font-style: normal; }
.branch-policy { display: grid; gap: 4px; padding: 0 9px 9px; }
.branch-policy span { color: #7b8392; font-size: 7px; line-height: 1.35; }
.blueprint-head { display: grid; grid-template-columns: 1fr 92px; padding: 7px 9px 4px 31px; color: #9ba2af; font-size: 7px; }
.blueprint-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 88px; gap: 5px; align-items: start; padding: 6px 8px; border-top: 1px solid #f0f1f4; }
.blueprint-row > em { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 5px; background: #f0f1f5; color: #868e9c; font-size: 7px; font-style: normal; }
.blueprint-row > div { display: grid; gap: 3px; min-width: 0; }
.blueprint-row input, .blueprint-row select { width: 100%; height: 23px; min-width: 0; border: 1px solid #e1e4e9; border-radius: 5px; background: white; color: #545c6c; padding: 0 5px; font: inherit; font-size: 7px; }
.blueprint-row input:focus, .blueprint-row select:focus { border-color: #a89be9; outline: 2px solid rgba(108,76,255,.1); }
.blueprint-row input[data-field="detail"] { color: #9299a6; }
.confirm-intent-button { width: calc(100% - 16px); height: 31px; margin: 8px; border: 0; border-radius: 7px; background: #2c3546; color: white; font-size: 8px; font-weight: 650; cursor: pointer; }
.confirm-intent-button:hover { background: #1f2735; }
.blueprint-hint { display: block; padding: 0 9px 9px; color: #9ba1ac; font-size: 7px; line-height: 1.45; }
.score-split { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.score-split span { border-radius: 7px; padding: 7px; background: white; color: #838a99; font-size: 8px; }
.score-split b { display: block; color: #5141b0; font-size: 11px; margin-top: 3px; }
.score-cap { margin-bottom: 8px; border-radius: 6px; padding: 7px; color: #ad7322; background: #fff5db; font-size: 8px; line-height: 1.45; }
.score-item { padding: 7px 2px; border-top: 1px solid #eceaf4; }
.score-item > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-item strong { font-size: 8px; color: #555d6e; }
.score-item span { flex: 0 0 auto; font-size: 8px; }
.score-item small { display: block; margin-top: 4px; color: #969dab; line-height: 1.4; }
.score-full span { color: #26936f; }
.score-partial span { color: #bd7e25; }
.score-none span { color: #d45f78; }
.conversation { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 16px 14px; }
.conversation::-webkit-scrollbar { width: 7px; }
.conversation::-webkit-scrollbar-track { background: transparent; }
.conversation::-webkit-scrollbar-thumb { border-radius: 99px; background: #c8ccd5; border: 2px solid white; }
.message { margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.message.user { flex-direction: row-reverse; }
.message-avatar { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; display: grid; place-items: center; background: #eeeaff; color: #715ae0; font-size: 10px; }
.message.user .message-avatar { background: #eef1f6; color: #687183; }
.bubble { max-width: 260px; background: #f5f5fa; border-radius: 4px 11px 11px 11px; padding: 10px 11px; font-size: 11px; line-height: 1.55; color: #4f586a; }
.message.user .bubble { background: #6b4ee9; color: white; border-radius: 11px 4px 11px 11px; }
.bubble strong { display: block; color: #2d3546; margin-bottom: 5px; }
.bubble small { display: block; margin-top: 6px; color: #9299a7; font-size: 9px; }
.message.user .bubble strong, .message.user .bubble small { color: white; }
.answer-box { display: block; visibility: visible; position: relative; z-index: 4; margin: 2px 0 8px 32px; padding: 11px; border: 1px solid #e1e0ed; border-radius: 11px; background: white; box-shadow: 0 7px 20px rgba(38, 43, 61, .055); }
.answer-label { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 8px; }
.answer-label strong { font-size: 10px; color: #454e60; }
.answer-label > div { display: flex; align-items: center; gap: 8px; }
.answer-label span { font-size: 8px; color: #a0a7b4; }
.finalize-interview { border: 0; background: transparent; color: #6752d5; padding: 0; font-size: 8px; cursor: pointer; }
.finalize-interview:hover { text-decoration: underline; }
.inline-ai-status { min-height: 42px; margin-bottom: 8px; border: 1px solid #e4e1f5; border-radius: 8px; background: #f8f7ff; color: #6c5abb; display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 9px; }
.inline-ai-status i { width: 12px; height: 12px; border: 2px solid #d7d0fa; border-top-color: #7058df; border-radius: 50%; animation: spin .8s linear infinite; }
.option-list button:disabled, .answer-actions button:disabled { opacity: .55; cursor: wait; }
.option-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.option-list button { border: 1px solid #e0ddf6; background: #f8f7ff; color: #6655bc; border-radius: 7px; padding: 6px 8px; font-size: 9px; cursor: pointer; }
.option-list button:hover { background: #eeeaff; border-color: #c8bff4; }
.answer-box textarea { width: 100%; resize: none; border: 1px solid #e0e3ea; border-radius: 9px; padding: 10px; font-size: 11px; line-height: 1.5; color: #384052; }
.answer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.upload-action { display: flex; align-items: center; gap: 4px; color: #838b9b; font-size: 9px; cursor: pointer; }
.global-file-input { display: none; }
.upload-action span { color: #6c55d9; font-size: 15px; }
.answer-actions button { border: 0; border-radius: 8px; height: 32px; padding: 0 12px; background: #242c3d; color: white; font-size: 9px; font-weight: 600; cursor: pointer; }
.answer-actions button b { margin-left: 8px; font-size: 13px; font-weight: 400; }

.loading-overlay { position: fixed; inset: 68px 0 0; z-index: 100; display: grid; place-items: center; background: rgba(246,247,251,.82); backdrop-filter: blur(10px); }
.loading-card { width: 330px; padding: 32px; text-align: center; background: white; border: 1px solid #e5e7ed; border-radius: 18px; box-shadow: var(--shadow); }
.loading-card strong, .loading-card span { display: block; }
.loading-card strong { font-size: 15px; margin: 17px 0 7px; }
.loading-card span { color: #9299a8; font-size: 11px; }
.loading-orbit { width: 52px; height: 52px; margin: auto; position: relative; animation: spin 2s linear infinite; }
.loading-orbit i { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #7458e9; }
.loading-orbit i:nth-child(1) { top: 0; left: 19px; }
.loading-orbit i:nth-child(2) { right: 3px; bottom: 6px; background: #a590ff; }
.loading-orbit i:nth-child(3) { left: 3px; bottom: 6px; background: #51c7a2; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.loading-steps i { width: 26px; height: 3px; border-radius: 5px; background: #ececf2; }
.loading-steps i.active { background: #7a5ce9; }
.prototype-modal { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; padding: 32px; }
.prototype-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(25,31,45,.38); backdrop-filter: blur(5px); cursor: default; }
.prototype-modal-panel { position: relative; width: min(680px, calc(100vw - 64px)); max-height: min(760px, calc(100vh - 64px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; border: 1px solid #e1e2ea; border-radius: 17px; background: white; box-shadow: 0 24px 80px rgba(24,29,45,.22); }
.prototype-modal-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid #eceef3; }
.prototype-modal-panel > header span, .prototype-modal-panel > header strong, .prototype-modal-panel > header small { display: block; }
.prototype-modal-panel > header span { margin-bottom: 6px; color: #705bd4; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.prototype-modal-panel > header strong { font-size: 18px; }
.prototype-modal-panel > header small { margin-top: 7px; color: #8c94a3; font-size: 10px; }
.prototype-modal-close { width: 32px; height: 32px; border: 1px solid #e2e4e9; border-radius: 8px; background: white; color: #778091; font-size: 19px; cursor: pointer; }
.prototype-node-list { min-height: 180px; overflow-y: auto; padding: 12px 18px; }
.prototype-node-item { display: grid; grid-template-columns: 100px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 11px 6px; border-bottom: 1px solid #eff0f4; }
.prototype-node-item:last-child { border-bottom: 0; }
.prototype-node-preview { width: 100px; height: 68px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #d3d5de; border-radius: 8px; background: #fafafe; color: #9aa1ae; font-size: 9px; }
.prototype-node-preview img { width: 100%; height: 100%; object-fit: contain; background: white; }
.prototype-node-item.is-complete .prototype-node-preview { border-style: solid; border-color: #c9c3ec; }
.prototype-node-copy { min-width: 0; }
.prototype-node-copy strong, .prototype-node-copy small, .prototype-node-copy em { display: block; }
.prototype-node-copy strong { color: #354052; font-size: 12px; }
.prototype-node-copy small { margin-top: 5px; color: #8e96a5; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prototype-node-copy em { margin-top: 7px; color: #b17b29; font-size: 8px; font-style: normal; }
.prototype-node-item.is-complete .prototype-node-copy em { color: #2f8a69; }
.prototype-node-item > button { height: 31px; padding: 0 11px; border: 1px solid #dcd7f5; border-radius: 8px; background: #f5f2ff; color: #6653c5; font-size: 9px; font-weight: 650; cursor: pointer; }
.prototype-node-item > button:hover { background: #ebe7ff; }
.prototype-node-empty { padding: 52px 20px; color: #9299a8; text-align: center; font-size: 11px; }
.prototype-modal-panel > footer { padding: 12px 24px; border-top: 1px solid #eceef3; background: #fafafd; color: #8b93a1; font-size: 9px; }
.prototype-node-item.is-complete .prototype-node-preview { cursor: zoom-in; }
.prototype-lightbox { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 24px; }
.prototype-lightbox-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(15,19,29,.82); backdrop-filter: blur(8px); cursor: zoom-out; }
.prototype-lightbox-panel { position: relative; width: min(1180px,94vw); height: 94vh; display: grid; grid-template-rows: minmax(0,1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: #151a24; box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.prototype-lightbox-viewport { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 12px; background: #0f131b; overscroll-behavior: contain; }
.prototype-lightbox-panel img { display: block; max-width: none; max-height: none; object-fit: contain; background: white; cursor: zoom-in; transition: width .16s ease, height .16s ease; }
.prototype-lightbox-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(18,23,33,.72); color: white; font-size: 21px; cursor: pointer; }
.prototype-lightbox-caption { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; color: white; }
.prototype-lightbox-caption strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.prototype-lightbox-controls { flex: none; display: flex; align-items: center; gap: 5px; }
.prototype-lightbox-controls button { height: 29px; min-width: 30px; padding: 0 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(255,255,255,.08); color: white; cursor: pointer; font-size: 10px; }
.prototype-lightbox-controls button:hover { background: rgba(255,255,255,.16); }
.prototype-lightbox-controls span { min-width: 42px; color: #c3cad6; font-size: 9px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%,20px); background: #202738; color: white; border-radius: 9px; padding: 10px 15px; font-size: 11px; opacity: 0; pointer-events: none; transition: .22s; z-index: 200; box-shadow: 0 10px 30px rgba(20,25,38,.22); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.export-menu { position: fixed; top: 58px; right: 24px; z-index: 80; width: 235px; padding: 7px; background: white; border: 1px solid #e1e4ea; border-radius: 12px; box-shadow: 0 16px 42px rgba(29,34,50,.16); }
.export-menu button { border: 0; background: transparent; width: 100%; display: flex; align-items: center; text-align: left; border-radius: 8px; padding: 9px; cursor: pointer; }
.export-menu button:hover { background: #f6f6fa; }
.export-menu button > span { width: 39px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #efedff; color: #6752d5; font-size: 9px; font-weight: 750; margin-right: 9px; }
.export-menu strong, .export-menu small { display: block; }
.export-menu strong { font-size: 11px; }
.export-menu small { font-size: 9px; color: #969dac; margin-top: 3px; }

@media (max-height: 720px) {
  .progress-card { margin-top: 9px; padding: 10px 12px; }
  .progress-card small { display: none; }
  .conversation { padding-top: 10px; padding-bottom: 10px; }
  .message { margin-bottom: 9px; }
  .bubble { padding: 8px 10px; }
  .answer-box { padding-top: 8px; padding-bottom: 9px; }
  .answer-box textarea { height: 54px; }
}

@media print {
  .topbar, .ai-panel, .canvas-toolbar, .canvas-legend { display: none !important; }
  .workspace { display: block !important; height: auto; }
  .canvas-shell, .canvas-viewport { overflow: visible; background: white; }
  .canvas-stage { transform: none !important; zoom: 1 !important; }
}
