/* ============================================================
   PixMart AI 界面演示 — 按真实应用 UI 复刻（模拟数据 · 无网络请求）
   真实结构来源：pixmart-ai/src/renderer（Navbar / ProductImages /
   StepIndicator / ModuleSelector / UploadArea）
   ============================================================ */

.demo-head {
  margin: clamp(48px, 6vw, 72px) 0 22px;
}

.demo-head .meta { margin-bottom: 10px; }

.demo-head h3 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-window {
  max-width: 1020px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg, var(--page));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

[data-theme="dark"] .app-window { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }

/* ---------- titlebar ---------- */
.app-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, var(--line));
  background: var(--bg-surface, var(--surface));
}

.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl.red { background: #ff5f57; }
.tl.yellow { background: #febc2e; }
.tl.green { background: #28c840; }

.app-title {
  margin-left: 10px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.app-ver { margin-left: auto; font-size: 10.5px; color: var(--muted); }

/* ---------- in-app navbar（复刻 Navbar.tsx）---------- */
.app-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--border, var(--line));
  background: var(--bg-surface, var(--surface));
}

.app-logo {
  display: flex;
  align-items: center;
  color: var(--brand);
}

.app-logo svg { height: 22px; width: auto; display: block; }

.app-tabs { display: flex; align-items: center; gap: 4px; }

.app-tabs button {
  padding: 6px 13px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted, var(--muted));
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.app-tabs button:hover { color: var(--ink); }

.app-tabs button.on {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-glow);
}

.app-gear {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--fg-muted, var(--muted));
}

/* ---------- page area ---------- */
.app-pagearea { padding: 20px 22px 26px; }

.app-page { display: none; }
.app-page.on { display: block; animation: pageIn 0.3s var(--ease); }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.app-h { margin-bottom: 4px; }

.app-h h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-h p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- step indicator（复刻 StepIndicator.tsx）---------- */
.app-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 0 18px;
}

.app-steps .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: none;
}

.app-steps .step i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-muted, var(--surface));
  color: var(--muted);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.app-steps .step.on i {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 18px var(--brand-glow);
}

.app-steps .step.done i { background: var(--brand); color: #fff; }

.app-steps .step i svg { width: 17px; height: 17px; }

.app-steps .step span { font-size: 12px; color: var(--muted); white-space: nowrap; }

.app-steps .step.on span { color: var(--brand); font-weight: 600; }

.app-steps .step.done span { color: var(--ink-secondary); }

.app-steps em {
  width: 60px;
  height: 2px;
  margin: 17px 8px 0;
  flex: none;
  background: var(--border, var(--line));
  transition: background 0.3s ease;
}

.app-steps em.done { background: var(--brand); }

/* ---------- two columns ---------- */
.app-cols {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.app-card {
  border: 1px solid var(--border, var(--line));
  border-radius: 12px;
  background: var(--bg-surface, var(--surface));
  padding: 16px;
}

/* form */
.form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ghost-link, .ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border, var(--line));
  border-radius: 8px;
  background: transparent;
  color: var(--fg-muted, var(--muted));
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost-link { border-color: transparent; padding-left: 0; }

.ghost-link:hover, .ghost-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-glow);
}

.ghost-link svg, .ghost-btn svg { width: 13px; height: 13px; }

.form-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border, var(--line));
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--bg-muted, var(--page));
}

.form-tabs button {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.form-tabs button.on {
  background: var(--bg-surface, var(--page));
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tabpane { display: none; }
.tabpane.on { display: block; animation: pageIn 0.25s var(--ease); }

.app-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary, var(--ink-secondary));
}

.app-input, .app-select2, .app-textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border, var(--line));
  border-radius: 8px;
  background: var(--page);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.app-textarea {
  resize: vertical;
  min-height: 66px;
  line-height: 1.55;
}

.app-input::placeholder, .app-textarea::placeholder { color: var(--muted); }

