:root {
  color-scheme: light;
  --ink: #0f172a;
  --text: #334155;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --paper: rgba(255, 255, 255, 0.75);
  --paper-solid: #ffffff;
  --dark: #0f172a;
  --green: #22c55e;
  --blue: #3b82f6;
  --red: #ef4444;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 22%, rgba(124, 58, 237, 0.07), transparent 40%),
    radial-gradient(ellipse at 82% 16%, rgba(236, 72, 153, 0.05), transparent 40%),
    radial-gradient(ellipse at 48% 88%, rgba(251, 191, 36, 0.04), transparent 40%);
}

.app.editor-mode {
  background: linear-gradient(135deg, #080711 0%, #130d28 48%, #331811 100%);
}

.app.editor-mode .ambient {
  display: none;
}

.app.editor-mode .topbar {
  background: rgba(8, 7, 17, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app.editor-mode .brand-btn,
.app.editor-mode .nav-pill,
.app.editor-mode .icon-pill {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.app.editor-mode .brand-btn {
  color: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.brand-btn,
.nav-pill,
.dark-pill,
.icon-pill,
.tool-button,
.send-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.brand-btn {
  background: transparent;
  font-weight: 650;
  font-size: 30px;
}

.brand-name {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

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

.nav-pill,
.icon-pill {
  background: transparent;
  color: #475569;
  border: 1px solid rgba(203, 213, 225, 0.5);
  padding: 0 16px;
  font-size: 15px;
}

.icon-pill {
  width: 52px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}

.sparkle-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 18px;
}

.dark-pill {
  background: #0f172a;
  color: #fff;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
}

.nav-pill:hover {
  background: #fff;
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.3);
}

.icon-pill:hover,
.brand-btn:hover {
  background: #fff;
  color: var(--ink);
  border-color: #cbd5e1;
}

.dark-pill:hover,
.send-button:hover {
  background: #1e293b;
}

.dark-pill:active,
.send-button:active {
  transform: scale(0.97);
}

.home-view,
.chat-view,
.library-view {
  position: relative;
  z-index: 10;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 82px);
  padding: 300px clamp(16px, 4vw, 32px) 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
  position: relative;
}

.hero > *:not(.hero-video-layer) {
  position: relative;
  z-index: 1;
}

.hero-video-layer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleY(-1);
  opacity: 0.88;
  display: block;
  background: #eef2ff;
}

.hero-video-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 26.416%,
    #fff 66.943%
  );
}

.config-chip,
.library-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}

.daily-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #8c93a1;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
}

.metric-stars {
  color: #f6b300;
  letter-spacing: 2px;
  font-size: 15px;
}

