:root,
[data-theme="dark"] {
  --bg: #050508;
  --bg-elevated: #0c0c12;
  --card: #111118;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.15);
  --accent-glow: rgba(139, 92, 246, 0.35);
  --gold: #fbbf24;
  --warn: #fb923c;
  --ok: #4ade80;
  --error: #f87171;
  --promo-bg: linear-gradient(90deg, #5b21b6, #7c3aed);
  --hero-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.25), transparent);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --text: #18181b;
  --text-muted: #52525b;
  --text-dim: #a1a1aa;
  --accent-soft: rgba(139, 92, 246, 0.1);
  --accent-glow: rgba(139, 92, 246, 0.2);
  --promo-bg: linear-gradient(90deg, #6d28d9, #8b5cf6);
  --hero-glow: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.12), transparent);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.navbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  width: 100%;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.navbar__logo {
  font-size: 1.25rem;
}

.nav-logo {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.navbar__nav {
  display: flex;
  gap: 8px;
  flex: 1;
}

.navbar__link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

.navbar__link:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.navbar__link--active {
  color: var(--text);
  font-weight: 600;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-ghost {
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.navbar__actions a.btn-ghost,
.navbar__actions button.btn-ghost#nav-logout {
  width: auto;
  height: auto;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Hero */
.hero {
  text-align: center;
  padding: 40px 20px 32px;
  background: var(--hero-glow);
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.hero__pill:hover {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.hero__pill[hidden] {
  display: none !important;
}

.hero__pill-emoji {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.hero__pill-text {
  white-space: nowrap;
}

.hero__pill-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.hero__pill:hover .hero__pill-arrow {
  background: var(--accent-soft);
  color: var(--accent);
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0 auto 8px;
  max-width: none;
  color: var(--text-muted);
  font-size: clamp(0.72rem, 1.55vw, 1rem);
  white-space: nowrap;
}

.hero__lead strong,
.hero__highlight {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 52%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.hero__highlight {
  margin: 10px auto 8px;
  max-width: 640px;
}

.hero__sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Workspace */
.workspace {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card--input,
.card--result {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Mode tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.mode-tabs--main {
  grid-template-columns: 1fr 1fr 1fr;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
}

.mode-tab {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-tab--active {
  background: var(--accent);
  color: #fff;
}

.mode-tab--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Free tools workspace — 与生图区共用 workspace-grid 布局 */
#generate-workspace[hidden],
#tools-workspace[hidden] {
  display: none !important;
}

.tools-panel .tools-subtabs {
  margin-bottom: 18px;
  max-width: none;
}

.tools-subtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 360px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tools-subtab {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tools-subtab--active {
  background: var(--accent);
  color: #fff;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.tools-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.tools-panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.tools-panel__desc {
  margin: 0 0 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 52%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.tools-field {
  margin-bottom: 16px;
}

.tools-field--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tools-field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tools-field--row .tools-field__label {
  margin-bottom: 0;
}

.tools-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.tools-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.tools-field input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
}

.tools-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.tools-textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.tools-textarea:focus,
.tools-select:focus {
  outline: none;
  border-color: var(--accent);
}

.tools-merge-tiles {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-sm);
  transition: background 0.15s, box-shadow 0.15s;
}

.tools-merge-tiles--drag {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.tools-merge-tiles[data-slots="1"] {
  grid-template-columns: 96px;
}

.tools-merge-tiles[data-slots="2"] {
  grid-template-columns: repeat(2, 96px);
}

.tools-merge-tiles[data-slots="3"],
.tools-merge-tiles[data-slots="4"] {
  grid-template-columns: repeat(2, minmax(84px, 1fr));
  width: 100%;
}

.tools-merge-tiles[data-slots="5"],
.tools-merge-tiles[data-slots="6"] {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  width: 100%;
}

.tools-merge-tiles[data-slots="7"],
.tools-merge-tiles[data-slots="8"],
.tools-merge-tiles[data-slots="9"] {
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  width: 100%;
}

.tools-merge-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tools-merge-tile--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tools-merge-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tools-merge-tile__rm {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.tools-merge-tile__rm:hover {
  background: rgba(220, 38, 38, 0.85);
}

.tools-merge-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tools-merge-add span:first-child {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}

.tools-merge-add__sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tools-merge-add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.tools-text-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 140px;
  margin-bottom: 16px;
  padding: 16px;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tools-text-drop--drag,
.tools-text-drop:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tools-text-drop--has-img {
  min-height: 180px;
  padding: 8px;
}

.tools-text-drop__thumb {
  max-width: 100%;
  max-height: 120px;
  border-radius: 6px;
  object-fit: contain;
}

.tools-text-drop__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.tools-text-drop__sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tools-text-drop--has-img .tools-text-drop__label,
.tools-text-drop--has-img .tools-text-drop__sub {
  display: none;
}

.tools-fill-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tools-fill-chip {
  flex: 1;
  min-width: 80px;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tools-fill-chip--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tools-reset-pos {
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.tools-text-layers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.tools-text-layers-empty {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.tools-text-layers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.tools-text-layer {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.tools-text-layer__btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tools-text-layer__btn:hover {
  border-color: var(--accent);
}

.tools-text-layer--active .tools-text-layer__btn {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.tools-text-layer__idx {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--accent);
}

.tools-text-layer__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-text-layer__rm {
  flex-shrink: 0;
  width: 36px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tools-text-layer__rm:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.tools-text-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.tools-text-stage canvas {
  display: block;
  max-width: 100%;
  border-radius: 6px;
}

.tools-text-overlay {
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  touch-action: none;
}

.tools-text-overlay--dragging {
  cursor: grabbing;
}

.tools-text-overlay--rotate {
  cursor: crosshair;
}

.tools-status {
  margin-top: 8px;
  margin-bottom: 0;
}

.tools-preview-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.tools-preview-card__title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.tools-preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--card-border);
  overflow: auto;
}

.tools-preview-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
}

#tools-canvas {
  display: block;
  max-width: 100%;
  border-radius: 6px;
}

.tools-download {
  width: 100%;
}

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tools-preview-wrap {
    min-height: 240px;
  }
}

@media (max-width: 720px) {
  .mode-tabs--main {
    grid-template-columns: 1fr;
  }
}

/* Reference images — Nano Banana style panel */
.field-group--ref {
  margin-bottom: 18px;
}

.ref-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ref-panel__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.ref-panel__count {
  font-weight: 500;
  color: var(--text-muted);
}

.ref-panel__body {
  border: 2px dashed color-mix(in srgb, var(--text-dim) 55%, var(--card-border));
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 14px;
  min-height: 128px;
  transition: border-color 0.15s, background 0.15s;
}

.ref-panel__body--dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.ref-panel__tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.ref-tile {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a12;
}

.ref-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-tile__size {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.ref-tile__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ref-tile__remove:hover {
  background: rgba(220, 38, 38, 0.88);
}

.ref-tile--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed color-mix(in srgb, var(--text-dim) 50%, var(--card-border));
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ref-tile--add:hover {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.ref-tile--add__icon {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-dim);
}

.ref-tile--add__label {
  font-size: 0.72rem;
  font-weight: 600;
}

.ref-tile--add__sub {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.ref-panel__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.ref-panel__add-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ref-panel__add-more:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--card-border));
}

.ref-panel__tip {
  margin: 10px 0 0;
  color: #34d399;
  font-size: 0.78rem;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.field-group {
  margin-bottom: 18px;
}

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

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-weight: 400;
  color: var(--text-dim);
}

.field-note {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.field-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

textarea,
.input-number {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus,
.input-number:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-number {
  max-width: 120px;
}

/* Examples */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.examples-hint {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
}

.example-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  min-height: 42px;
  border: 1.5px solid var(--example-border, var(--card-border));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.example-btn:hover {
  background: color-mix(in srgb, var(--example-border, var(--accent)) 14%, transparent);
  transform: translateY(-1px);
}

.example-btn__emoji {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}

.example-btn__title {
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Aspect ratio grid (ref. nano banana layout) */
.aspect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.aspect-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 9px 8px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.aspect-chip:hover {
  border-color: rgba(139, 92, 246, 0.45);
  color: var(--text);
}

.aspect-chip--active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0a0f;
  box-shadow: 0 0 16px var(--accent-glow);
}

.aspect-chip__icon {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.aspect-chip__icon--auto svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.aspect-chip__label {
  line-height: 1;
  flex: 0 0 auto;
}

/* Quality row */
.quality-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quality-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 12px 8px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.quality-chip__main {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: inherit;
}

.quality-chip__sub {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--gold);
  opacity: 0.9;
}

.quality-chip--active .quality-chip__sub {
  color: rgba(10, 10, 15, 0.72);
  opacity: 1;
}

.quality-chip:hover {
  border-color: rgba(139, 92, 246, 0.45);
  color: var(--text);
}

.quality-chip--active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0a0a0f;
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Generate CTA */
.generate-cta {
  margin-top: 8px;
}

.btn-generate__icon[hidden] {
  display: none;
}

/* Generate button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-generate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-generate__icon {
  font-size: 1.1rem;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.status[hidden] {
  display: none !important;
  margin: 0;
  min-height: 0;
}

.status--error {
  color: var(--error);
}

/* Result panel */
.result-head {
  margin-bottom: 16px;
}

.result-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.result-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.result-hint__warn {
  color: var(--warn);
}

.result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 14px;
}

.preview-stage {
  position: relative;
  flex: 1;
  min-height: 380px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 45%,
    rgba(139, 92, 246, 0.04) 100%
  );
  overflow: hidden;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 14px 16px 16px;
  overflow: hidden;
}

.preview-placeholder--img2img {
  padding: 6px;
  gap: 0;
  justify-content: stretch;
}

.preview-showcase {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius);
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.preview-placeholder--img2img .preview-showcase,
.preview-placeholder--text2img .preview-showcase {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-sm);
}

.preview-placeholder--text2img {
  padding: 6px;
  gap: 0;
  justify-content: stretch;
}

.preview-placeholder__title[hidden],
.preview-placeholder__sub[hidden] {
  display: none;
}

.preview-showcase__bg {
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 180deg at 50% 50%,
    rgba(139, 92, 246, 0.14),
    rgba(59, 130, 246, 0.1),
    rgba(6, 182, 212, 0.08),
    rgba(139, 92, 246, 0.14)
  );
  animation: preview-showcase-spin 16s linear infinite;
  opacity: 0.9;
}

.preview-showcase__scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(139, 92, 246, 0.05) 45%,
    rgba(139, 92, 246, 0.16) 50%,
    rgba(139, 92, 246, 0.05) 55%,
    transparent 100%
  );
  background-size: 100% 240%;
  animation: preview-showcase-scan 3.6s ease-in-out infinite;
  pointer-events: none;
}

.preview-showcase__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 20%, transparent 75%);
  pointer-events: none;
}

@keyframes preview-showcase-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes preview-showcase-scan {
  0%,
  100% {
    background-position: 0 -90%;
  }
  50% {
    background-position: 0 90%;
  }
}

.preview-flow {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  flex: 1;
  gap: 14px;
  min-height: 100%;
  padding: 18px 20px 16px;
}

.preview-flow[hidden] {
  display: none;
}

.preview-flow__header {
  flex-shrink: 0;
}

.preview-flow__brand {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(139, 92, 246, 0.28);
  border: 1px solid rgba(139, 92, 246, 0.45);
  animation: preview-chip-glow 2.6s ease-in-out infinite;
}

.preview-flow__tagline {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.preview-flow--img2img {
  position: relative;
  gap: 8px;
  padding: 12px 14px 14px;
  justify-content: flex-start;
  flex: 1;
  min-height: 100%;
  overflow: hidden;
}

.preview-flow__ambience {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.preview-flow__particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.75);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
  left: calc(8% + var(--i) * 7.5%);
  top: calc(12% + var(--i) * 6.5%);
  animation: flow-particle-drift 5s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.45s);
  opacity: 0;
}

.preview-flow__particle:nth-child(3n) {
  background: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.45);
}

.preview-flow__particle:nth-child(3n + 1) {
  background: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.preview-flow__particle:nth-child(4n) {
  width: 3px;
  height: 3px;
}

@keyframes flow-particle-drift {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.85;
  }
  50% {
    transform: translate(calc(-12px + var(--i) * 2px), calc(-28px - var(--i) * 1.5px)) scale(1);
    opacity: 0.55;
  }
  85% {
    opacity: 0.75;
  }
  100% {
    transform: translate(calc(8px + var(--i) * 1px), calc(-52px - var(--i) * 2px)) scale(0.5);
    opacity: 0;
  }
}

.preview-flow--img2img .preview-flow__header,
.preview-flow--img2img .preview-flow__hero,
.preview-flow--img2img .preview-flow__fork-zone {
  position: relative;
  z-index: 1;
}

.preview-flow__header--compact .preview-flow__tagline {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.preview-flow--img2img .preview-flow__tagline,
.preview-flow--img2img .preview-path__hint,
.preview-flow--text2img .preview-flow__tagline,
.preview-flow--text2img .preview-flow__t2i-hint {
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.4;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 52%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #f59e0b;
  filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.35));
}

.preview-flow--img2img .preview-path__hint,
.preview-flow--text2img .preview-flow__t2i-hint {
  font-size: 0.66rem;
}

.preview-flow__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 6px 0 2px;
}

