/* 幕间 / Scene Studio：冷灰工作台、白面板与钴蓝操作焦点。 */
:root {
  color-scheme: light;
  --accent: #4164ef;
  --accent-hover: #3454d9;
  --accent-soft: #edf1ff;
  --ink: #202633;
  --ink-secondary: #566174;
  --muted: #737d8d;
  --line: #e3e7ee;
  --line-strong: #d0d7e2;
  --workspace: #f4f5f8;
  --panel: #fff;
  --success: #21734f;
  --warning: #926119;
  --danger: #bd3748;
  --radius: 12px;
  --shadow: 0 3px 12px rgb(26 39 66 / 4%);
  --shadow-float: 0 12px 32px rgb(26 39 66 / 10%);
  --checkerboard: conic-gradient(#e8eaee 25%, #f9fafb 0 50%, #e8eaee 0 75%, #f9fafb 0);
  --sidebar-width: 220px;
  --topbar-height: 76px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; background: var(--workspace); }
body { margin: 0; min-width: 0; min-height: 100vh; color: var(--ink); background: var(--workspace); line-height: 1.55; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 27px; letter-spacing: -.7px; }
h2 { font-size: 20px; letter-spacing: -.4px; }
h3 { font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink-secondary);
  font-weight: 550;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
button:hover, .btn:hover { border-color: #b8c2d3; background: #f7f8fb; color: var(--ink); }
button:active:not(:disabled), .btn:active:not([aria-disabled="true"]) { background: #eef1f6; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 2px 3px rgb(65 100 239 / 12%); }
.btn.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #fff; }
.btn.primary:active { background: #2b49c5; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: #f7f8fb; border-color: #b5bfd0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-secondary); box-shadow: none; }
.btn.ghost:hover { color: var(--accent); background: var(--accent-soft); }
.btn.small { min-height: 29px; padding: 5px 9px; font-size: 12px; border-radius: 6px; }
.icon-btn { flex: 0 0 auto; width: 32px; height: 32px; min-height: 32px; padding: 6px; border-color: transparent; background: transparent; border-radius: 6px; }
.icon-btn:hover { background: #edf0f6; border-color: transparent; }
button.danger, .btn.danger, .icon-btn.danger { color: var(--danger); }
button.danger:hover, .btn.danger:hover, .icon-btn.danger:hover { color: #a12536; background: #fff1f2; border-color: #efd1d6; }
button:disabled, .btn[aria-disabled="true"] { opacity: .46; cursor: not-allowed; box-shadow: none; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid rgb(65 100 239 / 36%); outline-offset: 3px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: #fff;
  line-height: 1.4;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(65 100 239 / 11%);
}
input::placeholder, textarea::placeholder { color: #929bab; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: #f3f5f8; color: var(--muted); cursor: not-allowed; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
input[type="range"] { width: 100%; min-width: 0; height: 20px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
input[type="color"] { height: 36px; padding: 3px !important; cursor: pointer; }
input[type="file"] { font-size: 12px; }
input[type="file"]::file-selector-button { margin-right: 9px; padding: 5px 8px; border: 0; border-radius: 4px; color: var(--accent); background: var(--accent-soft); font: inherit; cursor: pointer; }
textarea { min-height: 88px; resize: vertical; }
select { padding-right: 28px; cursor: pointer; }
label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ink-secondary); font-size: 12px; font-weight: 500; }
svg.icon { width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; }
::selection { color: #203dae; background: #dde5ff; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.eyebrow { color: var(--accent); font-size: 11px; line-height: 1.4; letter-spacing: 1.7px; font-weight: 700; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-secondary); background: #f4f6f9; font-size: 11px; font-weight: 550; line-height: 1.35; }
.badge.blue { color: #3655d1; background: #edf1ff; border-color: #dce4ff; }
.badge.green { color: var(--success); background: #edf8f2; border-color: #d7eddf; }
.badge.amber { color: var(--warning); background: #fff7e8; border-color: #f1e4c5; }
.row, .between { display: flex; align-items: center; gap: 10px; min-width: 0; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hidden, [hidden] { display: none !important; }

/* 应用外壳：侧栏固定尺寸，内容保持宽版。 */
#shell.shell, .shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; width: var(--sidebar-width); height: 100vh; height: 100dvh; min-width: 0; padding: 26px 16px 18px; border-right: 1px solid var(--line); background: #fcfcfe; z-index: 40; }
.wordmark { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 11px; align-items: center; margin: 0 9px 36px; color: var(--ink); }
.wordmark:hover { color: var(--ink); }
.wordmark b { grid-column: 2; font-size: 21px; line-height: 1.2; letter-spacing: 2px; font-weight: 750; }
.wordmark small { display: block; grid-column: 2; margin-top: 5px; color: var(--accent); font-size: 10px; font-weight: 650; line-height: 1.2; letter-spacing: 1.2px; }
.logo-mark { position: relative; grid-column: 1; grid-row: 1 / 3; display: block; width: 36px; height: 39px; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; width: 24px; height: 29px; border: 2px solid var(--accent); border-radius: 5px; }
.logo-mark::before { left: 1px; top: 2px; background: #e7edff; opacity: .55; }
.logo-mark::after { left: 9px; top: 9px; background: #fcfcfe; box-shadow: 2px 2px 0 #e7edff; }
.nav-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nav-item { justify-content: flex-start; width: 100%; min-height: 42px; gap: 11px; padding: 11px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #697386; text-align: left; }
.nav-item:hover { background: #f0f2f7; border-color: transparent; }
.nav-item.active { color: var(--accent); background: #edf1ff; border-color: #e3e9ff; font-weight: 650; }
.nav-item > span:not(.count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { margin-left: auto; padding: 1px 6px; border-radius: 4px; background: #e8ecf3; color: #727d90; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-item.active .count { color: var(--accent); background: #dfe6ff; }
.sidebar-footer { margin-top: auto; padding: 17px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }
.local-dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #3b9c6e; box-shadow: 0 0 0 3px #e9f5ee; vertical-align: 1px; }
.main { min-width: 0; }
.topbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--topbar-height); padding: 0 32px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 95%); z-index: 20; }
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 12px; }
.breadcrumb > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb b, .breadcrumb strong, .breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 550; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.local-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: #6c7888; background: #fbfcfd; font-size: 11px; white-space: nowrap; }
#content { width: 100%; min-width: 0; padding: 28px 32px 40px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header > * { min-width: 0; }
.page-header h1 { overflow-wrap: anywhere; }
.page-header p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

/* 项目首页：真实竖屏图是主要视觉，不用装饰图形代替作品。 */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); height: 280px; margin-bottom: 29px; overflow: hidden; border: 1px solid #dfe5f1; border-radius: var(--radius); background: #f8faff; }
.hero-copy { align-self: center; min-width: 0; padding: 28px 30px; }
.hero-copy .eyebrow { margin-bottom: 12px; }
.hero-copy h2 { max-width: 520px; font-size: clamp(23px, 2.1vw, 31px); letter-spacing: -.9px; line-height: 1.3; }
.hero-copy p { max-width: 450px; margin-top: 11px; color: #718097; font-size: 13px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.art-preview, .hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; overflow: hidden; background: #eef2fb; }
.hero .art-preview { border-left: 1px solid #e5eaf4; }
.art-preview > .hero-art { width: 100%; }
.hero-art > img.real-scene, .art-preview > img.real-scene { position: relative; z-index: 1; width: auto; max-width: 66%; height: 258px; object-fit: contain; border-radius: 9px; transform: rotate(5deg); box-shadow: 0 8px 22px rgb(38 51 85 / 17%); }
.floating-note { position: absolute; z-index: 2; max-width: 175px; padding: 10px 13px; border: 1px solid #e3e8f2; border-radius: 8px; background: rgb(255 255 255 / 97%); box-shadow: 0 5px 15px rgb(37 52 91 / 7%); color: var(--ink-secondary); font-size: 11px; line-height: 1.6; }
.floating-note b, .floating-note strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 12px; font-weight: 600; }
.floating-note.top { top: 35px; left: 20px; }
.floating-note.bottom { right: 18px; bottom: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 15px; }
.section-title h2 { font-size: 17px; letter-spacing: -.3px; }
.section-title .muted { text-align: right; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.project-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); transition: border-color .18s ease, box-shadow .18s ease; }
.project-card:hover { border-color: #c8d3f1; box-shadow: 0 6px 18px rgb(27 45 91 / 7%); }
.project-preview { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 240px; padding: 14px; overflow: hidden; border-bottom: 1px solid var(--line); background: #eef0f5; }
.project-preview img { width: 100%; height: 100%; object-fit: contain; }
.project-preview > .badge { position: absolute; top: 12px; left: 12px; }
.project-info { min-width: 0; padding: 16px; }
.project-title { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-top: 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.project-actions { display: flex; align-items: center; gap: 7px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #eff1f5; }
.project-actions .btn:first-child { flex: 1; }
.project-actions .icon-btn { margin-left: auto; }
.new-project-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; align-self: start; min-width: 0; width: 100%; height: 240px; padding: 24px; border: 1px dashed #c8d0e0; border-radius: 11px; background: #f9fafd; color: var(--ink-secondary); text-align: center; cursor: pointer; }
.new-project-card:hover { border-color: var(--accent); color: var(--accent); background: #f0f4ff; }
.new-project-card .icon { width: 28px; height: 28px; flex-basis: 28px; color: #8c9bb8; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 280px; padding: 40px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fafbfd; color: var(--muted); text-align: center; }
.empty-state h2, .empty-state h3 { color: var(--ink); }
.empty-state p { max-width: 430px; font-size: 13px; line-height: 1.8; }
.empty-state > .icon { width: 30px; height: 30px; color: #a0abc1; }

/* 资产库。 */
.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.asset-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.asset-card:hover { border-color: #c8d3f1; box-shadow: var(--shadow); }
.asset-thumb { position: relative; display: flex; align-items: center; justify-content: center; height: 160px; padding: 13px; overflow: hidden; border-bottom: 1px solid var(--line); background-color: #f9fafb; background-image: var(--checkerboard); background-size: 16px 16px; }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.asset-info { min-width: 0; padding: 12px; }
.asset-info h3, .asset-info > b, .asset-info > strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.asset-info .muted { display: block; margin-top: 5px; font-size: 11px; }
.asset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.asset-actions .btn { flex: 1; }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 160px; padding: 24px; border: 1px dashed #bfcbe3; border-radius: 10px; background: #f8faff; color: var(--ink-secondary); text-align: center; transition: background-color .16s ease, border-color .16s ease; }
.upload-zone:hover, .upload-zone:focus-within, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone > .icon { color: var(--accent); }
.upload-zone input { max-width: 100%; }
.upload-zone p { overflow-wrap: anywhere; }

/* 编辑器：固定工具栏，独立滚动的图层、画布和属性面板。 */
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; margin: -3px 0 20px; }
.editor-title { display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.editor-title input { width: min(100%, 430px) !important; min-height: 33px !important; margin-left: -7px; padding: 4px 6px !important; border-color: transparent !important; background: transparent !important; font-size: 21px; font-weight: 650; letter-spacing: -.5px; text-overflow: ellipsis; }
.editor-title input:hover { border-color: var(--line-strong) !important; background: #fff !important; }
.editor-title input:focus { border-color: var(--accent) !important; background: #fff !important; }
.editor-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
.editor-layout { display: grid; grid-template-columns: 250px minmax(300px, 1fr) 252px; gap: 0; height: calc(100vh - 206px); height: calc(100dvh - 206px); min-height: 650px; min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; box-shadow: 0 4px 18px rgb(29 43 75 / 3%); }
.layer-panel, .property-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.layer-panel { border-right: 1px solid var(--line); }
.property-panel { overflow-y: auto; border-left: 1px solid var(--line); overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; min-height: 51px; padding: 13px 15px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 650; }
.panel-header h2, .panel-header h3 { font-size: 13px; letter-spacing: 0; }
.panel-header .badge { font-weight: 500; }
.panel-subtitle { flex: 0 0 auto; padding: 11px 15px 6px; color: #8b94a4; font-size: 10px; font-weight: 600; letter-spacing: .6px; }
.layers-list { flex: 1; min-height: 0; padding: 7px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.layer-section { margin: 6px 0 15px; }
.layer-section > h3, .layer-section > h4, .layer-section > .muted { display: block; padding: 5px 7px 8px; color: #8b94a4; font-size: 10px; font-weight: 600; }
.layer-row { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 55px; margin-bottom: 4px; padding: 8px 6px; border: 1px solid transparent; border-radius: 7px; background: #fff; color: var(--ink-secondary); text-align: left; cursor: pointer; }
.layer-row:hover { background: #f6f8fc; border-color: #edf0f6; }
.layer-row.selected { background: #edf2ff; border-color: #cedaff; }
.layer-row.locked { color: #858fa0; cursor: default; }
.layer-row.locked .layer-thumb { opacity: .62; }
.layer-row.locked.selected { background: #f1f4fc; border-color: #d5def3; }
.layer-thumb { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; overflow: hidden; border: 1px solid #e1e5ed; border-radius: 5px; background-color: #f9fafb; background-image: var(--checkerboard); background-size: 10px 10px; }
.layer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer-label { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.layer-label b, .layer-label strong { display: block; overflow: hidden; font-size: 12px; font-weight: 550; text-overflow: ellipsis; }
.layer-label small, .layer-label .muted { display: block; margin-top: 2px; color: #8a94a5; font-size: 10px; font-weight: 400; }
.layer-tools { display: flex; align-items: center; gap: 1px; }
.layer-tools .icon-btn { width: 24px; height: 28px; min-height: 28px; padding: 3px; color: #8591a5; }
.layer-tools .icon { width: 14px; height: 14px; flex-basis: 14px; }
.layer-tools .icon-btn:hover { background: #e1e8fa; color: var(--accent); }
.panel-footer { flex: 0 0 auto; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.panel-footer > .btn:only-child { width: 100%; }
.canvas-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #eff0f3; }
.canvas-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 51px; padding: 10px 13px; border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted); font-size: 11px; }
.canvas-toolbar .controls, .canvas-toolbar > .row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.canvas-toolbar select { width: auto; max-width: 100%; min-height: 29px; padding-top: 4px; padding-bottom: 4px; font-size: 11px; }
.canvas-toolbar label { flex-direction: row; align-items: center; font-size: 11px; }
.segmented { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px; border: 1px solid #e1e5ec; border-radius: 7px; background: #eef1f6; }
.segmented button { min-width: 0; min-height: 25px; padding: 4px 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #778197; font-size: 11px; font-weight: 500; white-space: nowrap; }
.segmented button:hover { color: var(--ink); background: rgb(255 255 255 / 65%); }
.segmented button.active, .segmented button[aria-pressed="true"] { color: var(--accent); background: #fff; border-color: #e0e5ef; box-shadow: 0 1px 3px rgb(25 41 81 / 7%); }
/* auto 外边距在画布小于视口时居中，放大时归零，避免左侧内容滚动不可达。 */
.stage-viewport { display: flex; flex: 1 1 0; align-items: flex-start; min-width: 0; min-height: 0; padding: 24px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.stage-wrap { position: relative; flex: 0 0 auto; margin: auto; isolation: isolate; }
/* 逻辑尺寸、缩放比例与包裹尺寸由 JS 内联样式控制。 */
.stage { position: absolute; top: 0; left: 0; overflow: hidden; transform-origin: top left; background-color: #f9fafb; background-image: var(--checkerboard); background-size: 24px 24px; box-shadow: 0 3px 18px rgb(25 35 52 / 15%), 0 0 0 1px rgb(25 35 52 / 8%); }
.stage.dark { background: #000; }
.stage.light { background: #fff; }
.canvas-layer { position: absolute; max-width: none; cursor: move; -webkit-user-select: none; user-select: none; touch-action: none; }
.canvas-layer img, img.canvas-layer { object-fit: contain; -webkit-user-drag: none; }
.canvas-layer img { width: 100%; height: 100%; max-width: none; pointer-events: none; }
.canvas-layer.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.canvas-layer.locked { cursor: default; }
.resize-handle { position: absolute; right: -7px; bottom: -7px; z-index: 10; width: 14px; height: 14px; border: 2px solid var(--accent); border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgb(25 41 81 / 15%); cursor: nwse-resize; touch-action: none; }
.safe-guide { position: absolute; inset: 8% 7%; z-index: 30; border: 2px dashed rgb(65 100 239 / 68%); border-radius: 24px; color: var(--accent); pointer-events: none; }
.camera-guide { position: absolute; inset: 18% 17% 15%; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; padding: 20px; border: 2px dashed rgb(129 141 160 / 35%); border-radius: 32px; color: #8691a3; background: rgb(231 235 242 / 12%); font-size: 22px; line-height: 1.5; text-align: center; pointer-events: none; }
.camera-guide::before { content: ""; position: absolute; top: 13%; left: 35%; width: 30%; aspect-ratio: 1; border: 3px solid rgb(133 146 166 / 25%); border-radius: 50%; background: rgb(178 190 207 / 10%); }
.camera-guide::after { content: ""; position: absolute; top: 43%; bottom: 14%; left: 14%; width: 72%; border: 3px solid rgb(133 146 166 / 25%); border-bottom: 0; border-radius: 48% 48% 12% 12%; background: rgb(178 190 207 / 10%); }
.stage-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 44px; padding: 8px 13px; border-top: 1px solid #e0e4ea; color: #808a9b; background: #fafbfc; font-size: 10px; }
.zoom-control { display: flex; align-items: center; gap: 7px; min-width: 0; margin-left: auto; font-variant-numeric: tabular-nums; }
.zoom-control input[type="range"] { width: 76px; }
.zoom-control .icon-btn { width: 25px; height: 25px; min-height: 25px; padding: 4px; }
.zoom-control .icon { width: 15px; height: 15px; flex-basis: 15px; }
.zoom-control > span { min-width: 35px; text-align: center; }
.property-panel > .panel-header { position: sticky; top: 0; z-index: 3; background: #fff; }
.property-block { flex: 0 0 auto; min-width: 0; padding: 16px 14px; border-bottom: 1px solid #edf0f5; }
.property-block:last-child { border-bottom: 0; }
.property-block h3, .property-block h4 { margin-bottom: 12px; font-size: 12px; font-weight: 650; }
.property-block > label + label, .property-block > .row + .row { margin-top: 10px; }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 9px; min-width: 0; }
.property-grid + .property-grid, .property-grid + .switch-row { margin-top: 12px; }
.property-grid input, .property-grid select { font-size: 12px; font-variant-numeric: tabular-nums; }
.prop-label { display: block; margin-bottom: 6px; color: #7d8798; font-size: 11px; font-weight: 500; }
label > .prop-label { margin-bottom: 0; }
.switch-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; color: var(--ink-secondary); font-size: 12px; }
.switch-row > label { flex-direction: row; align-items: center; }
.layer-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.hint-box { padding: 11px 12px; border: 1px solid #dfe7fb; border-radius: 7px; background: #f5f8ff; color: #7383a2; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.property-panel > .hint-box { margin: 14px; }
.inspector-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; padding: 28px 20px; color: #8792a5; text-align: center; font-size: 12px; line-height: 1.8; }
.inspector-empty .icon { width: 28px; height: 28px; flex-basis: 28px; color: #a3aec0; }
.asset-picker { min-width: 0; }
.picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 360px; padding: 3px; overflow: auto; overscroll-behavior: contain; }
.picker-grid > button, .picker-grid > a, .picker-grid > .asset-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: #f8f9fc; }
.picker-grid img { width: 100%; height: 105px; object-fit: contain; background-color: #f9fafb; background-image: var(--checkerboard); background-size: 12px 12px; border-radius: 4px; }
.picker-grid button:hover, .picker-grid .selected { border-color: var(--accent); background: var(--accent-soft); }
.picker-grid span { max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.property-panel .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-preview { display: flex; align-items: center; justify-content: center; min-width: 0; height: 160px; padding: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background-color: #f9fafb; background-image: var(--checkerboard); background-size: 14px 14px; }
.mini-preview img, img.mini-preview { width: 100%; height: 100%; object-fit: contain; }
img.mini-preview { height: 160px; }

/* 交付：左侧作品验证，右侧文件与使用说明。 */
.delivery-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.delivery-visual { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 600px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #eceff4; }
.delivery-visual img { width: 100%; height: 600px; object-fit: contain; }
.delivery-info { min-width: 0; padding: 16px 0; }
.delivery-info h1 { margin: 10px 0 13px; font-size: 29px; line-height: 1.35; overflow-wrap: anywhere; }
.delivery-info > p { max-width: 480px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.download-list { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 20px; }
.download-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.download-item > svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--accent); }
.download-item > div { flex: 1; min-width: 0; }
.download-item b, .download-item strong, .download-item h3 { display: block; color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.download-item small, .download-item p, .download-item .muted { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.download-item > a { flex-shrink: 0; font-size: 12px; font-weight: 550; }
.warning-list { margin: 19px 0; padding: 15px 17px 15px 32px; border: 1px solid #ebe3d2; border-radius: 8px; background: #fffbf2; color: #90794b; font-size: 12px; line-height: 1.8; }
.warning-list li + li { margin-top: 7px; }
.delivery-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: #8791a1; font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }

/* 对话框、通知与表单。 */
dialog, .dialog { width: min(560px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: auto; border: 1px solid #dfe4ed; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgb(23 34 58 / 22%); overscroll-behavior: contain; }
dialog:not([open]) { display: none; }
dialog::backdrop, .dialog::backdrop { background: rgb(28 36 56 / 38%); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 65px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 18px; }
.dialog-body { min-width: 0; padding: 22px; }
.dialog-body > p { margin-bottom: 17px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.dialog-body > label + label { margin-top: 15px; }
.dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fafbfd; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tabs { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; margin-bottom: 20px; padding-bottom: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); overscroll-behavior-x: contain; }
.tabs > button, .tabs > a { flex: 0 0 auto; min-height: 33px; padding: 7px 12px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; white-space: nowrap; }
.tabs > button:hover, .tabs > a:hover { color: var(--ink); background: #f1f4f9; }
.tabs > .active, .tabs > [aria-selected="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toast-container { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 4px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid #dce3ef; border-radius: 9px; color: var(--ink-secondary); background: #fff; box-shadow: var(--shadow-float); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; pointer-events: auto; animation: toast-enter .2s ease-out; }
.toast.error { color: #9f3442; border-color: #edccd3; background: #fff8f9; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 140px; color: var(--muted); font-size: 13px; }
button.loading, .btn.loading { min-height: 36px; }
.spinner { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; border: 2px solid #dfe5f2; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.btn.primary .spinner { border-color: rgb(255 255 255 / 35%); border-top-color: #fff; }
.notice-bar { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 15px; border: 1px solid #dce5fc; border-radius: 8px; color: #6178aa; background: #f0f5ff; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.notice-bar > .icon { margin-top: 1px; }
.notice-bar > :last-child.icon-btn { margin: -3px -5px -3px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* 1366 与 1440 保留 220px 侧栏及完整三栏编辑器。 */
@media (max-width: 1400px) {
  .topbar { padding-inline: 26px; }
  #content { padding-inline: 26px; }
  .hero-copy { padding-inline: 26px; }
  .project-grid { gap: 15px; }
  .asset-grid { gap: 13px; }
  .delivery-layout { gap: 26px; }
}

@media (max-width: 1199px) {
  .topbar { padding-inline: 22px; }
  #content { padding-inline: 22px; }
  .editor-layout { grid-template-columns: 200px minmax(300px, 1fr) 216px; }
  .layer-row { gap: 5px; padding-inline: 4px; }
  .layer-tools { flex-direction: column; gap: 0; }
  .layer-tools .icon-btn { height: 23px; min-height: 23px; }
  .hero-copy { padding: 22px; }
  .hero-copy h2 { font-size: 25px; }
  .floating-note { max-width: 142px; padding: 8px 10px; }
  .floating-note.top { top: 22px; left: 12px; }
  .floating-note.bottom { right: 12px; bottom: 20px; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-info { padding: 13px; }
  .project-actions { flex-wrap: wrap; }
  .editor-actions .btn { padding-inline: 10px; font-size: 12px; }
}

/* 中等宽度将属性放到下一行，画布不被挤压成不可用窄条。 */
@media (min-width: 761px) and (max-width: 1039px) {
  .editor-layout { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: minmax(550px, 68vh) auto; height: auto; }
  .property-panel { grid-column: 1 / -1; max-height: 420px; border-top: 1px solid var(--line); border-left: 0; }
  .property-panel .property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .property-panel .picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); height: 300px; }
  .hero-copy { padding: 20px; }
  .hero-copy h2 { font-size: 23px; }
  .floating-note { max-width: 125px; font-size: 10px; }
  .floating-note.top { top: 13px; left: 8px; }
  .floating-note.bottom { right: 8px; bottom: 12px; }
  .page-header, .editor-header { flex-wrap: wrap; }
  .editor-actions { justify-content: flex-start; }
  .delivery-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .delivery-visual { min-height: 480px; }
  .delivery-visual img { height: 480px; }
}

/* 手机侧栏变顶部横向导航，页面不横向溢出；放大画布只在自身视口滚动。 */
@media (max-width: 760px) {
  :root { --topbar-height: 60px; }
  #shell.shell, .shell { display: block; }
  .sidebar { position: relative; top: auto; width: 100%; height: auto; padding: 14px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wordmark { width: fit-content; grid-template-columns: 29px auto auto; grid-template-rows: auto; align-items: center; gap: 9px; margin: 0 0 15px; }
  .logo-mark { grid-row: 1; width: 29px; height: 29px; }
  .logo-mark::before, .logo-mark::after { width: 19px; height: 23px; border-radius: 4px; }
  .logo-mark::before { top: 0; left: 0; }
  .logo-mark::after { top: 5px; left: 7px; }
  .wordmark b { font-size: 19px; letter-spacing: 1px; }
  .wordmark small { grid-column: 3; margin: 2px 0 0 3px; font-size: 10px; letter-spacing: .8px; }
  .nav-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-item { flex: 1 1 100px; width: auto; min-width: 0; min-height: 39px; gap: 7px; padding: 9px 10px; font-size: 12px; }
  .nav-item .count { padding-inline: 5px; }
  .sidebar-footer { display: none; }
  .topbar { height: auto; min-height: var(--topbar-height); gap: 10px; padding: 12px 16px; }
  .breadcrumb { gap: 6px; font-size: 11px; }
  .top-actions { gap: 6px; flex-shrink: 0; }
  .top-actions .btn { min-height: 32px; padding: 6px 9px; font-size: 11px; }
  .local-chip { gap: 2px; padding: 4px 6px; font-size: 10px; }
  #content { padding: 22px 16px 32px; }
  h1 { font-size: 24px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 19px; }
  .page-header p { font-size: 12px; line-height: 1.75; }
  .header-actions { width: 100%; }
  .header-actions > .btn { flex: 1; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); height: 290px; margin-bottom: 24px; }
  .hero-copy { padding: 20px; }
  .hero-copy h2 { font-size: 24px; }
  .hero-copy p { font-size: 12px; line-height: 1.75; }
  .hero-actions { gap: 7px; margin-top: 18px; }
  .hero-actions .btn { padding-inline: 10px; font-size: 12px; }
  .hero-art > img.real-scene, .art-preview > img.real-scene { height: 262px; max-width: 72%; }
  .floating-note { max-width: 135px; padding: 8px 10px; font-size: 10px; }
  .floating-note.top { top: 17px; left: 10px; }
  .floating-note.bottom { right: 10px; bottom: 17px; }
  .section-title { gap: 10px; margin-top: 23px; }
  .section-title h2 { font-size: 16px; }
  .section-title .muted { font-size: 11px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .asset-thumb { height: 145px; padding: 10px; }
  .upload-zone { padding: 22px 16px; }
  .editor-header { flex-direction: column; align-items: stretch; gap: 13px; margin: 0 0 16px; }
  .editor-title input { max-width: 100%; font-size: 20px; }
  .editor-actions { justify-content: flex-start; flex-wrap: wrap; }
  .editor-actions .btn { flex: 1 1 auto; min-height: 38px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(160px, 230px) minmax(570px, 74svh) auto; height: auto; min-height: 0; }
  .layer-panel { max-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .layers-list { padding: 6px 8px; }
  .layer-section { margin: 0 0 8px; }
  .layer-row { min-height: 51px; gap: 10px; padding: 6px; }
  .layer-tools { flex-direction: row; gap: 3px; }
  .layer-tools .icon-btn { width: 32px; height: 32px; min-height: 32px; padding: 7px; }
  .layer-tools .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .panel-header { min-height: 46px; padding: 11px 13px; }
  .panel-footer { padding: 8px 12px; }
  .panel-subtitle { padding-top: 8px; }
  .canvas-panel { min-height: 570px; }
  .canvas-toolbar { align-items: flex-start; min-height: 51px; padding: 10px; }
  .stage-viewport { padding: 18px; }
  .stage-footer { padding: 9px 10px; }
  .property-panel { max-height: 520px; border-top: 1px solid var(--line); border-left: 0; }
  .property-block { padding: 15px; }
  .property-panel .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inspector-empty { min-height: 160px; }
  .delivery-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .delivery-visual { min-height: 0; padding: 18px; }
  .delivery-visual img { height: min(600px, 115vw); }
  .delivery-info { padding: 0; }
  .delivery-info h1 { font-size: 26px; }
  .download-list { margin-top: 22px; }
  .download-item { gap: 10px; padding: 13px; }
  .dialog-header, .dialog-body { padding: 18px; }
  .dialog-footer { padding: 14px 18px; }
  .toast-container { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 24px)); }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }
  .canvas-toolbar select { max-width: 170px; }
}

@media (max-width: 520px) {
  .hero { grid-template-columns: minmax(0, 1fr); height: auto; }
  .hero-copy { padding: 24px 22px; }
  .hero-copy h2 { max-width: 290px; font-size: 27px; }
  .hero-copy p { max-width: 290px; }
  .hero .art-preview { height: 310px; border-top: 1px solid #e5eaf4; border-left: 0; }
  .hero > .hero-art { height: 310px; }
  .hero-art > img.real-scene, .art-preview > img.real-scene { height: 286px; max-width: 70%; }
  .floating-note.top { top: 29px; left: 14px; }
  .floating-note.bottom { bottom: 26px; right: 14px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .project-info { padding: 16px; }
  .project-actions { flex-wrap: nowrap; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .asset-thumb { height: 160px; }
  .asset-info { padding: 10px; }
  .asset-actions .btn { padding: 6px 7px; }
  .new-project-card { height: 240px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-footer .btn { flex: 1; }
  .download-item { flex-wrap: wrap; }
  .download-item > div { flex-basis: calc(100% - 38px); }
  .download-item > a { margin-left: auto; }
  .section-title { align-items: center; }
  .notice-bar { padding: 11px 12px; }
}

@media (max-width: 359px) {
  #content { padding-inline: 12px; }
  .sidebar, .topbar { padding-inline: 12px; }
  .topbar { flex-wrap: wrap; }
  .top-actions { margin-left: auto; }
  .nav-item { padding-inline: 8px; }
  .hero-copy { padding-inline: 18px; }
  .hero-copy h2 { font-size: 25px; }
  .floating-note { max-width: 116px; }
  .stage-viewport { padding: 12px; }
  .property-panel .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented button { padding-inline: 7px; }
  .asset-actions { flex-direction: column; align-items: stretch; }
}

.sidebar-caption{padding:0 9px 16px;color:var(--ink-secondary);font-size:12px;font-weight:650;line-height:1.7}.sidebar-tip{margin:48px 10px 22px;padding:18px 12px;border-top:1px solid var(--line);color:#7c879b;font-size:12px;line-height:1.9}.sidebar-tip strong{display:block;margin:10px 0 5px;color:#566174}.sidebar-footer{display:flex;align-items:center;gap:5px}.sidebar-footer small{display:block;font-size:10px}.sidebar-footer .version{margin-left:auto}.avatar{display:grid;place-items:center;background:#e8edfc;color:var(--accent);width:30px;height:30px;border-radius:50%;font-weight:650}.preview-dim{position:absolute;right:10px;bottom:10px;background:#ffffffed;border:1px solid var(--line);padding:4px 7px;font-size:10px;border-radius:5px;color:var(--muted)}button.project-preview{border-width:0 0 1px;border-radius:0}.hero-copy>.badge{margin-bottom:12px}.floating-note{display:flex;align-items:center;gap:7px}.page-footnote{margin-top:28px;color:#8791a1;font-size:11px}.empty-project-art{display:flex;flex-direction:column;align-items:center;gap:14px;color:#939eb1}.empty-project-art svg{width:34px;height:34px}.upload-zone{width:100%}.layer-section{font-size:10px;color:#8b94a4;padding:4px 7px;margin:4px 0}.camera-divider{font-size:10px;letter-spacing:.2px;text-align:center;padding:10px 4px;border-top:1px dashed #cbd4e6;border-bottom:1px dashed #cbd4e6;margin:8px 0;color:#6480b0}.panel-footer{display:flex;gap:5px;flex-wrap:wrap}.panel-footer .btn{flex:1;padding-inline:5px}.property-block>p{margin:9px 0 12px}.property-block>h3{margin-top:0}.property-block>.hint-box{margin:12px 0}.switch-row{justify-content:flex-start}.dialog-body>.hint-box{margin-top:18px}.dialog-body>.form-grid{margin-top:16px}.help-steps h3{margin:18px 0 8px}.help-steps h3:first-child{margin-top:0}.help-steps p{color:var(--muted);font-size:13px;line-height:1.8}.delivery-visual{flex-direction:column;gap:16px}.delivery-visual img{background-image:var(--checkerboard);background-size:16px 16px}.delivery-info>h2{margin:14px 0 8px;font-size:25px}.composition-order{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:12px 0;font-size:12px;color:#687999}.composition-order span{padding:8px 10px;border:1px solid #dce4f7;background:#f0f4ff;border-radius:6px}.notice-bar{margin-top:16px}.canvas-layer{touch-action:none}.icon-btn.active{background:var(--accent-soft);color:var(--accent)}.stage .canvas-layer.selected{outline-width:calc(1.5px / var(--scale, .3))}.stage .resize-handle{width:calc(9px / var(--scale, .3));height:calc(9px / var(--scale, .3));right:0;bottom:0;border-width:calc(1px / var(--scale, .3))}.form-grid{margin-top:12px}.picker-grid .asset-info{width:100%;padding:3px}.picker-grid .asset-thumb{width:100%;height:110px;padding:0;border:0}.picker-grid .asset-info .badge{font-size:9px}.editor-title>div{min-width:0;flex:1}.property-block>input[type=range]{margin:10px 0 15px}.delivery-visual .segmented{flex-shrink:0}
@media(max-width:760px){.sidebar-tip,.sidebar-footer{display:none}.nav-item{flex:1 1 0;padding-inline:6px;gap:5px}.nav-item>span[data-icon]{flex:0 0 18px}.nav-item>span:not([data-icon]):not(.count){flex:1}.nav-item .count{margin-left:0}.wordmark>span:last-child{display:flex;align-items:center;gap:8px}.page-header>.btn{align-self:flex-start}.preview-dim{font-size:11px}.delivery-visual img{min-width:0}.delivery-info h2{font-size:22px}}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 多用户入口和业务页沿用浅色钴蓝工作台，不改变画布逻辑尺寸。 */
.auth-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); align-items: center; gap: clamp(32px, 7vw, 110px); min-height: 100vh; min-height: 100dvh; max-width: 1320px; margin: auto; padding: 48px clamp(24px, 6vw, 88px); }
.auth-story { min-width: 0; }
.auth-story .wordmark { width: fit-content; margin: 0 0 64px; }
.auth-story h1 { margin: 16px 0 22px; font-size: clamp(32px, 3.5vw, 48px); line-height: 1.3; letter-spacing: -1.6px; }
.auth-story > p:not(.eyebrow) { color: var(--ink-secondary); line-height: 1.95; }
.auth-story > .muted { margin-top: 36px; }
.auth-composition { display: grid; gap: 8px; max-width: 320px; margin: 34px 0; padding: 22px; border: 1px solid #dce4f7; border-radius: 16px; background: #eef2fc; }
.auth-composition span { padding: 13px 20px; border: 1px solid #d6dff6; border-radius: 8px; color: #52689d; background: #fff; font-size: 12px; }
.auth-composition span:last-child { margin-left: 22px; color: var(--accent); box-shadow: var(--shadow); }
.auth-card { width: 100%; min-width: 0; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 42px rgb(38 59 115 / 6%); }
.auth-card h2 { margin: 17px 0 9px; font-size: 25px; }
.auth-card .tabs { margin-top: 24px; }
.auth-card .btn.primary { min-height: 44px; }
.auth-footnote { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-footnote strong, .page-footnote strong { color: var(--ink-secondary); font-size: 12px; }
.auth-footnote small { display: block; margin-top: 4px; color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: 1.2px; }
.form-error { color: var(--danger); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.form-error:empty { display: none; }
.work-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.work-card > .muted { margin-top: 8px; }
.ai-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.consent-row { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink-secondary); font-size: 12px; line-height: 1.8; }
.consent-row input { margin-top: 4px; }
.reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 290px; margin-top: 12px; overflow-y: auto; padding: 3px; }
.reference-option { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; cursor: pointer; }
.reference-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.reference-option > img { width: 100%; height: 75px; object-fit: contain; background-image: var(--checkerboard); background-size: 12px 12px; }
.reference-option > span { display: flex; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; font-size: 11px; }
.task-panel > .muted { margin: 12px 0 18px; line-height: 1.8; }
.task-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fcfdff; }
.task-card > p { margin-top: 9px; }
.task-card .between { flex-wrap: wrap; }
.task-prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.task-result { width: 100%; height: 180px; margin-top: 12px; padding: 8px; background-image: var(--checkerboard); background-size: 16px 16px; }
.task-result img { width: 100%; height: 100%; object-fit: contain; }
.wallet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wallet-number { display: block; margin-top: 8px; color: var(--accent); font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }
.plan-grid, .account-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.plan-price { color: var(--ink); font-size: 30px; font-variant-numeric: tabular-nums; }
.record-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; }
.record-row > div { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.record-row p { margin-top: 6px; }
.account-layout #password-form { margin-top: 22px; }
.rgba-inspection { min-width: 0; }
.rgba-preview { display: grid; place-items: center; min-width: 0; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff var(--checkerboard); background-size: 16px 16px; }
.rgba-preview[data-surface="light"] { background: #fff; }
.rgba-preview[data-surface="dark"] { background: #191b22; }
.rgba-preview > img { width: 100%; height: min(36vh, 360px); object-fit: contain; }
.rgba-inspection > .segmented { margin-top: 8px; flex-wrap: wrap; }
.asset-review { align-items: flex-start; gap: 18px; }
.asset-review > .rgba-inspection { flex: 0 1 240px; }
.asset-review .rgba-preview > img { height: 200px; }
.asset-review > img { flex: 0 0 76px; width: 76px; height: 95px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.asset-review > div { min-width: 0; }
.asset-review p { margin: 7px 0 12px; }
.recovery-banner { flex-wrap: wrap; align-items: center; justify-content: space-between; }
#account-button { padding: 0; min-height: 30px; border: 0; flex: 0 0 30px; }
#auth-status, #session-message, #account-display-name, #account-username { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: minmax(0, 1fr); } .auth-screen { gap: 32px; padding-inline: 28px; } }
@media (max-width: 760px) {
 .auth-screen { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px 40px; }
 .auth-story .wordmark { margin-bottom: 25px; }
 .auth-story h1 { margin: 12px 0; font-size: 32px; }
 .auth-story > .muted { margin-top: 15px; }
 .auth-composition { display: none; }
 .auth-card { padding: 24px 20px; }
 .nav-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .nav-item { width: 100%; }
 .top-actions .local-chip { display: none; }
 .topbar { flex-wrap: wrap; }
 .work-card { padding: 18px; }
 .ai-layout, .plan-grid, .account-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
 .wallet-grid { gap: 8px; }
 .wallet-grid .work-card { padding: 13px 10px; }
 .wallet-number { font-size: 27px; }
 .reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .task-panel > .between { flex-wrap: wrap; }
 .asset-review { gap: 12px; flex-wrap: wrap; }
 .asset-review > .rgba-inspection { flex-basis: 100%; }
 .asset-review > img { flex-basis: 56px; width: 56px; height: 80px; }
 .record-row { padding: 14px; }
 .editor-title > div { min-width: 0; }
}

@media (forced-colors: active) {
  .btn.primary, .nav-item.active, .layer-row.selected, .segmented button.active { border-color: Highlight; }
  .canvas-layer.selected, :focus-visible { outline-color: Highlight; }
  .safe-guide, .resize-handle { border-color: Highlight; }
  .logo-mark::before, .logo-mark::after { border-color: ButtonText; }
}
