:root {
  --bg: #e8edf5;
  --surface: #f7f9fc;
  --surface-raised: #ffffff;
  --ink: #1a1d26;
  --muted: #5b6472;
  --line: #d5dbe6;
  --line-strong: #c5cddb;
  --blue: #3b82f6;
  --blue-soft: #e8f1ff;
  --blue-border: #bfdbfe;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --font: "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* display:flex 等会盖掉原生 hidden，必须强制隐藏 */
[hidden] { display: none !important; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dfe8f6 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e4ebf5 0%, transparent 50%),
    linear-gradient(180deg, #e9eef6 0%, #eef1f6 42%, #f3f5f8 100%);
  background-attachment: fixed;
  padding-bottom: 0;
}
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.app-frame {
  display: grid;
  grid-template-columns: 72px 1fr;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
.side-nav {
  position: sticky;
  top: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  background: #f7f7f8;
  border-right: 1px solid #ebecef;
  z-index: 52; /* 高于底部操作条，避免「设置」被挡住 */
  box-sizing: border-box;
}
.side-logo {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  padding: 0;
  flex-shrink: 0;
}
.side-logo-mark {
  font-weight: 800;
  font-size: 1.05rem;
  font-family: Georgia, "Times New Roman", serif;
}
.side-nav-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  width: 100%;
  align-items: center;
  padding: 4px 6px 0;
  min-height: 0;
  overflow: auto;
}
.side-nav-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 6px 4px;
  flex-shrink: 0;
  margin-top: auto;
}
.side-health {
  writing-mode: horizontal-tb;
  font-size: 0.62rem;
  color: #94a3b8;
  max-width: 64px;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.side-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #9aa0a8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 10px;
  font: inherit;
}
.side-item:hover {
  color: #5b616b;
}
.side-item.active {
  color: #111111;
}
.side-ico {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}
.side-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.side-label {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(232, 237, 245, 0.9), rgba(238, 242, 247, 0.95));
}
.app-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-view {
  min-height: 100%;
}
.project-topbar {
  position: relative;
  flex-shrink: 0;
  top: auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.96), rgba(236, 241, 248, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-strong);
}
.project-topbar .stepper { flex: 1; justify-content: center; }

.placeholder-view {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  padding: 24px;
}
.placeholder-view h1 { margin: 0 0 8px; font-size: 1.6rem; }
.placeholder-view p { color: var(--muted); margin: 0 0 16px; }

.projects-section {
  max-width: 860px;
  margin: 36px auto 48px;
  padding: 0 12px 40px;
}
.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.projects-head h1 {
  margin: 0;
  font-size: 1.35rem;
}
.projects-empty {
  text-align: center;
  padding: 48px 16px;
  color: #94a3b8;
}
.projects-empty p { margin: 0 0 14px; }
.projects-section-solo {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.project-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #eceff3;
  background: #fff;
  border-radius: 14px;
  padding: 12px 40px 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}