.preview-flow__hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: clamp(72px, 22%, 96px);
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 24, 0.75);
  animation: hero-card-float 3.2s ease-in-out infinite;
}

.preview-flow__hero-card--draft {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(17, 17, 24, 0.88));
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
  animation-delay: 0.4s;
}

@keyframes hero-card-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.preview-flow__hero-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.preview-flow__hero-res {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
}

.preview-flow__hero-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
}

.preview-flow__hero-cost {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
}

.preview-flow__hero-gift {
  display: block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1.35;
  color: #34d399;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  white-space: nowrap;
  animation: hero-gift-glow 2.4s ease-in-out infinite;
}

@keyframes hero-gift-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(52, 211, 153, 0);
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
    transform: scale(1.04);
    opacity: 1;
  }
}

.preview-flow__hero-beam {
  position: relative;
  flex: 1;
  max-width: 72px;
  height: 3px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.2), rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2));
  border-radius: 999px;
  overflow: visible;
}

.preview-flow__hero-beam-dot {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: translate(-50%, -50%);
  animation: hero-beam-run 1.6s ease-in-out infinite;
}

.preview-flow__hero-beam-dot--2 {
  animation-delay: 0.35s;
  width: 5px;
  height: 5px;
  opacity: 0.7;
}

.preview-flow__hero-beam-dot--3 {
  animation-delay: 0.7s;
  width: 4px;
  height: 4px;
  opacity: 0.5;
}