/* AI帮写（复刻 aiWriteBtnStyle：absolute 右下角）*/
.ta-wrap { position: relative; margin-bottom: 12px; }

.ta-wrap .app-textarea { margin-bottom: 0; }

.ai-write {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand-glow);
  color: var(--brand);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ai-write svg { width: 11px; height: 11px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.style-optbox {
  background: var(--bg-muted, var(--page));
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.style-optbox .app-select2 { margin-bottom: 0; }

.style-optbox .grid2, .style-optbox .grid3 { margin-bottom: 10px; }

.pv-replicating.on .gen-bar i { animation: genLoad 1.5s var(--ease) forwards; }

/* view slots（复刻 ThreeDGenerator 视角槽）*/
.view-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }

.vslot {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1.5px dashed var(--border, var(--line));
  border-radius: 10px;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.vslot:hover { border-color: var(--brand); }

.vslot small { font-size: 11px; }

.vslot.on {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-glow);
  color: var(--brand);
}

/* 3D 预览（复刻 ThreeDGenerator 右栏）*/
.pv3-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.pv3-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}

.pv3-actions { margin-left: auto; display: flex; gap: 6px; }

.pv3-state[hidden] { display: none; }

.pv3-empty {
  height: 300px;
  border: 2px dashed var(--border, var(--line));
  border-radius: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
}

.pv3-empty b { font-size: 14px; font-weight: 600; color: var(--ink-secondary); }

.pv3-empty p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* envelope tool cards（复刻 OtherTools uiverse 信封卡）*/
.envelope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}

.envelope { position: relative; height: 250px; cursor: pointer; }

.env-dash {
  position: absolute;
  inset: 0;
  border: 2px dashed var(--brand);
  opacity: 0.45;
  border-radius: 12px;
}

.env-card {
  position: relative;
  display: flex;
  height: 100%;
  width: 100%;
  align-items: flex-end;
  border: 2px solid var(--brand);
  background: var(--bg-surface, var(--surface));
  border-radius: 12px;
  overflow: hidden;
}

.env-front, .env-back { padding: 20px; width: 100%; transition: opacity 0.3s ease; }

.env-front svg { width: 38px; height: 38px; color: var(--brand); }

.env-front h5, .env-back h5 { margin: 12px 0 0; font-size: 19px; font-weight: 500; color: var(--ink); }

.env-front p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.env-back {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--bg-surface, var(--surface));
}

.env-back p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-secondary); }

.env-back b { margin: 20px 0 0; font-size: 12.5px; font-weight: 700; color: var(--brand); }

.envelope:hover .env-front { opacity: 0; }

.envelope:hover .env-back { opacity: 1; }

/* history header + filters + cards（复刻 ProjectHistory.tsx）*/
.app-h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.h2-left { display: flex; align-items: center; gap: 12px; }

.h2-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-glow);
  display: grid;
  place-items: center;
  color: var(--brand);
}

.h2-ico svg { width: 18px; height: 18px; }

.app-h2 h4 { margin: 0; font-size: 20px; font-weight: 700; font-family: var(--font-sans); }

.h2-right { display: flex; align-items: center; gap: 10px; }

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface, var(--surface));
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
  width: 240px;
}

.search-pill svg { width: 14px; height: 14px; color: var(--muted); flex: none; }

