:root {
  --bg: #101318;
  --panel: #171b22;
  --field: #222833;
  --ink: #f4f0e8;
  --muted: #9aa3b2;
  --quiet: #727b89;
  --line: #313846;
  --accent: #d7c4a2;
  --accent-ink: #22190f;
  --page: #07080b;
  --popup: #141820;
  --popup-border: #687380;
  --hover: #262117;
  --disabled-ink: #4e5563;
  --disabled-bg: #1a1e26;
  --ambient-filter: brightness(.55) saturate(.8);
  --ambient-opacity: 0.35;
  --shadow-strong: 0 18px 50px #000c;
  --control-h: 132px;
  --rail-h: 118px;
  --dock-pad: 14px;
  --radius: 16px;
  --font-micro: 15px;
  --font-hint: 17px;
  --font-body: 20px;
  --font-title: 24px;
  --font-display: 34px;
  font-size: var(--font-body);
  line-height: 1.45;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07080b; color: var(--ink); }
.app { position: relative; z-index: 1; }
button, select, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.app { height: 100vh; display: grid; grid-template-rows: minmax(0, 1fr); }
html.stage-locked .app { position: fixed; left: 50%; top: 50%; width: var(--stage-w, 2560px); height: var(--stage-h, 1280px); transform: translate(-50%, -50%) scale(var(--stage-scale, 1)); transform-origin: center center; overflow: hidden; }
.status { display: none !important; }
.workspace { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.compare { flex: none; height: 1074px; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px !important; padding-top: 172px !important; padding-bottom: 0 !important; padding-left: 18px !important; padding-right: 18px !important; }
.pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0; height: 902px; box-sizing: border-box; }
.pane h1 { margin: 0; font-size: var(--font-title); font-weight: 620; text-align: center; }
.result-meta { position: relative; }
.result-meta,
.source-meta {
  flex: 0 0 24px;
  height: 24px;
  margin-top: 27px;
  margin-bottom: 28px;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
  width: 100% !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--quiet);
  font-size: 17px;
  font-weight: 450;
  line-height: 24px;
  text-align: center;
}
.result-meta:has(.meta-extra:not([hidden])) {
  flex: 0 0 24px !important;
  height: 24px !important;
  margin-top: 27px !important;
  margin-bottom: 28px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.result-meta .meta-copy,
.source-meta #sourceMeta {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: default;
}
.result-meta .meta-extra {
  position: absolute !important;
  bottom: 100% !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 13.5px;
  line-height: 20px;
  font-weight: 400;
  color: var(--quiet);
  margin-bottom: 3px !important;
  opacity: 0.88;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.result-meta .meta-extra:hover {
  color: var(--gold-primary, #d4be88) !important;
  opacity: 1 !important;
}
.image-info-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--quiet);
  cursor: text;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 17px;
  line-height: 24px;
  font-weight: 450;
}
.image-info-name:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.image-info-name:empty { display: none; }
#resultName { display: none !important; }
#sourceMeta,
#resultMeta {
  color: var(--quiet);
  font-size: 17px;
  line-height: 24px;
  font-weight: 450;
}
#limitNote { margin: 0; color: var(--quiet); font-size: 17px; line-height: 24px; font-weight: 450; }
#limitNote[hidden] { display: none !important; }
#limitNote.over { color: #f07878; }
.meta-copy { display: block; font-size: 17px; font-weight: 450; line-height: 24px; }
.meta-extra { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.frame-slot {
  flex: 0 0 705px;
  width: 100%;
  height: 705px;
  box-sizing: border-box;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.frame { width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; height: auto; min-height: 0; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(circle at center, #1b2029 0%, #0e1117 100%); box-sizing: border-box; }
.frame.has-bg::before,
.compare-before::before {
  content: "";
  position: absolute;
  inset: -24px;
  background-image: var(--frame-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(36px) saturate(1.2);
  transform: scale(1.08);
  z-index: 0;
  pointer-events: none;
}
.frame.has-bg::after, .compare-before::after { content: ""; position: absolute; inset: 0; background: rgba(10, 12, 16, 0.45); z-index: 0; pointer-events: none; }
.frame.over { border-color: var(--accent); }
.frame img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none !important; -webkit-user-select: none !important; user-select: none !important; pointer-events: none; }
.frame > img:not([src]), .frame > img[src=""] { opacity: 0; }
.frame, .add-base, #runBtn, .part { transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; }
.add-base, #runBtn, .part { position: relative; z-index: 1; }
.frame:hover, .rail-item:hover, .add-base:hover, #runBtn:hover, .part:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28); z-index: 5; }
.empty { position: absolute; inset: 0; z-index: 2; display: grid; align-content: center; justify-items: center; gap: 12px; background: rgba(16, 19, 24, 0.72); }
.empty strong { font-size: 15px; font-weight: 550; color: #94a3b8; letter-spacing: 0.5px; }
.choose {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 0 16px;
  height: 32px;
  line-height: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  user-select: none;
}
.choose:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; border-color: rgba(255, 255, 255, 0.14); }
.hidden { display: none !important; }
.generating { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; align-content: center; overflow: hidden; background: #0d0f14; }
.flow-aurora { position: absolute; inset: -35%; pointer-events: none; z-index: 0; filter: blur(54px); }
.flow-orb { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.flow-orb-1 { width: 58%; height: 58%; left: 10%; top: 12%; background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(200, 205, 215, 0.12) 45%, transparent 72%); animation: flow-drift-1 6.8s ease-in-out infinite alternate; }
.flow-orb-2 { width: 64%; height: 64%; right: 8%; bottom: 10%; background: radial-gradient(circle, rgba(230, 235, 245, 0.22) 0%, rgba(160, 170, 185, 0.10) 48%, transparent 72%); animation: flow-drift-2 8.4s ease-in-out infinite alternate; }
.flow-orb-3 { width: 46%; height: 46%; left: 28%; bottom: 20%; background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(180, 190, 205, 0.08) 50%, transparent 72%); animation: flow-drift-3 5.9s ease-in-out infinite alternate; }
.flow-orb-4 { width: 52%; height: 52%; right: 22%; top: 18%; background: radial-gradient(circle, rgba(240, 245, 255, 0.20) 0%, rgba(150, 160, 175, 0.07) 46%, transparent 70%); animation: flow-drift-4 7.6s ease-in-out infinite alternate; }
@keyframes flow-drift-1 { 0% { transform: translate(-12%, -10%) scale(0.92); opacity: 0.65; } 50% { transform: translate(14%, 8%) scale(1.14); opacity: 0.95; } 100% { transform: translate(2%, 15%) scale(1.02); opacity: 0.70; } }
@keyframes flow-drift-2 { 0% { transform: translate(12%, 10%) scale(1.08); opacity: 0.75; } 50% { transform: translate(-14%, -12%) scale(0.90); opacity: 0.55; } 100% { transform: translate(4%, -15%) scale(1.12); opacity: 0.90; } }
@keyframes flow-drift-3 { 0% { transform: translate(-8%, 10%) scale(0.88); opacity: 0.50; } 100% { transform: translate(12%, -8%) scale(1.15); opacity: 0.85; } }
@keyframes flow-drift-4 { 0% { transform: translate(10%, -6%) scale(1.12); opacity: 0.80; } 100% { transform: translate(-10%, 12%) scale(0.92); opacity: 0.55; } }
.flow-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; user-select: none; }
.wait-pct-num { font-family: inherit; font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; color: #ffffff; letter-spacing: 0.04em; line-height: 1.1; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.75), 0 0 12px rgba(255, 255, 255, 0.35); }
.wait-state-title { color: rgba(246, 241, 230, 0.92); font-size: 15px; font-weight: 500; letter-spacing: 0.16em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65); }
.wait-sub { color: rgba(215, 196, 162, 0.85); font-size: 13px; font-weight: 400; letter-spacing: 0.06em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65); animation: wait-sub-fade 3.6s ease-in-out infinite; }
@keyframes wait-sub-fade { 0%, 100% { opacity: 0.62; } 50% { opacity: 1; } }
.ref-overlay { position: fixed; inset: 0; z-index: 22; display: grid; place-items: center; padding: 28px; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(16px); }
.ref-overlay[hidden] { display: none !important; }
.ref-overlay-card { position: relative; display: grid; justify-items: center; gap: 12px; max-width: min(920px, 92vw); }
.ref-overlay img { width: auto; height: auto; max-width: 82vw; max-height: 68vh; object-fit: contain; border: 2px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 4px rgba(215, 196, 162, 0.25), 0 16px 40px rgba(0, 0, 0, 0.55); }
.ref-preview-idx { position: absolute; left: 8px; top: 8px; padding: 4px 12px; border: 1px solid var(--accent); border-radius: 999px; background: rgba(16, 19, 24, 0.92); color: var(--accent); font-size: var(--font-body); font-weight: 600; }
.ref-close { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: rgba(16, 19, 24, 0.88); color: var(--ink); font-size: var(--font-title); line-height: 28px; cursor: pointer; }
.ref-close:hover { border-color: var(--accent); color: var(--accent); }
.instruction textarea::placeholder { color: #5c6470; opacity: 1; }
.film { min-width: 0; display: flex; align-items: flex-start; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #141820; }
.film.over { border-color: var(--accent); }
.add-base {
  flex: none; width: auto; aspect-ratio: 1; height: calc(100% - 16px);
  display: grid; align-content: center; justify-items: center; gap: 1px;
  border: 1px dashed #526074; border-radius: 9px;
  background: transparent; color: var(--muted);
}
.add-base b { font-size: 22px; line-height: 1; font-weight: 500; }
.add-base span { font-size: var(--font-body); line-height: 1.1; }
.add-base:hover, .film.over .add-base { border-color: var(--accent); color: var(--ink); }
.rail { min-width: 0; flex: 1; height: 100%; display: flex; align-items: flex-start; gap: 6px; overflow-x: auto; overflow-y: hidden; }
.rail::-webkit-scrollbar { height: 10px; }
.rail::-webkit-scrollbar-track { background: transparent; }
.rail::-webkit-scrollbar-thumb { background: #d7dbe2; border-radius: 99px; }
.rail:empty::before { content: none !important; display: none !important; }
.rail-pick { position: relative; flex: none; height: calc(100% - 16px); aspect-ratio: 1; }
#resultsRail .rail-item.active, #basesRail .rail-item.active, #referenceRail .rail-item.active { border: 3px solid transparent; background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from var(--run-angle), #6e5a3d 0 88%, #fff8ec 94%, #6e5a3d 100%) border-box; animation: run-border 4.8s linear infinite; }
.rail-item { position: relative; z-index: 1; flex: none; width: auto; aspect-ratio: 1; height: calc(100% - 16px); padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; overflow: hidden; background-clip: padding-box; transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; }
.rail-pick .rail-item { width: 100%; height: 100%; }
.rail-item.active { border-color: var(--accent); }
.rail-item img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.rail-item .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 5px 3px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: white; font-size: var(--font-hint); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item .del {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.rail-item .del:hover { background: #ff4d4f; transform: scale(1.15); }
.rail-item .ref-badge {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; border: 1px solid var(--accent);
  background: rgba(16, 19, 24, 0.88);
  color: var(--accent); font-size: var(--font-hint); font-weight: 700; line-height: 15px;
  text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.rail-item.pending { border-color: var(--line); background: rgba(255,255,255,.04); }
.rail-item.error { border-color: #e7a3a3; background: rgba(231, 163, 163, 0.12); display: grid; place-items: center; }
.rail-item.error .fail-badge { color: #e7a3a3; font-size: 22px; font-weight: 700; line-height: 1; margin-bottom: 12px; }
.rail-item.error .cap { background: rgba(180, 40, 40, 0.78); }
.rail-item.dim:not(.active) { opacity: .38; }
.rail-item.dim.active img, .rail-item.dim.active .cap { opacity: .38; }
.lower-films {
  flex: 0 0 118px;
  min-width: 0;
  height: var(--rail-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 506px;
  gap: 8px;
  box-sizing: border-box;
}
.result-tools { flex: 0 0 118px; min-width: 0; height: var(--rail-h); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; box-sizing: border-box; }
.result-tools .film { height: var(--rail-h); }
.meta-copy { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; font-size: var(--font-micro); line-height: 24px; }
.meta-copy > div { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.paint-hover, .painter, .viewer { position: fixed; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(0, 0, 0, 0.62); }
.paint-hover, .viewer { backdrop-filter: blur(16px); }
/* 涂抹弹窗必须去掉背景模糊：只要视口内存在 backdrop-filter，画布每帧更新都会触发
   整屏滤镜重合成，实测是涂抹掉帧的唯一主因（降半径、挪独立底层元素均无效）。
   磨砂效果保留在大图查看器与涂抹预览浮层上，涂抹弹窗背景只保留暗化。 */
.painter { z-index: 19; backdrop-filter: none; }
/* P13b 同款门禁延伸到画布页：画布涂抹弹窗打开期间（body.paint-modal-open，由 canvas-mask.js 挂/摘），
   全页暂停磨砂——画布页有参数坞/左轨/HUD/顶栏胶囊等约 20 个常驻 backdrop-filter 元素躲在半透明弹窗后面，
   8766 实测：磨砂开着涂抹 avg 22.1ms / p95 33.4ms（掉帧），全停后稳定 16.7ms 满帧。弹窗一关磨砂即恢复。
   选择器双写 .paint-modal-open 是刻意的优先级抬升：个别磨砂规则自带 !important（如 0-2-0），
   单类 + * 只有 0-1-1 会输给它们。 */
body.paint-modal-open.paint-modal-open, body.paint-modal-open.paint-modal-open * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.viewer { z-index: 20; }
.paint-hover img, .paint-fit { border: 2px solid var(--accent); border-radius: 18px; box-shadow: 0 0 0 8px rgba(215, 196, 162, 0.28), 0 24px 70px rgba(0, 0, 0, 0.42); }
.paint-hover img { max-width: min(920px, 82vw); max-height: 82vh; object-fit: contain; }
.paint-hover span { position: absolute; left: 50%; bottom: 38px; transform: translateX(-50%); border: 1px solid var(--accent); border-radius: 999px; background: rgba(16, 19, 24, 0.82); color: var(--ink); padding: 4px 10px; }
.painter-card {
  width: min(calc(100vw - 36px), calc(var(--paint-w, 900px) + 320px));
  /* 弹窗外层 padding 是 28px，可用高度是 100vh - 56px。
     原先按 -36px 算，只要视口高 ≤656px 就必然溢出 20px，把底部按钮切掉。 */
  min-height: min(520px, calc(100vh - 56px));
  height: max(min(520px, calc(100vh - 56px)), min(calc(100vh - 56px), var(--paint-h, 620px)));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  overflow: hidden;
  border: 1.5px solid var(--accent);
  border-radius: 18px;
  background: rgba(16, 19, 24, 0.95);
  box-shadow: 0 0 0 8px rgba(212, 190, 136, 0.22), 0 24px 70px rgba(0, 0, 0, 0.85);
}
.painter-card,
.tag-card {
  width: min(calc(100vw - 36px), calc(var(--paint-w, 900px) + 400px)) !important;
  grid-template-columns: minmax(0, 1fr) 380px !important;
}
.painter-side,
.tag-side {
  width: 380px !important;
}
.painter-stage { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 14, 0.55); overflow: hidden; padding: 12px; }
.paint-fit, .tag-fit { touch-action: none; }
.paint-fit { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; }
.paint-fit img, .paint-fit canvas { display: block; width: 100%; height: 100%; }
.paint-fit canvas { position: absolute; inset: 0; cursor: crosshair; opacity: 0.55; }
.paint-tip-highlight {
  margin: -2px 0 6px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 550;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-align: center;
}
html[data-theme="light"] .paint-tip-highlight { color: #b45309; background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); }
.painter-side { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 18px; border-left: 1px solid var(--line); overflow: hidden; box-sizing: border-box; }
.painter-tools { display: grid; gap: 8px; flex-shrink: 0; }
.painter-tools p { margin: -2px 0 4px; color: var(--quiet); font-size: var(--font-hint); line-height: 1.4; }
.paint-history, .tag-history { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; flex-shrink: 0; }
.paint-history button:disabled, .tag-history button:disabled { color: var(--quiet); cursor: default; }
#paintClear:hover:not(:disabled) { border-color: #e7a3a3; color: #ff9999; }
.painter-tools button, .painter-actions button { height: 44px; font-size: var(--font-body); border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-weight: 500; cursor: pointer; }
.painter-tools button.active, #paintOk { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.painter-tools label { display: grid; gap: 6px; color: var(--muted); font-size: var(--font-hint); }
.paint-note { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 120px; color: var(--quiet); font-size: var(--font-hint); }
.paint-note textarea { width: 100%; flex: 1; min-height: 110px; resize: none; color: #fff; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; box-sizing: border-box; font-size: 14.5px; line-height: 1.68; letter-spacing: 0.5px; font-family: inherit; }
.paint-note textarea:focus { border-color: var(--accent); outline: none; }
.painter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; }
.viewer, .canvas-viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #05070a;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.viewer::before, .canvas-viewer::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image: var(--viewer-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(36px) saturate(1.2);
  transform: scale(1.08);
  z-index: 0;
  pointer-events: none;
}
.viewer::after, .canvas-viewer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.5);
  z-index: 0;
  pointer-events: none;
}
.viewer > *, .canvas-viewer > * { z-index: 1; }
.viewer-frame {
  position: relative;
  width: 96vw;
  height: 94vh;
  overflow: visible;
  touch-action: none;
  /* 裁切点与分割线共用的一个量：图片左边缘 + 图片宽 × 比例。
     P30 之前这里是**整框**的百分比，而图片 contain 之后只占中间一块，
     滑杆因此能滑到黑边里。--vf-* 由 JS 始终下发（不再只在对比态算）。
     坐标都在固定框内，1px 都不用额外换算。 */
  --viewer-cut: calc(var(--vf-x, 0px) + var(--vf-w, 100%) * var(--viewer-pos, 0.5));
}
.viewer-frame::after {
  content: "";
  position: absolute;
  left: var(--vf-x, 0px);
  top: var(--vf-y, 0px);
  width: var(--vf-w, 100%);
  height: var(--vf-h, 100%);
  border: 2px solid var(--gold-primary, #d4be88);
  border-radius: 18px;
  box-shadow: 0 0 0 6px rgba(212, 190, 136, 0.28), 0 30px 80px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  z-index: 3;
}
.viewer-frame img {
  position: absolute;
  inset: var(--vf-y, 0px) auto auto var(--vf-x, 0px);
  width: var(--vf-w, 100%);
  height: var(--vf-h, 100%);
  max-width: none;
  max-height: none;
  object-fit: contain;
  display: block;
  border-radius: 18px;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.viewer-frame.is-compare img {
  inset: var(--vf-y, 0px) auto auto var(--vf-x, 0px);
  width: var(--vf-w, 100%);
  height: var(--vf-h, 100%);
  object-fit: cover;
  border-radius: 18px;
}
.viewer-before {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: polygon(0 0, var(--viewer-cut) 0, var(--viewer-cut) 100%, 0 100%);
  pointer-events: none;
  z-index: 1;
}
.viewer-before[hidden] { display: none !important; }
.viewer-divider {
  position: absolute;
  top: var(--vf-y, 0px);
  bottom: auto;
  height: var(--vf-h, 100%);
  left: var(--viewer-cut, 50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}
.viewer-handle {
  position: absolute;
  top: calc(var(--vf-y, 0px) + var(--vf-h, 100%) / 2);
  left: var(--viewer-cut, 50%);
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #1a160f;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 190, 136, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -1px;
  cursor: ew-resize;
  user-select: none;
  z-index: 4;
}
.viewer-divider[hidden], .viewer-handle[hidden] { display: none !important; }
#viewerClose, #viewerCompare {
  display: none !important;
  position: absolute;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  margin: 0;
  border: 1px solid rgba(212, 190, 136, 0.45);
  border-radius: 999px;
  background: rgba(14, 17, 22, 0.82);
  color: var(--ink);
  font-size: var(--font-body);
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#viewerClose:hover, #viewerCompare:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
#viewerClose { top: 16px; right: 16px; z-index: 6; }
#viewerCompare {
  left: 14px;
  bottom: 14px;
  left: calc(var(--vf-x, 0px) + 16px);
  bottom: calc(100% - var(--vf-y, 0px) - var(--vf-h, 100%) + 16px);
  z-index: 5;
}
#viewerCompare[hidden], #viewerClose[hidden] { display: none !important; }
#viewerCompare.active { background: rgba(212, 190, 136, 0.24); border-color: var(--gold-primary); color: var(--gold-primary); }
.lower-films .film { height: var(--rail-h); }
.dock { position: relative; flex: 1; min-height: 0; padding: 0 18px var(--dock-pad); box-sizing: border-box; }
.side { height: var(--control-h); display: flex; align-items: stretch; min-width: 0; }
.look { position: absolute; right: calc(50% + 69px); bottom: var(--dock-pad); justify-content: flex-end; }
.look-stack { width: auto; grid-template-columns: 176px 260px; }
.mode { position: relative; display: grid; grid-template-rows: 16px minmax(0, 1fr); gap: 3px; min-width: 0; }
.mode input { position: absolute; right: 5px; top: 19px; bottom: 0; z-index: 3; width: 15px; height: 15px; margin: auto 0; opacity: 0; cursor: pointer; }
.mode > button {
  position: relative;
  z-index: 1;
  grid-row: 2;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 16px;
  font-size: var(--font-body);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode > button::after { content: "▾"; position: absolute; right: 8px; color: var(--muted); font-size: 15px; }
.mode .v3-cell-label { color: var(--gold-primary, #d4be88); font-weight: 600; letter-spacing: 0.5px; }
.mode:has(input:checked) > button { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode:not(:has(input:checked)) > button { background: linear-gradient(180deg, #262118 0%, #191610 100%); color: #d8cdba; border: 1px solid rgba(212, 190, 136, 0.35); box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.05), 0 2px 6px rgba(0, 0, 0, 0.4); }
.center { position: absolute; left: 50%; transform: translateX(-50%); bottom: var(--dock-pad); width: 118px; }
.make { position: absolute; left: calc(50% + 69px); bottom: var(--dock-pad); gap: 10px; }
.model-stack {
  width: 260px;
  max-width: 260px;
  min-width: 0;
  flex: 0 0 260px;
  grid-template-rows: 1fr 1fr;
}
.model-field-group { display: grid; grid-template-rows: 16px minmax(0, 1fr); gap: 3px; min-width: 0; max-width: 100%; color: var(--quiet); font-size: var(--font-hint); line-height: 16px; }
.field-title-text { color: var(--quiet); font-size: var(--font-hint); line-height: 16px; user-select: none; }
.model-select-carrier {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
}
.btn-model-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(215, 196, 162, 0.35);
  border-radius: 8px;
  background: var(--field);
  padding: 0 8px;
  font-size: var(--font-body);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  user-select: none;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-model-select:hover, .btn-model-select[aria-expanded="true"] {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(215, 196, 162, 0.65), 0 0 8px rgba(215, 196, 162, 0.25);
}
.btn-model-select span#modelSelectedText {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 1 auto !important;
  min-width: 0;
}
.model-dropdown-arrow { flex: 0 0 auto !important; width: auto !important; font-size: 15px; color: var(--accent); margin-left: 6px; transition: transform 0.2s ease; }
.btn-model-select[aria-expanded="true"] .model-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}
.pair select { color: var(--ink) !important; }
html[data-theme="light"] .btn-model-select {
  background: var(--field);
  border-color: var(--line);
  color: var(--ink);
}
.prompt-opt-group { flex: none; display: flex; align-items: center; gap: 5px; margin-left: 8px; }
.btn-prompt-opt {
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(212, 190, 136, 0.65);
  border-radius: 5px;
  background: rgba(212, 190, 136, 0.12);
  color: #d4be88;
  font-size: var(--font-hint);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
#btnPromptOpt.active, #btnPromptOpt:not(:disabled):not(.disabled), .btn-prompt-opt.active, .btn-prompt-opt:not(:disabled):not(.disabled) { opacity: 1 !important; border: 1px solid rgba(212, 190, 136, 0.65) !important; background: rgba(212, 190, 136, 0.12) !important; color: #d4be88 !important; }
#btnPromptOpt.active span, #btnPromptOpt:not(:disabled):not(.disabled) span, .btn-prompt-opt.active span, .btn-prompt-opt:not(:disabled):not(.disabled) span { color: #d4be88 !important; }
.btn-prompt-opt:hover:not(:disabled):not(.disabled) { background: rgba(212, 190, 136, 0.22) !important; border-color: #d4be88 !important; box-shadow: 0 0 10px rgba(212, 190, 136, 0.3) !important; color: #fff !important; }
.btn-prompt-opt:hover:not(:disabled):not(.disabled) span { color: #fff !important; }
.btn-prompt-opt:disabled, .btn-prompt-opt.disabled { opacity: 1 !important; border: 1px solid var(--line) !important; background: rgba(34, 40, 51, 0.65) !important; color: #a0a8b4 !important; cursor: default !important; box-shadow: none !important; filter: none !important; }
.btn-prompt-opt:disabled span, .btn-prompt-opt.disabled span { color: #a0a8b4 !important; }
.instruction-field { position: relative; min-height: 0; }
.instruction-field.is-optimizing textarea { pointer-events: none; opacity: 0.45; filter: blur(0.5px); }
.instruction-field.is-optimizing::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(90deg, rgba(212, 190, 136, 0.05), rgba(212, 190, 136, 0.22), rgba(212, 190, 136, 0.05));
  background-size: 200% 100%;
  animation: opt-flow-shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  border: 1px solid rgba(212, 190, 136, 0.6);
  box-shadow: 0 0 16px rgba(212, 190, 136, 0.18);
}
.instruction-field.is-optimizing::after {
  content: "✨ AI 正在结合全案设计与空间透视深度扩写中...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  color: var(--gold-primary, #d4be88);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(13, 15, 20, 0.92);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(212, 190, 136, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
  animation: opt-pulse-glow 1.6s ease-in-out infinite alternate;
}
html[data-theme="light"] .instruction-field.is-optimizing::after { background: rgba(255, 255, 255, 0.96); color: #7d5e1b; border-color: rgba(143, 110, 43, 0.45); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08); }
.instruction-field.is-completed textarea { animation: opt-fill-highlight 1.2s ease-out; }
@keyframes opt-flow-shimmer { 0% { background-position: -100% 0; } 100% { background-position: 200% 0; } }
@keyframes opt-pulse-glow { 0% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.98); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); } }
@keyframes opt-fill-highlight { 0% { box-shadow: inset 0 0 0 2px var(--gold-primary, #d4be88), 0 0 14px rgba(212, 190, 136, 0.35); } 100% { box-shadow: none; } }
.instruction-count { position: absolute; right: 10px; bottom: 7px; z-index: 1; display: flex; gap: 5px; border-radius: 4px; padding: 1px 4px; background: var(--field); color: var(--quiet); font-size: var(--font-micro); pointer-events: none; }
#extraCount { color: var(--quiet); font-style: normal; }
.instruction textarea { display: block; height: 100%; min-height: 0; resize: none; padding-bottom: 27px; color: #fff; font-size: var(--font-body); line-height: 1.45; }
#extraCount.over { color: #e7a3a3; }
#runBtn.blocked { background: #6d655b; color: #d9d3cb; cursor: default; }
.btn-prompt-tool { height: 20px; padding: 0 8px; border-radius: 5px; border: 1px solid #2a3340; background: var(--field); color: var(--quiet); font-size: var(--font-hint); cursor: pointer; white-space: nowrap; }
.btn-prompt-tool:hover { color: #fff; border-color: #687380; }
.btn-prompt-tool.on { color: #f0d9a0; border-color: #8a7a52; }
.prompt-preview { position: absolute; left: 0; right: 0; bottom: 0; min-height: 100%; max-height: 70vh; z-index: 40; display: flex; flex-direction: column; border-radius: 10px; border: 1px solid #687380; background: #10151c; box-shadow: 0 18px 48px #000d; overflow: hidden; }
.jimeng-cockpit .prompt-preview,
.cockpit-input-area .prompt-preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 42px) !important;
  top: auto !important;
  min-height: 140px;
  max-height: 55vh;
  z-index: 60;
  border-radius: 14px;
  border: 1.2px solid rgba(212, 190, 136, 0.45);
  background: rgba(14, 16, 22, 0.98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 190, 136, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: prompt-preview-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes prompt-preview-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
html[data-theme="light"] .jimeng-cockpit .prompt-preview, html[data-theme="light"] .cockpit-input-area .prompt-preview { background: rgba(255, 255, 255, 0.98); border: 1.2px solid #9b7c38; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.16), 0 0 20px rgba(180, 140, 80, 0.15); }
html[data-theme="light"] .jimeng-cockpit .prompt-preview-head, html[data-theme="light"] .cockpit-input-area .prompt-preview-head { border-bottom-color: rgba(0, 0, 0, 0.08); color: #1e293b; }
html[data-theme="light"] .jimeng-cockpit .prompt-preview-body, html[data-theme="light"] .cockpit-input-area .prompt-preview-body { color: #334155; }
.prompt-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-bottom: 1px solid #232c38; color: var(--quiet); font-size: var(--font-hint); }
.prompt-preview-close { border: 0; background: transparent; color: var(--quiet); cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 6px; border-radius: 4px; }
.prompt-preview-close:hover { color: #fff; background: #1b2330; }
.prompt-preview-body { margin: 0; padding: 10px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #d6dbe3; font-size: 12px; line-height: 1.55; user-select: text; }
label { display: grid; grid-template-rows: 16px minmax(0, 1fr); gap: 3px; min-width: 0; color: var(--quiet); font-size: var(--font-hint); line-height: 16px; }
select, textarea, input:not(.auth-input) { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 0 8px; font-size: var(--font-body); }
select { height: 100%; }
textarea, input:not(.auth-input) { padding-top: 6px; padding-bottom: 6px; }
select:focus, textarea:focus, input:not(.auth-input):focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.center { height: calc(var(--control-h) - 19px); display: grid; grid-template-rows: 1fr; justify-items: center; }
.undo-delete-capsule {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--dock-pad) + var(--control-h) - 19px + 8px);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(215, 196, 162, 0.55);
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.95);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px rgba(215, 196, 162, 0.2);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.undo-delete-capsule:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 14px rgba(215, 196, 162, 0.45); transform: translateX(-50%) translateY(-1px); }
.undo-delete-capsule .undo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 50%;
  background: rgba(215, 196, 162, 0.3);
  color: inherit;
  font-size: 10px;
  font-weight: 700;
}
.undo-delete-capsule[hidden] { display: none !important; }
#runBtn {
  width: 118px; height: 100%;
  border: 3px solid transparent; border-radius: var(--radius);
  background:
    linear-gradient(var(--accent), var(--accent)) padding-box,
    conic-gradient(from var(--run-angle), #6e5a3d 0 88%, #fff8ec 94%, #6e5a3d 100%) border-box;
  box-shadow: 0 0 10px rgba(255, 248, 236, 0.16);
  color: var(--accent-ink);
  display: grid; place-items: center; align-content: center;
  font-size: var(--font-title); font-weight: 760;
  animation: run-border 4.8s linear infinite;
}
@property --run-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes run-border { to { --run-angle: 360deg; } }
#runBtn b { display: block; margin-top: 2px; font-size: var(--font-hint); font-weight: 680; }
#runBtn:hover:not(:disabled):not(.blocked) { filter: brightness(1.06); }
#runBtn:disabled, #runBtn.blocked { background: #181b22 !important; color: #5a606e !important; border-color: rgba(255, 255, 255, 0.08) !important; box-shadow: none !important; cursor: not-allowed !important; transform: none !important; animation: none !important; }
#runBtn:disabled b, #runBtn.blocked b { color: #5a606e !important; }
#runBtn.cooling, .canvas-run-btn.cooling, .cockpit-action-right #runBtn.cooling { pointer-events: none !important; cursor: wait !important; overflow: hidden !important; position: relative !important; border-radius: 50% !important; transform: none !important; box-shadow: none !important; opacity: 1 !important; }
#runBtn.cooling::before, .canvas-run-btn.cooling::before { content: ""; position: absolute; inset: 0; border-radius: 50% !important; background: rgba(10, 12, 16, 0.72); animation: wowCooldownWipe 1s linear forwards; pointer-events: none; z-index: 4; }
#runBtn.cooling::after, .canvas-run-btn.cooling::after { content: ""; position: absolute; inset: 0; border-radius: 50% !important; background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0%, rgba(212, 190, 136, 0.75) 50%, transparent 80%); opacity: 0; animation: wowReadyFlash 0.25s ease-out 1s forwards; pointer-events: none; z-index: 6; }
@keyframes wowCooldownWipe { 0% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(100% 0 0 0); } }
@keyframes wowReadyFlash { 0% { opacity: 0; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1); } }
.mode:has(input:checked) > button { background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 600; border-color: var(--accent) !important; box-shadow: inset 0 0 0 1px #d7c4a255, 0 0 10px rgba(215, 196, 162, 0.25) !important; }
.mode:not(:has(input:checked)) > button { background: rgba(140, 120, 85, 0.28) !important; color: #c5b8a1 !important; border-color: rgba(215, 196, 162, 0.35) !important; }
.mode:not(:has(input:checked)) > button:hover:not(:disabled) { background: rgba(160, 138, 98, 0.42) !important; color: #f0e6d6 !important; border-color: var(--accent) !important; }
.v3-cell-btn.has-value:not(:disabled) { border-color: var(--accent) !important; box-shadow: inset 0 0 0 1px #d7c4a255 !important; color: var(--ink) !important; }
.dock select.selected-value:not(:disabled),#extra.selected-value { border-color:var(--accent); box-shadow:inset 0 0 0 1px #d7c4a255; }
.dock select:disabled { border-color:var(--line); box-shadow:none; }
html.ui-v3 .lower-films { grid-template-columns: minmax(0, 1fr) 519px; gap: 10px; }
.look-stack-v3 { grid-template-columns: 175px 132px 132px; }
.look-stack-v3 .v3-cell-merge { grid-column: span 2; }
.v3-cell { position: relative; display: grid; grid-template-rows: 16px minmax(0, 1fr); gap: 3px; min-width: 0; }
.v3-cell-label { color: var(--quiet); font-size: var(--font-hint); line-height: 16px; }
.v3-cell-btn { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); padding: 0 16px; font-size: var(--font-body); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.v3-cell-btn::after { content: "▾"; position: absolute; right: 8px; color: var(--muted); font-size: 15px; }
.v3-cell-btn:hover:not(:disabled) { border-color: var(--muted); }
.v3-cell-btn:disabled, .v3-cell-btn.locked { color: #596170; background: #1a1e26; cursor: not-allowed; }
.v3-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 99999; width: max-content; max-height: calc(100vh - 120px); overflow: visible; border-radius: 16px; }
.v3-blocks { display: grid; justify-items: center; }
.v3-block { display: flex; flex-direction: column; align-items: stretch; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.08) !important; border-radius: 16px; background: #191d28 !important; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95); backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.v3-plus { color: var(--gold-primary); font-size: 13px; line-height: 1; padding: 4px 0; opacity: 0.8; }
.v3-cols { display: flex; gap: 8px; align-items: stretch; width: max-content; }
.shared-theme-wrap { position: relative; display: inline-flex; align-items: center; }
.shared-header-left { display: flex !important; align-items: center !important; gap: 28px !important; min-width: 0; flex: 1; }
.shared-header #currentProjectBadge {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
  line-height: 32px !important;
  gap: 8px !important;
  min-width: 0;
  max-width: 420px;
  color: #838896 !important;
  font-size: 21px !important;
  font-weight: 400 !important;
  letter-spacing: 2px !important;
  font-family: "Montserrat", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.shared-header #currentProjectBadge:hover, .shared-header #currentProjectBadge:hover strong { color: #ffffff !important; }
.shared-header #currentProjectBadge strong { font-weight: 400 !important; color: #ffffff; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="light"] .shared-header #currentProjectBadge strong, html[data-theme="light"] #headerDomainVal, html[data-theme="light"] #currentProjectName { color: #111318 !important; font-weight: 600 !important; }
html[data-theme="light"] .shared-header #currentProjectBadge:hover, html[data-theme="light"] .shared-header #currentProjectBadge:hover strong { color: #111318 !important; }
.pill-arrow { color: #838896; font-size: 15px; margin-left: -2px; transition: transform .2s ease; }
#currentProjectBadge[aria-expanded="true"] .pill-arrow { transform: rotate(180deg); }
.shared-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  text-align: left;
  font-size: 17px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.shared-dropdown-item:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.shared-dropdown-item.active { background: rgba(215, 196, 162, 0.2); color: var(--accent); font-weight: 500; }
.shared-dropdown-item:disabled, .shared-dropdown-item.disabled { color: #555d6b; cursor: not-allowed; background: transparent; }
.shared-dropdown-empty { padding: 10px; font-size: 16px; color: var(--quiet); text-align: center; }
html[data-theme="light"] .shared-dropdown-item { color: #111318 !important; font-weight: 500; }
html[data-theme="light"] .shared-dropdown-item:hover:not(:disabled) { background: rgba(143, 110, 43, 0.10); color: #111318 !important; }
html[data-theme="light"] .shared-dropdown-item.active { background: rgba(143, 110, 43, 0.16); color: #7d5e1b !important; font-weight: 600; }
html[data-theme="light"] .shared-dropdown-item:disabled, html[data-theme="light"] .shared-dropdown-item.disabled { color: #8e95a5 !important; }
.v3-col-title { padding: 2px 4px 6px 4px; margin-bottom: 8px; border-bottom: 1px solid rgba(212, 190, 136, 0.15); color: var(--gold-primary); font-size: var(--font-micro, 12.5px); font-weight: 600; letter-spacing: 0.5px; white-space: nowrap; text-align: center; width: 100% !important; box-sizing: border-box !important; }
html[data-theme="light"] #btnPromptOpt.active, html[data-theme="light"] #btnPromptOpt:not(:disabled):not(.disabled), html[data-theme="light"] .btn-prompt-opt.active, html[data-theme="light"] .btn-prompt-opt:not(:disabled):not(.disabled) { border: 1px solid #8f6e2b !important; background: #ffffff !important; color: #7d5e1b !important; box-shadow: 0 1px 3px rgba(143, 110, 43, 0.12) !important; }
html[data-theme="light"] #btnPromptOpt.active span, html[data-theme="light"] #btnPromptOpt:not(:disabled):not(.disabled) span, html[data-theme="light"] .btn-prompt-opt.active span, html[data-theme="light"] .btn-prompt-opt:not(:disabled):not(.disabled) span { color: #7d5e1b !important; }
html[data-theme="light"] .btn-prompt-opt:hover:not(:disabled):not(.disabled) { background: rgba(212, 190, 136, 0.15) !important; border-color: #8f6e2b !important; color: #7d5e1b !important; }
html[data-theme="light"] .btn-prompt-opt:disabled, html[data-theme="light"] .btn-prompt-opt.disabled { opacity: 1 !important; background: #ffffff !important; border: 1px solid var(--line) !important; color: #3d434f !important; box-shadow: none !important; filter: none !important; }
html[data-theme="light"] .btn-prompt-opt:disabled span, html[data-theme="light"] .btn-prompt-opt.disabled span { color: #3d434f !important; }
html[data-theme="light"] .shared-brand-title { color: var(--ink); }
html[data-theme="light"] .shared-brand-subtitle { color: var(--accent-text); }
html[data-theme="light"] #runBtn { color: var(--accent-ink); }
html[data-theme="light"] .v3-col-title { color: var(--accent-text); }
.v3-menu .v3-opt.dim { opacity: 0.55; }
html[data-theme="light"] .v3-menu .v3-opt.dim { opacity: 1; background: #b9b4a6; color: #5a5f6b; }
html[data-theme="light"] .v3-menu .v3-opt.dim:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
#runBtn #runCost { display: none; }
html[data-theme="light"] #runBtn.blocked, html[data-theme="light"] #runBtn:disabled { background: #e6e1d5; color: #9aa0aa; border: 1px solid #d5cfc0; box-shadow: none; animation: none; }
#runBtn > span { font-size: 21px; letter-spacing: 2px; }
.cad-view-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  box-sizing: border-box;
}
.cad-view-modal-backdrop[hidden] { display: none !important; }
.cad-view-card {
  width: min(840px, 94vw);
  max-height: 94vh;
  height: auto;
  background: #191d28;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  animation: cadModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@keyframes cadModalFadeIn { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.cad-view-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); flex: 0 0 auto; }
.cad-view-title { margin: 0; font-size: 18px; font-weight: 600; color: #f8fafc; letter-spacing: 0.03em; }
.cad-view-hint { font-size: 13px; color: #94a3b8; margin-left: 12px; margin-right: auto; }
.cad-view-close { background: transparent; border: none; color: #94a3b8; font-size: 20px; line-height: 1; padding: 4px 8px; cursor: pointer; border-radius: 6px; transition: all 0.15s ease; }
.cad-view-close:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.cad-view-stage.frame {
  width: calc(100% - 40px) !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: 460px !important;
  margin: 12px 20px 10px 20px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: radial-gradient(circle at center, #1b2029 0%, #0e1117 100%) !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
}
.cad-view-img-wrap { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; z-index: 1; }
#cadViewImg { width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; pointer-events: none; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.65)); }
.cad-gizmo-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cad-gizmo-pivot { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 10; }
.cad-pivot-dot { width: 14px; height: 14px; background: #ef4444; border: 2px solid #ffffff; border-radius: 50%; box-shadow: 0 0 14px rgba(239, 68, 68, 0.95); }
.cad-gizmo-cone { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; z-index: 8; transition: none !important; }
.cad-gizmo-fov { position: absolute; left: -140px; top: -160px; width: 280px; height: 160px; clip-path: polygon(140px 160px, 40px 0, 240px 0); background: radial-gradient(circle at 140px 160px, rgba(239, 68, 68, 0.45) 0%, rgba(220, 38, 38, 0.15) 65%, transparent 100%); border-top: 2.5px solid #ef4444; filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.5)); pointer-events: none; }
.cad-gizmo-axis { position: absolute; left: 0; bottom: 0; width: 2px; height: 145px; transform: translateX(-50%); background: repeating-linear-gradient(180deg, #ef4444, #ef4444 5px, transparent 5px, transparent 9px); pointer-events: none; box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
.cad-gizmo-pointer { position: absolute; left: 0; top: -145px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 15px solid #ef4444; transform: translateX(-50%); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9)); }
.cad-view-footer { padding: 10px 20px 16px; display: flex; flex-direction: column; gap: 12px; flex: 0 0 auto; }
.cad-direction-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cad-direction-card {
  height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
}
.cad-direction-card:hover:not(.is-active) { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #ffffff; }
.cad-direction-card.is-active { background: rgba(239, 68, 68, 0.18); border-color: #ef4444; color: #ffffff; font-weight: 600; box-shadow: 0 0 14px rgba(239, 68, 68, 0.35); }
.cad-dir-icon { font-size: 16px; }
.cad-dir-label { letter-spacing: 0.02em; }
.cad-view-footer-bottom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.cad-view-footer-spacer { grid-column: 1 / 4; }
.cad-view-actions { grid-column: 4 / 5; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.cad-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 13.5px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cad-btn-cancel:hover { background: rgba(255, 255, 255, 0.12); color: #f1f3f7; }
.cad-btn-confirm {
  background: linear-gradient(135deg, #e4cb8a 0%, #c4a75e 100%);
  border: none;
  color: #12151c;
  font-size: 13.5px;
  font-weight: 600;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(196, 167, 94, 0.35);
  transition: all 0.15s ease;
}
.cad-btn-confirm:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(196, 167, 94, 0.45); }
html[data-theme="light"] { --bg-dark: #f8f7f4; --capsule-bg: rgba(255, 255, 255, 0.94); --border-fine: rgba(0, 0, 0, 0.08); --border-strong: rgba(0, 0, 0, 0.12); --gold-glow: rgba(158, 124, 56, 0.20); }
html[data-theme="light"] .shared-header { background: #f8f7f4; border-bottom: 1px solid var(--border-fine); box-shadow: none; }
html[data-theme="light"] .user-vignette { background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.45) 0%, rgba(248, 247, 244, 0.85) 60%, #f8f7f4 100%); }
html[data-theme="light"] .project-cover-wrap { background: linear-gradient(180deg, rgba(248, 247, 244, 0.2), rgba(248, 247, 244, 0.95)); }
html[data-theme="light"] .project-card { background: #ffffff; border-color: #e8e4db; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); }
html[data-theme="light"] .project-card:hover { border-color: var(--gold-primary); box-shadow: 0 12px 32px rgba(158, 124, 56, 0.12); }
html[data-theme="light"] .batch-bar { background: rgba(255, 255, 255, 0.96); border-color: #ded8cb; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .title-edit-input { background: #f7f5ef; color: var(--ink); }
html[data-theme="light"] .modal-overlay { background: rgba(24, 26, 32, 0.35); }
html[data-theme="light"] .modal-box { background: #ffffff; border-color: #ded8cb; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14); }
html[data-theme="light"] .modal-input, html[data-theme="light"] .modal-select, html[data-theme="light"] .modal-textarea { background: #f7f5ef; color: var(--ink); border-color: #ded8cb; }
html[data-theme="light"] .modal-input:focus, html[data-theme="light"] .modal-select:focus, html[data-theme="light"] .modal-textarea:focus { border-color: var(--gold-primary); background: #ffffff; }
html[data-theme="light"] .btn-modal-cancel { background: #f2efe9; border-color: #ded8cb; color: #535965; }
html[data-theme="light"] .btn-modal-cancel:hover { background: #eae6dd; color: #181a20; }
html[data-theme="light"] .project-title-editable, html[data-theme="light"] .empty-card h3, html[data-theme="light"] .modal-title { color: var(--ink); }
html[data-theme="light"] .project-title-editable:hover { background: rgba(0, 0, 0, 0.05); }
html[data-theme="light"] .empty-card p { color: var(--muted); }
html[data-theme="light"] .batch-count { color: var(--ink); }
html[data-theme="light"] .batch-btn-select-all { background: var(--field); color: var(--ink); border-color: var(--border-strong); }
html[data-theme="light"] .batch-btn-cancel { color: var(--muted); border-color: var(--border-strong); }
html[data-theme="light"] .plan-card {
  background: #f3efe6;
  border-color: #ded9cb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .plan-card:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 14px 34px rgba(143, 110, 43, 0.14);
}
html[data-theme="light"] .plan-card.current {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 1px var(--gold-primary), 0 10px 28px rgba(143, 110, 43, 0.10);
}
html[data-theme="light"] .custom-input-box { background: #ffffff; color: var(--ink); border-color: #ded9cb; }
html[data-theme="light"] .section-title, html[data-theme="light"] .plan-name, html[data-theme="light"] .custom-input-box input { color: var(--ink); }
html[data-theme="light"] .shared-user-menu, html[data-theme="light"] .shared-status { background: #ffffff; color: var(--ink); border-color: #ded9cb; box-shadow: var(--shadow-strong); }
html[data-theme="light"] .shared-brand-subtitle { color: #7d5e1b; }
html[data-theme="light"] .proj-tab-btn { color: var(--muted); }
html[data-theme="light"] .proj-tab-btn.active { color: var(--ink); }
html[data-theme="light"] .proj-tab-btn:hover { color: var(--ink); }
html[data-theme="light"] .plan-price, html[data-theme="light"] .plan-price-symbol { color: var(--gold-primary); }
html[data-theme="light"] .plan-price-unit { color: var(--muted); }
html[data-theme="light"] .plan-perk-item, html[data-theme="light"] .plan-perk-item span, html[data-theme="light"] .plan-perk-item strong { color: #2c3038; }
html[data-theme="light"] .perk-bullet { background: var(--gold-primary) !important; }
html[data-theme="light"] .btn-plan-action { background: #ffffff; border: 1.5px solid rgba(143, 110, 43, 0.45); color: var(--gold-primary); }
html[data-theme="light"] .btn-plan-action:hover:not(:disabled) { background: linear-gradient(135deg, #dfcb9a 0%, #c4aa6e 100%); color: #08090c; border-color: transparent; }
html[data-theme="light"] .btn-plan-action:disabled { background: #f0ede6; color: #a2a8b5; border-color: #ded9cb; }
html[data-theme="light"] td[style*="#666"] { color: var(--muted) !important; }
html[data-theme="light"] .profile-banner { background: #f3efe6; border-color: #ded9cb; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.04); }
.paint-slot-btn {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  border: 1px dashed rgba(215, 196, 162, 0.45);
  background: rgba(30, 24, 16, 0.35);
  color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px;
}
.paint-slot-btn:hover { border-color: var(--accent); background: rgba(215, 196, 162, 0.15); color: #fff; }
.paint-slot-btn b { font-size: 16px; line-height: 1; }
.paint-slot-btn span { font-size: 11px; line-height: 1.1; white-space: nowrap; }
.paint-card-item { display: flex !important; flex-direction: column !important; border-radius: 9px !important; overflow: hidden !important; border: 1.5px solid var(--accent) !important; box-shadow: 0 0 0 1px rgba(212, 190, 136, 0.35) !important; background: #141820; }
.paint-card-item .paint-thumb-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #0f1217; }
.paint-card-item .paint-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.paint-card-item .paint-bar-box {
  flex: none;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(215, 196, 162, 0.22);
  border-top: 1px solid rgba(212, 190, 136, 0.35);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.paint-card-item.active { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(212, 190, 136, 0.5) !important; }
.paint-card-item.active .paint-bar-box { background: rgba(215, 196, 162, 0.32); color: var(--accent); font-weight: 600; }
html[data-theme="light"] .paint-card-item .paint-bar-box { background: rgba(240, 238, 230, 0.95); border-top-color: rgba(0, 0, 0, 0.08); color: #4a5160; }
html[data-theme="light"] .paint-card-item.active .paint-bar-box { background: rgba(176, 139, 71, 0.2); color: #8f6e2e; }
.tag-marks { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.tag-mark {
  position: absolute;
  pointer-events: auto;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #c400ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(196, 0, 255, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tag-mark:hover { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 0 5px rgba(196, 0, 255, 0.65), 0 6px 16px rgba(0, 0, 0, 0.6); }
.tag-mark span.tag-mark-tip {
  display: none;
  position: absolute;
  left: 28px;
  top: 50%;
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(16, 19, 24, 0.95);
  color: var(--ink);
  font-size: var(--font-body);
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
}
.tag-mark:hover span.tag-mark-tip { display: block; }
.tag-fit { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; cursor: crosshair; }
.tag-fit img { display: block; width: 100%; height: 100%; pointer-events: none; }
.tag-stage-marks { position: absolute; inset: 0; pointer-events: none; }
.tag-stage-marks .tag-mark { pointer-events: auto; }
.tag-bubble {
  position: absolute;
  z-index: 20;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: rgba(20, 24, 32, 0.96);
  box-shadow: 0 0 0 4px rgba(215, 196, 162, 0.2), 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tag-bubble-head { display: flex; justify-content: space-between; align-items: center; }
#tagBubbleNumber { font-size: 15px; font-weight: 600; color: #d4b182; }
.tag-bubble-del { background: transparent; border: none; color: #e7a3a3; font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.tag-bubble-del:hover { background: rgba(231, 163, 163, 0.2); color: #ff9999; }
.tag-bubble textarea {
  width: 100%;
  height: 72px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(10, 12, 16, 0.8);
  color: #fff;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.45;
  outline: none;
}
.tag-bubble textarea:focus { border-color: var(--accent); }
.tag-bubble-foot { display: flex; justify-content: flex-end; }
.tag-bubble-btn { height: 32px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.tag-tools { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; height: auto; }
.tag-tools-title { font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: 0.5px; }
.tag-tools-desc { font-size: 15px; color: var(--quiet); line-height: 1.5; margin: 0; }
.tag-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.tag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(30, 36, 48, 0.5);
  font-size: 17px;
  color: var(--ink);
  cursor: default;
  align-items: flex-start;
}
.tag-item:hover { border-color: var(--accent); background: rgba(30, 36, 48, 0.8); }
.tag-item-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c400ff;
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: none;
}
.tag-item-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.tag-item-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  max-height: 120px;
  resize: vertical;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
  box-sizing: border-box;
  overflow-y: auto;
}
.tag-item-input:focus { outline: none; border-color: var(--accent); }
.tag-item-del { color: #e7a3a3; background: none; border: none; cursor: pointer; padding: 4px 6px; font-size: 16px; flex: none; }
.tag-item-del:hover { color: #ff9999; }
#tagClearAll { border-color: #e7a3a3; color: #ff9999; }
#tagClearAll:hover { background: rgba(231, 163, 163, 0.15); border-color: #ff9999; }
#tagOk { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.compare-slider-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  -webkit-touch-callout: none !important;
  touch-action: none;
  cursor: ew-resize;
  --compare-pos: 50%;
}
.compare-before { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at center, #1b2029 0%, #0e1117 100%); clip-path: polygon(0 0, var(--compare-pos, 50%) 0, var(--compare-pos, 50%) 100%, 0 100%); pointer-events: none; }
.compare-before img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none !important; -webkit-user-select: none !important; user-select: none !important; pointer-events: none; }
.compare-divider { position: absolute; top: 0; bottom: 0; left: var(--compare-pos, 50%); width: 2px; background: #ffffff; box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); transform: translateX(-50%); pointer-events: none; }
.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #1a160f;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(215, 196, 162, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  pointer-events: auto;
  user-select: none;
}
.compare-arrow { font-size: 11px; font-weight: 800; letter-spacing: -1px; color: #1a160f; }
#resultCompare.active { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-weight: 600; }
.fast-tip {
  position: fixed;
  z-index: 1000000;
  max-width: min(880px, calc(100vw - 48px)) !important;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(18, 22, 30, 0.96);
  border: 1px solid rgba(212, 190, 136, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  color: #e5e8ef;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%) !important;
  transition: none !important;
  box-sizing: border-box;
}
.fast-tip.fast-tip-wide { width: min(880px, calc(100vw - 48px)) !important; white-space: pre-wrap !important; word-break: break-word !important; line-height: 1.6 !important; text-align: left !important; padding: 10px 18px !important; }
html[data-theme="light"] .fast-tip { background: rgba(255, 255, 255, 0.98); border: 1px solid #d4be88; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12); color: #111318; }
.instruction-count { pointer-events: auto; }
@keyframes miniToastFade { 0% { opacity: 0; transform: translate(-50%, -10px); } 5% { opacity: 1; transform: translate(-50%, 0); } 92% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
body.public-mode #btnPromptPreview, body.public-mode #promptPreview, body.public-mode [data-slot="prompt-preview"], body.public-mode [data-slot="prompt-preview-panel"] { display: none !important; }
#sourceImg, #resultImg { transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