@keyframes hero-beam-run {
  0% {
    left: 0;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0.2;
  }
}

.preview-flow__fork-zone {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-flow__rays {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.preview-flow__ray {
  stroke: url(#preview-ray-grad);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 5 7;
  opacity: 0.55;
  animation: preview-ray-dash 2s linear infinite;
  animation-delay: calc(var(--ray-i, 0) * 0.4s);
}

.preview-flow__ray--free {
  stroke: rgba(52, 211, 153, 0.6);
  stroke-width: 2;
  stroke-dasharray: 4 6;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.35));
}

.preview-flow__ray-dot--free {
  filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.9));
}

@keyframes preview-ray-dash {
  0% {
    stroke-dashoffset: 24;
    opacity: 0.35;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.35;
  }
}

.preview-flow__ray-dot {
  filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.9));
  opacity: 0.9;
}

.preview-flow__fork-hub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 0 4px;
  z-index: 1;
}

.preview-flow__fork-line {
  width: 2px;
  height: 14px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0.1));
}

.preview-flow__fork-ring {
  width: 10px;
  height: 10px;
  margin: 2px 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 0 16px var(--accent-glow);
  animation: fork-ring-pulse 2s ease-in-out infinite;
}

@keyframes fork-ring-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 0 12px var(--accent-glow);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.08), 0 0 22px var(--accent-glow);
  }
}

.preview-flow__fork-label {
  display: none;
}

.preview-flow__paths {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
  align-content: stretch;
  position: relative;
  z-index: 1;
}

.preview-path {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 17, 24, 0.78);
  overflow: hidden;
  text-align: center;
  animation: path-spotlight 6s ease-in-out infinite;
  animation-delay: calc(var(--path-i, 0) * 1.5s);
  transition: transform 0.25s ease;
}

.preview-path:hover {
  transform: translateY(-3px) scale(1.02);
}

@keyframes path-spotlight {
  0%,
  20%,
  100% {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }
  8%,
  16% {
    border-color: var(--path-glow, rgba(139, 92, 246, 0.55));
    box-shadow: 0 0 22px var(--path-shadow, rgba(139, 92, 246, 0.22));
  }
}

.preview-path--refine {
  --path-glow: rgba(52, 211, 153, 0.65);
  --path-shadow: rgba(52, 211, 153, 0.28);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.14), rgba(59, 130, 246, 0.08), rgba(17, 17, 24, 0.85));
}

.preview-path--featured {
  animation: path-spotlight-featured 5s ease-in-out infinite;
}

@keyframes path-spotlight-featured {
  0%,
  100% {
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.12);
  }
  50% {
    border-color: rgba(52, 211, 153, 0.75);
    box-shadow: 0 0 28px rgba(52, 211, 153, 0.28);
  }
}

.preview-path__free-ribbon {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.55);
  animation: free-ribbon-pop 2.6s ease-in-out infinite;
}