.metric-dots {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.metric-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

.metric-dots i:nth-child(2) { background: #ef4444; }
.metric-dots i:nth-child(3) { background: #f59e0b; }
.metric-dots i:nth-child(4) { background: #22c55e; }
.metric-dots i:nth-child(5) { background: #8b5cf6; }

.hero h1,
.library-hero h1 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.04em;
  font-size: clamp(38px, 6vw, 80px);
  line-height: 1.05;
  font-weight: 500;
}

.hero h1 em {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(46px, 7.5vw, 100px);
}

.hero h1 em + em {
  margin-left: 0.15em;
}

.hero h1 em:last-child {
  margin-left: 0.6em;
}

.hero-desc,
.library-hero p {
  margin: 0;
  max-width: 554px;
  color: var(--text);
  opacity: 0.8;
  font-size: 18px;
  line-height: 1.65;
}

.hero .config-chip,
.hero .daily-metric,
.hero h1,
.hero .hero-desc,
.hero .composer-mount {
  animation: fadeSlideUp 0.72s ease both;
}

.hero .daily-metric { animation-delay: 0.08s; }
.hero h1 { animation-delay: 0.16s; }
.hero .hero-desc { animation-delay: 0.24s; }
.hero .composer-mount { animation-delay: 0.32s; }

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.composer-mount,
.sticky-composer {
  width: min(960px, calc(100vw - 32px));
}

.sticky-composer {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 40;
  transform: translateX(-50%);
}

.composer {
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.4);
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 24px;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer:focus-within {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

.composer-head .model-chip {
  display: none;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.model-chip {
  border: 0;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 18px;
  background: #0f172a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.square-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #b6bbc4;
  font-size: 14px;
  white-space: nowrap;
}

.square-toggle span[data-i18n="publishToSquare"] {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.square-toggle:hover span[data-i18n="publishToSquare"] {
  opacity: 1;
}

.square-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.square-toggle input:checked + .toggle-track {
  background: #0f172a;
}

.square-toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.prompt-box {
  width: 100%;
  min-height: 100px;
  max-height: none;
  resize: both;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  outline: 0;
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.6;
  transition: border-color 0.2s ease;
}

.prompt-box::placeholder {
  color: #94a3b8;
}

.prompt-box:focus {
  border-color: rgba(124, 58, 237, 0.4);
}

.composer-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.composer-bar .prompt-box {
  flex: 1;
  min-width: 0;
}

.delete-btn {
  color: #ef4444;
  transition: color 0.15s ease;
}

.delete-btn:hover {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

.composer-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.paste-clear {
  display: flex;
  gap: 4px;
}

.paste-clear button {
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  color: #94a3b8;
  font-size: 15px;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
  cursor: pointer;
}

.paste-clear button:hover {
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.06);
}

.tool-button,
.add-reference-button {
  background: #f4f6f8;
  color: #667085;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid #edf0f3;
  min-height: 36px;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.upload-hint {
  font-size: 10px;
  color: #a0a7b3;
  white-space: nowrap;
  line-height: 1;
}

.add-reference-button {
  width: 100px;
  height: 100px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px dashed #d5d8de;
  background: #fff;
  color: #a0a7b3;
  font-size: 32px;
}

.tool-button input,
.add-reference-button input {
  display: none;
}

.tool-button:hover,
.tool-button.active,
.add-reference-button:hover {
  background: #fff;
  color: var(--ink);
  border-color: #94a3b8;
}

.send-button {
  margin-top: 4px;
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  color: #fff;
  padding: 0 28px;
  min-height: 54px;
  min-width: 86px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.send-button span {
  white-space: nowrap;
}

.send-button:hover {
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

.send-button:active {
  transform: scale(0.97);
}

.send-button:disabled {
  opacity: 0.45;
}

.advanced-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 4px 2px;
}

.custom-size-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  grid-column: span 2;
}

.advanced-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #778091;
  font-size: 12px;
}

.advanced-options label span {
  flex-shrink: 0;
}

.advanced-options label select {
  flex: 1;
  min-width: 0;
}

.advanced-options select,
.advanced-options input,
.modal input,
.modal select,
.modal textarea,
.admin-card input,
.admin-card select {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  padding: 9px 12px;
  color: var(--ink);
  transition: border-color 0.2s ease;
}

.advanced-options select:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.admin-card input:focus,
.admin-card select:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.reference-row {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.ref-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 10px;
  min-height: 28px;
}

.ref-bar .square-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

.reference-thumb {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  animation: refFadeIn 0.25s ease both;
}

.reference-thumb:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

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

.reference-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.hero-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.4);
}

.hero-action-btn:active {
  transform: scale(0.97);
}

.hero-action-btn i {
  font-size: 22px;
}

.hero-action-btn:nth-child(2) {
  background: linear-gradient(135deg, #ec4899, #db2777);
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
}
.hero-action-btn:nth-child(2):hover {
  box-shadow: 0 8px 28px rgba(236, 72, 153, 0.4);
}
.hero-action-btn:nth-child(3) {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}
.hero-action-btn:nth-child(3):hover {
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.4);
}

.recent-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 68px;
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.recent-header {
  text-align: center;
  margin-bottom: 32px;
}

.recent-header h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
  font-weight: 520;
  letter-spacing: 0;
  color: var(--ink);
}

.recent-header p {
  margin: 7px 0 0;
  color: #999;
  font-size: 14px;
}

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

.recent-tile {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  transition: box-shadow 0.2s ease;
  contain: layout paint;
}

.recent-tile:hover {
  box-shadow: 0 8px 30px -8px rgba(15, 23, 42, 0.12);
}

.recent-visual {
  height: 220px;
  background: #f1f5f9;
}


.recent-visual img,
.recent-gradient {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-visual img {
  transform: translateZ(0);
}

.recent-gradient {
  display: grid;
  place-items: center;
  background: var(--art-bg);
  color: rgba(255, 255, 255, 0.94);
  font-size: 44px;
}

.recent-caption {
  display: grid;
  gap: 5px;
  padding: 12px 13px 14px;
}

.recent-caption strong {
  color: #1e293b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-caption span {
  color: #778091;
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.example-card,
.prompt-card {
  border: 1px solid rgba(203, 213, 225, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  contain: layout paint;
}

.example-card:hover,
.prompt-card:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: 0 8px 25px -6px rgba(124, 58, 237, 0.12);
}

.card-art {
  height: 154px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--art-bg);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.94);
  font-size: 42px;
}

.prompt-card .card-art {
  aspect-ratio: 1;
  height: auto;
  position: relative;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art.image-error img {
  display: none;
}

.card-art.image-error::before {
  content: "\ef5b";
  font-family: remixicon;
  color: rgba(255, 255, 255, 0.92);
  font-size: 42px;
}

.card-art em {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-card h3,
.prompt-card h3 {
  margin: 0 4px 6px;
  font-size: 15px;
  color: #1e293b;
  font-weight: 600;
}

.prompt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 4px 8px;
}

.prompt-tags span {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.25;
}

.example-card p,
.prompt-card p {
  margin: 0 4px 14px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  border-top: 1px solid rgba(226, 232, 240, 0.66);
  padding: 10px 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-actions button,
.tiny-button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-actions .use-button {
  background: #0f172a;
  color: #fff;
  padding: 7px 13px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.card-actions .use-button:hover {
  background: #1e293b;
}

.chat-view {
  min-height: calc(100vh - 82px);
  padding-top: 0;
}

.generation-status {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 82px);
  color: #8a93a4;
  font-size: 14px;
  box-sizing: border-box;
}

.gen-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.status-fun {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

#funMessage {
  font-size: clamp(20px, 4vw, 36px);
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: funPulse 2.4s ease-in-out infinite;
  text-align: center;
  max-width: 420px;
  line-height: 1.4;
}

.fun-character {
  animation: charFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.3));
}

@keyframes charFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes funPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

.gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.gen-progress-text {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  margin-bottom: 30px;
}

.paint-drip {
  height: 32px;
  display: flex;
  align-items: end;
  gap: 6px;
}

.paint-drip span {
  width: 4px;
  border-radius: 999px;
  animation: drip 1.4s ease-in-out infinite;
}

.paint-drip span:nth-child(1),
.paint-drip span:nth-child(5) {
  background: #1a1a1a;
}

.paint-drip span:nth-child(2),
.paint-drip span:nth-child(4) {
  background: #666;
  animation-delay: 0.12s;
}

.paint-drip span:nth-child(3) {
  background: #999;
  animation-delay: 0.24s;
}

@keyframes drip {
  0% {
    opacity: 0;
    height: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    height: 28px;
  }
}

.history-list {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  display: grid;
  gap: 20px;
}

.history-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #667085;
  background: #f0f5ff;
  border: 1px solid #d6e4ff;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.4;
}

.date-separator {
  color: #b7bec9;
  font-size: 13px;
  margin-top: 4px;
}

.message-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.3);
  overflow: hidden;
}

.message-prompt {
  padding: 18px 18px 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #273140;
}

.message-prompt i {
  color: #94a3b8;
  margin-top: 3px;
}

.prompt-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.prompt-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  min-height: calc(1.5em * 2);
  flex: 1;
  min-width: 0;
}

.prompt-text.expanded {
  -webkit-line-clamp: unset;
}

.prompt-expand-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 2px;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: transform 0.2s, color 0.2s;
  line-height: 1;
}

.prompt-expand-btn:hover {
  color: #7c3aed;
}

.prompt-expand-btn.expanded {
  transform: rotate(180deg);
}

.message-image {
  padding: 0 14px 14px;
}

