:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #0d1118;
  --panel-2: #111720;
  --surface: #151b25;
  --surface-2: #1a2230;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #8f9bad;
  --muted-2: #657183;
  --mint: #7cf5d2;
  --mint-2: #48d7b2;
  --violet: #a78bfa;
  --danger: #ff6f7d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  overflow: hidden;
  font-size: 16px;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 48% 0%, rgba(86, 114, 145, 0.09), transparent 34%),
    var(--bg);
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  width: fit-content;
}

.brand-mark {
  width: 75px;
  height: 30px;
  display: block;
  flex: none;
  overflow: hidden;
}

.brand-mark img {
  width: 75px;
  height: 30px;
  display: block;
  object-fit: contain;
  filter: invert(1) hue-rotate(180deg) saturate(1.08) brightness(1.08);
}

.brand-product {
  color: #a7b1c0;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: rgba(20, 27, 38, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 82px;
  padding: 11px 20px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  position: relative;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124, 245, 210, 0.22), rgba(167, 139, 250, 0.18));
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(124, 245, 210, 0.5), 0 6px 18px rgba(60, 220, 180, 0.16) inset;
  font-weight: 750;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 4px;
  height: 3px;
  border-radius: 99px;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(124, 245, 210, 0.8);
}

.nav-item[data-view="video"]::before,
.nav-item[data-view="image"]::before,
.nav-item[data-view="assets"]::before {
  margin-right: 6px;
  font-size: 13px;
}

.nav-item[data-view="video"]::before { content: "▶"; }
.nav-item[data-view="image"]::before { content: "▣"; }
.nav-item[data-view="assets"]::before { content: "▤"; }

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.model-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #c9d0da;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.025);
}

.balance-pill {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #8f9bad;
  font-size: 13px;
}

.balance-pill strong { color: var(--mint); }

.balance-pill[hidden] {
  display: none;
}

.guest-auth-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.guest-auth-actions[hidden],
.avatar[hidden] {
  display: none;
}

.auth-entry {
  height: 34px;
  min-width: 58px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.auth-entry:hover {
  transform: translateY(-1px);
}

.auth-login {
  background: var(--mint);
  color: #06110e;
  box-shadow: 0 5px 18px rgba(124, 245, 210, 0.12);
}

.auth-login:hover {
  background: #91f8da;
}

.auth-register {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: #cbd3df;
}

.auth-register:hover {
  border-color: rgba(124, 245, 210, 0.34);
  color: var(--mint);
}

.model-pill i,
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(124, 245, 210, 0.55);
}

.icon-button,
.avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #aab4c2;
}

.auth-dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
}

.auth-dialog::backdrop {
  background: rgba(2, 5, 9, 0.76);
  backdrop-filter: blur(8px);
}

.auth-card {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #11161e;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.auth-intro {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

#authForm {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

#authForm label {
  margin-top: 4px;
  color: #cbd3df;
  font-size: 14px;
  font-weight: 600;
}

#authForm input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: #0b1017;
  color: var(--text);
  font: inherit;
}

#authForm input:focus {
  border-color: rgba(124, 245, 210, 0.62);
  box-shadow: 0 0 0 3px rgba(124, 245, 210, 0.08);
}

.auth-error {
  min-height: 20px;
  margin: 2px 0 0;
  color: #ff9b9b;
  font-size: 13px;
}

.auth-submit {
  min-height: 46px;
  margin-top: 2px;
  border: 0;
  border-radius: 10px;
  background: var(--mint);
  color: #06110e;
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.auth-switch button:hover {
  text-decoration: underline;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, #384155, #202838);
  font-size: 13px;
  color: white;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(500px, 1fr);
  height: calc(100vh - 64px);
}

.control-panel,
.asset-panel {
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2e3746 transparent;
  background: rgba(13, 17, 24, 0.92);
}

.control-panel {
  border-right: 1px solid var(--line);
  padding: 22px 20px 24px;
}

.asset-panel {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: 330px;
  z-index: 31;
  border-left: 1px solid var(--line);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform 220ms ease;
  box-shadow: -24px 0 50px rgba(0, 0, 0, 0.35);
}

.asset-panel.open {
  transform: translateX(0);
}

.panel-heading,
.asset-heading,
.canvas-heading,
.section-row,
.progress-heading,
.date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.icon-button.subtle {
  background: transparent;
  border-color: transparent;
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 6px;
  padding: 4px;
  border-radius: 12px;
  background: #080b10;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.type-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.type-switch button.active {
  background: linear-gradient(135deg, rgba(124, 245, 210, 0.2), rgba(167, 139, 250, 0.16));
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(124, 245, 210, 0.3), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  font-weight: 750;
}

.type-switch svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.control-section {
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.source-section {
  padding-top: 25px;
}

.section-row {
  margin-bottom: 11px;
}

.section-row.compact {
  margin-bottom: 13px;
}

.section-row label,
.spec-name {
  color: #d7dde7;
  font-size: 14px;
  font-weight: 600;
}

.simple-label small {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 500;
}

.auto-hint {
  color: var(--muted-2);
  font-size: 11px;
}

.section-note {
  font-size: 12px;
  color: var(--mint-2);
}

.mini-segment {
  display: flex;
  gap: 2px;
}

.mini-segment button,
.asset-filters button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
}

.mini-segment button.active,
.asset-filters button.active {
  color: #ffffff;
  background: rgba(124, 245, 210, 0.16);
  box-shadow: 0 0 0 1px rgba(124, 245, 210, 0.28);
  font-weight: 750;
}

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

.reference-grid .reference-tile:not(:first-child) {
  display: none;
}

.reference-grid.show-more {
  grid-template-columns: 1fr 1fr;
}

.reference-grid.show-more .reference-tile {
  display: flex;
}

.reference-grid.show-more .primary-reference {
  grid-column: 1 / -1;
}

.reference-tile {
  position: relative;
  min-height: 88px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.primary-reference {
  min-height: 82px;
}

.more-button {
  width: auto;
  border: 0;
  background: transparent;
  color: #768295;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  padding: 5px 2px;
}

.more-button:hover {
  color: #bac4d1;
}

.reference-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 9px;
}

.reference-tile:hover {
  border-color: rgba(124, 245, 210, 0.46);
  background: rgba(124, 245, 210, 0.035);
}

.reference-tile.drop-ready {
  border-style: solid;
  border-color: var(--mint);
  background: rgba(124, 245, 210, 0.1);
  box-shadow: 0 0 0 3px rgba(124, 245, 210, 0.08);
}

.reference-tile.filled {
  border-style: solid;
  border-color: rgba(124, 245, 210, 0.34);
}

.reference-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070a;
}

