:root {
  --bg: #eef0f4;
  --panel: #ffffff;
  --ink: #111214;
  --ink-2: #555a62;
  --ink-3: #9a9fa7;
  --line: #ececef;
  --soft: #f5f5f7;
  --soft-2: #efeff2;
  --brand: #7a6cf0;
  --brand-soft: #efecff;
  --ok: #1f9d63;
  --warn: #d48806;
  --err: #e5484d;
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .06);
  --shadow-pop: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 48px rgba(16, 24, 40, .14);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at -5% -20%, #dfe6ff 0%, transparent 60%),
    radial-gradient(900px 560px at 110% 120%, #f1e5ff 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .4; }
input, select { font: inherit; color: inherit; }
img { display: block; }
.ic { width: 18px; height: 18px; flex: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; background: var(--soft); padding: 1px 6px; border-radius: 6px; }

/* ── 整体布局 ── */
.app { height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.panel { background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 344px; gap: 14px; }

/* ── 顶栏 ── */
.topbar {
  height: 62px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 14px 0 18px; background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: .08em; line-height: 1.1; }
.logo-sub { font-size: 9.5px; letter-spacing: .22em; color: var(--ink-3); font-weight: 600; }
.engine-switch { display: flex; gap: 2px; padding: 4px; background: var(--soft); border-radius: 999px; }
.engine-switch button {
  display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s;
}
.engine-switch button:hover { color: var(--ink); }
.engine-switch button.on { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.engine-switch .dot { width: 6px; height: 6px; border-radius: 50%; background: #c7cad0; }
.engine-switch .dot.ok { background: #31c27c; }
.engine-switch button.off { color: var(--ink-3); }
/* 顶部页面切换：AI 试衣 / 实时换装 */
.page-tabs { display: flex; gap: 2px; padding: 4px; background: var(--soft); border-radius: 999px; }
.page-tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s; white-space: nowrap; }
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.on { background: var(--ink); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.page-tabs em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 5px; border-radius: 5px; background: var(--err); color: #fff; }
/* 管理员的引擎切换放到右侧，做小一点 */
.top-right .engine-switch { padding: 3px; }
.top-right .engine-switch button { padding: 5px 10px; font-size: 11.5px; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.top-hint { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 12px; }
.top-hint .spend { position: relative; padding-bottom: 5px; color: var(--ink-2); white-space: nowrap; cursor: default; }
.top-hint .spend b { color: var(--ink); font-weight: 700; }
.top-hint .spend i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--soft-2); overflow: hidden; }
.top-hint .spend i::after { content: ""; position: absolute; inset: 0; width: var(--p); background: var(--ok); border-radius: 3px; }
.top-hint .spend.hot i::after { background: var(--warn); }
.top-hint .quota { padding: 4px 9px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

/* ── 左栏 ── */
.left { padding: 14px; gap: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 3px; flex: none; }
.seg button { padding: 8px 0; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg em { font-style: normal; font-weight: 500; margin-left: 4px; color: var(--ink-3); font-size: 12px; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.upload-card {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left;
  border: 1.5px dashed #d9dbe1; border-radius: var(--r-lg); background: linear-gradient(180deg, #fafafb, #f6f6f8);
  transition: border-color .15s, background .15s;
}
.upload-card:hover, .left.drag-over .upload-card { border-color: var(--brand); background: var(--brand-soft); }
.upload-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.upload-txt { display: flex; flex-direction: column; gap: 3px; }
.upload-txt b { font-size: 14px; }
.upload-txt small { font-size: 11.5px; color: var(--ink-3); }

.list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -6px; padding: 0 6px 6px; }
.item {
  position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--r-md); cursor: pointer; transition: background .15s;
}
.item:hover { background: var(--soft); }
.item.on { background: var(--soft-2); box-shadow: inset 0 0 0 1.5px var(--ink); }
.thumb { width: 58px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--soft-2); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.info { min-width: 0; }
.name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acts { position: absolute; right: 8px; top: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.item:hover .acts { opacity: 1; }
.mini { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); background: rgba(255,255,255,.9); }
.mini .ic { width: 14px; height: 14px; }
.mini:hover { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.mini.danger:hover { color: var(--err); }
.list-empty { padding: 30px 10px; text-align: center; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--soft-2); color: var(--ink-2); }
.badge.eng { background: #fff1e6; color: #c2570c; }
.badge.demo { background: var(--soft-2); color: var(--ink-3); }
.badge.err { background: #ffeced; color: var(--err); }
.badge.run { background: var(--brand-soft); color: var(--brand); }
.badge.spin { background: var(--ink); color: #fff; }

/* ── 中间舞台 ── */
.stage { position: relative; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 26px 0; flex: none; z-index: 2; }
.titles { min-width: 0; }
.stage-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { margin-top: 6px; font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }
.stage-tags { display: flex; gap: 6px; flex: none; padding-top: 4px; }
.stage-tags .badge { font-size: 12px; padding: 5px 11px; }

.viewer {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: radial-gradient(60% 45% at 50% 92%, #eceef2 0%, rgba(236,238,242,0) 70%);
}
.figure { position: absolute; inset: 14px 92px 96px; display: flex; align-items: center; justify-content: center; }
.frame { position: relative; border-radius: 16px; overflow: hidden; transition: filter .3s; }
.frame img, .frame canvas { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.frame canvas { cursor: grab; touch-action: none; }
.frame canvas:active { cursor: grabbing; }
.figure.dim .frame img { filter: saturate(.75) brightness(1.04); }
.figure.failed .frame img { filter: grayscale(.8) opacity(.45); }

.scan { position: absolute; inset: 0; overflow: hidden; background: rgba(255,255,255,.12); }
.scan-line {
  position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg, rgba(122,108,240,0), rgba(122,108,240,.28) 70%, rgba(255,255,255,.9) 100%);
  animation: scan 2.2s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(300%); } }
.scan-text {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: rgba(17,18,20,.82); color: #fff; font-size: 12.5px; font-weight: 500; backdrop-filter: blur(8px);
}
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .8s linear infinite; display: inline-block; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

.spin-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.88); box-shadow: 0 4px 16px rgba(0,0,0,.08); font-size: 12px; font-weight: 600; color: var(--ink-2);
  pointer-events: none; transition: opacity .4s; white-space: nowrap;
}
.spin-hint .ic { width: 15px; height: 15px; }
.spin-hint.fade { opacity: 0; }
.spin-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(255,255,255,.7); backdrop-filter: blur(6px); font-size: 12.5px; color: var(--ink-2); }
.spin-progress .bar { width: 160px; height: 4px; border-radius: 4px; background: var(--soft-2); overflow: hidden; }
.spin-progress .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .15s; }

.ghost {
  position: absolute; top: 12%; bottom: 22%; width: 15%; display: flex; align-items: center; opacity: .22;
  transition: opacity .2s, transform .2s; filter: grayscale(.3);
}
.ghost:hover { opacity: .45; }
.ghost img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.ghost-l { left: -4%; justify-content: flex-end; -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.ghost-r { right: -4%; justify-content: flex-start; -webkit-mask-image: linear-gradient(270deg, transparent, #000 70%); mask-image: linear-gradient(270deg, transparent, #000 70%); }
.nav {
  position: absolute; top: calc(50% - 40px); width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.1); display: grid; place-items: center; z-index: 3; transition: transform .15s;
}
.nav:hover:not(:disabled) { transform: scale(1.06); }
.nav:disabled { opacity: 0; pointer-events: none; }
.nav-l { left: 20px; }
.nav-r { right: 20px; }

.empty { position: absolute; inset: 0 0 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.empty-art { width: 128px; height: 168px; margin-bottom: 18px; color: #d4d6dc; }
.empty h2 { margin: 0; font-size: 20px; }
.empty p { margin: 8px 0 22px; font-size: 13px; color: var(--ink-3); max-width: 380px; line-height: 1.7; }
.steps { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; justify-content: center; }
.steps div { display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 9px; background: var(--soft); border-radius: 999px; font-size: 12.5px; color: var(--ink-2); }
.steps b { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; }

.notice {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: min(560px, 86%);
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.6;
  background: #fff8e8; color: #8a5a00; box-shadow: 0 4px 16px rgba(0,0,0,.06); z-index: 4;
}
.notice.err { background: #fff0f0; color: #b4232a; }
.notice .ic { width: 16px; height: 16px; margin-top: 2px; }
.notice button { margin-left: 6px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.dock {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 10px 30px rgba(16,24,40,.12); white-space: nowrap;
}
.dock-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.dock-btn { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .15s; }
.dock-btn:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.dock-btn.on { background: var(--ink); color: #fff; }
.dock-btn.danger:hover:not(:disabled) { color: var(--err); }
.dock-btn .ic { width: 16px; height: 16px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px;
  border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  transition: transform .12s, box-shadow .15s;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(17,18,20,.25); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary .ic { width: 16px; height: 16px; }
.btn-gen { height: 44px; padding: 0 22px; background: linear-gradient(135deg, #1b1c20, #3a3550); }
.btn-gen .count { min-width: 20px; height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 11.5px; display: grid; place-items: center; }
.btn-ghost { height: 40px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); }

/* ── 右栏 ── */
.right { padding: 18px 16px 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex: none; }
.section-head.mt { margin-top: 20px; }
.section-head h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink-2); }
.link { font-size: 12px; color: var(--ink-3); }
.link:hover { color: var(--ink); }
.pill-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.pill-btn .ic { width: 14px; height: 14px; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: none; }
.slot {
  position: relative; aspect-ratio: 1 / 1.18; border-radius: var(--r-md); border: 1.5px dashed #dfe1e6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #b9bcc3; cursor: pointer; transition: border-color .15s, color .15s; background: #fcfcfd;
}
.slot:hover { border-color: #b9bcc3; color: var(--ink-3); }
.slot .slot-label { font-size: 11px; font-weight: 600; }
.slot .ic { width: 22px; height: 22px; }
.slot.filled { border: 0; background: var(--soft); padding: 6px 6px 22px; cursor: default; }
.slot.filled img { width: 100%; height: 100%; object-fit: contain; }
.slot.filled .slot-label { position: absolute; bottom: 5px; color: var(--ink-2); font-size: 10.5px; }
.slot.locked { border-style: solid; border-color: var(--soft-2); background: var(--soft); color: #c4c7cd; cursor: default; }
.slot-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.slot-x .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.slot.filled:hover .slot-x { opacity: 1; }

.chips { display: flex; gap: 6px; overflow-x: auto; flex: none; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--soft); display: flex; align-items: center; gap: 5px; }
.chip em { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.chip:hover { background: var(--soft-2); }
.chip.on { background: var(--ink); color: #fff; }
.chip.on em { color: rgba(255,255,255,.6); }

.grid-wrap { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -16px; padding: 0 16px 16px; }
.right.drag-over .grid-wrap { background: var(--brand-soft); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { position: relative; border-radius: var(--r-lg); padding: 6px 6px 10px; cursor: pointer; transition: background .15s, box-shadow .15s; }
.card:hover { background: var(--soft); }
.card.on { box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }
.pic { aspect-ratio: 1 / 1.08; border-radius: 13px; background: #f4f4f6; display: grid; place-items: center; overflow: hidden; padding: 8px; }
.pic img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .25s; }
.card:hover .pic img { transform: scale(1.04); }
.cap { padding: 8px 4px 0; }
.pname { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ptag { font-size: 11px; color: var(--ink-3); margin-top: 3px; display: block; }
.card .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; transform: scale(0); transition: transform .15s; }
.card .check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.card.on .check { transform: scale(1); }
.card .card-del { position: absolute; top: 12px; left: 12px; opacity: 0; }
.card:hover .card-del { opacity: 1; }
.add-card { border: 1.5px dashed #dfe1e6; border-radius: var(--r-lg); aspect-ratio: 1 / 1.3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); font-size: 12px; text-align: center; padding: 10px; line-height: 1.6; }
.add-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ── 弹窗 ── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(17,18,20,.32); backdrop-filter: blur(4px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-pop); padding: 20px; animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.sheet-wide { width: min(620px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pm-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pm-row { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 10px; border-radius: var(--r-md); background: var(--soft); }
.pm-row .pic { aspect-ratio: auto; height: 90px; background: #fff; }
.pm-fields { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pm-fields input { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; font-size: 13.5px; }
.pm-fields input:focus { border-color: var(--ink); }
.pm-cats { display: flex; gap: 5px; flex-wrap: wrap; }
.pm-cats .chip { height: 28px; background: #fff; }
.pm-cats .chip.on { background: var(--ink); }
.pm-tip { font-size: 12px; color: var(--ink-3); line-height: 1.7; margin: 12px 2px 0; }
.help { overflow-y: auto; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.help p { margin: 0 0 12px; }
.help-card { background: var(--soft); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.help-card h4 { margin: 0 0 6px; font-size: 14.5px; color: var(--ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.help-card h4 span { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.help-card ol { margin: 0; padding-left: 20px; }
.muted { color: var(--ink-3); font-size: 12.5px; }

.drop-overlay { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: grid; place-items: end center; padding-bottom: 60px; }
.drop-overlay div { padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop); }

.toasts { position: fixed; left: 50%; top: 86px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop); animation: toastIn .25s cubic-bezier(.2,.9,.3,1.2); max-width: 90vw; }
.toast.warn { background: #fff8e8; color: #8a5a00; }
.toast.err { background: var(--err); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ── 响应式 ── */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr) 300px; }
  .figure { inset: 14px 70px 96px; }
  .top-hint { display: none; }
}
@media (max-width: 900px) {
  .app { height: auto; min-height: 100vh; padding: 10px; gap: 10px; }
  .topbar { grid-template-columns: 1fr auto; height: auto; padding: 10px 12px; row-gap: 10px; }
  .page-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .top-right .engine-switch { display: none; }
  .engine-switch button { padding: 7px 12px; font-size: 12px; }
  .layout { display: flex; flex-direction: column; gap: 10px; }
  .stage { order: 1; height: 78vh; min-height: 520px; }
  .left { order: 2; max-height: 420px; }
  .right { order: 3; max-height: 640px; }
  .stage-head { padding: 16px 16px 0; }
  .stage-head h1 { font-size: 20px; }
  .figure { inset: 10px 16px 88px; }
  .nav, .ghost { display: none; }
  .dock { max-width: calc(100% - 20px); overflow-x: auto; bottom: 12px; }
  .dock-btn { padding: 0 10px; }
  .dock-btn span { display: none; }
}