.image-shell {
  border-radius: 22px;
  overflow: hidden;
  background: #f1f5f9;
  min-height: 220px;
  display: grid;
  place-items: center;
}

.image-shell img {
  width: 100%;
  height: auto;
  max-width: 60%;
  max-height: 50vh;
}

.message-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 18px 16px;
}

.message-actions a,
.message-actions button {
  border: 0;
  background: #f6f7f9;
  color: #667085;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.message-actions a:hover,
.message-actions button:hover {
  background: #fff;
  color: var(--ink);
}

.message-actions .delete-btn {
  padding: 0 6px;
  min-width: 28px;
  justify-content: center;
}

.message-actions .delete-btn i {
  font-size: 15px;
}

.message-actions .delete-btn:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.error-box {
  margin: 0 18px 16px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd5d1;
  border-radius: 16px;
  padding: 12px;
  font-size: 13px;
}

.bottom-spacer {
  height: 180px;
}

.library-view {
  padding-bottom: 96px;
}

.library-hero {
  position: relative;
  text-align: center;
  padding: 54px 16px 40px;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.library-hero h1 {
  font-size: clamp(30px, 5vw, 52px);
}

.library-search {
  width: min(640px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.35);
  border-radius: 14px;
  padding: 6px;
}

.library-search span {
  flex-shrink: 0;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
}

.library-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 8px;
}

.library-search button {
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  transition: background 0.15s ease;
}

.library-search button:hover {
  background: rgba(203, 213, 225, 0.3);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 880px;
}

.tag-filters button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  padding: 7px 18px;
  font-size: 13px;
  transition: all 0.15s ease;
}

.tag-filters button:hover {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.5);
}

.tag-filters button.active {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.3);
}

.tag-filters button span {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.56;
}

.library-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 48px);
  margin: 4px 0 20px;
}

.library-stats div:not(.stat-divider) {
  display: grid;
  gap: 3px;
  text-align: center;
}

.library-stats strong {
  color: #1e293b;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.library-stats span {
  color: #94a3b8;
  font-size: 12px;
}

.stat-divider {
  width: 1px;
  align-self: stretch;
  background: #e2e8f0;
}

.prompt-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.load-more-wrap,
.empty-message {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 28px 0;
  color: #94a3b8;
}

.load-more-wrap button {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  color: #64748b;
  padding: 12px 28px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.load-more-wrap button:hover {
  background: #fff;
  color: #1e293b;
}

.load-more-wrap span {
  opacity: 0.58;
  margin-left: 4px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.15);
  padding: 24px;
  position: relative;
  animation: modalIn 0.18s ease-out both;
}

.preview-modal {
  width: min(860px, 100%);
  padding: 14px;
}

.compliance-modal {
  width: min(780px, calc(100vw - 32px));
  padding: 46px 56px 26px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 8%, rgba(124, 58, 237, 0.08), transparent 34%),
    #fff;
}

.compliance-close {
  color: #8a8f98;
  background: transparent;
}

.compliance-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 28px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.34);
}

.compliance-title {
  text-align: center;
  margin-bottom: 22px;
}

.compliance-title h2 {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.compliance-title h2 i {
  color: #ec4899;
}

.compliance-title p {
  margin: 0;
  color: #667085;
  font-weight: 650;
  font-size: 14px;
}

.notice-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #fff;
  padding: 20px 22px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.1);
  margin-bottom: 16px;
}

.notice-card h3 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.notice-card.danger {
  border-left: 4px solid #ff344f;
}

.notice-card.danger h3 span {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.notice-card.privacy {
  border-left: 4px solid #f59e0b;
}

.notice-card.privacy h3 i {
  color: #3b82f6;
}

.notice-card.together {
  border-left: 4px solid #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.notice-card ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 14px;
  list-style: none;
}

.notice-card li {
  position: relative;
  padding-left: 22px;
  color: #475467;
  line-height: 1.7;
  font-size: 14px;
}

.notice-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ef4444;
}

.notice-card em {
  color: #f97316;
  font-style: normal;
  font-weight: 800;
}

.notice-card p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
  font-size: 14px;
}

.compliance-actions {
  border-top: 1px solid rgba(226, 232, 240, 0.92);
  margin-top: 20px;
  padding-top: 18px;
  display: flex;
  justify-content: center;
}

.compliance-actions .modal-primary {
  width: auto;
  min-width: 120px;
  padding: 0 30px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.28);
}

.works-modal {
  width: min(980px, calc(100vw - 32px));
  padding: 24px;
}

.works-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 8px 44px 20px 0;
}

.works-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.works-head p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.works-refresh {
  width: 42px;
  min-height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
}

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

.work-card {
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.work-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  background: #eef2f7;
}

.work-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.work-body p {
  min-height: 40px;
  margin: 0;
  color: #101828;
  font-size: 13px;
  line-height: 1.55;
}

.work-body span {
  color: #98a2b3;
  font-size: 12px;
}

.works-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.work-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.work-actions .delete-btn {
  flex: 0 0 auto;
  padding: 0 6px;
  min-width: 28px;
  justify-content: center;
  color: #94a3b8;
}

.work-actions .delete-btn i {
  font-size: 15px;
}

.work-actions .delete-btn:hover {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.work-actions a,
.work-actions button {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  padding: 0 4px;
}

.work-actions a:hover,
.work-actions button:hover {
  background: #fff;
  color: var(--ink);
}

.preview-image,
.preview-gradient {
  width: 100%;
  max-height: min(68vh, 720px);
  border-radius: 22px;
  object-fit: contain;
  background: #f1f5f9;
}

.preview-gradient {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: var(--art-bg);
  color: #fff;
  font-size: 72px;
}

.preview-body {
  padding: 16px 8px 4px;
}

.preview-body h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
}

.preview-body p {
  margin: 0 0 14px;
  color: #64748b;
  line-height: 1.65;
}