.tile-media-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(124, 245, 210, 0.12);
  color: var(--mint);
  font-size: 17px;
}

.reference-tile.filled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 7, 10, 0.8), transparent 55%);
}

.tile-label {
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.tile-actions {
  position: absolute;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  display: flex;
  gap: 5px;
}

.tile-action,
.tile-remove {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #dfe5ec;
  padding: 3px 6px;
  font-size: 11px;
}

.tile-remove {
  background: rgba(225, 82, 104, 0.2);
  color: #ffb6c1;
}

.tile-remove:hover,
.tile-remove:focus-visible {
  background: rgba(225, 82, 104, 0.38);
  outline: 1px solid rgba(255, 182, 193, 0.8);
}

.tile-icon {
  font-size: 20px;
  color: #778396;
  line-height: 1;
}

.person-icon {
  transform: rotate(180deg);
}

.tile-title {
  font-size: 12px;
  color: #aeb7c5;
  font-weight: 600;
}

.tile-note {
  font-size: 11px;
  color: #667284;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--mint-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.text-action:hover {
  color: var(--mint);
}

.prompt-box {
  border: 1px solid var(--line);
  background: #090d13;
  border-radius: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.prompt-box:focus-within {
  border-color: rgba(124, 245, 210, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 245, 210, 0.05);
}

.prompt-box textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: #e8edf4;
  padding: 18px 16px 10px;
  font-size: 15px;
  line-height: 1.8;
}

.prompt-box textarea:focus {
  outline: 0;
}

.prompt-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 9px;
  font-size: 11px;
  color: var(--muted-2);
}

.prompt-meta b {
  font-weight: 500;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.prompt-chips[hidden] {
  display: none;
}

.prompt-chips button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #8995a7;
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
}

.prompt-chips button:hover {
  border-color: rgba(124, 245, 210, 0.35);
  color: #cfeee6;
}

.spec-line {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  margin-top: 9px;
}

.specs-section {
  padding: 9px 0;
}

.spec-summary {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #bec7d3;
  padding: 0 2px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.spec-summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.spec-summary i {
  color: var(--muted-2);
  font-style: normal;
  transition: transform 160ms ease;
}

.spec-summary[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.spec-options {
  padding: 2px 0 8px;
}

.spec-name {
  color: #8793a4;
  font-size: 12px;
  font-weight: 500;
}

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

.option-row button {
  position: relative;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #8894a5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.option-row button:hover {
  color: #d7dde6;
  border-color: var(--line-strong);
}

.option-row button.active {
  color: #eafff9;
  border-color: rgba(124, 245, 210, 0.43);
  background: rgba(124, 245, 210, 0.075);
  box-shadow: inset 0 0 16px rgba(124, 245, 210, 0.025);
}

.option-row em {
  position: absolute;
  top: -5px;
  right: 2px;
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.03em;
  color: #c0affb;
  background: #332a55;
  padding: 1px 3px;
  border-radius: 3px;
}

.ratio-icon {
  display: inline-block;
  border: 1px solid currentColor;
  margin-right: 5px;
  vertical-align: -1px;
  opacity: 0.72;
}

.ratio-icon.landscape {
  width: 10px;
  height: 7px;
}

.ratio-icon.portrait {
  width: 6px;
  height: 9px;
}

.ratio-icon.square {
  width: 8px;
  height: 8px;
}

.generate-wrap {
  padding-top: 20px;
}

.generate-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(110deg, var(--mint) 0%, #77e8c9 54%, #9fdedb 100%);
  color: #07130f;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 9px 28px rgba(72, 215, 178, 0.16);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.generate-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(72, 215, 178, 0.24);
}

.generate-button:active {
  transform: translateY(0);
}

.generate-button[disabled] {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.generate-button kbd {
  position: absolute;
  right: 30px;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid rgba(7, 19, 15, 0.18);
  background: rgba(255, 255, 255, 0.28);
  font-size: 9px;
  font-family: inherit;
}

.generate-wrap p {
  margin: 9px 0 0;
  text-align: center;
  color: #677284;
  font-size: 11px;
}

.generate-wrap #priceHint.insufficient {
  color: #ff9d9d;
  font-weight: 650;
}

.generate-wrap .generate-error {
  padding: 12px 13px;
  border: 1px solid rgba(255, 111, 111, 0.58);
  border-radius: 9px;
  background: rgba(132, 31, 42, 0.38);
  box-shadow: 0 8px 24px rgba(94, 18, 27, 0.3);
  color: #ffd2d2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.generate-wrap .generate-error[hidden] {
  display: none;
}

.canvas-panel {
  overflow-y: auto;
  padding: 26px clamp(24px, 3.2vw, 52px) 28px;
  scrollbar-width: thin;
  scrollbar-color: #2e3746 transparent;
}

.canvas-heading {
  margin-bottom: 17px;
}

.canvas-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: #a9b3c1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.ghost-button:hover {
  color: white;
  border-color: var(--line-strong);
}

.download-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #06110e;
  border-color: rgba(124, 245, 210, 0.65);
  background: var(--mint);
}