.project-card:hover { border-color: #d7dde7; }
.project-card.active { border-color: #94a3b8; box-shadow: 0 0 0 1px #cbd5e1; }
.project-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-thumb-fallback {
  font-size: 0.75rem;
  color: #94a3b8;
}
.project-card-body { min-width: 0; }
.project-card-title {
  font-weight: 650;
  font-size: 0.95rem;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
}
.project-card-wrap {
  position: relative;
  display: block;
}
.project-card-wrap .project-card { width: 100%; }
.project-card-more {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  background: rgba(248, 250, 252, 0.95);
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 10px;
}
.project-card-more:hover {
  background: #fef2f2;
  color: #b91c1c;
}
body { padding-bottom: 0; }
/* 底部操作条只由 .detail-content 留白避让，避免与 app-content 叠加成大片空白 */
body:has(#footerBar:not([hidden])) { padding-bottom: 0; }
body.has-footer-bar .app-content {
  padding-bottom: 0;
}

.works-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.assets-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.assets-page-tabs {
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assets-works-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assets-work-card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #eceff3;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}
.assets-work-card:hover { border-color: #d7dde7; }
.assets-work-cover {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  display: grid;
  place-items: center;
}
.assets-work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assets-work-cover span {
  font-size: 0.75rem;
  color: #94a3b8;
}
.assets-work-body { min-width: 0; }
.assets-work-title {
  font-weight: 650;
  font-size: 1rem;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assets-work-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assets-work-arrow {
  color: #94a3b8;
  font-size: 1.2rem;
  padding: 0 4px;
}
#assetsDetailHead {
  align-items: center;
  gap: 12px;
}
#assetsDetailHead h1 {
  flex: 1;
  margin: 0;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-card .meta-from {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 6px;
}
.assets-empty {
  text-align: center;
  padding: 48px 16px;
  color: #94a3b8;
}
.assets-empty p { margin: 0 0 14px; }

@media (max-width: 800px) {
  .app-frame { grid-template-columns: 64px 1fr; }
  .side-label { font-size: 0.64rem; }
  .footer-bar { left: calc(64px + 12px); right: 12px; }
}

button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
}
.btn:hover { border-color: #cbd5e1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.btn.primary:hover { background: #000; }
.btn.secondary { background: var(--blue-soft); border-color: var(--blue-border); color: #1d4ed8; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: #f1f5f9; }
.btn.sm { padding: 4px 10px; font-size: 0.85rem; }
.btn.next { min-width: 120px; padding: 10px 28px; font-size: 0.95rem; }

.topbar {
  position: relative;
  flex-shrink: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}
.brand-name { font-weight: 700; font-size: 0.95rem; }
.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.health { font-size: 0.75rem; color: var(--muted); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.step:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.step:not(:disabled):hover {
  background: #f1f5f9;
  color: var(--ink);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  background: #e5e7eb;
  color: #4b5563;
}
.step.active {
  background: var(--blue-soft);
  border-color: var(--blue-border);
  color: #1d4ed8;
}
.step.active .step-num { background: var(--blue); color: #fff; }
.step.done { color: #1e40af; }
.step.done .step-num {
  background: var(--blue);
  color: #fff;
}
.step.done .step-num::after { content: "✓"; font-size: 0.7rem; }
.step.done .step-num { font-size: 0; }
.step-line {
  width: 28px;
  height: 1px;
  background: var(--line);
}

.shell { display: block; }
.rail { display: none !important; }
.rail-head { display: none; }
.job-list { display: flex; flex-direction: column; gap: 8px; }
.job-card {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.job-card:hover { border-color: var(--blue-border); }
.job-card.active { border-color: var(--blue); background: var(--blue-soft); }
.job-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; line-height: 1.35; }
.job-meta { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: var(--muted); }
.progress {
  margin-top: 8px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.3s;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.progress-row .progress {
  flex: 1;
  margin-top: 0;
  min-width: 0;
}
.progress-pct {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  min-width: 2.4em;
  text-align: right;
}

.status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status.running { background: #fef3c7; color: #b45309; }
.status.awaiting_next { background: var(--blue-soft); color: #1d4ed8; }
.status.completed { background: #d1fae5; color: #047857; }
.status.failed { background: #fee2e2; color: #b91c1c; }
.status.queued { background: #e0e7ff; color: #3730a3; }
.status.paused { background: #f1f5f9; color: #475569; }

.workspace { padding: 0; max-width: none; }
.workspace.home-flow-mode {
  padding: 0;
  max-width: none;
  height: auto;
  overflow: visible;
}
#viewCanvas {
  height: calc(100vh);
  overflow: hidden;
  position: relative;
}
#viewCanvas .flow-shell {
  height: 100%;
  min-height: 100%;
}
.canvas-mobile-gate {
  display: none;
  height: 100%;
  min-height: inherit;
  place-items: center;
  padding: 24px 20px calc(88px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #e8eef8 0%, transparent 55%),
    #f4f6f9;
}
.canvas-mobile-gate-card {
  width: min(420px, 100%);
  text-align: center;
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}
.canvas-mobile-gate-ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #f8fafc, #e2e8f0);
  border: 1px solid #dbe2ea;
  position: relative;
}
.canvas-mobile-gate-ico::before,
.canvas-mobile-gate-ico::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #94a3b8;
  border-radius: 2px;
}
.canvas-mobile-gate-ico::before {
  top: 12px;
  width: 28px;
  height: 18px;
  border: 2px solid #64748b;
  background: #f1f5f9;
  border-radius: 3px;
  box-sizing: border-box;
}
.canvas-mobile-gate-ico::after {
  bottom: 10px;
  width: 16px;
  height: 3px;
}
.canvas-mobile-gate-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.canvas-mobile-gate-card p {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}
.canvas-mobile-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.canvas-mobile-gate-actions .btn {
  min-width: 120px;
}
.detail-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 28px 28px;
}
body.has-footer-bar .detail-content {
  /* 仅够躲开底部操作条，不多留空白 */
  padding-bottom: 88px;
}
.detail-content .project-head {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.detail-content .meta-tags .tag {
  background: #eef2f8;
  border-color: var(--line-strong);
  color: #475569;
}
.detail-content .meta-tags .tag.status {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.empty-stage {
  min-height: 50vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
}
.empty-stage h1 { margin: 0; color: var(--ink); font-size: 1.6rem; }

.project-head { margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.project-head h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
}
.meta-tags { display: flex; flex-direction: column; gap: 8px; }
.meta-tags-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  color: var(--muted);
  background: #eef2f8;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 10px;
}
.tag.tag-style {
  border-radius: 10px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.panel {
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.script-ep-panel {
  background: linear-gradient(165deg, #ffffff 0%, #f0f4fa 55%, #eaf0f8 100%);
  border-color: #c8d2e1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 12px 28px rgba(15, 23, 42, 0.08);
}
.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.intro-grid.edit {
  grid-template-columns: repeat(3, 1fr);
}
.intro-item input,
.intro-item textarea,
.script-edit {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  background: #eef2f7;
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.intro-item input:focus,
.intro-item textarea:focus,
.script-edit:focus {
  outline: none;
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.script-edit {
  min-height: 360px;
  font-size: 0.9rem;
}
.edit-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.asset-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  flex-wrap: wrap;
}
.asset-toolbar .asset-tabs {
  border-bottom: none;
  margin-bottom: 0;
}
.intro-item {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.intro-item .k { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.intro-item .v { font-weight: 600; font-size: 0.9rem; }
.synopsis {
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  line-height: 1.7;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.script-body {
  max-height: 420px;
  overflow: auto;
  line-height: 1.75;
  font-size: 0.9rem;
  white-space: pre-wrap;
  color: #334155;
}
.ep-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ep-badge .done-pill {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.done-pill {
  display: inline-flex;
  align-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}

.asset-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 0;
}
.asset-tab {
  border: none;
  background: transparent;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.asset-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
}
.asset-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
  height: auto;
  display: flex;
  flex-direction: column;
}
.asset-card.viewable {
  cursor: zoom-in;
}
.asset-card.viewable:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
}
.asset-card.is-generating {
  cursor: wait;
  pointer-events: auto;
}
.asset-card.is-generating .thumb {
  cursor: wait;
}
.asset-card .thumb {
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
/* 全局资产页统一正方形，避免同行高低不齐留白 */
#globalAssetGrid .asset-card .thumb,
#globalAssetGrid .asset-card .thumb.scene,
#globalAssetGrid .asset-card .thumb.square {
  aspect-ratio: 1;
}
.asset-card .thumb.scene { aspect-ratio: 16/9; }
.asset-card .thumb.square { aspect-ratio: 1; }
.asset-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none !important;
  transition: none !important;
  will-change: auto;
}
.asset-card.viewable:hover img {
  filter: none;
  transform: none !important;
}
.asset-card .thumb-view {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}
.asset-card.viewable:hover .thumb-view {
  opacity: 1;
}
.asset-card .thumb-gen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.72);
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 650;
  pointer-events: none;
}
.asset-card .thumb-pending {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
}
.asset-card.pending {
  border-style: dashed;
  opacity: 0.95;
}
.asset-card .tag-mini {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 650;
  color: #1d4ed8;
  background: #eff6ff;
  vertical-align: middle;
}
.asset-card .body {
  padding: 10px 12px 12px;
  flex: 0 0 auto;
}
.asset-card .name {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.3;
}
.asset-card .desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 0;
}
.asset-desc-label {
  display: block;
  margin: 0;
}
.asset-desc-edit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 64px;
  max-height: 140px;
}
.asset-desc-edit:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.asset-card .meta-from {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 8px;
}
.asset-card .regen {
  width: 100%;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
  margin-top: 10px;
}
.asset-card-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.asset-card-foot .meta-from {
  margin-top: 0;
}
.asset-card-foot .regen {
  margin-top: 0;
}
/* 项目向导里有「再次生成」的卡片，正文区略留底边距 */
.asset-card:has(.regen) .desc {
  margin-bottom: 0;
}

/* 资产大图预览 */
.asset-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
}
.asset-lightbox[hidden] {
  display: none !important;
}
.asset-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}
.asset-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.asset-lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.asset-lightbox-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.asset-lightbox-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.asset-lightbox-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #0f172a;
  display: grid;
  place-items: center;
}
.asset-lightbox-body img,
.asset-lightbox-body .asset-lightbox-video {
  max-width: 100%;
  max-height: min(70vh, 640px);
  object-fit: contain;
  border-radius: 8px;
  background: #1e293b;
}
.asset-lightbox-body .asset-lightbox-video {
  width: min(100%, 860px);
  background: #000;
}
.asset-lightbox-desc[hidden] {
  display: none !important;
}
.asset-lightbox-foot {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 16px 14px;
  display: grid;
  gap: 10px;
}
.asset-lightbox-edit {
  display: grid;
  gap: 6px;
  margin: 0;
}
.asset-lightbox-edit .k {
  font-size: 0.75rem;
  font-weight: 650;
  color: #64748b;
}
.asset-lightbox-desc {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.5;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
}
.asset-lightbox-desc:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.asset-lightbox-desc[readonly] {
  background: #f1f5f9;
  color: #475569;
}
.asset-lightbox-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.asset-lightbox-actions[hidden] {
  display: none !important;
}

.ep-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 16px;
}
.ep-count {
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.ep-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
}
.ep-toolbar-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .ep-toolbar {
    align-items: stretch;
  }
  .ep-toolbar-actions {
    width: 100%;
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ep-toolbar-actions .btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    padding: 8px 10px;
  }
}
@media (max-width: 420px) {
  .ep-toolbar-actions {
    grid-template-columns: 1fr;
  }
}
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.ep-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ep-card:hover {
  border-color: var(--blue-border);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
}
.ep-card .media {
  aspect-ratio: 16/10;
  background: var(--blue-soft);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.ep-card .media img,
.ep-card .media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ep-card .play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(15,23,42,.35), transparent 55%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.ep-card:hover .play-badge,
.ep-card.has-video .play-badge,
.ep-card.clickable .play-badge { opacity: 1; }
.ep-card .play-badge span {
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  padding: 8px 14px;
}
.ep-card .idx {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
}
.ep-card .body { padding: 14px; flex: 1; }
.ep-card .title { font-weight: 700; margin-bottom: 6px; }
.ep-card .meta { font-size: 0.78rem; color: var(--muted); }
.ep-card .status-line {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--blue);
  font-weight: 500;
}
.placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #dbeafe;
  opacity: 0.8;
}

.err-box {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}
.running-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}
.running-banner.queued-banner {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.running-banner.paused-banner {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.footer-bar {
  position: fixed;
  left: calc(72px + 16px);
  right: 16px;
  bottom: 18px;
  transform: none;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 12px 16px 12px 22px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}
.footer-bar.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.footer-msg { margin: 0; font-size: 0.88rem; flex: 1; }
.footer-actions { display: flex; gap: 8px; align-items: center; }
.footer-bar.light .btn.primary { background: #111827; color: #fff; }
.footer-bar:not(.light) .btn.ghost { color: #cbd5e1; }
.footer-bar:not(.light) .btn.primary {
  background: #1f2937;
  border-color: #374151;
}
.footer-bar:not(.light) .btn.primary:hover { background: #374151; }

.back-top-fab {
  position: fixed;
  right: 22px;
  bottom: 28px;
  z-index: 48;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #e5e7eb;
  background: #111827;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
}
.back-top-fab.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top-fab:hover {
  background: #1f2937;
}
.back-top-fab:active {
  transform: translateY(1px);
}
body.has-footer-bar .back-top-fab {
  bottom: 92px;
}

.create-drawer,
.ui-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 60;
  padding: 0 0 28px;
  overflow: auto;
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.14);
  border-left: 1px solid #eef1f5;
  animation: uiSlideInRight 0.22s ease;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 55;
  animation: uiFadeIn 0.18s ease;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #eef1f5;
  position: relative;
  background: #fff;
  z-index: 2;
}
.drawer-head h2 { margin: 0; font-size: 1.12rem; font-weight: 650; }
.drawer-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.create-form {
  padding: 8px 20px 0;
}
.create-form label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.create-form input:not([type="file"]):not([type="checkbox"]),
.create-form select,
.create-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fbfcfd;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.create-form input:not([type="file"]):not([type="checkbox"]):focus,
.create-form select:focus,
.create-form textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
  background: #fff;
}
.create-form textarea.secret-textarea {
  -webkit-text-security: disc;
  text-security: disc;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.12em;
}
.api-keys-block .api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
}
.api-keys-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.api-keys-row input[type="password"] {
  margin-top: 0 !important;
}
.api-keys-row .api-key-remove {
  flex-shrink: 0;
  min-width: 36px;
  height: 40px;
  padding: 0 10px;
}
.create-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--ink) !important;
}
.check-row input { width: auto !important; margin: 0 !important; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-row .btn { flex: 1; border-radius: 10px; }
.save-tip { font-size: 0.8rem; color: var(--ok); margin-top: 8px; }
.save-tip.err { color: var(--bad); }

.settings-block {
  margin: 16px 0 8px;
  padding: 12px 0 0;
  border-top: 1px solid #eceff3;
}
.settings-block h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.settings-hint {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}
.settings-hint a { color: #2563eb; }

.skills-manage {
  margin: 16px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.skills-manage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.skills-manage-head h3 {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
}
.skills-update-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.skills-update-tip {
  margin: 0 0 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}
.skill-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.skill-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.skill-upload-zone:hover,
.skill-upload-zone.dragover {
  border-color: #64748b;
  background: #f8fafc;
}
.skill-upload-zone:disabled {
  opacity: 0.65;
  cursor: wait;
}
.skill-upload-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #334155;
  font-size: 1rem;
  flex-shrink: 0;
}
.skill-upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.skill-upload-text strong {
  font-size: 0.88rem;
  font-weight: 600;
}
.skill-upload-text small {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
}
.skills-pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-pack {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.skill-pack.active {
  border-color: #94a3b8;
  box-shadow: 0 0 0 1px #cbd5e1;
}
.skill-pack.is-default {
  background: #f1f5f9;
}
.skill-pack-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.skill-pack-title {
  font-weight: 600;
  font-size: 0.88rem;
}
.skill-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}
.skill-badge.readonly {
  background: #e2e8f0;
  color: #475569;
}
.skill-badge.custom {
  background: #dbeafe;
  color: #1d4ed8;
}
.skill-pack-meta {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #64748b;
}
.skill-pack-stages {
  margin-top: 6px;
  font-size: 0.72rem;
  color: #2563eb;
}
.skill-pack-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.skill-active-tag {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
}
.skill-off-tag {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}
.skill-pack.is-off {
  opacity: 0.72;
}
.danger-text { color: #b91c1c !important; }

.log-mini {
  margin-top: 12px;
  max-height: 120px;
  overflow: auto;
  font-size: 0.75rem;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .step-label { display: none; }
  .detail-content { padding: 16px 16px 24px; }
  .project-card { grid-template-columns: 56px 1fr; padding-right: 40px; }
  .project-thumb { width: 56px; height: 56px; }
}

.shot-modal[hidden] { display: none !important; }
.shot-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  overscroll-behavior: none;
  animation: uiFadeIn 0.18s ease;
}
.shot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overscroll-behavior: none;
}
.shot-modal-panel,
.ui-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  padding: 0;
  animation: uiPopIn 0.2s cubic-bezier(0.2, 0.9, 0.25, 1);
  isolation: isolate;
}
.shot-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 0;
  border-radius: 20px 20px 0 0;
}
.shot-modal-head-main {
  min-width: 0;
  flex: 1 1 auto;
}
.shot-modal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-top: 2px;
}
.shot-modal-nav-idx {
  font-size: 0.78rem;
  color: #64748b;
  min-width: 3.5em;
  text-align: center;
  white-space: nowrap;
}
.shot-modal-nav .btn {
  padding: 6px 10px;
  white-space: nowrap;
}
.shot-modal-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.shot-modal-sub {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 52ch;
}
.shot-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  padding: 16px 20px 22px;
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}
.ui-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e8ecf1;
  background: #f8fafc;
  border-radius: 10px;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ui-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #dbe2ea;
}
.shot-player {
  background: linear-gradient(160deg, #0b1220, #1e293b);
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px solid #1e293b;
}
.shot-player video,
.shot-player img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: transparent;
}
.shot-edit label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.shot-edit textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  resize: vertical;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  background: #fbfcfd;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shot-edit textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #fff;
}
.shot-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.shot-edit-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.2em;
}

