:root {
  --blue: #2f66f6;
  --blue-hover: #2458de;
  --blue-soft: #edf3fe;
  --text: #111827;
  --muted: #6b7380;
  --muted-light: #9aa1ad;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --panel: #f8fafd;
  --asset: #b8bdc7;
  --radius-control: 8px;
  --radius-message: 12px;
  --radius-composer: 16px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 1080px; height: 100%; overflow: hidden; }
body { background: #fff; }
button, input, [contenteditable] { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, [role="button"]:focus-visible { outline: 3px solid rgba(47,102,246,.2); outline-offset: 2px; }
[contenteditable]:focus, [contenteditable]:focus-visible { outline: 0 !important; box-shadow: none !important; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); width: 100%; height: 100vh; min-height: 720px; transition: grid-template-columns .2s ease; background: #fff; }
.app-shell.is-sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar { position: relative; z-index: 30; width: 300px; min-width: 300px; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; overflow: visible; background: var(--surface-subtle); transition: transform .2s ease, opacity .16s ease; }
.is-sidebar-collapsed .sidebar { transform: translateX(-300px); opacity: 0; pointer-events: none; }
.sidebar-top { min-height: 0; overflow-y: auto; scrollbar-width: none; }
.sidebar-top::-webkit-scrollbar { display: none; }
.brand-row { height: 32px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; line-height: 24px; font-weight: 500; text-decoration: none; }
.brand-mark, .compact-mark { width: 24px; height: 16px; display: block; border-radius: 2px; background: #d1d6de; }
.sidebar-actions { display: flex; gap: 4px; }
.icon-control, .quick-action-group button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.icon-control:hover, .quick-action-group button:hover { background: #eef1f5; }
.icon-control svg, .quick-action-group svg { width: 16px; height: 16px; }
.sidebar-link { width: 100%; height: 48px; margin-top: 20px; display: flex; align-items: center; gap: 12px; padding: 4px 0; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-size: 14px; text-align: left; }
.sidebar-link:hover { background: #f1f3f6; }
.asset-nav-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; color: #626b78; background: transparent; }
.asset-nav-icon svg { width: 23px; height: 23px; stroke-width: 1.7; }
.new-project { width: 100%; height: 40px; margin-top: 30px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 0 2.4px rgba(0,39,141,.13); cursor: pointer; font-size: 14px; }
.new-project:hover { border-color: #cdd4df; background: #fdfefe; }
.new-project svg { width: 16px; height: 16px; }
.project-search { height: 40px; margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.project-search > svg { width: 16px; height: 16px; color: var(--muted); }
.project-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.project-search button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.project-section { margin-top: 14px; }
.sidebar-section-heading { height: 28px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; line-height: 24px; }
.section-action { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.section-action:hover { color: var(--text); background: #eef1f5; }
.section-action svg { width: 16px; height: 16px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { position: relative; width: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 4px 36px 4px 0; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.recent-item:hover, .recent-item.is-current { background: #f0f2f5; }
.recent-item img { width: 32px; height: 32px; flex: none; border-radius: 8px; object-fit: cover; background: #d9dce1; }
.recent-item .recent-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.recent-item strong { overflow: hidden; color: #343943; font-size: 14px; line-height: 20px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.recent-item small { display: none; color: var(--muted); font-size: 10px; }
.recent-more { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; display: none; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #697384; background: #e7eaf0; cursor: pointer; }
.recent-item:hover .recent-more, .recent-more:focus-visible { display: grid; }
.recent-more svg { width: 15px; height: 15px; }
.recent-select { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border: 1.5px solid #cfd4dc; border-radius: 50%; color: #fff; background: #fff; }
.recent-item.is-checked .recent-select { border-color: var(--blue); background: var(--blue); }
.recent-item.is-checked .recent-select::after { content: ""; width: 7px; height: 4px; border-left: 1.7px solid; border-bottom: 1.7px solid; transform: rotate(-45deg) translateY(-1px); }
.search-empty { margin: 24px 0; color: var(--muted); font-size: 12px; text-align: center; }
.profile-wrap { position: relative; }
.profile { width: 100%; height: 48px; display: flex; align-items: center; gap: 8px; padding: 8px 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.profile:hover { background: #f1f3f6; }
.avatar { width: 32px; height: 32px; flex: none; display: block; border-radius: 50%; object-fit: cover; background: #d9dce1; }
.profile-name { flex: 1; text-align: left; font-size: 14px; }
.more-icon { width: 16px; height: 16px; color: #2c2c2c; }
.more-icon circle { fill: currentColor; stroke: none; }
.profile-menu { position: absolute; z-index: 60; left: 0; bottom: 56px; width: 184px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 48px rgba(17,24,39,.16); }
.profile-menu button { width: 100%; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; font-size: 14px; }
.profile-menu button:hover { background: #f4f6f8; }
.profile-menu svg { width: 18px; height: 18px; }

.main-area { position: relative; min-width: 0; height: 100vh; overflow: hidden; background: #fff; }
.quick-actions { position: absolute; z-index: 45; top: 14px; left: 24px; height: 32px; display: flex; align-items: center; gap: 16px; }
.quick-action-group { height: 32px; display: flex; align-items: center; gap: 0; padding: 2px 6px; border: 1px solid #e5e5e5; border-radius: 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.quick-action-group button { width: 24px; height: 26px; }
.screen { position: relative; width: 100%; height: 100vh; min-height: 720px; background: #fff; }
.screen:not(.is-active) { display: none; }
.screen.is-entering { animation: screen-fade-in .32s cubic-bezier(.2,.75,.3,1) both; }
.screen.is-entering .workbench-grid > * { animation: column-enter .42s cubic-bezier(.2,.75,.3,1) both; }
.screen.is-entering .workbench-grid > :nth-child(2) { animation-delay: .045s; }
.screen.is-entering .workbench-grid > :nth-child(3) { animation-delay: .09s; }
@keyframes screen-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes column-enter { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }

.home-content { position: absolute; top: 275px; left: 50%; width: min(960px, calc(100% - 96px)); transform: translateX(-50%); text-align: center; transition: top .2s ease; }
.is-sidebar-collapsed .home-content { top: 220px; }
.home-content h1 { margin: 0 0 40px; color: var(--text); font-size: 32px; line-height: 44px; font-weight: 800; letter-spacing: -.02em; }

.composer { position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 128px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-composer); background: #fff; text-align: left; }
.composer-wide { width: 100%; }
.composer-editor { width: 100%; min-height: 44px; max-height: 154px; overflow-x: hidden; overflow-y: auto; color: var(--text); font-size: 14px; line-height: 22px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; outline: 0; }
.composer-editor:empty::before, .composer-editor.muted::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.composer-editor.muted { color: var(--muted); }
.composer-footer { min-height: 40px; display: flex; align-items: center; justify-content: space-between; }
.add-control { position: relative; }
.composer-add { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-control); background: transparent; cursor: pointer; }
.composer-add:hover { background: #f4f6f8; }
.composer-add svg { width: 22px; height: 22px; }
.send-button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--blue); cursor: pointer; transition: background .16s ease, transform .16s ease; }
.send-button svg { width: 20px; height: 20px; }
.send-button:hover:not(:disabled) { background: var(--blue-hover); transform: translateY(-1px); }
.send-button:disabled { color: rgba(255,255,255,.95); background: #a9bff8; cursor: not-allowed; }
.add-menu { position: absolute; z-index: 70; left: 0; bottom: 48px; width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 42px rgba(17,24,39,.15); }
.add-menu button { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.add-menu button:hover { background: #f5f7f9; }
.add-menu svg { width: 20px; height: 20px; flex: none; }
.add-menu span { display: flex; flex-direction: column; }
.add-menu strong { font-size: 13px; line-height: 20px; font-weight: 500; }
.add-menu small { color: var(--muted); font-size: 11px; line-height: 17px; }

.inline-token { position: relative; top: 1px; max-width: 132px; height: 24px; display: inline-flex; align-items: center; gap: 5px; margin: 0 3px 4px; padding: 2px 7px 2px 3px; border: 1px solid #dfe3e9; border-radius: 7px; background: #f4f6f8; vertical-align: baseline; cursor: default; user-select: all; }
.inline-token.is-token-selected { border-color: #7da2ff; box-shadow: 0 0 0 2px rgba(47,102,246,.12); }
.inline-token img, .inline-token .token-swatch { width: 18px; height: 18px; flex: none; border-radius: 4px; object-fit: cover; background: #b8bdc7; }
.inline-token .token-name { min-width: 0; overflow: hidden; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.token-hover-preview { position: fixed; z-index: 200; width: 240px; padding: 6px; border: 1px solid #2f343c; border-radius: 10px; background: #181a1f; box-shadow: 0 18px 44px rgba(0,0,0,.24); pointer-events: none; }
.token-hover-preview img { width: 100%; height: 132px; display: block; border-radius: 6px; object-fit: cover; background: #2a2d33; }

.project-header { height: 64px; display: flex; align-items: center; padding-left: 194px; font-size: 14px; line-height: 22px; }
.analysis-stage { position: relative; height: calc(100% - 64px); }
.analysis-user-turn { position: absolute; top: 36px; right: 17%; width: 408px; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.analysis-user-turn img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #d9d9d9; }
.analysis-user-turn p { max-width: 408px; margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); font-size: 14px; line-height: 22px; }
.analysis-progress { position: absolute; top: 184px; left: 16.6%; height: 24px; display: flex; align-items: center; }
.analysis-progress span { color: transparent; font-size: 14px; line-height: 22px; background: linear-gradient(90deg,#dbdee5 0%,#4f545e 38%,#dbdee5 75%); background-size: 220% 100%; background-clip: text; -webkit-background-clip: text; animation: text-shimmer 1.25s linear infinite; }
@keyframes text-shimmer { to { background-position: -220% 0; } }
.analysis-composer-wrap { position: absolute; left: 50%; bottom: 67px; width: min(960px, calc(100% - 96px)); transform: translateX(-50%); }
.composer.is-locked { opacity: .82; }

.workbench-grid { display: grid; grid-template-columns: 360px 240px minmax(600px, 1fr); width: 100%; height: 100vh; min-height: 720px; }
.agent-panel, .reference-panel { position: relative; min-width: 0; border-right: 1px solid var(--line); background: #fff; }
.workbench-header, .column-header { height: 64px; display: flex; align-items: center; padding: 0 24px; }
.workbench-header { padding-left: 194px; white-space: nowrap; font-size: 14px; }
.column-header h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }
.conversation { height: calc(100vh - 220px); min-height: 470px; overflow-y: auto; padding: 44px 24px 24px; scrollbar-width: thin; scrollbar-color: #cfd5de transparent; }
.conversation-user { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; margin-bottom: 38px; }
.conversation-user img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.conversation-user p { max-width: 304px; margin: 0; padding: 12px 16px; border-radius: var(--radius-message); background: var(--blue-soft); font-size: 14px; line-height: 22px; }
.conversation-agent { margin-bottom: 24px; }
.agent-copy { color: #404754; font-size: 14px; line-height: 22px; white-space: pre-line; }
.agent-output { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.agent-result-preview { width: 88px; height: 88px; display: block; border-radius: 12px; object-fit: cover; background: #e5e7eb; }
.agent-copy.is-thinking { width: max-content; max-width: 100%; color: transparent; background: linear-gradient(90deg,#cbd0d9 0%,#4f545e 42%,#cbd0d9 78%); background-size: 220% 100%; background-clip: text; -webkit-background-clip: text; animation: text-shimmer 1.25s linear infinite; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.choice-button, .correction-choice { min-height: 32px; padding: 5px 10px; border: 1px solid #d7dce4; border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; line-height: 18px; }
.choice-button:hover, .correction-choice:hover { border-color: #9bb5fb; background: #f6f8ff; }
.choice-button.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.response-actions { display: flex; gap: 8px; margin-top: 12px; }
.response-actions button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; color: #697384; background: transparent; cursor: pointer; }
.response-actions button:hover { color: var(--text); background: #f1f3f6; }
.response-actions button.is-active { color: var(--blue); background: var(--blue-soft); }
.response-actions button.is-active svg { fill: currentColor; }
.response-actions svg { width: 16px; height: 16px; }
.composer-compact { position: absolute; left: 16px; right: 16px; bottom: 24px; width: auto; min-height: 128px; }

.reference-panel { padding: 0; }
.reference-panel .column-header { padding: 0 24px; }
.reference-scroll { height: calc(100vh - 64px); overflow-y: auto; padding-bottom: 40px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #cfd5de transparent; }
.reference-scroll::-webkit-scrollbar { width: 6px; }
.reference-scroll::-webkit-scrollbar-track { background: transparent; }
.reference-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: #cfd5de; }
.reference-add-wrap { position: relative; margin: 0 18px 0 24px; }
.reference-add { width: 100%; height: 144px; display: grid; place-items: center; border: 0; border-radius: 12px; color: #323338; background: var(--panel); cursor: pointer; }
.reference-add:hover { background: #f1f4f8; }
.reference-add svg { width: 36px; height: 36px; stroke-width: 1.5; }
.reference-add-menu { left: 0; bottom: auto; top: 76px; }
.reference-list { display: flex; flex-direction: column; gap: 20px; margin: 20px 18px 0 24px; }
.reference-card { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.reference-card img { width: 100%; height: 104px; display: block; border-radius: 8px; object-fit: cover; background: #d9dce1; }
.reference-card span { display: block; margin-top: 6px; overflow: hidden; color: #303640; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.reference-card img, .reference-card span { transition: color .14s ease, box-shadow .14s ease, transform .14s ease; }
.reference-card:hover img, .reference-card:active img { transform: translateY(-1px); box-shadow: 0 0 0 2px #a9bfff; }
.reference-card:hover span, .reference-card:active span { color: var(--blue); }

.canvas-panel { position: relative; min-width: 0; height: 100vh; overflow: hidden; background: #f5f6f8; }
.canvas-column-header { position: relative; z-index: 20; justify-content: space-between; padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.text-action { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.text-action:hover { color: var(--blue); }
.canvas-viewport { position: absolute; inset: 64px 0 0; overflow: hidden; outline: 0; cursor: grab; touch-action: none; background-color: #f6f7f9; background-image: radial-gradient(#d6dae2 1px,transparent 1px); background-size: 20px 20px; }
.canvas-viewport.is-panning { cursor: grabbing; }
.canvas-world { --world-x: 0px; --world-y: 0px; --world-scale: 1; position: absolute; left: 0; top: 0; width: 1800px; height: 2200px; transform: translate(var(--world-x),var(--world-y)) scale(var(--world-scale)); transform-origin: 0 0; will-change: transform; }
.canvas-section { --section-x:72px; --section-y:70px; position: absolute; left: 0; top: 0; width: 900px; min-height: 268px; padding: 38px 28px 28px; border: 1px solid #d9dee7; border-radius: 4px; background: rgba(255,255,255,.94); box-shadow: 0 1px 2px rgba(17,24,39,.04); transform: translate(var(--section-x),var(--section-y)); touch-action: none; }
.canvas-section-label { position: absolute; left: -1px; top: -34px; height: 28px; display: flex; align-items: center; padding: 0 11px; border: 1px solid #d9dee7; border-radius: 6px; color: #343b46; background: #fff; font-size: 13px; line-height: 20px; font-weight: 500; }
.canvas-section-label:hover { border-color: #b9c7e8; cursor: text; }
.asset-row { display: flex; gap: 24px; }
.task-asset { width: 168px; display: flex; flex-direction: column; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.asset-preview { width: 168px; height: 162px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: #555d69; background-color: #f1f3f6; background-image: linear-gradient(45deg,#e7eaf0 25%,transparent 25%),linear-gradient(-45deg,#e7eaf0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e7eaf0 75%),linear-gradient(-45deg,transparent 75%,#e7eaf0 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; transition: box-shadow .14s ease, transform .14s ease; }
.task-asset:hover .asset-preview, .task-asset:hover small { color: var(--blue); }
.task-asset:hover .asset-preview { transform: translateY(-1px); box-shadow: 0 0 0 2px #94affc; }
.task-asset.is-active .asset-preview { box-shadow: 0 0 0 2px var(--blue); }
.task-asset.is-active small { color: var(--blue); }
.task-asset small { order: -1; display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 18px; transition: color .14s ease; }
.canvas-section-label[contenteditable="true"], .task-asset small[contenteditable="true"], .result-name[contenteditable="true"], #workbench-project-name[contenteditable="true"] { padding: 1px 4px; border-radius: 4px; color: var(--text); background: #fff; box-shadow: 0 0 0 2px rgba(47,102,246,.32) !important; cursor: text; }
.task-asset small, .result-name, #workbench-project-name { cursor: text; }
.subject-preview::before { content: ""; width: 80px; height: 112px; border-radius: 46% 46% 38% 38%; background: #9da5b2; box-shadow: -26px 44px 0 -17px #9da5b2,26px 44px 0 -17px #9da5b2; }
.element-preview::before { content: ""; width: 94px; height: 94px; border-radius: 38% 62% 45% 55%; background: #b0b6c1; transform: rotate(18deg); }
.element-two::before { width: 106px; height: 70px; border-radius: 50% 22% 50% 28%; transform: rotate(-12deg); background: #8e97a4; }
.text-preview { color: #747d8b; font-size: 23px; font-weight: 700; letter-spacing: -.04em; }
.result-section { position: absolute; left: 72px; top: 400px; width: 1500px; min-height: 800px; }
.results-board { position: relative; width: 1500px; min-height: 1200px; }
.canvas-result-node { --node-x: 0px; --node-y: 0px; position: absolute; left: 0; top: 0; width: 760px; display: flex; flex-direction: column; transform: translate(var(--node-x),var(--node-y)); }
.canvas-result-node.is-active .result-name { color: var(--blue); }
.result-node-meta { order: -1; display: flex; align-items: center; justify-content: space-between; margin: 0 0 7px; padding: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.result-name { min-width: 0; flex: 1; overflow: hidden; color: #303640; text-overflow: ellipsis; white-space: nowrap; transition: color .14s ease; }
.canvas-result-node:hover .result-canvas { border-color: #94affc; }
.canvas-result-node:hover .result-name { color: var(--blue); }
.result-node-meta #result-status, .result-node-meta .node-status { color: var(--muted-light); font-size: 11px; }
.version-strip { display: flex; gap: 10px; margin-top: 9px; }
.version-card { width: 112px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.version-card.is-active { border-color: var(--blue); background: var(--blue-soft); }
.version-card img { width: 100%; height: 42px; display: block; border-radius: 4px; object-fit: cover; }
.version-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.canvas-loading { position: absolute; left: 0; top: 0; width: 760px; height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; color: var(--muted); background: #e5e7eb; }
.canvas-loading strong { color: #4f5764; font-size: 14px; font-weight: 500; }
.canvas-loading small { font-size: 12px; }
.canvas-loading > span { width: 58%; height: 150px; border-radius: 10px; background: linear-gradient(90deg,#cbd1da,#eef0f4,#cbd1da); background-size: 200% 100%; animation: skeleton-shimmer 1.1s linear infinite; }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }
.result-canvas { position: relative; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 10px; background: #e5e7eb; cursor: move; transition: border-color .12s ease, filter .12s ease; touch-action: none; }
.result-canvas > img { width: 100%; height: auto; aspect-ratio: var(--result-ratio,16/9); display: block; border-radius: 8px; object-fit: cover; }
.canvas-result-node.ratio-square { width: 520px; }
.canvas-result-node.ratio-square .result-canvas > img { aspect-ratio: 1; }
.result-canvas.version-two > img { filter: saturate(1.08) contrast(1.03); transform: scale(1.003); }
.result-canvas.is-selected, .canvas-result-node.is-active .result-canvas { border-color: var(--blue); }
.selection-label { position: absolute; z-index: 4; left: 12px; top: 12px; display: none; padding: 4px 8px; border-radius: 6px; color: var(--blue); background: #fff; box-shadow: 0 4px 14px rgba(17,24,39,.12); font-size: 11px; }
.result-canvas.is-selected .selection-label, .result-canvas.is-selected .selection-handle, .result-canvas.is-selected .canvas-toolbar { display: flex; }
.selection-handle { position: absolute; z-index: 5; width: 10px; height: 10px; display: none; border: 2px solid var(--blue); background: #fff; }
.top-left { left: -6px; top: -6px; } .top-right { right: -6px; top: -6px; } .bottom-left { left: -6px; bottom: -6px; } .bottom-right { right: -6px; bottom: -6px; }
.canvas-toolbar { position: absolute; z-index: 6; right: 8px; top: -44px; display: none; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 10px 30px rgba(17,24,39,.14); }
.toolbar-action { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: #4d5663; }
.toolbar-action:hover { color: var(--text); background: #f0f2f5; }
.toolbar-action svg { width: 16px; height: 16px; }
.canvas-footer { position: absolute; z-index: 30; right: 18px; bottom: 14px; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.zoom-controls { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 6px 20px rgba(17,24,39,.08); }
.zoom-controls button { min-width: 28px; height: 24px; padding: 0 6px; border: 0; border-radius: 5px; color: #596170; background: transparent; cursor: pointer; font-size: 12px; }
.zoom-controls button:hover { color: var(--text); background: #f1f3f6; }

.reference-context-menu, .project-context-menu { position: fixed; z-index: 210; width: 168px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgba(17,24,39,.16); }
.reference-context-menu button, .project-context-menu button { width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 7px; color: #303640; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.reference-context-menu button:hover, .project-context-menu button:hover { background: #f1f3f6; }
.reference-context-menu button.danger, .project-context-menu button.danger { color: #e5484d; }
.reference-context-menu > span, .project-context-menu > span { height: 1px; display: block; margin: 5px 8px; background: var(--line); }
.multi-select-bar { position: fixed; z-index: 75; left: 0; bottom: 0; width: 300px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -12px 32px rgba(17,24,39,.08); font-size: 13px; }
.multi-select-bar > div { display: flex; align-items: center; gap: 6px; }
.multi-select-bar button { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; }
.multi-select-bar button:hover { background: #f4f6f8; }
.multi-select-bar button.danger { color: #e5484d; }
.ui-tooltip { position: fixed; z-index: 300; max-width: 180px; padding: 6px 9px; border-radius: 7px; color: #fff; background: rgba(25,27,31,.94); box-shadow: 0 8px 24px rgba(17,24,39,.2); pointer-events: none; font-size: 12px; line-height: 18px; white-space: nowrap; }
.image-lightbox { position: fixed; z-index: 220; inset: 0; display: grid; place-items: center; padding: 64px; background: rgba(10,12,16,.72); backdrop-filter: blur(6px); }
.image-lightbox img { max-width: min(1000px,86vw); max-height: 82vh; border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.38); }
.image-lightbox button { position: fixed; right: 28px; top: 24px; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.15); cursor: pointer; font-size: 26px; }

.asset-popover { position: fixed; z-index: 100; left: 50%; top: 50%; width: 340px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 24px 80px rgba(17,24,39,.2); transform: translate(-50%,-50%); }
.asset-popover strong { font-size: 16px; }
.asset-popover p { margin: 10px 0 18px; color: var(--muted); font-size: 13px; line-height: 21px; }
.asset-popover button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); cursor: pointer; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 32px; min-width: 220px; padding: 11px 16px; border-radius: 10px; color: #fff; background: rgba(17,24,39,.93); box-shadow: 0 16px 44px rgba(17,24,39,.22); transform: translateX(-50%); text-align: center; font-size: 13px; }

@media (max-width: 1240px) {
  .app-shell { grid-template-columns: 280px minmax(0,1fr); }
  .sidebar { width: 280px; min-width: 280px; }
  .workbench-grid { grid-template-columns: 340px 220px minmax(520px,1fr); }
  .home-content { width: min(820px, calc(100% - 64px)); }
  .analysis-composer-wrap { width: min(820px, calc(100% - 64px)); }
  .multi-select-bar { width: 280px; }
}

#assets-screen { position: absolute; z-index: 60; inset: 0; display: flex; flex-direction: column; gap: 20px; padding: 32px; background: var(--surface); color: var(--text); }
#assets-screen .assets-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#assets-screen h1 { margin: 0; font-size: 22px; font-weight: 600; }
#assets-screen .assets-header-actions, #assets-screen .asset-upload-row, #assets-screen #asset-color-form, #assets-screen #asset-import-options { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#assets-screen button, #assets-screen select, #assets-screen input[type="text"] { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: 13px; }
#assets-screen button { cursor: pointer; }
#assets-screen button:hover { background: var(--surface-subtle); border-color: #cdd4df; }
#assets-screen button:disabled { opacity: .45; cursor: default; }
#assets-screen #asset-filters { display: flex; flex-wrap: wrap; gap: 8px; }
#assets-screen #asset-filters button { border-color: transparent; color: var(--muted); }
#assets-screen #asset-filters .is-active { color: var(--blue); background: var(--blue-soft); }
#assets-screen #asset-upload, #assets-screen #asset-color-submit, #assets-screen #asset-import-confirm { border-color: var(--blue); color: #fff; background: var(--blue); }
#assets-screen #asset-upload:hover, #assets-screen #asset-color-submit:hover, #assets-screen #asset-import-confirm:hover { background: var(--blue-hover); }
#assets-screen #asset-color-form { margin-top: 12px; }
#assets-screen input[type="color"] { width: 42px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
#assets-screen #asset-status { flex: none; min-height: 20px; margin: 0; font-size: 13px; line-height: 20px; color: var(--muted); }
#assets-screen .asset-scroll { flex: 1; min-height: 0; overflow: auto; padding: 1px 4px 20px 1px; }
#assets-screen #asset-empty { margin: 64px 0; text-align: center; color: var(--muted); font-size: 14px; }
#assets-screen #asset-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
#assets-screen .asset-card { display: flex; flex-direction: column; min-width: 0; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
#assets-screen .asset-preview-action { display: flex; align-items: center; justify-content: center; width: 100%; height: 150px; padding: 10px; overflow: hidden; border: 0; background: var(--panel); font-size: 17px; }
#assets-screen .asset-preview-action img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
#assets-screen .asset-font-sample { overflow-wrap: anywhere; }
#assets-screen .asset-name { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
#assets-screen .asset-card small { color: var(--muted); font-size: 12px; }
#assets-screen .asset-card-actions { display: flex; gap: 8px; margin-top: 4px; }
#assets-screen .asset-card-actions button { flex: 1; padding: 6px; min-height: 32px; }
#assets-screen #asset-preview { position: absolute; z-index: 1; inset: 100px 32px 32px; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 20px 60px rgba(17,24,39,.16); }
#assets-screen #asset-preview-close { display: block; margin-left: auto; }
#assets-screen #asset-preview-content { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; }
#assets-screen .asset-large-sample { display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 32px; overflow-wrap: anywhere; border-radius: 12px; background: var(--panel); font-size: 36px; text-align: center; }

#analysis-review { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-message); background: var(--surface-subtle); font-size: 13px; }
#analysis-review label { display: flex; flex-direction: column; gap: 5px; }
#analysis-review textarea, #analysis-review input[type="text"] { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; }
#analysis-review textarea { min-height: 58px; resize: vertical; }
#analysis-review .analysis-element-row, #analysis-review .analysis-color-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
#analysis-review .analysis-element-row label { flex-direction: row; align-items: center; flex: none; }
#analysis-review .analysis-color-swatch { width: 24px; height: 24px; flex: none; border: 1px solid var(--line); border-radius: 6px; }
#analysis-review .is-invalid { border-color: #dc2626 !important; }
#quality-select { padding: 4px 7px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; }
#task-assets .task-asset img { display: block; width: 100%; height: 90px; border-radius: var(--radius-control); object-fit: contain; background: var(--panel); }

#version-strip { flex-wrap: wrap; }
#version-strip .version-card { cursor: pointer; }

.canvas-footer #download-selected { padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
#task-assets .extraction-status { position: absolute; left: 109px; top: -34px; font-size: 13px; line-height: 28px; }
@supports (anchor-name: --extraction-label) {
  #task-assets .canvas-section-label { anchor-name: --extraction-label; }
  #task-assets .extraction-status { left: calc(anchor(--extraction-label right) + 8px); top: anchor(--extraction-label top); }
}

.canvas-result-node .result-canvas > img, .canvas-result-node.ratio-square .result-canvas > img { object-fit: contain; aspect-ratio: var(--result-ratio, 16/9); transform: none; }
.result-size { color: var(--muted-light); font-size: 11px; white-space: nowrap; }
.home-image-hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; }

.provider-busy-status { position: fixed; z-index: 80; right: 24px; bottom: 20px; margin: 0; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--muted); font-size: 13px; pointer-events: none; }

.is-edit-target { outline: 2px solid var(--blue); outline-offset: 3px; }
.is-target-candidate { outline: 2px dashed var(--blue); outline-offset: 3px; }
.image-role-marker { display: inline-block; margin-top: 4px; padding: 1px 5px; border-radius: 4px; color: var(--blue); background: var(--surface); font-size: 11px; }
#primary-reference-card { width: calc(100% - 42px); margin: 20px 18px 0 24px; }
.edit-target-question { color: var(--muted); }

/* T-006c: role switches are available only on home image tokens. */
.home-image-role { position: static; cursor: pointer; border: 0; font: inherit; font-size: 10px; line-height: 1.5; padding: 1px 5px; margin-left: 4px; }
.home-image-role:hover, .home-image-role:focus-visible { outline: 1px solid var(--blue); }