.download-button:hover {
  color: #06110e;
  border-color: var(--mint);
  background: #91f8da;
}

.download-button[hidden] {
  display: none;
}

.stage {
  position: relative;
  width: min(100%, 940px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  transition: width 240ms ease, aspect-ratio 240ms ease;
}

.stage.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.stage.ratio-9-16 {
  width: min(54%, 470px);
  aspect-ratio: 9 / 16;
}

.stage.ratio-1-1 {
  width: min(76%, 660px);
  aspect-ratio: 1;
}

.stage > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #020305;
  transition: filter 250ms ease, transform 500ms ease, object-position 500ms ease;
}

.stage > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #020305;
}

.stage > img[hidden],
.stage > video[hidden] { display: none; }

.stage.empty .stage-shade,
.stage.empty .stage-badge,
.stage.empty .play-button,
.stage.empty .playback {
  display: none;
}
.stage.has-video .stage-shade,
.stage.has-video .playback { display: none; }

.stage.has-video .play-button {
  z-index: 4;
  width: 68px;
  height: 68px;
  border-color: rgba(124, 245, 210, 0.72);
  background: rgba(10, 31, 29, 0.82);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(124, 245, 210, 0.08);
}

.stage.has-video .play-button svg {
  fill: var(--mint);
}

.stage.has-video.video-playing .play-button {
  opacity: 0 !important;
  pointer-events: none;
}

.image-to-video-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(124, 245, 210, 0.78);
  border-radius: 11px;
  background: rgba(8, 29, 27, 0.9);
  color: var(--mint);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-weight: 700;
}

.image-to-video-button:hover {
  color: #06110e;
  background: var(--mint);
}

.image-to-video-button[hidden] {
  display: none;
}

.stage.ratio-9-16 > img {
  object-position: 39% center;
}

.stage-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 4, 7, 0.58), transparent 42%, rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

.stage-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(5, 8, 12, 0.64);
  backdrop-filter: blur(10px);
  color: #cdd5df;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stage-badge span {
  color: var(--mint);
  font-weight: 700;
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(6, 9, 13, 0.48);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(6, 9, 13, 0.65);
}

.play-button svg {
  width: 24px;
  fill: white;
  transform: translateX(1px);
}

.stage.is-playing > img {
  animation: ken-burns 8s ease-in-out infinite alternate;
}

@keyframes ken-burns {
  from { transform: scale(1.01); object-position: 47% center; }
  to { transform: scale(1.09); object-position: 54% center; }
}

.stage-status {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 10, 0.46);
  backdrop-filter: blur(2px);
  text-align: center;
}

.stage.generating .stage-status {
  display: flex;
}

.stage.generating.has-live-frame .stage-status {
  inset: 14px auto auto 14px;
  align-items: flex-start;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(10px);
  text-align: left;
}

.stage.generating .play-button,
.stage.generating .playback {
  opacity: 0;
  pointer-events: none;
}

.stage-status strong {
  margin-top: 13px;
  font-size: 15px;
}

.stage-status span {
  margin-top: 6px;
  color: #a0acbb;
  font-size: 12px;
}

.spinner {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 2px solid rgba(124, 245, 210, 0.22);
  border-top-color: var(--mint);
  animation: spin 750ms linear infinite;
}

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

.scan-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: 0;
  display: none;
  background: linear-gradient(transparent, var(--mint), transparent);
  box-shadow: 0 0 22px 4px rgba(124, 245, 210, 0.24);
  opacity: 0.75;
}

.stage.generating .scan-line {
  display: block;
  animation: scan 2.2s ease-in-out infinite alternate;
}

@keyframes scan {
  to { left: calc(100% - 2px); }
}

.playback {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 24px 42px 1fr 42px 24px;
  align-items: center;
  gap: 7px;
  color: #dce3eb;
  font-size: 10px;
  transition: opacity 150ms ease;
}

.playback button {
  border: 0;
  background: transparent;
  color: white;
  padding: 0;
  cursor: pointer;
}

.play-track,
.progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  overflow: hidden;
}

.play-track i,
.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--mint);
}

.progress-card {
  width: min(100%, 940px);
  margin: 16px auto 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(15, 20, 28, 0.82);
}

.progress-heading {
  margin-bottom: 12px;
}