.ui-dialog-panel {
  width: min(420px, 100%) !important;
  max-height: none;
  overflow: hidden;
}
.ui-dialog .shot-modal-head {
  border-bottom: none;
  padding-bottom: 4px;
  border-radius: 20px 20px 0 0;
}
.ui-dialog .shot-modal-sub {
  margin-top: 10px;
  font-size: 0.92rem;
  color: #334155;
  max-width: none;
  white-space: pre-wrap;
}
.ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 20px 18px;
  flex-shrink: 0;
}
.ui-dialog-actions .btn {
  min-width: 88px;
  border-radius: 10px;
}
.ui-dialog.danger-ok #uiDialogOk {
  background: #dc2626;
  border-color: #dc2626;
}

@keyframes uiFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes uiPopIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes uiSlideInRight {
  from { transform: translateX(16px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes uiSlideInUp {
  from { transform: translateY(28px); opacity: 0.55; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 800px) {
  .shot-modal { padding: 12px; align-items: end; }
  .shot-modal-panel {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 18px 18px 12px 12px;
  }
  .shot-modal-head {
    border-radius: 18px 18px 0 0;
    flex-wrap: wrap;
    align-items: center;
  }
  .shot-modal-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
  }
  .shot-modal-nav .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }
  .shot-modal-body { grid-template-columns: 1fr; padding: 14px 16px 18px; }
  .ui-dialog-panel { border-radius: 18px !important; }
  .ui-dialog .shot-modal-head { border-radius: 18px 18px 0 0; }
}

.hidden-settings-form { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.home-mode-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.create-home.mode-flow .home-mode-bar {
  margin: 0;
  padding: 8px 16px;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 6;
}
.home-mode-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.home-mode-btn.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.classic-create {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 12px 80px;
}

/* ===== ComfyUI-style flow canvas ===== */
.create-home {
  margin: 0;
  padding: 28px 12px 0;
  max-width: none;
}
.create-home.mode-flow {
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.create-home.mode-classic .classic-create {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 12px;
}
.home-mode-bar { display: none !important; }
.flow-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #eef1f6;
}
.flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.flow-toolbar-slim {
  justify-content: space-between;
  padding: 8px 14px;
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
}
.flow-toolbar-slim .flow-toolbar-actions,
.flow-toolbar-slim .flow-toolbar-skills {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 4px 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.flow-toolbar-slim .flow-toolbar-actions {
  margin-left: auto;
  padding: 4px 6px;
}
.flow-toolbar-skills {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, 70vw);
}
.flow-skill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.flow-skill-toggle input {
  accent-color: #2563eb;
}
.flow-skill-select {
  min-width: 120px;
  max-width: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  background: #fff;
  color: #0f172a;
}
.flow-skill-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.flow-toolbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.flow-toolbar-left strong {
  font-size: 0.95rem;
}
.flow-toolbar-sub {
  font-size: 0.72rem;
  color: var(--muted);
}
.flow-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.flow-toolbar-hint {
  margin: 0;
  margin-left: auto;
  font-size: 0.72rem;
  color: #94a3b8;
}
.flow-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: grab;
  background-color: #f7f8fa;
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.35) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.flow-viewport:active { cursor: grabbing; }

/* 画布添加菜单仅右键弹出，不再使用常驻侧栏 */
.flow-add-ico {
  width: 18px;
  height: 18px;
  color: #374151;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.flow-add-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

.flow-asset-picker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  width: min(440px, calc(100% - 48px));
  max-height: min(70vh, 480px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e8ecf1;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  padding: 14px;
  animation: uiPopIn 0.18s ease;
}
.flow-asset-picker[hidden] { display: none !important; }
.flow-asset-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 650;
  font-size: 0.95rem;
}
.flow-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.flow-asset-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}
.flow-asset-item:hover { border-color: #94a3b8; }
.flow-asset-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #eef2f7;
}
.flow-asset-item span {
  display: block;
  padding: 6px 8px;
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-media-preview {
  width: 100%;
  max-height: 220px;
  margin: 0;
  border-radius: 10px;
  background: #0f172a;
  display: block;
  object-fit: contain;
}
.flow-media-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.flow-media-thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: #0f172a;
}
.flow-media-thumb-btn.is-video .flow-media-preview {
  pointer-events: none;
  max-height: 260px;
  min-height: 140px;
}
.flow-media-thumb {
  display: block;
  width: 100%;
  max-height: 260px;
  min-height: 140px;
  object-fit: contain;
  background: #0f172a;
}
.flow-media-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  pointer-events: none;
}
.flow-video-count {
  margin: 0 0 8px;
}
.flow-video-count .flow-theme-label {
  margin-bottom: 6px;
}
.flow-video-count.is-adaptive .flow-video-adapt-tip {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted, #8a93a6);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(127, 140, 160, 0.1);
}
.flow-video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 10px;
}
.flow-video-grid .flow-media-clear {
  grid-column: 1 / -1;
  justify-self: end;
}
.flow-video-grid .flow-media-card {
  margin: 0;
}
.flow-note-details {
  margin: 0 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 0 8px 8px;
}
.flow-note-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 2px;
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
  user-select: none;
}
.flow-note-details > summary::-webkit-details-marker {
  display: none;
}
.flow-note-details[open] > summary {
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.flow-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
  will-change: transform;
}
.flow-wires {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: auto;
  z-index: 1;
}
.flow-wire {
  stroke: #64748b;
  stroke-width: 2.5;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.flow-wire.draft {
  stroke: #94a3b8;
  stroke-dasharray: 6 4;
  pointer-events: none;
}
.flow-wire.selected {
  stroke: #ef4444;
  stroke-width: 3.5;
}
.flow-wire-hit {
  stroke: transparent;
  stroke-width: 14;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}
.flow-nodes {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}
.flow-node {
  pointer-events: auto;
}
.flow-node {
  position: absolute;
  background: #fff;
  border: 1px solid #dbe1ea;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  overflow: visible;
  user-select: none;
  min-width: 220px;
  box-sizing: border-box;
}
.flow-node.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 12px 32px rgba(15, 23, 42, 0.12);
}
.flow-node.locked {
  opacity: 0.92;
}
.flow-node.locked .flow-node-head {
  cursor: not-allowed;
}
.flow-lock-badge {
  font-size: 0.68rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 1px 6px;
  margin-right: 4px;
}
.flow-marquee {
  position: absolute;
  z-index: 7;
  border: 1.5px solid rgba(59, 130, 246, 0.9);
  background: rgba(59, 130, 246, 0.12);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.flow-marquee[hidden] { display: none !important; }
.flow-select-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  max-width: calc(100% - 32px);
}
.flow-select-bar[hidden] { display: none !important; }
.flow-select-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  margin-right: 4px;
  white-space: nowrap;
}
.flow-hint-tip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  pointer-events: none;
}
.flow-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  border-left: 3px solid var(--node-accent, #64748b);
  border-radius: 12px 12px 0 0;
  cursor: grab;
}
.flow-node-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: #0f172a;
  cursor: text;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-node-title-edit {
  width: 140px;
  max-width: 58%;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  padding: 2px 6px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  background: #fff;
  outline: none;
}
.flow-node-ico {
  width: 18px;
  height: 18px;
  color: #0f766e;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.flow-node-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}
.flow-node-cat {
  font-size: 0.68rem;
  color: #64748b;
  margin-right: auto;
}
.flow-node-del {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  font-family: inherit;
}
.flow-node-del:hover {
  background: #fee2e2;
  color: #991b1b;
}
.flow-add-item.danger {
  color: #b91c1c;
  font-weight: 600;
}
.flow-node-body {
  padding: 10px 12px 12px;
}
.flow-upstream-box {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  background: #f0fdfa;
}
.flow-upstream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  color: #0f766e;
}
.flow-upstream-hint {
  font-weight: 500;
  color: #5eead4;
  font-size: 0.7rem;
}
.flow-upstream-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}
.flow-upstream-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ccfbf1;
  font-size: 0.74rem;
  color: #334155;
  line-height: 1.4;
  width: 100%;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}