.preview-actions {
  padding: 0;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-modal {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f5f6f7;
  color: #6b7280;
}

.modal-title {
  text-align: center;
  margin-bottom: 18px;
}

.modal-title i {
  font-size: 32px;
  color: var(--ink);
}

.modal-title h2 {
  margin: 8px 0 5px;
  font-size: 22px;
  font-weight: 650;
}

.modal-title p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background: #fff;
  margin-bottom: 14px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.contact-qr {
  width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
  border-radius: 14px;
  background: #f8fafc;
}

.modal-form,
.admin-form {
  display: grid;
  gap: 12px;
}

.modal-form label,
.admin-form label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.modal-primary,
.modal-secondary,
.ghost-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  font-weight: 600;
}

.modal-primary {
  background: var(--dark);
  color: #fff;
}

.modal-secondary {
  background: #f5f5f5;
  color: #333;
}

.link-button {
  border: 0;
  background: transparent;
  color: #9aa2af;
  font-size: 13px;
  padding: 8px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  background: #f3f4f6;
  border-radius: 18px;
  padding: 5px;
}

.auth-tabs button {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #8b94a1;
  min-height: 38px;
  font-weight: 600;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
}

/* Auth modal — purple tech theme */
.auth-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 30px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
}
.auth-modal .auth-tabs button.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}
.auth-modal .modal-primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
  border-radius: 14px;
  min-height: 48px;
}
.auth-modal .modal-primary:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.3);
}
.auth-modal .auth-tabs {
  background: #f1f5f9;
  border-radius: 14px;
}
.auth-modal .auth-tabs button {
  border-radius: 11px;
  min-height: 40px;
}
.auth-modal .modal-title h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.auth-modal .modal-title p {
  color: #94a3b8;
  font-size: 14px;
}
.auth-modal .modal-form label {
  color: #64748b;
  font-size: 13px;
}
.auth-modal .modal-form input {
  border-radius: 12px;
  padding: 11px 14px;
  background: #fff;
  border-color: #e2e8f0;
}
.auth-modal .modal-form input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.auth-modal .link-button {
  color: #94a3b8;
  font-size: 13px;
  padding: 10px;
}
.auth-modal .link-button:hover {
  color: #7c3aed;
}

.credits-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.checkin-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px solid #eceff3;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 22px 16px;
  margin: 18px 0;
}

.checkin-card i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 22px;
}

.checkin-card strong {
  color: #111;
  font-size: 34px;
  line-height: 1;
}

.checkin-card span {
  color: #667085;
  font-size: 13px;
}

.package-card {
  border: 1px solid #eee;
  background: #f9f9f9;
  border-radius: 18px;
  padding: 16px 8px;
  position: relative;
}

.package-card.hot {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.package-card strong {
  display: block;
  font-size: 22px;
}

.package-card span {
  display: block;
  opacity: 0.68;
  font-size: 12px;
  margin-top: 4px;
}

.hot-badge {
  position: absolute;
  top: -9px;
  right: -5px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
}

.admin-modal {
  width: min(1120px, 100%);
}

.editor-view {
  min-height: calc(100vh - 82px);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.18) 1px, transparent 0) 0 0 / 40px 40px,
    linear-gradient(135deg, #080711 0%, #130d28 45%, #331811 100%);
  color: #f8fafc;
  padding: 22px clamp(14px, 3vw, 32px) 32px;
}

.editor-stage {
  max-width: 1540px;
  margin: 0 auto;
}

.editor-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.editor-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  font-weight: 750;
}