@keyframes free-ribbon-pop {
  0%,
  100% {
    transform: scale(0.92);
  }
  50% {
    transform: scale(1.12);
  }
}

.preview-path--tune {
  --path-glow: rgba(139, 92, 246, 0.6);
  --path-shadow: rgba(139, 92, 246, 0.25);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.14), rgba(17, 17, 24, 0.85));
}

.preview-path--upscale {
  --path-glow: rgba(6, 182, 212, 0.55);
  --path-shadow: rgba(6, 182, 212, 0.2);
  background: linear-gradient(160deg, rgba(6, 182, 212, 0.1), rgba(17, 17, 24, 0.85));
}

.preview-path--keep {
  --path-glow: rgba(52, 211, 153, 0.55);
  --path-shadow: rgba(52, 211, 153, 0.2);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.1), rgba(17, 17, 24, 0.85));
}

.preview-path__node-glow {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--path-glow, rgba(139, 92, 246, 0.8));
  box-shadow: 0 0 10px var(--path-shadow, rgba(139, 92, 246, 0.5));
  animation: path-node-pulse 2.4s ease-in-out infinite;
  animation-delay: calc(var(--path-i, 0) * 0.5s);
  pointer-events: none;
}

@keyframes path-node-pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.preview-path__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.07) 50%,
    transparent 65%
  );
  background-size: 220% 100%;
  animation: path-shine-sweep 3.5s ease-in-out infinite;
  animation-delay: calc(var(--path-i, 0) * 0.6s);
  pointer-events: none;
}

@keyframes path-shine-sweep {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -130% 0;
  }
}

.preview-path__icon {
  font-size: 1.35rem;
  line-height: 1;
  animation: path-icon-spin 4s ease-in-out infinite;
  animation-delay: calc(var(--path-i, 0) * 0.5s);
}

.preview-path--refine .preview-path__icon {
  animation-name: path-icon-spin;
}

.preview-path--keep .preview-path__icon {
  animation-name: path-icon-pop;
}

@keyframes path-icon-spin {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
}

@keyframes path-icon-pop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.preview-path--tune .preview-path__icon,
.preview-path--upscale .preview-path__icon {
  animation-name: path-icon-bob;
}

@keyframes path-icon-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.preview-path__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.preview-path__hint {
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.preview-path__badge {
  margin-top: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.preview-path__badge--free {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

.preview-path__badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
}

.preview-path__badge--pulse {
  animation: badge-free-pulse 2.2s ease-in-out infinite;
}

@keyframes badge-free-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(52, 211, 153, 0);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
  }
}

.preview-path__badge--then {
  padding: 2px 7px;
  font-size: 0.56rem;
  font-weight: 600;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 999px;
  animation: badge-then-fade 2.2s ease-in-out infinite;
  animation-delay: 0.6s;
}

@keyframes badge-then-fade {
  0%,
  35%,
  100% {
    opacity: 0.7;
  }
  55%,
  75% {
    opacity: 1;
  }
}

.preview-path__chips {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.preview-path__chips span {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.22);
  animation: path-chip-pulse 2.4s ease-in-out infinite;
}

.preview-path__chips span:last-child {
  animation-delay: 0.35s;
}

@keyframes path-chip-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.preview-flow__visual {
  position: relative;
  width: clamp(64px, 16vw, 88px);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.preview-flow__visual--ref {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(17, 17, 24, 0.9));
}

.preview-flow__visual--draft {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(17, 17, 24, 0.85));
}

.preview-flow__visual--2k {
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.35), rgba(17, 17, 24, 0.85));
}

.preview-flow__visual--4k {
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.3), rgba(17, 17, 24, 0.85));
}

.preview-flow__visual-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.preview-flow__visual-tag {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
}

.preview-flow__visual-res {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.preview-flow__visual--2k .preview-flow__visual-res {
  color: #93c5fd;
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
}

.preview-flow__visual--4k .preview-flow__visual-res {
  color: #67e8f9;
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.preview-flow__visual-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(139, 92, 246, 0.2) 50%,
    transparent 70%
  );
  background-size: 100% 200%;
  animation: preview-showcase-scan 2.4s ease-in-out infinite;
}

.preview-flow__label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.preview-flow__meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.preview-flow__meta--gold {
  color: var(--gold);
  font-weight: 600;
}

.preview-flow__loop-badge {
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(139, 92, 246, 0.35);
  animation: preview-loop-fade 2.8s ease-in-out infinite;
}

@keyframes preview-loop-fade {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.preview-flow__link {
  position: relative;
  flex: 0 0 clamp(20px, 4vw, 36px);
  height: 2px;
  align-self: center;
  margin-top: -28px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.55), transparent);
}

.preview-flow__link--wide {
  flex-basis: clamp(16px, 3vw, 28px);
}

.preview-flow__link--tall {
  flex: 0 0 auto;
  width: 2px;
  height: clamp(24px, 5vh, 40px);
  margin: 0 auto;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.55), transparent);
}

.preview-flow__pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: translate(-50%, -50%);
  animation: preview-arrow-flow 1.8s ease-in-out infinite;
}

.preview-flow__link--tall .preview-flow__pulse {
  top: 0;
  left: 50%;
  animation-name: preview-arrow-flow-v;
}

.preview-flow__pulse--delay {
  animation-delay: 0.55s;
}

@keyframes preview-arrow-flow {
  0% {
    left: 0;
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0.25;
  }
}

@keyframes preview-arrow-flow-v {
  0% {
    top: 0;
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0.25;
  }
}

.preview-flow__fork {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-flow__fork-or {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: -24px;
}

.preview-flow__features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.preview-flow__features li {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-flow__features--compact li {
  font-size: 0.7rem;
  padding: 5px 10px;
}

.preview-flow__check {
  color: var(--accent);
  font-weight: 700;
}

@keyframes preview-chip-glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(139, 92, 246, 0);
  }
  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  }
}