.flow-upstream-chip.is-btn,
.flow-upstream-chip-meta {
  cursor: pointer;
}
.flow-upstream-chip.is-btn:hover,
button.flow-upstream-chip-meta:hover {
  border-color: #5eead4;
  background: #ecfdf5;
}
.flow-upstream-chip.is-img {
  align-items: center;
}
.flow-upstream-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  background: #e2e8f0;
}
.flow-upstream-chip.is-img img,
.flow-upstream-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}
.flow-upstream-chip-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}
.flow-upstream-chip-tag {
  flex-shrink: 0;
  font-weight: 650;
  color: #0f766e;
  white-space: nowrap;
}
.flow-upstream-chip-text {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.flow-try-box {
  margin-bottom: 10px;
  padding: 8px 4px 2px;
}
.flow-doc-empty {
  padding: 18px 12px 22px;
  text-align: center;
  color: #94a3b8;
}
.flow-doc-empty-ico {
  color: #cbd5e1;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}
.flow-doc-empty-ico svg {
  width: 48px;
  height: 36px;
}
.flow-doc-empty p {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
}
.flow-doc-empty span {
  font-size: 0.75rem;
  line-height: 1.4;
  display: block;
}
.flow-doc-editor {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.flow-doc-editor.is-running {
  opacity: 0.72;
}
.flow-doc-input {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 420px;
  border: none;
  resize: vertical;
  padding: 12px 12px 18px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #0f172a;
  background: transparent;
  white-space: pre-wrap;
}
.flow-doc-input:focus {
  outline: none;
}
.flow-doc-resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 55%, #94a3b8 55%, #94a3b8 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, #94a3b8 70%, #94a3b8 78%, transparent 78%);
  opacity: 0.7;
}
.flow-template-picker {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}
.flow-template-picker[hidden] {
  display: none !important;
}
.flow-viewport.is-modal-open .flow-world,
.flow-viewport.is-modal-open .flow-select-bar,
.flow-viewport.is-modal-open .flow-hint-tip,
.flow-viewport.is-modal-open .flow-marquee {
  pointer-events: none !important;
}
body.flow-template-modal-open {
  overflow: hidden;
}
.flow-shell.is-modal-open .flow-viewport,
.flow-shell.is-modal-open .flow-toolbar {
  pointer-events: none;
}
.flow-shell.is-modal-open .flow-template-picker,
.flow-shell.is-modal-open .flow-template-panel {
  pointer-events: auto;
}
.flow-template-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(640px, calc(100vh - 48px));
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  padding: 22px 22px 18px;
  pointer-events: auto;
}
.flow-template-head {
  position: relative;
  margin-bottom: 16px;
  padding-right: 36px;
}
.flow-template-head h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #0f172a;
}
.flow-template-head p {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.5;
}
.flow-template-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.flow-template-close:hover {
  background: #f1f5f9;
  color: #334155;
}
.flow-template-theme {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}
.flow-theme-block {
  min-width: 0;
}
.flow-theme-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}
.flow-theme-select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.84rem;
  color: #0f172a;
}
.flow-theme-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.84rem;
  color: #0f172a;
  box-sizing: border-box;
}
.flow-theme-input[hidden] {
  display: none !important;
}
.flow-theme-custom-eps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: #64748b;
}
.flow-theme-input-num {
  width: 72px;
  margin-top: 0 !important;
  text-align: center;
}
.flow-theme-eps-hint {
  font-size: 0.72rem;
  color: #94a3b8;
}
.flow-theme-custom-eps[hidden] {
  display: none !important;
}
.flow-theme-block-style,
.flow-theme-block-eps {
  min-width: 0;
}
.flow-theme-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-theme-seg-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
}
.flow-theme-seg-btn.on {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.flow-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) {
  .flow-template-theme {
    grid-template-columns: 1fr;
  }
  .flow-template-grid {
    grid-template-columns: 1fr;
  }
}
.flow-template-card {
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px 14px 12px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.flow-template-card:hover {
  border-color: #5eead4;
  background: #f0fdfa;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.flow-template-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.flow-template-card-top strong {
  font-size: 0.95rem;
  color: #0f172a;
}
.flow-template-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 999px;
  padding: 2px 8px;
}
.flow-template-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
}
.flow-dock-auto {
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.flow-dock-auto:hover {
  background: #1e293b;
}
.flow-dock-auto:disabled {
  opacity: 0.55;
  cursor: wait;
}
.flow-dock-auto[hidden] {
  display: none !important;
}
.flow-text-dock {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 12px 14px 10px;
  pointer-events: auto;
  box-sizing: border-box;
}
.flow-text-dock[hidden] {
  display: none !important;
}
.flow-text-dock.is-running {
  border-color: #99f6e4;
}
.flow-dock-progress {
  margin: 0 0 10px;
}
.flow-dock-progress .flow-progress-bar {
  margin-top: 0;
}
.flow-dock-progress[hidden] {
  display: none !important;
}
.flow-dock-input {
  width: 100%;
  border: none;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #0f172a;
  background: transparent;
  padding: 0 28px 8px 2px;
}
.flow-dock-input:focus {
  outline: none;
}
.flow-dock-input::placeholder {
  color: #94a3b8;
}
.flow-dock-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.flow-dock-theme {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1.35fr);
  gap: 10px 12px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}