.search-pill input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  width: 100%;
}

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.cat-chips button {
  padding: 6px 15px;
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-chips button.on {
  border-color: var(--brand);
  background: var(--brand-glow);
  color: var(--brand);
  font-weight: 600;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.proj-card {
  border: 1px solid var(--border, var(--line));
  border-radius: 12px;
  background: var(--bg-surface, var(--surface));
  padding: 14px;
  animation: pageIn 0.3s var(--ease);
}

.pc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.pc-ico {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-glow);
  color: var(--brand);
}

.pc-ico svg { width: 16px; height: 16px; }

.pc-head b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.badge-done {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .badge-done { background: #166534; color: #dcfce7; }

.pc-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.pc-thumbs i {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-style: normal;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, var(--line));
}

.pc-meta { margin-top: 10px; font-size: 11.5px; color: var(--muted); }

.pc-actions { display: flex; gap: 8px; margin-top: 10px; }

.pc-actions .ghost-btn, .cfg-row .ghost-btn { padding: 5px 10px; font-size: 11px; }

.proj-empty {
  padding: 56px 20px;
  text-align: center;
  border: 1px dashed var(--border, var(--line));
  border-radius: 12px;
}

.proj-empty b { font-size: 14px; color: var(--ink-secondary); }

.proj-empty p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* settings（复刻 Settings.tsx 模型管理页）*/
.set-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; }

.set-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border, var(--line));
  padding-right: 14px;
}

.set-side > b { font-size: 14px; font-weight: 700; padding: 4px 10px 12px; }

.set-side button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.set-side button svg { width: 15px; height: 15px; }

.set-side button:hover { color: var(--ink); }

.set-side button.on { background: var(--brand-glow); color: var(--brand); font-weight: 600; }

.set-main { min-width: 0; }

.set-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.set-head h4 { margin: 0 0 4px; font-size: 17px; font-weight: 700; font-family: var(--font-sans); }

.set-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.rec-card {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-surface, var(--surface));
  border: 1px solid var(--border, var(--line));
  box-shadow: 0 4px 14px var(--brand-glow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.rec-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--brand-glow); }

.rec-blob {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 35% 35%, var(--brand) 0%, transparent 62%);
  opacity: 0.28;
}

.rec-content { position: relative; text-align: center; }

.rec-content b { display: block; font-size: 11px; font-weight: 700; color: var(--brand); }

.rec-content small { font-size: 9.5px; color: var(--muted); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }

.stat-c {
  background: var(--bg-muted, var(--page));
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.stat-c b { display: block; font-size: 22px; font-weight: 700; }

.stat-c span { font-size: 11.5px; color: var(--muted); }

.addcfg { margin-bottom: 16px; }

.addcfg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.addcfg-head b { font-size: 14px; font-weight: 600; }

.dots { display: flex; gap: 4px; }

.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border, var(--line)); }

.dots i.on { background: var(--brand); }

.cfg-actions { display: flex; gap: 10px; margin-top: 4px; }

.app-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.app-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong, var(--line));
}

.app-status.ok { color: var(--ink-secondary); }

.app-status.ok i { background: #2fa96c; box-shadow: 0 0 0 3px rgba(47, 169, 108, 0.18); }

.cfg-list { display: grid; gap: 10px; }

.cfg-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }

.cfg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.cfg-dot.ok { background: #2fa96c; box-shadow: 0 0 0 3px rgba(47, 169, 108, 0.15); }

.cfg-info { flex: 1; min-width: 0; }

.cfg-info b { display: block; font-size: 13px; font-weight: 600; }

.cfg-info small { font-size: 11px; color: var(--muted); }

/* upload（复刻 UploadArea.tsx）*/
.app-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.app-thumb72 {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, var(--line));
  background: linear-gradient(135deg, var(--brand-light, #f0a997), var(--brand, #c96442));
}

.app-thumb72 i {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-style: normal;
  font-size: 9px;
}

.app-upload2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 118px;
  padding: 20px 22px;
  border: 2px dashed var(--border, var(--line));
  border-radius: 12px;
  background: var(--bg-muted, var(--page));
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.app-upload2:hover { border-color: var(--brand); }

.app-upload2 b { font-size: 13px; font-weight: 500; }

.app-upload2 small { font-size: 12px; color: var(--muted); }

/* module selector（复刻 ModuleSelector.tsx）*/
.modsel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modsel-head .app-label { margin: 0; }

.mod-count { font-size: 12px; color: var(--muted); }

.mod-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-secondary);
  cursor: pointer;
}