.editor-tabs {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.editor-tabs button,
.editor-toolbar button,
.editor-zoom button,
.editor-prompt-bar button,
.editor-attach {
  border: 0;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.editor-tabs button {
  gap: 8px;
  min-height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-size: 16px;
  font-weight: 700;
}

.editor-tabs button.active {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: #fff;
  box-shadow: inset -4px -6px 25px rgba(201, 201, 201, 0.08), inset 4px 4px 10px rgba(29, 29, 29, 0.24);
}

.editor-workspace {
  position: relative;
  min-height: calc(100vh - 160px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.2) 1.5px, transparent 0) 0 0 / 38px 38px,
    rgba(5, 5, 14, 0.82);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.editor-toolbar {
  position: absolute;
  left: 50%;
  top: 28px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(63, 68, 76, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.editor-toolbar button {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 25px;
}

.editor-toolbar button.active {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
}

.editor-toolbar input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.editor-canvas-area {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  padding: 110px 48px 132px;
}

.editor-upload-card {
  width: min(520px, calc(100vw - 48px));
  min-height: 280px;
  border-radius: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  cursor: pointer;
}

.editor-upload-card i {
  font-size: 44px;
  color: #c4b5fd;
}

.editor-upload-card strong {
  font-size: 20px;
  color: #fff;
}

.editor-upload-card span {
  font-size: 13px;
}

.editor-upload-card input,
.editor-attach input {
  display: none;
}

.editor-image-frame {
  max-width: min(76vw, 980px);
  max-height: calc(100vh - 280px);
  display: grid;
  place-items: center;
}

.editor-image-scaler {
  position: relative;
  transform-origin: center center;
  transition: transform 0.16s ease;
}

.editor-image-scaler img {
  display: block;
  max-width: min(76vw, 980px);
  max-height: calc(100vh - 280px);
  width: auto;
  height: auto;
  user-select: none;
  border-radius: 2px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  cursor: zoom-in;
}

.editor-image-scaler canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.editor-zoom {
  position: absolute;
  left: 34px;
  bottom: 34px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.editor-zoom button {
  width: 36px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
  font-size: 22px;
}

.editor-zoom span {
  min-width: 54px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.editor-keyboard {
  position: absolute;
  right: 34px;
  bottom: 34px;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 14, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 22px;
}

.editor-prompt-bar {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 6;
  transform: translateX(-50%);
  width: min(880px, calc(100vw - 320px));
  min-height: 72px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(42, 42, 48, 0.96), rgba(12, 12, 16, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

.editor-attach {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 23px;
}

.editor-prompt-icon {
  color: #a855f7;
  font-size: 24px;
}

.editor-prompt-bar > input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  outline: none;
}

.editor-prompt-bar input::placeholder {
  color: rgba(255, 255, 255, 0.54);
}

.editor-public-toggle {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.58);
}

.editor-prompt-bar button[type="submit"] {
  min-width: 132px;
  height: 54px;
  gap: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
  transition: box-shadow 0.2s ease;
}

.editor-prompt-bar button[type="submit"]:hover {
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.4);
}

.editor-prompt-bar button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) 1fr;
  gap: 18px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  padding: 18px;
}

.admin-card h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

.admin-switch {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
  color: #273140 !important;
}

.admin-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--dark);
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.users-table th {
  color: #8b94a1;
  font-size: 12px;
  text-transform: uppercase;
}

.users-table input,
.users-table select {
  min-width: 86px;
  padding: 8px;
  border-radius: 12px;
}

.user-cell strong {
  display: block;
}

.user-cell span {
  color: #8b94a1;
  font-size: 12px;
}

.toast-layer {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 230px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #0f172a;
  border: 1px solid rgba(203, 213, 225, 0.3);
  padding: 12px 14px;
  padding-left: 16px;
  animation: toastIn 0.22s ease-out both;
  font-size: 13px;
  border-left: 4px solid #94a3b8;
}

.toast-success {
  border-left-color: #22c55e;
  background: rgba(240, 253, 244, 0.95);
}

.toast-error {
  border-left-color: #ef4444;
  background: rgba(254, 242, 242, 0.95);
}

.toast-warning {
  border-left-color: #f59e0b;
  background: rgba(255, 247, 237, 0.95);
}

.toast-info {
  border-left-color: #3b82f6;
  background: rgba(239, 246, 255, 0.95);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fade-up {
  animation: fadeUp 0.65s ease-out both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes refFadeIn {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-pill span {
    display: none;
  }

  .nav-pill .sparkle-icon {
    display: inline-grid;
  }

  .hero {
    padding-top: 160px;
  }

  .daily-metric {
    flex-wrap: wrap;
    gap: 8px 12px;
    white-space: normal;
  }

  .advanced-options,
  .custom-size-row,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .recent-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-composer {
    bottom: 10px;
  }

  .editor-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .editor-brand {
    justify-self: center;
  }

  .editor-canvas-area {
    padding: 104px 18px 158px;
  }

  .editor-prompt-bar {
    width: calc(100vw - 32px);
    bottom: 84px;
    border-radius: 28px;
    flex-wrap: wrap;
  }

  .editor-public-toggle {
    order: 5;
  }

  .editor-zoom {
    left: 16px;
    bottom: 22px;
  }

  .editor-keyboard {
    right: 16px;
    bottom: 22px;
  }
}

@media (max-width: 560px) {
  .top-actions {
    gap: 6px;
  }

  .nav-pill,
  .dark-pill,
  .icon-pill {
    min-height: 36px;
    padding: 0 11px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero h1 em {
    font-size: 48px;
  }

  .composer {
    border-radius: 28px;
    padding: 18px;
  }

  .composer-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .composer-bar {
    align-items: stretch;
  }

  .composer-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .send-button,
  .tool-button {
    min-width: 72px;
  }

  .prompt-box {
    min-width: 0;
    font-size: 15px;
  }

  .library-search {
    flex-wrap: wrap;
  }

  .library-search input {
    flex-basis: 100%;
    order: 5;
  }

  .credits-packages {
    grid-template-columns: 1fr;
  }

  .works-modal {
    padding: 20px 14px;
  }

  .works-head {
    margin-right: 40px;
  }

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

  .work-actions {
    flex-wrap: wrap;
  }
  .work-actions a,
  .work-actions button {
    flex: 1 1 calc(50% - 3px);
  }

  .compliance-modal {
    padding: 38px 18px 20px;
    border-radius: 18px;
  }

  .compliance-title h2 {
    font-size: 18px;
  }

  .notice-card {
    padding: 16px;
  }

  .recent-masonry {
    gap: 10px;
  }

  .recent-visual {
    height: 180px;
  }

  .editor-view {
    padding: 12px 10px 24px;
  }

  .editor-tabs button {
    min-height: 40px;
    padding: 0 16px;
  }

  .editor-toolbar {
    top: 18px;
    gap: 4px;
    padding: 7px;
  }

  .editor-toolbar button {
    width: 39px;
    height: 39px;
    font-size: 22px;
  }

  .editor-image-scaler img,
  .editor-image-frame {
    max-width: calc(100vw - 42px);
  }

  .editor-prompt-bar > input {
    flex-basis: calc(100% - 76px);
    font-size: 15px;
  }

  .editor-prompt-bar button[type="submit"] {
    min-width: 108px;
    height: 48px;
    font-size: 16px;
  }
}

/* Result view — single image display */
.result-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* Floating prompt button */
.prompt-float-btn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 45;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #0f172a;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.prompt-float-btn:hover {
  background: #1e293b;
}

/* Floating prompt panel */
.prompt-float-panel {
  position: fixed;
  right: 28px;
  bottom: 96px;
  z-index: 45;
  width: 380px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--line);
  padding: 16px;
  animation: modalIn 0.18s ease-out both;
}

#floatComposer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.float-prompt-box {
  width: 100%;
  min-height: 100px;
  max-height: none;
  resize: both;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
  background: #fff;
}

.float-prompt-box:focus {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.float-prompt-box::placeholder {
  color: #a5adba;
}

#floatComposer button[type="submit"] {
  align-self: flex-end;
  min-height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#floatComposer button[type="submit"]:hover {
  background: #1e293b;
}

@media (max-width: 560px) {
  .prompt-float-panel {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
  }

  .prompt-float-btn {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
}

/* Editor progress bar */
.editor-progress {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 6px;
  overflow: visible;
  border-radius: 999px 999px 0 0;
  z-index: 5;
}

.editor-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.editor-progress-text {
  position: absolute;
  right: 0;
  top: 8px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

/* Editor toolbar save button & divider */
.editor-toolbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 4px;
  flex: 0 0 auto;
}

/* Zoom overlay — keeps the works modal underneath */
.zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.zoom-overlay .zoom-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  cursor: default;
}

.zoom-tip {
  position: fixed;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.zoom-tip.visible {
  opacity: 1;
}

.zoom-info {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  pointer-events: none;
  z-index: 1001;
  text-align: center;
}

.zoom-info strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.zoom-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.85;
  max-height: 60px;
  overflow-y: auto;
}

.zoom-controls button,
.zoom-save {
  border: 0;
  background: #f5f6f7;
  color: #515866;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.zoom-controls button:hover,
.zoom-save:hover {
  background: #e8eaed;
  color: var(--ink);
}

.zoom-controls span {
  min-width: 48px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.zoom-save {
  width: auto;
  padding: 0 14px;
  border-radius: 999px;
  gap: 6px;
  font-size: 13px;
  margin-left: 8px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 70;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-size: 20px;
  border: 1px solid rgba(203, 213, 225, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.15s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: #f8fafc;
}

/* ======= AI 套图 (Suite View) ======= */
.suite-view {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 32px) 80px;
  display: grid;
  gap: 32px;
}

.suite-hero {
  text-align: center;
  padding: 20px 0 0;
}

.suite-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.suite-hero p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 15px;
}

.suite-view h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 620;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Upload area */
.suite-upload-hint {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.suite-upload-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.suite-upload-slot {
  width: 108px;
  height: 108px;
  border: 1.5px dashed #d0d5dd;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #f9fafb;
  color: #98a2b3;
  font-size: 28px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.suite-upload-slot:hover {
  border-color: #a78bfa;
  background: #f5f3ff;
  color: #7c3aed;
}

.suite-upload-slot.has-image {
  border-style: solid;
  border-color: #e2e8f0;
}

.suite-upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.suite-upload-slot .ri-add-line {
  position: relative;
  z-index: 1;
}

.suite-upload-slot .slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.suite-upload-slot input[type="file"],
#suite-file-input {
  display: none;
}

.suite-upload-grid.drag-over .suite-upload-add {
  border-color: #7c3aed;
  background: #f5f3ff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Type selector — force 7 items in one row */
.suite-type-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.suite-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: #475569;
  line-height: 1.25;
  text-align: center;
}

.suite-type-card i {
  font-size: 24px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.suite-type-card:hover {
  border-color: #c4b5fd;
  background: #faf5ff;
}

.suite-type-card.active {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #6d28d9;
}

.suite-type-card.active i {
  color: #7c3aed;
}

/* Settings */
.suite-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 16px;
}

.suite-setting {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #475569;
}

.suite-setting span {
  font-weight: 550;
}

.suite-setting select,
.suite-setting input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(203, 213, 225, 0.5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s ease;
}

.suite-setting select:focus,
.suite-setting input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

/* Generate bar */
.suite-generate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 84px;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.suite-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #667085;
  flex-wrap: wrap;
}

.suite-cost i {
  color: #f59e0b;
  font-size: 18px;
}

.suite-cost strong {
  font-size: 20px;
  color: #1e293b;
  min-width: 24px;
  text-align: center;
}

.suite-cost-detail {
  font-size: 12px;
  color: #94a3b8;
}

.suite-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.suite-generate-btn:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.suite-generate-btn:active {
  transform: scale(0.97);
}

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

/* Results grid */
.suite-results-section h3 {
  margin-bottom: 16px;
}

.suite-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.suite-result-item {
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  transition: box-shadow 0.2s ease;
}

.suite-result-item:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.suite-result-thumb {
  aspect-ratio: 1;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.suite-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.suite-result-thumb:hover img {
  transform: scale(1.03);
}

.suite-result-pending {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.suite-result-pending .paint-drip {
  margin-bottom: 4px;
}

.suite-result-pending strong {
  color: #64748b;
  font-size: 13px;
}

.suite-result-error {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #ef4444;
  font-size: 13px;
  background: #fef2f2;
  padding: 16px;
  text-align: center;
}

.suite-result-body {
  padding: 10px 12px 12px;
  display: grid;
  gap: 4px;
}

.suite-result-body strong {
  font-size: 13px;
  color: #1e293b;
}

.suite-result-body span {
  font-size: 11px;
  color: #94a3b8;
}

.suite-result-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.suite-result-actions button,
.suite-result-actions a {
  border: 0;
  background: #f6f7f9;
  color: #667085;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.suite-result-actions button:hover,
.suite-result-actions a:hover {
  background: #fff;
  color: var(--ink);
}

.suite-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: #94a3b8;
  font-size: 14px;
}

.suite-no-results i {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  color: #d0d5dd;
}

/* Queued state */
.suite-result-queued {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f8fafc;
  color: #94a3b8;
}
.suite-result-queued i {
  font-size: 28px;
  color: #cbd5e1;
}
.suite-result-queued span {
  font-size: 12px;
  color: #94a3b8;
}

/* Save-all button */
.suite-save-all {
  grid-column: 1 / -1;
  text-align: right;
}
.suite-save-all button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.suite-save-all button:hover {
  opacity: 0.9;
}

/* Suite progress */
.suite-progress {
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.05);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0;
}

.suite-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ======= AI 套图 视觉增强 ======= */

/* Section heading icons */
.suite-view h3 i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 16px;
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(168,85,247,0.12));
  border-radius: 8px;
  flex-shrink: 0;
}

.suite-view h3 {
  gap: 10px;
}

/* Section cards with accent border */
.suite-view section {
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(203,213,225,0.25);
  border-radius: 18px;
  padding: 22px 24px;
  border-left: 3px solid #7c3aed;
  transition: box-shadow 0.2s ease;
}
.suite-view section:hover {
  box-shadow: 0 4px 20px rgba(15,23,42,0.04);
}

.suite-hero {
  text-align: center;
  padding: 28px 24px 20px;
  border-left: none;
  position: relative;
  overflow: hidden;
}
.suite-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(124,58,237,0.08), transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}
.suite-hero h1 {
  position: relative;
  z-index: 1;
}
.suite-hero p {
  position: relative;
  z-index: 1;
}
.suite-hero:hover {
  box-shadow: none;
}

.suite-upload,
.suite-types,
.suite-settings-section,
.suite-results-section {
  border-left: 3px solid #7c3aed;
}

/* Results header with action buttons */
.suite-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.suite-results-header h3 {
  margin: 0;
}

/* Retry all button */
.suite-retry-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  background: rgba(239,68,68,0.06);
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.suite-retry-all:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.5);
}