.flow-dock-theme[hidden] {
  display: none !important;
}
.flow-text-dock.has-theme {
  min-width: 540px;
}
.flow-dock-theme .flow-theme-block {
  gap: 4px;
}
.flow-dock-theme .flow-theme-label {
  font-size: 0.72rem;
}
.flow-dock-theme .flow-theme-select,
.flow-dock-theme .flow-theme-input {
  min-height: 30px;
  font-size: 0.78rem;
}
.flow-dock-theme .flow-theme-seg-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.74rem;
}
.flow-dock-theme .flow-theme-custom-eps {
  margin-top: 8px;
  font-size: 0.74rem;
}
.flow-dock-theme .flow-theme-input-num {
  width: 52px;
  min-height: 28px;
}
@media (max-width: 640px) {
  .flow-dock-theme {
    grid-template-columns: 1fr;
  }
}
.flow-dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-dock-tool {
  min-width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}
.flow-dock-tool:hover {
  background: #f8fafc;
}
.flow-dock-ref {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 650;
}
.flow-dock-ref.has-refs {
  background: #ecfdf5;
  color: #0f766e;
}
.flow-dock-send {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
}
.flow-dock-send:hover {
  background: #000;
}
.flow-dock-send:disabled,
.flow-dock-send.is-busy {
  opacity: 0.6;
  cursor: wait;
}
.flow-dock-send svg {
  width: 16px;
  height: 16px;
}
.flow-try-illus {
  color: #cbd5e1;
  margin-bottom: 6px;
}
.flow-try-illus svg {
  width: 48px;
  height: 36px;
  display: block;
}
.flow-try-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 6px;
}
.flow-try-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flow-try-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  color: #1f2937;
}
.flow-try-item:hover {
  background: #f3f4f6;
}
.flow-composer {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flow-composer.is-expanded .flow-composer-input {
  min-height: 180px;
}
.flow-composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.flow-composer-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
}
.flow-composer-icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.flow-composer-icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.flow-composer-icon-btn svg {
  width: 16px;
  height: 16px;
}
.flow-composer-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  min-height: 88px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #0f172a;
  padding: 2px 0 4px;
}
.flow-composer-input:focus {
  outline: none;
}
.flow-composer-input::placeholder {
  color: #94a3b8;
}
.flow-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.flow-composer-meta {
  min-height: 28px;
  display: flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.78rem;
}
.flow-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.flow-composer-tool {
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #334155;
  padding: 0;
}
.flow-composer-tool:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.flow-composer-tool.is-busy {
  opacity: 0.6;
  cursor: wait;
}
.flow-composer-trans {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.flow-composer-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
}
.flow-composer-send:hover {
  background: #000;
}
.flow-composer-send:disabled {
  opacity: 0.55;
  cursor: wait;
}
.flow-composer-send svg {
  width: 16px;
  height: 16px;
}
.flow-node[data-type="prompt"] {
  border-color: #5eead4;
  border-width: 1.5px;
}
.flow-node[data-type="prompt"].selected {
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.28), 0 12px 32px rgba(15, 23, 42, 0.12);
}
.flow-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
  background: #f8fafc;
  color: var(--ink);
  margin-top: 6px;
}
.flow-field:first-child { margin-top: 0; }
.flow-field:focus {
  outline: none;
  border-color: #94a3b8;
  background: #fff;
}
.flow-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-seg-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  color: #475569;
}
.flow-seg-btn.on {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.flow-mini-label {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #64748b;
}
.flow-script-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.flow-gen-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}
.flow-run-bar {
  margin-top: 8px;
}
.flow-node-run { width: 100%; border-radius: 8px !important; }
.flow-composer.is-running {
  border-color: #99f6e4;
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.18), 0 6px 18px rgba(15, 23, 42, 0.05);
}
.flow-composer-status {
  color: #0f766e;
  font-weight: 600;
}
.flow-composer-send.is-busy {
  background: #0f766e;
  cursor: wait;
}
.flow-node.is-running {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25), 0 12px 32px rgba(15, 23, 42, 0.1);
}
.flow-result.is-running {
  border-style: solid;
  border-color: #99f6e4;
  background: #f0fdfa;
  padding: 10px;
}
.flow-result.is-error {
  font-size: 0.78rem;
  color: #b91c1c;
  border-style: dashed;
  border-color: #fecaca;
  background: #fef2f2;
}
.flow-result-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-result-progress-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: #0f766e;
}
.flow-result-progress-text strong {
  font-size: 0.86rem;
}
.flow-result-progress-text span {
  color: #5eead4;
}
.flow-progress-bar {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: #ccfbf1;
  overflow: hidden;
}
.flow-progress-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
  animation: flowProgress 1.1s ease-in-out infinite;
}
.flow-spin {
  width: 16px;
  height: 16px;
  border: 2px solid #99f6e4;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: flowSpin 0.7s linear infinite;
  flex-shrink: 0;
}
.flow-spin-light {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  width: 14px;
  height: 14px;
}
@keyframes flowSpin {
  to { transform: rotate(360deg); }
}
@keyframes flowProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.flow-result {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}
.flow-result.empty {
  font-size: 0.72rem;
  color: #94a3b8;
  border-style: dashed;
}
.flow-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  color: #059669;
  font-weight: 600;
  margin-bottom: 4px;
}
.flow-result-body {
  font-size: 0.75rem;
  color: #334155;
  line-height: 1.45;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.flow-ref-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  min-height: 28px;
}
.flow-result-img {
  display: block;
  margin: 6px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #0f172a;
}
.flow-result-img img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.flow-media-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}
.flow-media-wrap .flow-result-img {
  margin: 0;
}
.flow-media-clear {
  align-self: flex-end;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.76rem;
  color: #64748b;
}
.flow-media-clear:hover {
  color: #0f172a;
}
.flow-ref-chip.img {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-ref-chip.img img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #e2e8f0;
}
.flow-ref-preview .muted {
  font-size: 0.72rem;
  color: #94a3b8;
}
.flow-ports {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  flex-shrink: 0;
  min-width: 0;
}
.flow-ports.is-empty {
  width: 10px;
  min-width: 10px;
  padding: 0;
}
.flow-node-main {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 72px;
}
.flow-node-main .flow-node-body {
  flex: 1;
  min-width: 0;
}
.flow-port-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.68rem;
  color: #94a3b8;
  min-height: 20px;
  white-space: nowrap;
}
.flow-port-row.in { justify-content: flex-start; }
.flow-port-row.out {
  justify-content: flex-end;
  flex-direction: row-reverse;
}
.flow-port {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--node-accent, #64748b);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
  cursor: crosshair;
  padding: 0;
  z-index: 3;
}
/* 扩大可点/可吸附区域，方便随便拖也能连上 */
.flow-port::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
}
.flow-port-row.in .flow-port { left: -6px; }
.flow-port-row.out .flow-port { right: -6px; }
.flow-port-label {
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flow-port-dot { display: none; }
.flow-port.snap-hot {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.flow-add-menu {
  position: fixed;
  z-index: 90;
  min-width: 200px;
  max-height: min(70vh, 440px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 6px;
}
.flow-at-menu {
  position: fixed;
  z-index: 95;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(50vh, 280px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  padding: 6px;
}
.flow-at-menu[hidden] {
  display: none !important;
}
.flow-at-head {
  padding: 6px 10px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}
.flow-at-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #0f172a;
}
.flow-at-item:hover {
  background: #f0fdfa;
}
.flow-at-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.flow-at-ico {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.flow-at-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flow-at-meta strong {
  font-size: 0.84rem;
  font-weight: 700;
}
.flow-at-meta em {
  font-style: normal;
  font-size: 0.72rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-add-menu[hidden] { display: none !important; }
.flow-add-cat {
  font-size: 0.72rem;
  font-weight: 560;
  color: #94a3b8;
  padding: 6px 10px 4px;
  letter-spacing: 0.02em;
}
.flow-ctx-item,
.flow-add-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  color: #111827;
  transition: background 0.1s;
}
.flow-add-item {
  justify-content: flex-start;
  gap: 10px;
}
.flow-ctx-item:hover,
.flow-add-item:hover {
  background: #f3f4f6;
}
.flow-ctx-item:disabled {
  color: #9ca3af;
  cursor: default;
}
.flow-ctx-item:disabled:hover {
  background: transparent;
}
.flow-ctx-item.danger,
.flow-add-item.danger {
  color: #dc2626;
}
.flow-ctx-item.danger:hover,
.flow-add-item.danger:hover {
  background: #fef2f2;
}
.flow-ctx-kbd {
  margin-left: auto;
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 450;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.flow-ctx-back {
  color: #6b7280;
  font-size: 0.84rem;
}
.flow-add-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.flow-add-divider {
  height: 1px;
  background: #eceff3;
  margin: 5px 6px;
}

.create-hero { text-align: center; margin-bottom: 28px; }
.create-hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.create-hero p { margin: 0; color: var(--muted); font-size: 1rem; }
.inspire-kicker {
  margin: 0 0 10px !important;
  font-size: 0.78rem !important;
  font-weight: 650 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  color: #2563eb !important;
}
.inspire-page {
  position: relative;
  overflow: clip;
}
.inspire-atmosphere {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 70%;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 18% 20%, rgba(37, 99, 235, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 40% at 88% 10%, rgba(14, 165, 233, 0.12), transparent 65%),
    radial-gradient(ellipse 40% 35% at 55% 55%, rgba(148, 163, 184, 0.08), transparent 70%);
  animation: inspireDrift 14s ease-in-out infinite alternate;
}
@keyframes inspireDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 8px, 0) scale(1.03); }
}
.inspire-page .classic-create {
  position: relative;
  z-index: 1;
}
.inspire-feed {
  margin: 36px auto 8px;
  max-width: 720px;
  animation: uiFadeIn 0.35s ease 0.05s both;
}
.inspire-feed-head {
  margin-bottom: 14px;
}
.inspire-feed-head h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 650;
}
.inspire-feed-head p {
  margin: 0;
  font-size: 0.84rem;
  color: #64748b;
  transition: color 0.2s;
}
.inspire-feed-head p.flash {
  color: #1d4ed8;
  font-weight: 560;
}
.inspire-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.inspire-tag {
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.inspire-tag:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}
.inspire-tag.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.inspire-ideas {
  display: grid;
  gap: 10px;
}
.inspire-idea {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "tag title cta"
    "tag desc cta";
  gap: 2px 14px;
  width: 100%;
  text-align: left;
  border: 1px solid #e8ecf1;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.inspire-idea:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}
.inspire-idea-tag {
  grid-area: tag;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 650;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: nowrap;
}
.inspire-idea-title {
  grid-area: title;
  font-weight: 650;
  font-size: 0.95rem;
}
.inspire-idea-desc {
  grid-area: desc;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}
.inspire-idea-cta {
  grid-area: cta;
  align-self: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

.pavo-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line);
  overflow: hidden;
  max-width: 100%;
}
.pavo-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f3f4f6;
}
.pavo-tab {
  border: none;
  background: transparent;
  padding: 16px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pavo-tab.active {
  background: #fff;
  color: var(--ink);
  border-radius: 14px 14px 0 0;
}
.tab-ico { font-size: 0.95rem; opacity: 0.7; }
.pavo-pane { padding: 22px 22px 18px; }

.drop-zone {
  border: 1.5px dashed #d1d5db;
  border-radius: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px;
  background: #fafafa;
}
.drop-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.drop-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.drop-hint { margin: 0; font-size: 0.8rem; color: var(--muted); text-align: left; }
.paste-area {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}
.upload-main.panel,
.upload-guide.panel {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.upload-main .upload-drop {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}
.upload-main .upload-script-field {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.upload-main .upload-drop .paste-area,
.upload-main .upload-drop .script-edit {
  flex: 1 1 auto;
  min-height: 360px;
  height: 100%;
}
.upload-main > .edit-hint {
  margin-top: 10px;
  margin-bottom: 0;
}
.upload-main h3,
.upload-guide h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.95rem;
}
.upload-step-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: #0f172a;
}
.upload-step-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e5e7eb;
  color: #4b5563;
  flex: 0 0 auto;
}
.upload-step-check.is-done {
  background: var(--blue);
  color: #fff;
  font-size: 0.7rem;
}
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.upload-drop {
  min-height: 0;
}
.upload-script-field {
  display: block;
  margin: 0;
}
.upload-script-field .k {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}
.upload-field-tip {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.75rem;
}
.upload-drop .paste-area,
.upload-drop .script-edit {
  min-height: 280px;
  background: #fff;
}
.upload-guide-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.65;
}
.upload-guide-steps li + li {
  margin-top: 4px;
}
.upload-guide-steps code {
  font-size: 0.78em;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
}
.upload-flow-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
}
.upload-flow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.upload-flow-step:hover {
  background: #fff;
  color: #334155;
}
.upload-flow-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-flow-num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  background: #e5e7eb;
  color: #64748b;
}
.upload-flow-step.is-done {
  color: #1e40af;
}
.upload-flow-step.is-done .upload-flow-num {
  background: var(--blue);
  color: #fff;
  font-size: 0;
}
.upload-flow-step.is-done .upload-flow-num::after {
  content: "✓";
  font-size: 0.68rem;
}
.upload-flow-step.is-current {
  background: #fff;
  border-color: var(--blue-border);
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.upload-flow-step.is-current .upload-flow-num {
  background: var(--blue);
  color: #fff;
}
.upload-flow-line {
  display: none;
}
.upload-flow-caption {
  margin: 0 0 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
}
.upload-guide-pane[hidden] {
  display: none !important;
}
.upload-guide-pane:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.upload-guide-pane .upload-template-box {
  flex: 0 0 auto;
}
.upload-guide-pane > .edit-hint {
  margin-top: auto;
  margin-bottom: 0;
}
.upload-guide-copy {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #475569;
}
.upload-guide-block {
  margin: 0 0 12px;
}
.upload-guide-block .k {
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
  margin-bottom: 6px;
}
.upload-guide-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.upload-guide-pipeline li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}
.upload-guide-pipeline strong {
  font-size: 0.8rem;
  color: #1e3a8a;
}
.upload-guide-pipeline span {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
}
.upload-template-box {
  margin: 0 0 10px;
}
.upload-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.upload-template-head .k {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
}
.upload-template-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.upload-template-actions .btn.sm {
  padding: 4px 8px;
  font-size: 0.72rem;
}
.upload-template-sample {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 148px;
  overflow: auto;
}
@media (max-width: 900px) {
  .upload-layout {
    grid-template-columns: 1fr;
  }
  .upload-template-sample {
    max-height: 132px;
  }
  .upload-flow-label {
    font-size: 0.72rem;
  }
}