.preview-flow--text2img {
  position: relative;
  flex: 1;
  min-height: 100%;
  gap: 8px;
  padding: 12px 14px 14px;
  overflow: hidden;
}

.preview-flow--text2img .preview-flow__header,
.preview-flow--text2img .preview-flow__t2i-steps {
  position: relative;
  z-index: 1;
}

.preview-flow__ambience--soft .preview-flow__particle {
  animation-duration: 6s;
}

.preview-flow__t2i-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}

.preview-flow__t2i-step {
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 17, 24, 0.55);
}

.preview-flow__t2i-step--output {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-flow__t2i-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.preview-flow__t2i-num {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  animation: t2i-num-glow 2.8s ease-in-out infinite;
}

.preview-flow__t2i-step:nth-child(1) .preview-flow__t2i-num {
  animation-delay: 0s;
}

.preview-flow__t2i-steps > .preview-flow__t2i-step:nth-child(3) .preview-flow__t2i-num {
  animation-delay: 0.4s;
}

.preview-flow__t2i-steps > .preview-flow__t2i-step:nth-child(5) .preview-flow__t2i-num {
  animation-delay: 0.8s;
}

@keyframes t2i-num-glow {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.55);
    transform: scale(1.08);
  }
}

.preview-flow__t2i-step-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.preview-flow__t2i-step .preview-flow__prompt-bar {
  width: 100%;
  margin-bottom: 6px;
}

.preview-flow__t2i-hint {
  margin: 0;
  text-align: left;
}

.preview-flow__t2i-vlink {
  position: relative;
  flex-shrink: 0;
  height: 18px;
  width: 2px;
  margin: 2px auto;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.45), rgba(139, 92, 246, 0.1));
}

.preview-flow__t2i-vlink-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translate(-50%, -50%);
  animation: preview-arrow-flow-v 1.8s ease-in-out infinite;
}

.preview-flow__t2i-quality {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.preview-flow__t2i-q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  animation: t2i-q-spotlight 4.5s ease-in-out infinite;
  animation-delay: calc(var(--q-i, 0) * 1.5s);
}

.preview-flow__t2i-q--1k {
  --q-glow: rgba(139, 92, 246, 0.45);
}

.preview-flow__t2i-q--2k {
  --q-glow: rgba(96, 165, 250, 0.5);
}

.preview-flow__t2i-q--4k {
  --q-glow: rgba(6, 182, 212, 0.5);
}

@keyframes t2i-q-spotlight {
  0%,
  22%,
  100% {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: translateY(0);
  }
  6%,
  16% {
    border-color: var(--q-glow, rgba(139, 92, 246, 0.5));
    box-shadow: 0 0 18px var(--q-glow, rgba(139, 92, 246, 0.25));
    transform: translateY(-2px);
  }
}

.preview-flow__t2i-q-res {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.preview-flow__t2i-q--2k .preview-flow__t2i-q-res {
  color: #93c5fd;
}

.preview-flow__t2i-q--4k .preview-flow__t2i-q-res {
  color: #67e8f9;
}

.preview-flow__t2i-q-tier {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.preview-flow__t2i-q-pts {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
}

.preview-flow__t2i-step--output .preview-flow__frame-mock {
  flex: 1;
  min-height: 80px;
  width: 100%;
  margin-bottom: 6px;
}

.preview-flow__frame-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.08em;
  pointer-events: none;
}

.preview-flow__text2img-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  width: 100%;
  padding: 4px 8px;
}

.preview-flow__prompt-panel {
  width: min(100%, 320px);
}

.preview-flow__prompt-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
}

.preview-flow__prompt-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 24, 0.82);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: left;
}

.preview-flow__prompt-cursor {
  flex-shrink: 0;
  width: 2px;
  height: 16px;
  background: var(--accent);
  animation: preview-cursor-blink 1s step-end infinite;
}

@keyframes preview-cursor-blink {
  50% {
    opacity: 0;
  }
}

.preview-flow__output-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 280px);
}

.preview-flow__frame-mock {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.preview-flow__frame-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(139, 92, 246, 0.18) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: preview-frame-shimmer 2.4s ease-in-out infinite;
}

@keyframes preview-frame-shimmer {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -130% 0;
  }
}

.preview-flow__frame-spark {
  position: absolute;
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0;
  animation: preview-spark-float 3s ease-in-out infinite;
}

.preview-flow__frame-spark--1 {
  top: 18%;
  left: 22%;
}

.preview-flow__frame-spark--2 {
  bottom: 22%;
  right: 18%;
  animation-delay: 1.2s;
}

@keyframes preview-spark-float {
  0%,
  100% {
    opacity: 0;
    transform: translateY(4px) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
}

.preview-flow__quality-row {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.preview-flow__quality-pill {
  flex: 1;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-flow__quality-pill--active {
  color: var(--accent);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
  animation: preview-quality-cycle 4.5s ease-in-out infinite;
}

@keyframes preview-quality-cycle {
  0%,
  100% {
    color: var(--accent);
    border-color: rgba(139, 92, 246, 0.45);
  }
  33% {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.45);
  }
  66% {
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.45);
  }
}

.preview-placeholder__title {
  margin: 0;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.84rem;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(139, 92, 246, 0.14), transparent),
    rgba(0, 0, 0, 0.25);
}

.preview-placeholder__sub {
  font-size: 0.76rem;
  margin: 0;
  flex-shrink: 0;
  color: var(--text-dim);
}

.preview-loading[hidden],
.preview-placeholder[hidden] {
  display: none;
}

.gen-loading__panel {
  width: 100%;
  max-width: 340px;
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: linear-gradient(165deg, rgba(30, 27, 46, 0.95) 0%, rgba(17, 17, 24, 0.98) 100%);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.gen-loading__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 55%, #06b6d4 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.gen-loading__icon-svg {
  width: 28px;
  height: 28px;
  animation: gen-spin 1.2s linear infinite;
}

@keyframes gen-spin {
  to {
    transform: rotate(360deg);
  }
}