.mod-all input { accent-color: var(--brand); margin: 0; }

.mod-custom {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand-glow);
  color: var(--brand);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.mod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-muted, var(--page));
  border: 1px solid var(--border-subtle, var(--line));
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.mod.on {
  background: var(--brand-glow);
  border-color: var(--brand);
  opacity: 1;
}

.mod-check {
  width: 15px;
  height: 15px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border, var(--line));
  border-radius: 4px;
  color: transparent;
  transition: all 0.15s ease;
}

.mod-check svg { width: 10px; height: 10px; }

.mod.on .mod-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.mod-t {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod.on .mod-t { color: var(--brand); font-weight: 600; }

.mod-qty { display: flex; align-items: center; flex: none; }

.mod-qty select {
  padding: 3px 4px;
  border: 1px solid var(--border, var(--line));
  border-radius: 6px;
  background: var(--page);
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
}

/* 占位图通用图标（演示中不使用 emoji）*/
.app-thumb72 svg, .style-tile svg, .vslot svg { width: 20px; height: 20px; }

.pc-thumbs svg { width: 15px; height: 15px; }

.res-shot svg { width: 24px; height: 24px; }

/* form actions */
.app-btn-primary.block { width: 100%; }

.app-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] .app-btn-primary { color: #1a1a1a; }

.app-btn-primary:hover { background: var(--brand-strong, var(--brand)); }

.app-btn-primary:disabled { opacity: 0.55; cursor: default; }

.app-btn-primary svg { width: 15px; height: 15px; }

/* ---------- right preview ---------- */
.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  text-align: center;
}

.pv { display: none; width: 100%; }
.pv.on { display: block; }

.pv-empty .pv-ico {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--bg-muted, var(--page));
  color: var(--muted);
}

.pv-empty .pv-ico svg { width: 30px; height: 30px; }

.pv b.pv-t { display: block; font-size: 14px; font-weight: 600; color: var(--ink-secondary); }

.pv p.pv-s { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

/* plan */
.pv-plan .plan-list { display: grid; gap: 8px; margin: 16px 0; text-align: left; }

.plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, var(--line));
  border-radius: 10px;
  background: var(--page);
}

.plan-row .pn { font-size: 12.5px; font-weight: 600; flex: 1; }

.plan-row .pq {
  font-size: 11px;
  color: var(--muted);
  padding: 3px 9px;
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
}

.pv-plan .plan-sum { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

/* generating */
.pv-generating .gen-bar {
  height: 6px;
  max-width: 320px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: var(--bg-muted, var(--page));
  overflow: hidden;
}

.pv-generating .gen-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
}

.pv-generating.on .gen-bar i { animation: genLoad 1.6s var(--ease) forwards; }

@keyframes genLoad {
  0% { width: 3%; }
  55% { width: 68%; }
  100% { width: 100%; }
}

/* done */
.pv-done .res-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.res-shot {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-light, #f0a997), var(--brand, #c96442));
  color: #fff;
  font-size: 28px;
  animation: shotIn 0.45s var(--ease) backwards;
}

.res-shot:nth-child(2) { animation-delay: 0.1s; }
.res-shot:nth-child(3) { animation-delay: 0.2s; }
.res-shot:nth-child(4) { animation-delay: 0.3s; }

@keyframes shotIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.res-shot b { font-size: 11.5px; font-weight: 600; }