.ai-prompt {
  width: 100%;
  border: 1.5px dashed #d1d5db;
  border-radius: 14px;
  padding: 18px 16px;
  min-height: 200px;
  font: inherit;
  line-height: 1.7;
  resize: vertical;
  background: #fafafa;
}
.ai-prompt:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pavo-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.pavo-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pavo-toolbar-tip {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #64748b;
  min-width: 0;
}
.pavo-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.auto-run-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.auto-run-check input { accent-color: #2563eb; }
.pill-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
}
.pill-btn:hover { background: #f8fafc; }
.pill-btn.active-pill { border-color: var(--blue-border); background: var(--blue-soft); color: #1d4ed8; }
.start-btn {
  min-width: 140px;
  border-radius: 999px !important;
  padding: 10px 22px !important;
}
.start-btn:disabled {
  background: #e5e7eb !important;
  border-color: #e5e7eb !important;
  color: #9ca3af !important;
}

@media (max-width: 900px) {
  .pavo-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .pavo-toolbar-tip {
    order: 3;
  }
  .pavo-toolbar-actions {
    justify-content: space-between;
    width: 100%;
  }
  .pavo-toolbar-actions .start-btn {
    flex: 1 1 auto;
  }
}

.pop-menu[hidden] { display: none !important; }
.pop-menu {
  position: fixed;
  z-index: 90;
  min-width: 220px;
  max-height: min(70dvh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 8px;
  animation: uiPopIn 0.16s ease;
  backdrop-filter: blur(8px);
}
.pop-menu-inner { display: flex; flex-direction: column; gap: 2px; }
.pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background 0.12s;
}
.pop-item:hover, .pop-item.selected { background: #f1f5f9; }
.pop-item.selected { color: #1d4ed8; font-weight: 560; }
.pop-item .ico {
  width: 22px;
  height: 28px;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  flex-shrink: 0;
}
.pop-item .ico.landscape { width: 28px; height: 18px; }
.pop-custom {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  /* iOS：小于 16px 会强制缩放页面，导致弹层错位/无法输入 */
  font-size: 16px;
  background: #fbfcfd;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}
.pop-custom-box {
  padding: 6px 8px 8px;
  /* 保证自定义区可点到，不被祖先 user-select:none 干扰 */
  -webkit-user-select: text;
  user-select: text;
}
.pop-divider {
  height: 1px;
  background: #eef1f5;
  margin: 6px 4px;
}
.pop-custom-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}
.pop-menu.pop-menu-sheet {
  min-width: 0;
  max-width: none;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.16);
}

.preset-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
  color: #475569;
}

.ep-outline-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.55;
}
.ep-outline-list li {
  margin: 0.35rem 0;
  padding: 4px 6px;
  border-radius: 8px;
}
.ep-outline-list li.on {
  background: #eff6ff;
}
.ep-outline-list li strong {
  margin-right: 0.5rem;
}
.ep-outline-list li span {
  color: #64748b;
  font-weight: 400;
}
.ep-outline-list li.pending {
  opacity: 0.75;
}
.ep-outline-list li.pending span {
  color: #b45309;
  font-style: italic;
}
.ep-outline-list li.ready strong {
  color: #15803d;
}

.live-gen-panel {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}
.live-gen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  color: #1e3a8a;
  margin-bottom: 8px;
}
.live-gen-bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 8px;
}
.live-gen-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.live-gen-meta {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 6px;
}
.live-gen-skill {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  font-size: 0.78rem;
  color: #1d4ed8;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
}
.live-gen-skill span {
  color: #64748b;
  font-size: 0.74rem;
}
.live-gen-skill.muted {
  color: #94a3b8;
  background: #f1f5f9;
}
.live-gen-stream {
  margin: 0 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #0b1220;
  color: #e2e8f0;
  overflow: hidden;
}
.live-gen-stream-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  background: #111827;
  font-size: 0.78rem;
}
.live-gen-stream-head strong {
  color: #f8fafc;
  font-weight: 600;
}
.live-gen-stream-head span {
  color: #94a3b8;
  white-space: nowrap;
}
.live-gen-stream-body {
  margin: 0;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.live-gen-stream-think {
  margin: 0;
  padding: 0 10px;
  border-bottom: 1px solid #1f2937;
  font-size: 0.74rem;
  color: #94a3b8;
}
.live-gen-stream-think summary {
  cursor: pointer;
  padding: 6px 0;
}
.live-gen-stream-think pre {
  margin: 0 0 8px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow: auto;
  color: #a5b4fc;
}
.live-gen-now {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 8px;
}
.live-gen-logs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 120px;
  overflow: auto;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}