.progress-heading > div {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.progress-heading strong {
  font-size: 13px;
}

.progress-heading #progressDetail {
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-dot {
  background: #586476;
  box-shadow: none;
}

.progress-card.running .live-dot {
  background: var(--mint);
  box-shadow: 0 0 9px rgba(124, 245, 210, 0.55);
  animation: pulse 1.3s ease-in-out infinite;
}

.progress-card.stopped .live-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.stop-button {
  border: 1px solid rgba(255, 111, 125, 0.24);
  border-radius: 8px;
  background: rgba(255, 111, 125, 0.07);
  color: #ff97a1;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.stop-button:hover:not(:disabled) {
  background: rgba(255, 111, 125, 0.14);
}

.stop-button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.frame-strip {
  display: flex;
  gap: 6px;
  padding-bottom: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #354154 transparent;
}

.frame-item {
  position: relative;
  flex: 0 0 auto;
  height: 52px;
  aspect-ratio: var(--preview-ratio, 16 / 9);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #090d12;
  overflow: hidden;
  cursor: pointer;
}

.frame-item > i {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, #101620 35%, #19212e 48%, #101620 62%);
  background-size: 220% 100%;
}

.running .frame-item:not(.ready) > i {
  animation: skeleton 1.2s linear infinite;
}

@keyframes skeleton {
  to { background-position: -220% 0; }
}

.frame-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070a;
  display: block;
}

.frame-item:nth-child(2) img { object-position: 42% center; filter: brightness(.96) saturate(1.04); }
.frame-item:nth-child(3) img { object-position: 44% center; filter: brightness(.93) saturate(1.08); }
.frame-item:nth-child(4) img { object-position: 47% center; filter: brightness(.9) saturate(1.12); }
.frame-item:nth-child(5) img { object-position: 50% center; filter: brightness(.88) saturate(1.15); }
.frame-item:nth-child(6) img { object-position: 53% center; filter: brightness(.91) saturate(1.12); }
.frame-item:nth-child(7) img { object-position: 56% center; filter: brightness(.95) saturate(1.08); }
.frame-item:nth-child(8) img { object-position: 59% center; filter: brightness(.98) saturate(1.04); }

.frame-item span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  z-index: 2;
  padding: 1px 3px;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.45);
  font-size: 8px;
}

.frame-item.selected {
  border-color: var(--mint);
  box-shadow: 0 0 0 1px var(--mint);
}

.progress-footer {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-track i {
  background: linear-gradient(to right, var(--mint-2), var(--mint));
  transition: width 380ms ease;
}

.progress-footer span {
  color: #9aa5b5;
  font-size: 10px;
  text-align: right;
}

.safety-note {
  width: min(100%, 940px);
  margin: 13px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6f7c8e;
  font-size: 11px;
}

.safety-note svg {
  width: 16px;
  fill: none;
  stroke: #728194;
  stroke-width: 1.6;
}

.safety-note strong {
  color: #8f9bab;
}

.asset-heading {
  padding: 0 3px 15px;
}

.asset-heading-actions {
  display: flex;
  gap: 6px;
}

.asset-heading h2 {
  font-size: 20px;
}

.asset-search {
  display: none;
  padding: 0 2px 11px;
}

.asset-search.open {
  display: block;
}

.asset-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d13;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
}

.asset-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  background: #090d13;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 15px;
}

.asset-filters.video-only {
  display: block;
  padding: 8px 10px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.recent-tasks {
  margin-top: 14px;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  color: var(--text);
  font-size: 12px;
}

.section-label span {
  color: var(--muted);
  font-weight: 500;
}

.asset-section-label {
  margin-top: 18px;
}

.task-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.task-open {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-thumb {
  width: 48px;
  aspect-ratio: 16 / 10;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: white;
  background: #20252d;
}

.task-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-thumb i {
  font-style: normal;
  font-size: 13px;
}

.task-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.task-info strong,
.task-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info strong {
  font-size: 12px;
}

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

.task-stop {
  flex: none;
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--danger);
  background: rgba(255, 111, 125, 0.1);
  font-size: 11px;
  cursor: pointer;
}

.asset-filters button {
  min-height: 28px;
}

.asset-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: none;
}

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

.date-heading {
  margin-bottom: 8px;
  color: #aab4c1;
  font-size: 12px;
  font-weight: 650;
}

.date-heading time {
  color: #5f6b7d;
  font-weight: 500;
  font-size: 10px;
}

.asset-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 6px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.asset-card[draggable="true"] {
  cursor: grab;
}

.asset-card.dragging {
  opacity: 0.45;
}

.asset-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.asset-delete {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #697587;
  cursor: pointer;
}

.asset-side-actions {
  display: grid;
  gap: 3px;
}