.gen-loading__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.gen-loading__sub {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.gen-loading__hint {
  margin: 0 0 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.gen-loading__progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gen-loading__pct {
  font-weight: 700;
  color: #38bdf8;
}

.gen-loading__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gen-loading__bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ec4899 0%, #a855f7 50%, #6366f1 100%);
  transition: width 0.35s ease;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview-img[hidden] {
  display: none;
}

.meta,
.cost {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.45;
}

.meta[hidden],
.cost[hidden] {
  display: none;
}

.meta strong {
  color: var(--ok);
}

.meta code {
  font-size: 0.75rem;
  color: var(--accent);
  word-break: break-all;
}

.cost {
  color: var(--gold);
}

.meta-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 0.05em;
}

.field-hint--img2img {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quality-chip--locked {
  cursor: default;
  opacity: 1;
}

.img2img-finalize {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--card-border));
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

.img2img-finalize__title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.img2img-finalize__desc {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.img2img-finalize__row {
  margin-bottom: 12px;
}

.img2img-finalize__btn--wide {
  width: 100%;
}

.img2img-finalize__label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

.img2img-finalize__refine {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 56px;
}

.img2img-finalize__refine:focus {
  outline: none;
  border-color: var(--accent);
}

.img2img-finalize__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 720px) {
  .img2img-finalize__actions {
    grid-template-columns: 1fr;
  }
}

.img2img-finalize__btn {
  min-height: 42px;
  font-size: 0.82rem;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.btn-secondary {
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Recent assets — align with workspace width (Nano Banana style) */
.section-recent {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 32px;
}

.section-recent__card {
  padding: 22px 22px 18px;
}

.section-recent__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 18px;
}

.section-recent__titles {
  flex: 1 1 260px;
}

.section-recent__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-recent__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.section-recent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-recent-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-recent-refresh:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.65);
}

.btn-recent-refresh__icon {
  font-size: 1rem;
  line-height: 1;
}