/* Enhanced type card selected state */
.suite-type-card.active {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  box-shadow: 0 2px 8px rgba(124,58,237,0.1);
  border-color: #7c3aed;
}

/* Upload slot hover enhancement */
.suite-upload-slot:hover {
  border-color: #a78bfa;
  background: #f5f3ff;
  color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.08);
}

/* Save-all bar — horizontal layout for multiple buttons */
.suite-save-all {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.suite-save-all button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.suite-save-all button:hover {
  opacity: 0.9;
}
.suite-save-all .suite-retry-all {
  background: rgba(239,68,68,0.08);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
  padding: 7px 16px;
  font-size: 13px;
  border-radius: 10px;
}
.suite-save-all .suite-retry-all:hover {
  background: rgba(239,68,68,0.16);
}

/* Suite generate bar enhancement */
.suite-generate-bar {
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.85));
  border: 1px solid rgba(203,213,225,0.3);
  border-left: 3px solid #7c3aed;
}

/* Settings panel enhancement */
.suite-settings-grid {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(203,213,225,0.25);
  border-radius: 14px;
}

/* Mobile */
@media (max-width: 680px) {
  .suite-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .suite-type-card {
    padding: 12px 6px;
    font-size: 11px;
  }
  .suite-type-card i {
    font-size: 20px;
  }
  .suite-settings-grid {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }
  .suite-upload-grid {
    justify-content: center;
  }
  .suite-generate-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .suite-generate-btn {
    justify-content: center;
  }
  .suite-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .suite-view section {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .suite-results-grid {
    grid-template-columns: 1fr;
  }
  .suite-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================= AI生图 View ======================= */
.ai-gen-view {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

.ai-gen-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: stretch;
}

.ai-gen-left {
  display: grid;
  gap: 20px;
}

.ai-gen-section {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ai-gen-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
}

.ai-gen-ref-count {
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
}

.ai-gen-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  color: #94a3b8;
  font-size: 13px;
}

.ai-gen-upload-zone:hover,
.ai-gen-upload-zone.drag-over {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.04);
}