.pv-done .again {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid var(--border, var(--line));
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.pv-done .again:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- other pages ---------- */
.style-duo, .style-res {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.style-tile {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed var(--border, var(--line));
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.style-tile:hover { border-color: var(--brand); }

.style-tile small { font-size: 11px; color: var(--muted); }

.style-tile.fill-ref { border: none; background: linear-gradient(135deg, #f7cdc4, #e8a0b8); color: #7a382c; }
.style-tile.fill-prod { border: none; background: linear-gradient(135deg, var(--brand-light, #f0a997), var(--brand, #c96442)); color: #fff; }
.style-tile.fill-res { border: none; background: linear-gradient(135deg, var(--brand, #c96442), #8a4a9e); color: #fff; }

.style-arrow { color: var(--muted); font-size: 17px; }

/* 3D */
.app-cube-scene {
  height: 250px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border, var(--line));
  border-radius: 12px;
  margin-bottom: 14px;
  perspective: 620px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  position: relative;
}

.app-cube-scene:active { cursor: grabbing; }

.app-cube {
  position: relative;
  width: 92px;
  height: 92px;
  transform-style: preserve-3d;
  animation: cubeSpin 10s linear infinite;
}

.app-cube-scene.drag .app-cube { animation: none; }

@keyframes cubeSpin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}

.app-cube i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(201, 100, 66, 0.88), rgba(181, 85, 58, 0.88));
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.app-cube i:nth-child(1) { transform: translateZ(46px); }
.app-cube i:nth-child(2) { transform: rotateY(180deg) translateZ(46px); background: linear-gradient(135deg, rgba(240, 169, 151, 0.92), rgba(201, 100, 66, 0.92)); }
.app-cube i:nth-child(3) { transform: rotateY(90deg) translateZ(46px); background: linear-gradient(135deg, rgba(138, 74, 158, 0.85), rgba(201, 100, 66, 0.9)); }
.app-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(46px); }
.app-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(46px); background: linear-gradient(135deg, rgba(240, 169, 151, 0.92), rgba(230, 126, 100, 0.92)); }
.app-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(46px); }

.cube-tip {
  position: absolute;
  bottom: 12px;
  font-size: 11px;
  color: var(--muted);
}

/* tools page */
.tool-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.tool-card {
  padding: 16px;
  border: 1px solid var(--border, var(--line));
  border-radius: 12px;
  background: var(--page);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--brand-glow);
}

.tool-card .tc-ico {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-glow);
  color: var(--brand);
  margin-bottom: 10px;
}

.tool-card .tc-ico svg { width: 16px; height: 16px; }

.tool-card b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }

.tool-card small { display: block; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

/* history page */
.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.proj-card {
  border: 1px solid var(--border, var(--line));
  border-radius: 12px;
  background: var(--page);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.proj-card:hover { border-color: var(--brand); transform: translateY(-2px); }

.proj-thumb {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
}

.proj-card .pj-meta { padding: 10px 12px; text-align: left; }

.proj-card .pj-meta b { display: block; font-size: 12px; font-weight: 600; }

.proj-card .pj-meta small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }

/* toast */
.app-toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(8px);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  white-space: nowrap;
  z-index: 5;
}

.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.app-pagearea { position: relative; }

.app-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

/* responsive */
@media (max-width: 820px) {
  .app-cols { grid-template-columns: 1fr; }
  .preview { min-height: 320px; }
  .app-nav { gap: 10px; padding: 0 14px; }
  .app-tabs {
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .app-tabs::-webkit-scrollbar { display: none; }
  .app-tabs button {
    padding: 6px 9px;
    font-size: 12px;
    white-space: nowrap;
    flex: none;
  }
  .tool-cards, .proj-grid { grid-template-columns: 1fr; }
}

/* 窄屏：进度条与设置页收紧（与真实应用移动端一致：隐藏步骤标签） */
@media (max-width: 640px) {
  .app-steps .step span { display: none; }
  .app-steps .step i { width: 30px; height: 30px; }
  .app-steps em { width: 22px; margin: 14px 6px 0; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .set-layout { grid-template-columns: 1fr; gap: 14px; }
  .set-side {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border, var(--line));
    padding: 0 0 10px;
  }
  .set-side > b { display: none; }
  .set-side button { flex: none; white-space: nowrap; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .app-cube { animation: none; }
  .app-page.on, .res-shot { animation: none; }
  .pv-generating.on .gen-bar i { animation: none; width: 100%; }
}