.asset-hd,
.asset-use,
.asset-delete {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.asset-hd {
  border: 1px solid rgba(124, 245, 210, 0.32);
  background: rgba(124, 245, 210, 0.08);
  color: var(--mint);
  font-size: 9px;
  font-weight: 800;
}

.asset-hd:hover {
  background: rgba(124, 245, 210, 0.18);
}

.asset-use {
  background: rgba(124, 245, 210, 0.09);
  color: var(--mint);
  font-size: 11px;
  font-weight: 750;
}

.asset-use:hover {
  background: rgba(124, 245, 210, 0.17);
}

.asset-delete:hover {
  color: #ff9b9b;
  background: rgba(255, 100, 100, 0.08);
}

.asset-card:hover {
  background: rgba(255, 255, 255, 0.035);
}

.asset-card.selected {
  background: rgba(124, 245, 210, 0.045);
  border-color: rgba(124, 245, 210, 0.16);
}

.asset-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  background: #161c25;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--mint);
  background: linear-gradient(135deg, #18232c, #090d13);
}

.asset-empty {
  margin-top: 20px;
  padding: 24px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #788496;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.grade-b img { filter: saturate(.75) brightness(1.05); object-position: 36% center; }
.grade-c img { filter: hue-rotate(16deg) saturate(1.2) brightness(.8); object-position: 58% center; }
.grade-d img { filter: grayscale(.35) sepia(.12) brightness(.92); object-position: 30% center; }

.asset-kind {
  position: absolute;
  right: 4px;
  bottom: 4px;
  border-radius: 4px;
  padding: 2px 4px;
  background: rgba(5, 8, 12, 0.65);
  color: #dce4ee;
  font-size: 8px;
  font-style: normal;
}

.asset-hd-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 5px;
  border: 1px solid rgba(124, 245, 210, 0.48);
  border-radius: 5px;
  background: rgba(5, 16, 14, 0.84);
  color: var(--mint);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.asset-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 7px;
  font-style: normal;
}

.asset-info {
  min-width: 0;
}

.asset-info strong,
.asset-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-info strong {
  margin-bottom: 5px;
  color: #cdd4df;
  font-size: 12px;
  font-weight: 600;
}

.asset-info small {
  color: #657184;
  font-size: 10px;
}

.library-button {
  flex: none;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: #909cad;
  cursor: pointer;
  font-size: 11px;
}

.library-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.asset-card[hidden],
.date-group[hidden] {
  display: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  padding: 13px 15px;
  display: flex;
  gap: 11px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(124, 245, 210, 0.25);
  background: rgba(15, 22, 28, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.42);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  min-width: 310px;
  border-color: rgba(255, 111, 111, 0.62);
  background: rgba(55, 17, 23, 0.96);
  box-shadow: 0 18px 52px rgba(70, 10, 18, 0.52);
}

.toast.error > span {
  width: 30px;
  height: 30px;
  background: rgba(255, 111, 111, 0.18);
  color: #ffaaaa;
  font-size: 16px;
  font-weight: 800;
}

.toast.error strong {
  color: #ffd3d3;
  font-size: 14px;
}

.toast.error small {
  color: #ffb5b5;
  font-size: 12px;
}

.toast > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(124, 245, 210, 0.12);
  color: var(--mint);
  font-size: 12px;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.toast small {
  color: #8995a6;
  font-size: 10px;
}

.mobile-nav {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 64px 0 0;
  z-index: 30;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
  cursor: default;
}

.reference-dialog {
  width: min(540px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #0f141c;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.reference-dialog::backdrop {
  background: rgba(1, 4, 8, 0.72);
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 22px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-heading h2 {
  font-size: 20px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: #aab4c2;
  cursor: pointer;
  font-size: 20px;
}

.dialog-intro {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hd-quote {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.hd-quote > div {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.hd-quote > div:last-child {
  border-bottom: 0;
}

.hd-quote span,
.hd-estimate-note {
  color: var(--muted);
  font-size: 12px;
}

.hd-quote strong {
  color: #e7edf5;
  font-size: 13px;
}

.hd-quote b {
  color: var(--mint);
  font-size: 18px;
}

.hd-estimate-note {
  margin: 12px 2px 0;
  line-height: 1.55;
}

.hd-unavailable {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 100, 100, 0.35);
  border-radius: 9px;
  background: rgba(255, 100, 100, 0.08);
  color: #ffaaaa;
  font-size: 12px;
}

.hd-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 18px;
}

.hd-dialog-actions .ghost-button,
.hd-dialog-actions .auth-submit {
  min-height: 44px;
}

.hd-dialog-actions .auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.reference-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

button[data-res="512"] {
  display: none;
}

.image-mode button[data-res="512"] {
  display: inline-block;
}

.image-mode .secondary-reference,
.image-mode #moreReferenceButton,
.image-mode .video-spec,
.image-mode #frameStrip,
.image-mode #compareButton,
.image-mode #playButton,
.image-mode #playback,
.image-mode #hdButton,
.image-mode #downloadButton,
.image-mode #continueButton {
  display: none !important;
}

.frame-strip[hidden] {
  display: none;
}

.image-mode #referenceGrid,
.image-mode #referenceGrid.show-more {
  grid-template-columns: 1fr;
}

.image-mode .stage-shade {
  background: linear-gradient(to top, rgba(2, 4, 7, 0.28), transparent 34%);
}

.reference-choice > button {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111822;
  cursor: pointer;
  text-align: left;
}

.reference-choice > button:hover {
  border-color: rgba(124, 245, 210, 0.42);
  background: rgba(124, 245, 210, 0.045);
}

.choice-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8d2df;
  font-size: 17px;
}

.reference-choice strong {
  color: #edf2f8;
  font-size: 14px;
}

.reference-choice small {
  color: #738094;
  font-size: 11px;
  line-height: 1.5;
}

.compare-mode #stageImage {
  clip-path: inset(0 50% 0 0);
}