.ai-gen-upload-zone i {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
  color: #7c3aed;
}

.ai-gen-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-gen-ref-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: refFadeIn 0.25s ease both;
}

.ai-gen-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.ai-gen-ref-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.ai-gen-ref-remove:hover {
  background: rgba(239, 68, 68, 0.85);
}

.ai-gen-clear-btn {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.ai-gen-clear-btn:hover {
  background: #fef2f2;
}

.ai-gen-prompt-actions {
  display: flex;
  gap: 4px;
}

.ai-gen-prompt-actions button {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.ai-gen-prompt-actions button:hover {
  background: #f1f5f9;
  color: #7c3aed;
}

.ai-gen-prompt-box {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ai-gen-prompt-box:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

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

.ai-gen-param {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ai-gen-param select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.ai-gen-param select:focus {
  border-color: #7c3aed;
}

.ai-gen-prompt-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-gen-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.ai-gen-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
}

.ai-gen-submit-btn:active {
  transform: scale(0.97);
}

.ai-gen-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Right panel — results */
.ai-gen-right {
  position: sticky;
  top: 100px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.ai-gen-results-head {
  padding: 16px 18px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.ai-gen-results-area {
  padding: 0;
  flex: 1;
  display: flex;
  min-height: 0;
}
.ai-gen-results-area > * {
  width: 100%;
}

.ai-gen-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.ai-gen-empty i {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.ai-gen-empty p {
  margin: 0 0 6px;
  font-weight: 500;
  color: #64748b;
}

.ai-gen-empty span {
  font-size: 13px;
}

.ai-gen-result-item {
  overflow: hidden;
  border: none;
  background: transparent;
}

.ai-gen-result-item img {
  width: 100%;
  display: block;
}

.ai-gen-result-actions {
  display: flex;
  gap: 4px;
  padding: 8px;
  justify-content: center;
  border-top: 1px solid #e2e8f0;
}

.ai-gen-result-actions a,
.ai-gen-result-actions button {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ai-gen-result-actions a:hover,
.ai-gen-result-actions button:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.04);
}

.ai-gen-result-pending {
  display: grid;
  place-items: center;
  padding: 40px;
  color: #7c3aed;
}

.ai-gen-result-error {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ef4444;
  gap: 8px;
  font-size: 14px;
  text-align: center;
}

/* ======================= AI Gen Prompt Tips ======================= */
.ai-gen-prompt-tips {
  margin-top: 8px;
}

.ai-gen-tips-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.ai-gen-tips-toggle:hover {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}

.ai-gen-tips-arrow {
  transition: transform 0.2s;
  font-size: 14px;
}

.ai-gen-tips-toggle.expanded .ai-gen-tips-arrow {
  transform: rotate(180deg);
}

.ai-gen-tips-body {
  margin-top: 6px;
  padding: 10px 14px;
  background: #f8f7ff;
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #475569;
}

.ai-gen-tips-body ul {
  margin: 0;
  padding-left: 16px;
}

.ai-gen-tips-body li {
  margin-bottom: 4px;
}

.ai-gen-tips-body li:last-child {
  margin-bottom: 0;
}

.ai-gen-tips-body strong {
  color: #7c3aed;
}

/* ======================= AI Gen Generating Progress ======================= */
.ai-gen-funmsg {
  font-size: 13px;
  color: #7c3aed;
  margin-bottom: 12px;
  text-align: center;
  font-style: italic;
}

.ai-gen-progress-track {
  width: 100%;
  height: 6px;
  background: #ede9fe;
  border-radius: 3px;
  overflow: hidden;
}

.ai-gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ai-gen-progress-text {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
}

/* ── Global progress area (left panel, between submit btn and results) ── */
.ai-gen-global-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 12px;
  animation: fadeIn 0.3s ease both;
}

.ai-gen-global-track {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.ai-gen-global-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ai-gen-global-label {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
  font-weight: 500;
}

/* ======================= Feedback Widget ======================= */
.feedback-float-btn {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.feedback-float-btn:active {
  transform: scale(0.95);
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.feedback-modal-content {
  width: min(440px, 92vw);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-weight: 650;
  font-size: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.feedback-close-btn {
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.feedback-close-btn:hover {
  background: #f1f5f9;
  color: #475569;
}

.feedback-modal-body {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.feedback-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  min-height: 120px;
}

.feedback-textarea:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.feedback-contact-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.feedback-contact-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.feedback-submit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.feedback-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.feedback-submit-btn:active {
  transform: scale(0.97);
}

.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ======================= Responsive for AI Gen View ======================= */
@media (max-width: 820px) {
  .ai-gen-layout {
    grid-template-columns: 1fr;
  }
  .ai-gen-right {
    position: static;
  }
  .ai-gen-params {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ai-gen-view {
    padding: 16px 12px;
  }
  .ai-gen-params {
    grid-template-columns: 1fr;
  }
  .feedback-float-btn {
    width: 42px;
    height: 42px;
    font-size: 18px;
    right: 16px;
    bottom: 70px;
  }
}

/* ===== AI Video View ===== */


.video-view {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
.video-section {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(226,232,240,0.7);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.video-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 14px;
}
.video-media-row { display: flex; gap: 16px; margin-bottom: 16px; }
.video-upload-item { flex: 1; }
.video-media-sub-row { display: flex; gap: 16px; }
.video-upload-group { flex: 1; min-width: 0; }
.video-upload-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.video-ref-count { font-size: 12px; color: #94a3b8; font-weight: 400; }
.video-upload-zone { border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 20px 16px; text-align: center; cursor: pointer; transition: all 0.2s; color: #94a3b8; font-size: 13px; background: rgba(248,250,252,0.6); }
.video-upload-zone:hover, .video-upload-zone.drag-over { border-color: #7c3aed; background: rgba(124,58,237,0.05); color: #475569; }
.video-upload-zone i { font-size: 24px; display: block; margin-bottom: 6px; color: #a78bfa; }
.video-upload-single { padding: 16px; }
.video-upload-single i { font-size: 20px; }
.video-ref-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.video-ref-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.video-ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-ref-name { font-size: 9px; color: #64748b; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; margin-top: 2px; }
.video-ref-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; opacity: 0; transition: opacity 0.2s; }
.video-ref-thumb:hover .video-ref-remove { opacity: 1; }
.video-prompt-area { display: flex; flex-direction: column; gap: 10px; }
.video-prompt-box { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 80px; background: #fff; color: #1e293b; transition: border-color 0.2s; box-sizing: border-box; }
.video-prompt-box:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.video-tips-box { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 10px 14px; font-size: 13px; font-family: inherit; resize: vertical; min-height: 60px; background: #fff; color: #1e293b; box-sizing: border-box; }
.video-tips-box:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.video-prompt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.video-prompt-action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.video-prompt-action-btn:hover { border-color: #7c3aed; color: #7c3aed; background: rgba(124,58,237,0.05); }
.video-params-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; padding: 0 2px; }
.video-param { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475569; font-weight: 500; }
.video-param select { padding: 6px 10px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; font-size: 13px; color: #1e293b; cursor: pointer; min-width: 80px; }
.video-param-check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 2px; }
.video-param-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: #7c3aed; cursor: pointer; }
.video-storyboard-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.video-story-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.video-story-btn:hover { border-color: #7c3aed; color: #7c3aed; background: rgba(124,58,237,0.05); }
.video-ratio-toggle { display: flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; margin-left: auto; }
.video-ratio-btn { padding: 6px 14px; border: none; background: #fff; color: #64748b; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.video-ratio-btn.active { background: #7c3aed; color: #fff; }
.video-ratio-btn:not(.active):hover { color: #7c3aed; }
.video-storyboard-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.video-story-action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.video-story-action-btn:hover { border-color: #7c3aed; color: #7c3aed; background: rgba(124,58,237,0.05); }
.video-generate-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 14px; border: none; background: linear-gradient(135deg,#7c3aed,#6d28d9); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.25s; box-shadow: 0 4px 16px rgba(124,58,237,0.3); margin-bottom: 20px; }
.video-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.4); }
.video-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.video-result-area { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.video-empty { text-align: center; color: #94a3b8; padding: 40px 20px; }
.video-empty i { font-size: 48px; color: #cbd5e1; display: block; margin-bottom: 12px; }
.video-empty p { font-size: 15px; font-weight: 500; margin: 0 0 4px; color: #64748b; }
.video-empty span { font-size: 13px; }
.video-player { width: 100%; max-width: 100%; border-radius: 12px; background: #000; max-height: 560px; }
.video-result-actions { margin-top: 12px; text-align: center; }
.video-download-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 8px; border: 1px solid #7c3aed; color: #7c3aed; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.video-download-link:hover { background: #7c3aed; color: #fff; }
.video-generating { text-align: center; padding: 30px 20px; color: #7c3aed; font-size: 14px; }
.video-generating .gen-progress-track { width: 100%; max-width: 300px; margin: 0 auto 10px; }
.video-history-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.video-history-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 13px; cursor: pointer; }
.video-history-btn:hover { border-color: #7c3aed; color: #7c3aed; }
.video-history-search { flex: 1; padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e8f0; font-size: 13px; background: #fff; color: #1e293b; min-width: 0; }
.video-history-search:focus { outline: none; border-color: #7c3aed; }
.video-history-clear-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #ef4444; font-size: 13px; cursor: pointer; }
.video-history-clear-btn:hover { background: #fef2f2; border-color: #ef4444; }
.video-history-list { max-height: 300px; overflow-y: auto; }
@media (max-width: 820px) {
  .video-media-row { flex-direction: column; }
  .video-media-sub-row { flex-direction: column; }
  .video-params-row { flex-direction: column; align-items: stretch; }
  .video-param select { width: 100%; }
  .video-storyboard-tools { flex-direction: column; align-items: stretch; }
  .video-ratio-toggle { margin-left: 0; }
  .video-history-bar { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .video-view { padding: 16px 12px 80px; }
  .video-section { padding: 14px; }
  .video-prompt-actions { flex-direction: column; }
}