.live-gen-logs li {
  padding: 2px 0;
  border-top: 1px dashed #e2e8f0;
}
.live-gen-logs li.warn { color: #b45309; }
.live-gen-logs li.error { color: #b91c1c; }

.meta-tags .tag.em { color: #334155; }

.ep-script-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.ep-script-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
.ep-script-tab:disabled {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto !important;
}
.ep-script-tab.active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.ep-script-tab.todo {
  border-style: dashed;
  color: #b45309;
}
.script-ep-panel .script-ep-body {
  display: block;
  margin-top: 12px;
  padding-top: 4px;
}
.script-ep-summary,
.script-ep-script {
  display: block !important;
  width: 100%;
  margin: 0 0 12px;
}
.script-ep-script .script-edit {
  min-height: 320px;
  display: block !important;
  width: 100%;
  visibility: visible !important;
  opacity: 1 !important;
  background: #eef2f7;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.done-pill.warn {
  background: #fef3c7;
  color: #92400e;
}
#scriptEpPanel.ep-flash {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.meta-tags .tag.em { color: #334155; }

.pop-check { margin-left: auto; color: #2563eb; font-weight: 700; }


.job-card-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: stretch;
}
.job-card-wrap .job-card { width: 100%; }
.job-del {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 0.75rem;
  cursor: pointer;
  writing-mode: horizontal-tb;
}
.job-del:hover { background: #fee2e2; }

.project-head-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.project-head-row h1{margin:0}


.episode-list { display: flex; flex-direction: column; gap: 12px; }
.episode-row {
  display: grid;
  grid-template-columns: 36px 100px 1fr auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.episode-row:hover { border-color: var(--blue-border); }
.episode-idx {
  width: 28px; height: 28px; border-radius: 8px;
  background: #f1f5f9; display: grid; place-items: center;
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
}
.episode-thumb {
  width: 100px; aspect-ratio: 9/14; border-radius: 10px; overflow: hidden;
  background: var(--blue-soft); display: grid; place-items: center;
}
.episode-thumb img, .episode-thumb video { width: 100%; height: 100%; object-fit: cover; }
.episode-title { font-weight: 700; margin-bottom: 4px; }
.episode-meta { font-size: 0.8rem; color: var(--muted); }
.episode-actions { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .episode-row { grid-template-columns: 28px 72px 1fr; }
  .episode-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.project-head-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.logs-panel {
  width: min(720px, 100%) !important;
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.logs-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #0b1220, #111827);
  color: #e2e8f0;
  border-radius: 0 0 20px 20px;
  margin: 0;
  padding: 14px 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  max-height: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.log-line { padding: 4px 0; border-bottom: 1px solid rgba(148,163,184,.1); word-break: break-word; }
.log-line.warn { color: #fbbf24; }
.log-line.error { color: #f87171; }
.log-ts { color: #94a3b8; margin-right: 6px; }
.logs-empty { color: #94a3b8; padding: 32px 16px; text-align: center; }

/* ===== Responsive: tablet / phone ===== */
@media (max-width: 700px) {
  /* 手机窄屏：画布改为提示，避免流程编辑器打不开 */
  #viewCanvas .flow-shell {
    display: none !important;
  }
  .canvas-mobile-gate {
    display: grid;
  }
}

@media (max-width: 1024px) {
  .classic-create,
  .create-home.mode-classic .classic-create {
    max-width: 720px;
  }
  .detail-content {
    padding: 16px 18px 24px;
  }
  .works-page,
  .assets-page {
    padding: 22px 16px 60px;
  }
  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  html, body {
    min-height: 100dvh;
  }
  .app-frame {
    grid-template-columns: 1fr;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  .side-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid #e5e7eb;
    background: rgba(247, 247, 248, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 45;
  }
  .side-logo {
    display: none;
  }
  .side-nav-main {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    padding: 0;
  }
  .side-nav-foot {
    flex-direction: row;
    width: auto;
    flex: 0 0 auto;
    padding: 0 2px 0 0;
    gap: 0;
  }
  .side-health {
    display: none;
  }
  .side-item {
    flex: 1;
    min-width: 0;
    padding: 6px 2px;
    gap: 4px;
  }
  .side-nav-foot .side-item {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 6px 8px;
  }
  .side-ico {
    width: 22px;
    height: 22px;
  }
  .side-ico svg {
    width: 20px;
    height: 20px;
  }
  .side-label {
    font-size: 0.62rem;
  }
  .app-main {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }
  .app-content {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
  }
  #viewCanvas {
    height: 100%;
  }
  .project-topbar {
    flex-shrink: 0;
    position: relative;
    z-index: 40;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .project-topbar .stepper {
    order: 2;
    flex: 1 1 100%;
    justify-content: center;
  }
  .create-home {
    padding: 16px 10px 24px;
  }
  .create-home.mode-classic.inspire-page {
    padding: 0 0 calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .classic-create,
  .create-home.mode-classic .classic-create {
    padding: 0 4px 28px;
  }
  .inspire-page {
    overflow: visible;
    max-width: 100%;
  }
  .inspire-page .classic-create,
  .create-home.mode-classic.inspire-page .classic-create {
    padding: 0 12px 32px;
    /* 给 fixed 标题留空，高度与 .create-hero 大致一致 */
    padding-top: 92px;
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: visible;
  }
  .inspire-page .create-hero {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 42;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    border-radius: 0;
    background: rgba(244, 245, 247, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  }
  .inspire-page .create-hero .inspire-kicker {
    margin: 0 0 2px !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.12em !important;
  }
  .inspire-page .create-hero h1 {
    font-size: 1.22rem !important;
    margin: 0 0 2px !important;
    line-height: 1.25;
  }
  .inspire-page .create-hero > p:not(.inspire-kicker) {
    font-size: 0.78rem;
    line-height: 1.35;
  }
  .inspire-page .pavo-card {
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .inspire-page .pavo-pane {
    padding: 14px 12px 12px;
  }
  .inspire-page .ai-prompt,
  .inspire-page .paste-area {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px 12px;
    font-size: 16px;
    line-height: 1.55;
    min-height: 140px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .inspire-page .upload-layout {
    grid-template-columns: 1fr;
  }
  .inspire-page .inspire-feed {
    margin: 22px 0 8px;
    max-width: none;
    width: 100%;
  }
  .create-hero {
    margin-bottom: 18px;
  }
  .create-hero h1 {
    font-size: 1.55rem;
  }
  .create-hero p {
    font-size: 0.92rem;
  }
  .pavo-tab {
    padding: 13px 8px;
    font-size: 0.86rem;
    gap: 5px;
  }
  .pavo-pane {
    padding: 16px 14px 14px;
  }
  .ai-prompt,
  .drop-zone {
    min-height: 160px;
  }
  .pavo-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
  }
  .pavo-pills {
    width: 100%;
  }
  .pavo-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
  .auto-run-check {
    align-self: center;
  }
  .start-btn {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }
  .inspire-feed {
    margin: 28px auto 12px;
  }
  .inspire-tags {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin-right: 0;
    overscroll-behavior-x: contain;
  }
  .inspire-tags::-webkit-scrollbar {
    display: none;
  }
  .inspire-tag {
    flex: 0 0 auto;
  }
  .inspire-idea {
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "tag cta"
      "title title"
      "desc desc";
    padding: 12px 14px;
  }
  .projects-section {
    margin: 20px auto 40px;
    padding: 0 8px 48px;
  }
  .works-page,
  .assets-page {
    padding: 16px 12px 72px;
  }
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .asset-card .body {
    padding: 10px;
  }
  .asset-card .name {
    font-size: 0.9rem;
  }
  .asset-card .desc {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
  }
  .asset-card .thumb-view {
    opacity: 1;
    font-size: 0.68rem;
    padding: 3px 7px;
  }
  .asset-lightbox {
    padding: 8px;
  }
  .asset-lightbox-panel {
    width: 100%;
    max-height: 96vh;
    border-radius: 12px;
  }
  .asset-lightbox-body img {
    max-height: min(62vh, 520px);
  }
  .assets-page-tabs {
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .assets-page-tabs .asset-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .detail-content {
    padding: 12px 12px 16px;
  }
  body.has-footer-bar .detail-content {
    /* 底栏在导航之上：一次留白即可，不再叠加 app-content */
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }
  .project-head {
    margin-bottom: 14px;
    gap: 14px;
  }
  .project-head h1 {
    font-size: 1.18rem;
    line-height: 1.35;
    margin: 0;
  }
  .project-head-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .project-head-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 2px;
  }
  .project-head-actions .btn {
    min-height: 40px;
    width: 100%;
    justify-content: center;
    padding: 8px 6px;
    font-size: 0.8rem;
  }
  .ep-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .ep-count {
    font-size: 0.86rem;
    line-height: 1.4;
  }
  .ep-toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ep-toolbar-actions .btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    font-size: 0.82rem;
  }
  .meta-tags .tag-style {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  .panel {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 14px;
  }
  .panel h3 {
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .intro-grid,
  .intro-grid.edit {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .intro-item {
    padding: 10px 12px;
  }
  .intro-item input,
  .intro-item textarea,
  .script-edit {
    font-size: 16px; /* 避免 iOS 聚焦放大 */
    padding: 11px 12px;
    min-height: 44px;
  }
  .script-edit {
    min-height: 180px;
  }
  .preset-readonly {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
  }
  .live-gen-panel {
    padding: 10px 12px;
  }
  .live-gen-logs {
    max-height: 72px;
  }
  /* 底栏已说明暂停状态，避免重复占高 */
  body.has-footer-bar .running-banner.paused-banner {
    display: none;
  }
  .episode-row {
    grid-template-columns: 28px 72px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .episode-thumb {
    width: 72px;
  }
  .episode-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .episode-actions .btn {
    flex: 1;
    min-height: 40px;
  }
  .asset-toolbar {
    gap: 8px;
  }
  .asset-tab {
    padding: 10px 12px;
    font-size: 0.86rem;
  }
  .create-drawer,
  .ui-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: min(92dvh, 100%);
    max-height: min(92dvh, 100%);
    border-left: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: uiSlideInUp 0.24s ease;
  }
  .create-drawer[hidden],
  .ui-drawer[hidden] {
    display: none !important;
  }
  .drawer-head {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    margin-bottom: 0;
    padding: 16px 16px 12px;
  }
  .drawer-head h2 {
    font-size: 1.05rem;
  }
  .create-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .create-form label {
    font-size: 0.84rem;
    margin-bottom: 14px;
  }
  .create-form input:not([type="file"]):not([type="checkbox"]),
  .create-form select,
  .create-form textarea {
    font-size: 16px; /* 避免 iOS 聚焦自动放大 */
    padding: 12px 14px;
    border-radius: 12px;
  }
  .create-form .row {
    grid-template-columns: 1fr;
  }
  .check-row {
    gap: 10px;
    min-height: 44px;
    align-items: flex-start;
    padding: 4px 0;
  }
  .check-row input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 2px !important;
    flex-shrink: 0;
  }
  .settings-block {
    margin-top: 12px;
    padding-top: 14px;
  }
  .settings-block h3 {
    font-size: 0.95rem;
  }
  .settings-hint {
    font-size: 0.8rem;
  }
  .skills-manage {
    padding: 12px;
    margin: 12px 0;
  }
  .skill-upload-zone {
    padding: 14px;
    gap: 10px;
  }
  .skill-upload-text strong {
    font-size: 0.92rem;
  }
  .skill-upload-text small {
    font-size: 0.72rem;
  }
  .btn-row {
    position: sticky;
    bottom: 0;
    margin: 8px 0 0;
    padding-top: 10px;
    background: linear-gradient(180deg, transparent, #fff 28%);
  }
  .btn-row .btn {
    min-height: 46px;
    font-size: 1rem;
  }
  body.drawer-open {
    overflow: hidden;
    touch-action: none;
  }
  .footer-bar {
    left: 10px;
    right: 10px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    transform: none;
    min-width: 0;
    width: auto;
    border-radius: 16px;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    max-height: none;
  }
  .back-top-fab {
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    width: 42px;
    height: 42px;
  }
  body.has-footer-bar .back-top-fab {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }
  .footer-msg {
    font-size: 0.76rem;
    line-height: 1.35;
    margin: 0;
    flex: 1 1 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }
  .footer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .footer-actions .btn {
    min-height: 40px;
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.86rem;
  }
  .footer-actions .btn[hidden] {
    display: none !important;
  }
  .footer-actions:has(.btn[hidden]) {
    grid-template-columns: 1fr;
  }
  body:has(#footerBar:not([hidden])) {
    /* 底部空隙交给 .detail-content，避免 body + 内容区双重留白 */
    padding-bottom: 0;
  }
  .flow-toolbar {
    padding: 8px 10px;
  }
  .flow-hint-tip {
    font-size: 0.72rem;
    padding: 0 10px;
  }
  .pop-menu {
    max-width: calc(100vw - 24px);
    max-height: min(55dvh, 380px);
    z-index: 120;
  }
  .pop-menu.pop-menu-sheet {
    max-height: min(48dvh, 360px);
  }
  .pop-custom,
  .flow-theme-input,
  .flow-theme-input-num,
  .flow-theme-select {
    font-size: 16px;
  }
  .placeholder-view {
    margin: 48px auto;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .side-label {
    font-size: 0.58rem;
  }
  .create-hero h1 {
    font-size: 1.35rem;
  }
  .pavo-tab {
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
    padding: 12px 6px;
  }
  .drop-actions {
    flex-direction: column;
    width: 100%;
  }
  .drop-actions .btn {
    width: 100%;
  }
  .pill-btn {
    padding: 7px 11px;
    font-size: 0.8rem;
  }
  .job-card-wrap,
  .project-card-wrap {
    grid-template-columns: 1fr;
  }
  .project-card-wrap {
    display: block;
  }
  .project-card-more {
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
  }
  .job-del {
    writing-mode: horizontal-tb;
    padding: 8px 10px;
  }
  .project-head h1 {
    font-size: 1.08rem;
  }
  .project-head-actions .btn {
    min-height: 42px;
    font-size: 0.78rem;
    padding: 8px 4px;
  }
  .detail-content {
    padding-left: 10px;
    padding-right: 10px;
  }
  .ep-outline-list li {
    padding: 10px;
  }
  .script-ep-panel .script-edit {
    min-height: 160px;
  }
}

.sb-import-panel {
  width: min(720px, 94vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
}
.sb-import-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}
.sb-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-import-gen {
  margin-top: 4px;
}
#sbImportText {
  min-height: 280px;
  width: 100%;
}