.btn-recent-all {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-recent-all:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 960px) {
  .recent-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.recent-card {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.recent-card:hover {
  transform: translateY(-2px);
}

.recent-card--selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

.recent-card__media {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.recent-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recent-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.recent-card__edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.95);
  color: #fff;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.recent-empty {
  margin: 0;
  padding: 36px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* Use cases — 应用场景（原创示意视觉，可替换 public/images/usecases/ 内图片） */
.section-usecases {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 48px;
  text-align: center;
}

.section-usecases__badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-usecases__title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.section-usecases__lead {
  margin: 0 auto 32px;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.usecases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: left;
}

.usecase-card {
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.usecase-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--card-border));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.usecase-visual {
  aspect-ratio: 16 / 9;
  background: #0d0d12;
  overflow: hidden;
}

.usecase-visual__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.usecase-card__title {
  margin: 0;
  padding: 16px 18px 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.usecase-card__desc {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .usecases-grid {
    grid-template-columns: 1fr;
  }
}


.section-pricing {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  text-align: center;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.section-desc {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-desc--sub {
  margin-top: -4px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  opacity: 0.9;
}

.section-tagline {
  margin: 0 0 28px;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.section-tagline--last {
  margin-bottom: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.price-card {
  position: relative;
  padding: 24px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
}

.price-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}

.price-card__badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.price-card h3 {
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

.price-card__route {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.price-card__val {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--gold);
  opacity: 0.92;
}

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 32px 20px 40px;
  text-align: center;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer__note,
.footer__copy {
  margin: 4px 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer__feedback {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 10px 0 6px;
  padding: 0.38rem 0.85rem;
  font-size: 0.72rem;
  line-height: 1.4;
  border: 1px solid var(--card-border);
  border-radius: 100px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
}

.footer__feedback-label {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer__feedback a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__feedback a:hover {
  color: color-mix(in srgb, var(--accent) 82%, #fff);
}

/* Navbar user / auth */
.navbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary-sm:hover {
  background: var(--accent-hover);
}

.nav-credits-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

/* 首页用户菜单（banana 风格） */
.nav-user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.nav-user-trigger:hover,
.nav-user-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-user-trigger__avatar {
  font-size: 1rem;
  line-height: 1;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  min-width: 240px;
  padding: 8px 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.nav-user-dropdown[hidden] {
  display: none;
}

.nav-user-dropdown__head {
  padding: 10px 14px 8px;
}

.nav-user-dropdown__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.nav-user-dropdown__email {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  word-break: break-all;
}

.nav-user-dropdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}

.nav-user-dropdown__row:hover {
  background: var(--accent-soft);
}

.nav-user-dropdown__row-val {
  font-weight: 700;
  color: var(--accent);
}

.nav-user-dropdown__divider {
  height: 1px;
  margin: 4px 0;
  background: var(--card-border);
}

.nav-user-dropdown__item,
.nav-user-dropdown__logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.nav-user-dropdown__item:hover,
.nav-user-dropdown__logout:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-user-dropdown__logout {
  color: var(--error);
}

.auth-page {
  display: flex;
  justify-content: center;
  padding: 32px 16px 48px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.auth-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
}

.auth-card__title {
  margin: 0 2rem 8px 0;
  font-size: 1.35rem;
}

.auth-card__lead {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-field--row {
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}

.auth-field--grow {
  flex: 1;
  min-width: 0;
}

.auth-forgot {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-send-code {
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 1px;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-input--code {
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.auth-submit {
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.auth-submit:hover {
  background: var(--accent-hover);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-message {
  margin: 0;
  font-size: 0.85rem;
}

.auth-message[hidden] {
  display: none;
}

.auth-message--error {
  color: var(--error);
}

.auth-message--ok {
  color: var(--ok);
}

.auth-switch {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-switch a {
  color: var(--accent);
}

.auth-link-btn {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.credits-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.credits-hero {
  text-align: center;
  padding: 28px 20px;
}

.credits-hero h1 {
  margin: 0 0 8px;
}

.credits-hero__sub {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.credits-balance {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.credits-balance__val {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.credits-balance__unit {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.credits-email {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.credits-redeem h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.credits-foot {
  text-align: center;
  margin-top: 16px;
}

.credits-foot a {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 340px;
  }

  .preview-flow__paths {
    gap: 8px;
  }

  .preview-path {
    padding: 8px 6px;
  }

  .preview-path__title {
    font-size: 0.72rem;
  }

  .preview-path__hint {
    font-size: 0.56rem;
  }

  .preview-flow__hero-card {
    width: 64px;
  }

  .preview-flow__hero-gift {
    font-size: 0.48rem;
    padding: 1px 4px;
  }

  .preview-path__badge-row {
    gap: 3px;
  }

  .preview-path__badge--then {
    font-size: 0.5rem;
  }
}

@media (max-width: 640px) {
  .navbar__nav {
    display: none;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .aspect-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quality-row {
    grid-template-columns: 1fr;
  }
}

/* —— 用户后台 Dashboard —— */
.dash-body {
  min-height: 100vh;
}

.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  border-right: 1px solid var(--card-border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.dash-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 8px;
}

.dash-nav__section {
  margin: 12px 10px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.dash-nav__label {
  flex: 1;
  min-width: 0;
}

.dash-nav__link:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.dash-nav__link--active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.dash-nav__icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
}

.dash-sidebar__foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-upgrade {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

.dash-upgrade__title {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
}

.dash-upgrade__text {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-upgrade__btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.dash-user__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-user__name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-user__email {
  font-size: 0.72rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 12px;
  border-bottom: 1px solid var(--card-border);
}

.dash-crumb {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.dash-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.dash-user--topbar {
  width: auto;
  max-width: 240px;
  flex-shrink: 1;
  padding: 6px 12px;
}

.dash-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}

.dash-content {
  padding: 20px 28px 40px;
}

.dash-content--wide {
  width: 100%;
  max-width: none;
}

.dash-content--wide .dash-card,
.dash-content--wide .admin-stats {
  width: 100%;
  max-width: none;
}

.dash-content--wide .dash-table-wrap {
  width: 100%;
}

.dash-lead {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dash-card {
  padding: 20px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 16px;
}

.dash-card__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.dash-card__sub {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.dash-card--fixed {
  width: 100%;
  max-width: 560px;
  flex-shrink: 0;
}

.dash-form-fixed {
  max-width: 100%;
}

.dash-stat--solo {
  max-width: 560px;
  margin-bottom: 16px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-stat h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dash-stat__val {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.dash-stat__val--lg {
  font-size: 2.2rem;
  color: var(--accent);
}

.dash-stat__sub {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dash-stat__link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.dash-dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.dash-dl > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
}

.dash-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dash-dl dd {
  margin: 0;
  font-weight: 500;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-form-inline {
  flex-direction: row;
  align-items: center;
  max-width: 100%;
}

.dash-form-inline .auth-input {
  flex: 1;
}

.dash-toolbar {
  margin-bottom: 16px;
}

.dash-content--transactions {
  max-width: none;
}

.billing-stack {
  max-width: 920px;
}

.billing-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.billing-top-row .dash-card {
  margin-bottom: 0;
  max-width: none;
  width: 100%;
}

.billing-card__row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 2.75rem;
}

.billing-balance .billing-card__row {
  justify-content: space-between;
}

.billing-balance__val {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.billing-recharge-btn,
.billing-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
}

.billing-recharge-btn {
  margin-top: 0;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}

.billing-recharge-btn:hover {
  opacity: 0.9;
  color: #fff;
}

.billing-redeem-form {
  width: 100%;
  flex: 1;
  min-width: 0;
}

.billing-redeem .billing-card__row {
  width: 100%;
}

.billing-action-btn.auth-submit {
  padding: 0 18px;
  min-height: 40px;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.billing-redeem .auth-message {
  margin: 8px 0 0;
}

.billing-tx-section {
  margin-bottom: 0;
}

.billing-tx-head {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.billing-tx-head__title {
  margin: 0;
  flex-shrink: 0;
}

.billing-tx-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
  max-width: calc(100% - 120px);
}

.billing-date-input {
  width: 128px;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.82rem;
  flex-shrink: 1;
}

.billing-date-sep {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.billing-date-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.billing-date-btn.btn-ghost {
  width: auto;
  min-width: 52px;
  height: auto;
  line-height: 1.2;
}

.billing-tx-section .dash-table-wrap {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .billing-top-row {
    grid-template-columns: 1fr;
  }
}

.dash-content--transactions .dash-table-wrap,
.dash-content--transactions .dash-pagination {
  width: 100%;
}

.dash-search {
  max-width: 360px;
}

.dash-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dash-table th,
.dash-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.dash-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.tx-amt--pos {
  color: var(--ok);
  font-weight: 600;
}

.tx-amt--neg {
  color: var(--error);
  font-weight: 600;
}

.tx-desc {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 32px !important;
}

.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dash-pagination[hidden],
#assets-lead[hidden] {
  display: none !important;
}

.dash-pagination__ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Admin */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat--compact {
  padding: 14px 16px;
}

.dash-stat--compact h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dash-stat--compact .dash-stat__val {
  margin: 0;
  font-size: 1.35rem;
}

.admin-quota-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-quota-hint {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.admin-quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.admin-quota-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.admin-quota-card--alert {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.admin-quota-card__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-quota-card__meta,
.admin-quota-card__sub {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-quota-card__sub {
  margin: 10px 0 0;
}

.admin-quota-bar + .admin-quota-bar {
  margin-top: 10px;
}

.admin-quota-bar__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.admin-quota-bar__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.admin-quota-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.25s ease;
}

.admin-quota-bar__fill--warn {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.admin-gen-form {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-field__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-gen-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-gen-result__meta {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-filter {
  max-width: 140px;
  margin-left: auto;
}

.dash-card__title--inline {
  margin: 0;
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-badge--unused {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.admin-badge--used {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.admin-adjust-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-adjust-input {
  width: 88px;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.82rem;
}

.admin-code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.btn-secondary--sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

.pricing-grid--compact .price-card {
  padding: 16px 12px;
  text-align: center;
}

.pricing-grid--compact .price-card__val {
  font-size: 0.78rem;
  white-space: nowrap;
}

.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 220px));
  gap: 16px;
  justify-content: start;
  align-items: start;
}

.asset-card {
  width: 220px;
  min-height: 382px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.asset-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.asset-card__media {
  position: relative;
  width: 100%;
  height: 220px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
}

.asset-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.asset-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.asset-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  z-index: 1;
}

.asset-card__edit {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.92);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.asset-card__edit:hover {
  background: #2563eb;
}

.asset-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 8px;
  height: 58px;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.asset-card__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.asset-card__time {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.76rem;
}

.asset-card__dims {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-height: 22px;
  max-height: 22px;
  overflow: hidden;
}

.asset-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--text-dim);
  white-space: nowrap;
}

.asset-tag:first-child {
  color: var(--text-muted);
}

.asset-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px 12px;
  height: 76px;
  flex-shrink: 0;
  box-sizing: border-box;
  align-content: start;
  margin-top: auto;
}

.asset-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  min-height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.asset-act:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--text);
  border-color: rgba(139, 92, 246, 0.35);
}

.asset-act:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.asset-act--danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.35);
}

.asset-act--share {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--accent);
}

.asset-act--share:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

/* 点数不足弹窗 */
body.modal-open {
  overflow: hidden;
}

.credits-modal[hidden] {
  display: none;
}

.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.credits-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  animation: credits-modal-fade 0.2s ease;
}

.credits-modal__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 400px);
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow), 0 0 0 1px rgba(139, 92, 246, 0.12);
  text-align: center;
  animation: credits-modal-rise 0.22s ease;
}

.credits-modal__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.35rem;
  box-shadow: 0 0 24px var(--accent-glow);
}

.credits-modal__title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
}

.credits-modal__desc {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.credits-modal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.credits-modal__stat {
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
}

.credits-modal__stat--balance {
  border-color: color-mix(in srgb, var(--error) 35%, var(--card-border));
  background: color-mix(in srgb, var(--error) 8%, var(--bg-elevated));
}

.credits-modal__stat-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.credits-modal__stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
}

.credits-modal__stat--balance .credits-modal__stat-val {
  color: var(--error);
}

.credits-modal__stat-unit {
  margin-left: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.credits-modal__hint {
  margin: 0 0 20px;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

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

.credits-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.88rem;
  text-decoration: none;
  box-sizing: border-box;
}

@keyframes credits-modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes credits-modal-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 通用确认弹窗（退出登录等） */
.confirm-dialog[hidden] {
  display: none;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  animation: credits-modal-fade 0.2s ease;
}

.confirm-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 380px);
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  animation: credits-modal-rise 0.22s ease;
}

.confirm-dialog__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
}

.confirm-dialog__panel--danger .confirm-dialog__icon {
  background: color-mix(in srgb, var(--error) 14%, transparent);
  color: var(--error);
  font-size: 1.35rem;
}

.confirm-dialog__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.confirm-dialog__message {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

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

.confirm-dialog__btn {
  min-height: 42px;
  font-size: 0.88rem;
}

.confirm-dialog__ok--danger {
  background: color-mix(in srgb, var(--error) 88%, #000);
}

.confirm-dialog__ok--danger:hover {
  background: var(--error);
}

/* 引擎配额排队 / 日限额提示 */
.quota-modal[hidden] {
  display: none !important;
}

.quota-modal {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quota-modal__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
  backdrop-filter: blur(6px);
  animation: credits-modal-fade 0.2s ease;
}

.quota-modal__panel {
  position: relative;
  width: min(92vw, 400px);
  padding: 28px 24px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: credits-modal-rise 0.22s ease;
}

.quota-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  font-size: 1.5rem;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
}

.quota-modal__title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 650;
}

.quota-modal__desc {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.quota-modal__countdown {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.quota-modal__hint {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quota-modal__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.quota-modal__btn {
  min-width: 120px;
}

/* 全局 Toast 提示 */
.toast-host {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--card) 92%, var(--bg-elevated));
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: auto;
  animation: none;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast--leaving {
  animation: toast-leave 0.18s ease forwards;
}

.toast--success {
  border-left: 3px solid var(--ok);
}

.toast--error {
  border-left: 3px solid var(--error);
}

.toast--info {
  border-left: 3px solid var(--accent);
}

.toast--warning {
  border-left: 3px solid var(--warn);
}

.toast__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
}

.toast--success .toast__icon {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.toast--error .toast__icon {
  background: color-mix(in srgb, var(--error) 16%, transparent);
  color: var(--error);
}

.toast--info .toast__icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.toast--warning .toast__icon {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

.toast__message {
  flex: 1;
  margin: 0;
  padding-top: 2px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: -2px -2px 0 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.toast__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@keyframes toast-leave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* 作品查看弹层 */
.asset-lightbox[hidden] {
  display: none;
}

.asset-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.asset-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.asset-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card);
}

.asset-lightbox__x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.asset-lightbox__img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.asset-lightbox__prompt {
  margin: 14px 0 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.asset-lightbox__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.asset-lightbox__meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.asset-lightbox__dl {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.assets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.assets-empty[hidden],
.assets-grid[hidden] {
  display: none !important;
}

.assets-empty__icon {
  font-size: 2.5rem;
}

.assets-empty__sub {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.assets-empty__cta {
  margin-top: 12px;
  text-decoration: none;
  display: inline-block;
}

@media (max-width: 720px) {
  .assets-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 160px));
    gap: 12px;
  }

  .asset-card {
    width: 160px;
    min-height: 318px;
  }

  .asset-card__media {
    height: 160px;
  }
}

@media (max-width: 900px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .dash-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .dash-sidebar__foot {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-stats {
    grid-template-columns: 1fr;
  }
}