.compare-mode::after {
  content: "参考 / 生成";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(5, 8, 12, 0.7);
  color: white;
  font-size: 10px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 340px minmax(450px, 1fr);
  }
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
    grid-template-columns: 1fr auto;
  }

  .brand-product,
  .main-nav,
  .model-pill,
  .top-actions .icon-button {
    display: none;
  }

  .balance-pill { font-size: 12px; }

  .top-actions {
    gap: 6px;
  }

  .auth-entry {
    min-width: 52px;
    padding: 0 11px;
  }

  .workspace {
    display: block;
    height: auto;
    min-height: calc(100vh - 58px);
    padding-bottom: 72px;
  }

  .control-panel,
  .canvas-panel,
  .asset-panel {
    display: none;
    width: 100%;
    border: 0;
  }

  .control-panel.mobile-active,
  .canvas-panel.mobile-active {
    display: block;
  }

  .asset-panel.mobile-active {
    display: flex;
    position: static;
    transform: none;
    min-height: calc(100vh - 130px);
    box-shadow: none;
  }

  .drawer-backdrop {
    display: none;
  }

  .control-panel {
    padding: 20px 16px 25px;
  }

  .canvas-panel {
    padding: 20px 14px 25px;
  }

  .canvas-heading {
    align-items: flex-end;
  }

  .stage.ratio-9-16 {
    width: min(78%, 430px);
  }

  .stage.ratio-1-1 {
    width: 100%;
  }

  .frame-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .progress-heading {
    align-items: flex-start;
  }

  .progress-heading > div {
    grid-template-columns: auto 1fr;
  }

  .progress-heading #progressDetail {
    grid-column: 1 / -1;
  }

  .safety-note {
    align-items: flex-start;
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: rgba(15, 20, 28, 0.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav button {
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-nav button.active {
    background: var(--surface-2);
    color: var(--text);
  }

  .toast {
    right: 16px;
    bottom: 74px;
  }

  .dialog-card {
    padding: 18px;
  }

  .reference-choice {
    grid-template-columns: 1fr;
  }

  .reference-choice > button {
    min-height: 104px;
  }
}

@media (min-width: 781px) {
  .type-switch {
    display: none;
  }

  .control-panel,
  .canvas-panel {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* 主题：默认浅色，深色通过 html[data-theme="dark"] 切换。 */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --surface: #eef2f7;
  --surface-2: #e5ebf3;
  --line: rgba(31, 48, 72, 0.13);
  --line-strong: rgba(31, 48, 72, 0.22);
  --text: #172236;
  --muted: #5d6b7e;
  --muted-2: #7c8999;
  --mint: #14b890;
  --mint-2: #079b78;
  --violet: #7658d6;
  --shadow: 0 20px 60px rgba(31, 48, 72, 0.12);
}

html[data-theme="dark"] {
  --bg: #080b10;
  --panel: #0d1118;
  --panel-2: #111720;
  --surface: #151b25;
  --surface-2: #1a2230;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #8f9bad;
  --muted-2: #657183;
  --mint: #7cf5d2;
  --mint-2: #48d7b2;
  --violet: #a78bfa;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .control-panel,
html[data-theme="light"] .canvas-panel,
html[data-theme="light"] .asset-panel,
html[data-theme="light"] .dialog-card,
html[data-theme="light"] .auth-card {
  background: var(--panel);
}

html[data-theme="light"] .prompt-box,
html[data-theme="light"] .type-switch,
html[data-theme="light"] .main-nav {
  background: #f8fafc;
}

html[data-theme="light"] .prompt-box textarea { color: #172236; }
html[data-theme="light"] .stage,
html[data-theme="light"] .reference-tile,
html[data-theme="light"] .asset-card { background: #eef2f7; }

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .section-row label,
html[data-theme="light"] .section-label strong,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] .tile-title,
html[data-theme="light"] .asset-info strong,
html[data-theme="light"] .control-section label {
  color: #172236;
}

html[data-theme="light"] .brand-product,
html[data-theme="light"] .tile-note,
html[data-theme="light"] .auto-hint,
html[data-theme="light"] .prompt-meta,
html[data-theme="light"] .section-label span,
html[data-theme="light"] .asset-info small,
html[data-theme="light"] .prompt-hint {
  color: #526176;
}

html[data-theme="light"] .text-action,
html[data-theme="light"] .text-action:hover {
  color: #087e65;
}

html[data-theme="light"] .prompt-box,
html[data-theme="light"] .reference-tile,
html[data-theme="light"] .asset-card,
html[data-theme="light"] .spec-summary,
html[data-theme="light"] .dialog-card,
html[data-theme="light"] .auth-card {
  border-color: rgba(31, 48, 72, 0.18);
  box-shadow: 0 8px 24px rgba(31, 48, 72, 0.06);
}

html[data-theme="light"] .prompt-box textarea::placeholder,
html[data-theme="light"] input::placeholder {
  color: #7b8797;
}

html[data-theme="light"] .icon-button,
html[data-theme="light"] .ghost-button,
html[data-theme="light"] .mini-segment button,
html[data-theme="light"] .asset-filters button,
html[data-theme="light"] .nav-item {
  color: #405069;
}

html[data-theme="light"] .main-nav {
  border-color: rgba(31, 48, 72, 0.18);
  background: #e8edf4;
}

html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .type-switch button.active {
  color: #123d35;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  color: #172236;
}

html[data-theme="light"] .asset-search input,
html[data-theme="light"] .prompt-box,
html[data-theme="light"] .type-switch {
  background: #ffffff;
}

.theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle:hover {
  border-color: var(--mint-2);
  color: var(--mint-2);
}

.image-spec { display: none; }
.image-mode .image-spec { display: grid; }

/* 浅色主题保持清晰的层次，同时让模型选择成为图像流程中的明确步骤。 */
html[data-theme="light"] .app-shell {
  background: linear-gradient(135deg, #f7fafc 0%, #eef5f3 52%, #f6f7fb 100%);
}

html[data-theme="light"] .topbar {
  box-shadow: 0 1px 0 rgba(31, 48, 72, 0.12), 0 8px 24px rgba(31, 48, 72, 0.05);
}

html[data-theme="light"] .main-nav {
  border-color: rgba(31, 48, 72, 0.24);
  background: #edf2f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .nav-item.active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(31, 48, 72, 0.13);
  color: #087e65;
}

html[data-theme="light"] .prompt-box:focus-within {
  border-color: #18b99a;
  box-shadow: 0 0 0 3px rgba(20, 184, 144, 0.14), 0 10px 28px rgba(31, 48, 72, 0.08);
}

html[data-theme="light"] .stage {
  border: 1px solid rgba(31, 48, 72, 0.18);
  box-shadow: 0 18px 45px rgba(31, 48, 72, 0.12);
}

.image-spec .option-row {
  gap: 8px;
}

.image-spec .option-row button {
  min-width: 96px;
  font-weight: 700;
}

/* 输出设置是高频操作，浅色主题下保持正文级对比度。 */
html[data-theme="light"] .spec-summary,
html[data-theme="light"] .spec-summary strong,
html[data-theme="light"] .spec-summary i,
html[data-theme="light"] .spec-name {
  color: #26364d !important;
}

html[data-theme="light"] .spec-summary strong {
  font-weight: 700;
}

html[data-theme="light"] .option-row button {
  color: #34445b !important;
  border-color: #c8d2df;
  background: #ffffff;
}

html[data-theme="light"] .option-row button:hover {
  color: #10253d !important;
  border-color: #1bb995;
  background: #f2fbf8;
}

html[data-theme="light"] .option-row button.active {
  color: #075d4e !important;
  border-color: #16b890;
  background: #d9f7ee;
  box-shadow: inset 0 0 0 1px rgba(22, 184, 144, 0.1);
}

@media (max-width: 780px) {
  html[data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(31, 48, 72, 0.18);
    box-shadow: 0 12px 35px rgba(31, 48, 72, 0.16);
  }

  html[data-theme="light"] .mobile-nav button.active {
    background: #dff7ef;
    color: #087e65;
  }
}

/* 资产删除两段式确认：第一次点击变红要求二次确认 */
.asset-delete.confirming {
  width: auto;
  min-width: 28px;
  padding: 0 7px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* 模型选择保持可见；浅色主题沿用 logo 原始深色文字。 */
.image-model-picker {
  gap: 9px;
  margin: 16px 0 4px;
}
.image-model-picker .option-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.image-model-picker .option-row button { min-height: 40px; }
html[data-theme="light"] .brand-mark img { filter: none; }
html[data-theme="light"] .image-model-picker > .section-label { color: #26364d; }
html[data-theme="light"] .model-pill { color: #334155; background: #f1f5f9; border-color: #cbd5e1; }

.image-model-picker button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
#imageNodeStatus { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.model-pill.unavailable i { background: #94a3b8; }

#progressBar.indeterminate { animation: generation-pending 1.8s ease-in-out infinite alternate; }
@keyframes generation-pending { from { transform: translateX(0); } to { transform: translateX(180%); } }
@media (prefers-reduced-motion: reduce) { #progressBar.indeterminate { animation: none; } }

/* 质量流程与助手草稿共用现有主题，不以进度动画冒充模型阶段。 */
.quality-guide, .quality-presets, .prompt-review, .quality-review { border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px; margin: 12px 0; background: var(--panel-2); }
.quality-guide p, .quality-presets p, .prompt-tips p, .prompt-review p, .quality-review p { font-size: 12px; line-height: 1.75; color: var(--muted); margin: 8px 0; overflow-wrap: anywhere; }
.quality-guide strong, .quality-review strong { font-size: 13px; }
.quality-tag, .quality-review .section-row > span { font-size: 11px; color: var(--muted); }
.quality-guide summary, .prompt-tips summary, .prompt-review summary, .quality-review summary { cursor: pointer; font-size: 12px; line-height: 1.8; }
.mode-options { display: grid; gap: 6px; margin: 10px 0; }
.mode-options button { padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); }
.mode-options span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.quality-presets .option-row { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; }
.assistant-status { padding: 10px; font-size: 12px; line-height: 1.7; color: var(--text); background: var(--surface); border-radius: 8px; overflow-wrap: anywhere; }
.assistant-status.error { border-left: 3px solid #dc647b; }
.prompt-review label { display: block; font-size: 12px; margin: 10px 0 6px; }
.prompt-review textarea { width: 100%; min-height: 180px; resize: vertical; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; line-height: 1.7; }
#draftOriginal { white-space: pre-wrap; }

/* 提示词助手的建议效果 LoRA 列表：目录注释 + 强度细调 + 启停 */
.lora-suggestions { margin: 12px 0 2px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.lora-suggestions-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lora-suggestions-head label { font-size: 12px; color: var(--text); }
.lora-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lora-item { padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 10px; }
.lora-item:first-of-type { border-top: none; margin-top: 6px; }
.lora-item.disabled .lora-toggle, .lora-item.disabled .lora-desc, .lora-item.disabled .lora-strength { opacity: 0.45; }
.lora-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lora-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.lora-cat { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.lora-desc { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin: 6px 0 8px; overflow-wrap: anywhere; }
.lora-strength { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.lora-strength input[type="range"] { flex: 1; accent-color: var(--mint); }
.lora-strength-value { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--text); min-width: 34px; text-align: right; }
.review-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.quality-review { width: 100%; }
.quality-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.quality-checklist label { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.6; }
.prompt-tips { margin-top: 12px; }
@media (max-width: 780px) { .quality-checklist { grid-template-columns: 1fr; } .quality-tag { display: none; } }


/* ============================================================
   2026-10 现代化改版:aurora 渐变背景 + 玻璃拟态面板 + 渐变强调
   以覆盖层方式追加,浅色主题(data-theme="light")不受影响。
   ============================================================ */
html:not([data-theme="light"]) {
  --bg: #06080d;
  --panel: rgba(15, 20, 29, 0.62);
  --panel-2: rgba(21, 27, 39, 0.66);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

/* aurora 光斑:两团缓慢漂移的 mint / violet 光晕 */

html:not([data-theme="light"]) .app-shell {
  background:
    radial-gradient(ellipse 44vw 38vw at 6% -6%, rgba(72, 215, 178, 0.12), transparent 68%),
    radial-gradient(ellipse 50vw 44vw at 98% 106%, rgba(167, 139, 250, 0.11), transparent 68%),
    radial-gradient(ellipse 40vw 30vw at 70% -12%, rgba(96, 130, 255, 0.07), transparent 66%),
    var(--bg);
}

/* 顶栏:更透的玻璃 */
html:not([data-theme="light"]) .topbar {
  background: rgba(9, 12, 18, 0.55);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* 导航:胶囊分段控件,激活项渐变高亮 */
html:not([data-theme="light"]) .main-nav {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
html:not([data-theme="light"]) .nav-item { border-radius: 10px; }
html:not([data-theme="light"]) .nav-item.active {
  background: linear-gradient(135deg, rgba(124, 245, 210, 0.9), rgba(72, 215, 178, 0.82) 46%, rgba(167, 139, 250, 0.85));
  color: #06110d;
  box-shadow: 0 4px 20px rgba(72, 215, 178, 0.35);
}
html:not([data-theme="light"]) .nav-item.active::after { display: none; }

/* 三大面板:玻璃卡 + 呼吸间距 */
html:not([data-theme="light"]) .control-panel,
html:not([data-theme="light"]) .asset-panel {
  background: rgba(12, 16, 23, 0.88);
}
html:not([data-theme="light"]) .control-panel { border-right: 1px solid rgba(255, 255, 255, 0.05); }

/* 左栏内部 section:bento 卡片化 */
html:not([data-theme="light"]) .control-section {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 16px;
  transition: border-color 0.2s ease;
}
html:not([data-theme="light"]) .control-section:hover { border-color: rgba(124, 245, 210, 0.25); }

/* 提示词输入:内嵌深色 + 聚焦光晕 */
html:not([data-theme="light"]) .prompt-box textarea {
  background: rgba(4, 6, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}
html:not([data-theme="light"]) .prompt-box textarea:focus-visible {
  outline: none;
  border-color: rgba(124, 245, 210, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 245, 210, 0.14);
}

/* 生成按钮:渐变 + 光晕 + 悬浮 */
html:not([data-theme="light"]) .generate-button {
  border-radius: 14px;
  background: linear-gradient(105deg, #7cf5d2 0%, #48d7b2 40%, #a78bfa 110%);
  box-shadow: 0 10px 34px rgba(72, 215, 178, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}
html:not([data-theme="light"]) .generate-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 44px rgba(72, 215, 178, 0.42);
  filter: saturate(1.1);
}
html:not([data-theme="light"]) .generate-button:disabled { box-shadow: none; filter: saturate(0.5) brightness(0.72); }

/* 幽灵按钮 / 模型胶囊:玻璃化 */
html:not([data-theme="light"]) .ghost-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
html:not([data-theme="light"]) .ghost-button:hover { border-color: rgba(124, 245, 210, 0.45); background: rgba(124, 245, 210, 0.08); }
html:not([data-theme="light"]) .model-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

/* 预览舞台与进度/自检/复核卡:统一大圆角玻璃 */
html:not([data-theme="light"]) .stage { border-radius: 22px; }
html:not([data-theme="light"]) .progress-card,
html:not([data-theme="light"]) .quality-review,
html:not([data-theme="light"]) .prompt-review,
html:not([data-theme="light"]) .lora-suggestions {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 眉标与主标题:渐变文字 */
html:not([data-theme="light"]) .eyebrow { color: var(--mint-2); letter-spacing: 0.14em; }
html:not([data-theme="light"]) #canvasTitle {
  background: linear-gradient(120deg, #f5f7fb 30%, #9fe8d5 70%, #b9a5fb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 滑杆 / 进度条统一 mint */
html:not([data-theme="light"]) input[type="range"] { accent-color: var(--mint); }
html:not([data-theme="light"]) .progress-track > i {
  background: linear-gradient(90deg, var(--mint), var(--violet));
  border-radius: 999px;
}

/* 停止按钮更醒目但不刺眼 */
html:not([data-theme="light"]) .stop-button {
  border-radius: 999px;
  border: 1px solid rgba(255, 111, 125, 0.45);
  background: rgba(255, 111, 125, 0.1);
}
html:not([data-theme="light"]) .stop-button:hover:not(:disabled) { background: rgba(255, 111, 125, 0.2); }
