:root {
  --app-bg-color: #1b2026;
  --app-content-bg: #111315;
  --app-sidebar-bg: #1a1a1a;
  --app-card-bg: #232a30;
  --app-elevated-bg: rgba(35, 42, 48, 0.9);
  --app-input-bg: #1b2026;
  --app-item-active-bg: #2d3640;
  --app-text-color-primary: #ffffff;
  --app-text-color-secondary: #cbd5e1;
  --app-text-color-muted: #8b9bb4;
  --app-border-color: #2d3748;
  --app-border-color-strong: #4a5568;
  --app-border-weak: rgba(255, 255, 255, 0.08);
  --app-ghost-bg: rgba(255, 255, 255, 0.06);
  --app-hero-bg: linear-gradient(135deg, rgba(35, 42, 48, 0.96), rgba(21, 27, 31, 0.96));
  --app-accent-color: #10c284;
  --app-accent-hover: #0ea06d;
  --app-hover-gradient: linear-gradient(135deg, #10aec2, #10c284);
  --app-rainbow-gradient: linear-gradient(45deg, #10aec2, #10c284, #98dc63, #fff049);
  --app-shadow-color: rgba(0, 0, 0, 0.3);
}

body.light-mode {
  --app-bg-color: #ffffff;
  --app-content-bg: #eef4f2;
  --app-sidebar-bg: #ffffff;
  --app-card-bg: #ffffff;
  --app-elevated-bg: rgba(255, 255, 255, 0.98);
  --app-input-bg: #ffffff;
  --app-item-active-bg: #e9eef2;
  --app-text-color-primary: #142234;
  --app-text-color-secondary: #475569;
  --app-text-color-muted: #718096;
  --app-border-color: #d6e0e7;
  --app-border-color-strong: #bfccd6;
  --app-border-weak: rgba(20, 34, 52, 0.12);
  --app-ghost-bg: rgba(0, 0, 0, 0.04);
  --app-hero-bg: linear-gradient(135deg, #ffffff 0%, #edfff8 48%, #f8fbff 100%);
  --app-accent-color: #0e9263;
  --app-accent-hover: #0c7a52;
  --app-hover-gradient: linear-gradient(135deg, #2c3e50, #0e9263);
  --app-shadow-color: rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--app-bg-color);
  color: var(--app-text-color-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--app-content-bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 16px;
  background: var(--app-sidebar-bg);
  border-right: 1px solid var(--app-border-weak);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--app-rainbow-gradient);
  color: #0b1417;
  font-weight: 900;
  letter-spacing: -2px;
  box-shadow: 0 12px 30px rgba(16, 194, 132, 0.25);
  overflow: hidden;
}

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

.brand strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.brand span {
  display: block;
  margin-top: -4px;
  color: var(--app-accent-color);
  font-size: 12px;
  font-style: italic;
}

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  background: transparent;
  color: var(--app-text-color-primary);
  font-size: 14px;
  text-align: left;
  transition: 0.2s ease;
}

.menu-item span {
  color: var(--app-accent-color);
}

.menu-item em {
  margin-left: auto;
  font-style: normal;
}

.menu-item:hover,
.menu-item.active {
  background: #2d3640;
}

.sidebar-bottom {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.theme-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: max-content;
  margin: 0 auto;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: var(--app-card-bg);
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--app-text-color-secondary);
}

.theme-switch .active {
  background: var(--app-item-active-bg);
  color: var(--app-text-color-primary);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--app-card-bg);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--app-hover-gradient);
  font-weight: 800;
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card strong {
  font-size: 14px;
}

.user-card span {
  color: var(--app-accent-color);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  height: 100vh;
  padding: 26px;
  overflow: auto;
  background:
    radial-gradient(circle at 15% 0%, rgba(16, 174, 194, 0.16), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(16, 194, 132, 0.12), transparent 28%),
    var(--app-content-bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar p {
  color: var(--app-text-color-muted);
  font-size: 13px;
}

.topbar h1 {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 850;
  letter-spacing: -1px;
}

.top-actions {
  display: flex;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: white;
  transition: 0.2s ease;
}

.primary-btn {
  background: var(--app-hover-gradient);
  box-shadow: 0 10px 24px rgba(16, 194, 132, 0.22);
  font-weight: 800;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.primary-btn.small {
  min-height: 38px;
}

.ghost-btn {
  border: 1px solid var(--app-border-weak);
  background: var(--app-ghost-bg);
  color: var(--app-text-color-secondary);
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.pay-btn {
  text-decoration: none;
  font-weight: 850;
}

.star-coin {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff56a, #18d48f);
  color: #102019;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 6px 14px rgba(16, 194, 132, 0.26);
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  min-height: 220px;
  margin-bottom: 22px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  background: var(--app-hero-bg);
  box-shadow: 0 24px 60px var(--app-shadow-color);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -40% 45% auto auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(16, 194, 132, 0.18);
  filter: blur(50px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.pill {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 13px;
  border: 1px solid rgba(16, 194, 132, 0.35);
  border-radius: 999px;
  background: rgba(16, 194, 132, 0.1);
  color: #7fffd0;
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h2 {
  max-width: 680px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -2px;
}

.hero-copy p {
  max-width: 620px;
  margin-top: 16px;
  color: var(--app-text-color-secondary);
  font-size: 16px;
}

.hero-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 14px;
  transform: rotate(-4deg);
}

.hero-mosaic div,
.art {
  min-height: 130px;
  border-radius: 18px;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 35px rgba(0, 0, 0, 0.2);
}

.hero-mosaic div:nth-child(1),
.art-1 {
  background: radial-gradient(circle at 30% 20%, #fff049, transparent 20%), linear-gradient(135deg, #10aec2, #1d2b64 60%, #0f1020);
}

.hero-mosaic div:nth-child(2),
.art-2 {
  background: radial-gradient(circle at 70% 25%, #ffd1dc, transparent 22%), linear-gradient(135deg, #6d5dfc, #10c284 75%);
}

.hero-mosaic div:nth-child(3),
.art-3 {
  background: radial-gradient(circle at 50% 35%, #ffffff, transparent 15%), linear-gradient(135deg, #ff9066, #402565 62%, #111315);
}

.hero-mosaic div:nth-child(4),
.art-4 {
  background: radial-gradient(circle at 70% 70%, #98dc63, transparent 18%), linear-gradient(135deg, #181f2f, #10aec2 55%, #10c284);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  gap: 22px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: var(--app-elevated-bg);
  box-shadow: 0 20px 50px var(--app-shadow-color);
}

.generator-panel {
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 14px;
  background: #1b2026;
}

.tabs button {
  height: 42px;
  border-radius: 10px;
  background: transparent;
  color: var(--app-text-color-secondary);
  font-weight: 800;
}

.tabs button.active {
  background: var(--app-hover-gradient);
  color: white;
}

.field-label {
  display: block;
  margin: 18px 0 10px;
  color: var(--app-text-color-primary);
  font-weight: 800;
}

.prompt-box {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #1b2026;
}

textarea {
  width: 100%;
  min-height: 154px;
  padding: 16px 16px 42px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  line-height: 1.6;
}

textarea::placeholder {
  color: var(--app-text-color-muted);
}

#counter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.upload-box {
  display: none;
  margin-top: 16px;
  color: var(--app-text-color-secondary);
}

.upload-box.visible {
  display: block;
}

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

.upload-head strong {
  color: var(--app-text-color-secondary);
  font-size: 14px;
}

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

.upload-head em {
  padding: 2px 7px;
  border-radius: 999px;
  background: #10a36f;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 98px;
  padding: 10px;
  border: 1px dashed #18b98a;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
}

.upload-box.dragging .upload-dropzone {
  border-color: #0f9f6e;
  background: rgba(16, 163, 111, 0.12);
  box-shadow: 0 0 0 4px rgba(16, 163, 111, 0.12);
}

.reference-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reference-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.12);
}

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

.reference-thumb button {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.reference-add {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 82px;
  height: 78px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--app-text-color-secondary);
  cursor: pointer;
}

.upload-icon {
  color: #64748b;
  font-size: 34px;
  line-height: 1;
}

.reference-add strong {
  font-size: 13px;
  font-weight: 700;
}

.upload-dropzone > span {
  flex: 1;
  min-width: 120px;
  color: #10a36f;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.model-card {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #1b2026;
  color: white;
  text-align: left;
  transition: 0.2s ease;
}

.model-card:hover,
.model-card.active {
  border-color: rgba(16, 194, 132, 0.65);
  box-shadow: 0 0 0 3px rgba(16, 194, 132, 0.12);
}

.model-card b {
  font-size: 14px;
}

.model-card span {
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.search-enhance-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(16, 194, 132, 0.22);
  border-radius: 14px;
  background: rgba(16, 194, 132, 0.07);
}

.prompt-optimize-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.z-image-options-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.08);
}

.prompt-optimize-panel label {
  display: grid;
  gap: 8px;
  color: var(--app-text-color-muted);
  font-size: 13px;
}

.z-image-options-panel small {
  display: block;
  margin-top: 4px;
  color: var(--app-text-color-muted);
  font-size: 11px;
  line-height: 1.55;
}

.wan-options-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.07);
}

.wan-options-panel label,
.wan-grid label {
  display: grid;
  gap: 8px;
  color: var(--app-text-color-muted);
  font-size: 13px;
}

.wan-options-panel textarea,
.wan-options-panel select,
.wan-options-panel input:not([type="checkbox"]):not([type="color"]) {
  width: 100%;
  border: 1px solid var(--app-border-weak);
  border-radius: 12px;
  outline: 0;
  background: var(--app-input-bg);
  color: var(--app-text-color-primary);
}

.wan-options-panel textarea {
  min-height: 76px;
  padding: 10px 12px;
}

.wan-options-panel textarea {
  resize: vertical;
}

.wan-options-panel select,
.wan-options-panel input:not([type="checkbox"]):not([type="color"]) {
  height: 42px;
  padding: 0 12px;
}

.wan-options-panel small {
  color: var(--app-text-color-muted);
  font-size: 11px;
  line-height: 1.55;
}

.wan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.wan-options-panel .switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wan-options-panel .switch-row input {
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  height: 24px;
  padding: 0;
}

.wan-bbox-tools,
.wan-color-tools {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border-weak);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

body.light-mode .wan-bbox-tools,
body.light-mode .wan-color-tools {
  background: rgba(255, 255, 255, 0.72);
}

.wan-bbox-tools > div,
.wan-color-tools > div:first-child {
  display: grid;
  gap: 4px;
}

.wan-bbox-tools strong,
.wan-color-tools strong {
  color: var(--app-text-color-secondary);
  font-size: 13px;
}

.wan-bbox-tools span,
.wan-color-tools span {
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.wan-color-tools.disabled {
  opacity: 0.58;
}

.wan-color-tools.disabled input,
.wan-color-tools.disabled button {
  cursor: not-allowed;
}

.wan-color-row {
  display: grid;
  grid-template-columns: 46px 1fr 96px 30px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.wan-color-row input[type="color"] {
  height: 36px;
  padding: 3px;
}

.wan-color-row button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--app-ghost-bg);
  color: var(--app-text-color-secondary);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--app-text-color-secondary);
  font-size: 13px;
  font-weight: 800;
}

.switch-row input {
  width: 42px;
  height: 24px;
  appearance: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.36);
  cursor: pointer;
  transition: 0.2s ease;
}

.switch-row input::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 999px;
  background: #fff;
  transition: 0.2s ease;
}

.switch-row input:checked {
  background: #10c284;
}

.switch-row input:checked::before {
  transform: translateX(18px);
}

.settings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.settings-row label {
  display: grid;
  gap: 8px;
  color: var(--app-text-color-muted);
  font-size: 13px;
}

select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  outline: 0;
  background: #1b2026;
  color: white;
}

.generate-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  font-size: 16px;
}

.generate-btn span {
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.preview-panel {
  padding: 22px;
}

.history-view.hidden,
.hidden {
  display: none !important;
}

.history-panel {
  min-height: 520px;
  padding: 22px;
}

.inspiration-panel {
  min-height: 620px;
  padding: 24px;
}

.inspiration-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.inspiration-head > div,
.inspiration-search {
  min-width: 0;
}

.inspiration-head p {
  color: var(--app-accent-color);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.inspiration-head h2 {
  margin-top: 4px;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -1px;
}

.inspiration-head span {
  display: block;
  max-width: 720px;
  margin-top: 8px;
  color: var(--app-text-color-muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inspiration-search {
  display: grid;
  gap: 8px;
  color: var(--app-text-color-muted);
  font-size: 13px;
  font-weight: 800;
}

.inspiration-search input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--app-border-weak);
  border-radius: 14px;
  outline: 0;
  background: var(--app-input-bg);
  color: var(--app-text-color-primary);
}

.inspiration-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.inspiration-stats div {
  padding: 14px;
  border: 1px solid var(--app-border-weak);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.inspiration-stats strong,
.inspiration-stats span {
  display: block;
}

.inspiration-stats strong {
  color: var(--app-accent-color);
  font-size: 24px;
}

.inspiration-stats span {
  margin-top: 2px;
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.inspiration-language-filters {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--app-border-weak);
  border-radius: 999px;
  background: var(--app-ghost-bg);
}

.inspiration-language-filter {
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--app-text-color-secondary);
  font-size: 13px;
  font-weight: 900;
}

.inspiration-language-filter.active {
  background: var(--app-hover-gradient);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 194, 132, 0.18);
}

.inspiration-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.inspiration-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--app-border-weak);
  border-radius: 999px;
  background: var(--app-ghost-bg);
  color: var(--app-text-color-secondary);
  font-size: 13px;
  font-weight: 800;
}

.inspiration-filter span {
  color: var(--app-accent-color);
  font-size: 12px;
}

.inspiration-filter.active {
  border-color: rgba(16, 194, 132, 0.58);
  background: rgba(16, 194, 132, 0.14);
  color: var(--app-text-color-primary);
}

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

.inspiration-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--app-border-weak);
  border-radius: 18px;
  background: var(--app-card-bg);
  box-shadow: 0 18px 42px var(--app-shadow-color);
}

.inspiration-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(16, 174, 194, 0.14), rgba(16, 194, 132, 0.12));
  color: var(--app-text-color-muted);
}

.inspiration-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.inspiration-card:hover .inspiration-image img {
  transform: scale(1.04);
}

.inspiration-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.inspiration-card-meta,
.inspiration-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.inspiration-card-meta span,
.inspiration-ref {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(16, 194, 132, 0.12);
  color: var(--app-accent-color);
  font-weight: 900;
}

.inspiration-card-meta em {
  font-style: normal;
}

.inspiration-card h3 {
  font-size: 17px;
  line-height: 1.35;
}

.inspiration-title-en {
  color: var(--app-text-color-muted);
  font-size: 12px;
  line-height: 1.45;
}

.inspiration-prompt {
  display: -webkit-box;
  min-height: 74px;
  overflow: hidden;
  color: var(--app-text-color-secondary);
  font-size: 13px;
  line-height: 1.6;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.inspiration-note {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--app-text-color-muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.inspiration-actions .ghost-btn,
.inspiration-actions .primary-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title h3 {
  font-size: 22px;
  font-weight: 900;
}

.panel-title p {
  color: var(--app-text-color-muted);
  font-size: 13px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.preview-carousel {
  position: relative;
}

.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
  color: #1d4ed8;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.preview-nav:hover {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
  transform: translateY(-50%) scale(1.05);
}

.preview-nav-prev {
  left: 18px;
}

.preview-nav-next {
  right: 18px;
}

.preview-counter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.history-panel .preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-items: start;
}

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

.empty-preview {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  min-height: 360px;
  padding: 28px;
  border: 1px dashed var(--app-border-color-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-color-muted);
  text-align: center;
}

.empty-preview strong,
.empty-preview span {
  display: block;
}

.empty-preview strong {
  color: var(--app-text-color-secondary);
  font-size: 18px;
}

.empty-preview span {
  margin-top: 8px;
  font-size: 14px;
}

.history-load-more {
  display: block;
  width: min(220px, 100%);
  margin: 18px auto 0;
}

.history-panel .art-card.is-loading {
  background: linear-gradient(120deg, #1b2026 0%, #242a32 50%, #1b2026 100%);
  background-size: 200% 100%;
  animation: history-skeleton 1.2s linear infinite;
}

.history-panel .art-card.is-loading img {
  opacity: 0;
}

.history-panel .art-card img {
  transition: opacity 0.32s ease, transform 0.22s ease, filter 0.22s ease;
}

.history-panel .preview-grid.is-ready .art-card img {
  opacity: 1;
}

@keyframes history-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body.light-mode .history-panel .art-card.is-loading {
  background: linear-gradient(120deg, #eef2f7 0%, #f7f9fc 50%, #eef2f7 100%);
  background-size: 200% 100%;
}

.generating-preview {
  min-height: 520px;
  padding: 22px;
  border: 1px solid var(--app-border-color);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.generating-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.generating-preview-head h3 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
}

.generating-preview-body {
  display: grid;
  place-items: center;
  min-height: 430px;
  border: 1px solid #c7d2e8;
  border-radius: 18px;
  background: #eef4ff;
  color: #0f172a;
}

.generating-spinner {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-bottom: 24px;
}

.generating-ring-soft,
.generating-ring-active {
  position: absolute;
  inset: 0;
  border: 5px solid rgba(0, 84, 214, 0.18);
  border-radius: 999px;
}

.generating-ring-active {
  border-color: #0054d6;
  border-top-color: transparent;
  animation: spin 0.9s linear infinite;
}

.generating-sparkle {
  color: #5f93e8;
  font-size: 42px;
  animation: pulse 1s ease-in-out infinite alternate;
}

.generating-preview-body p {
  font-size: 15px;
  font-weight: 800;
}

.art-card {
  position: relative;
  min-height: 245px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: #1b2026;
  overflow: hidden;
}

.preview-panel .art-card {
  min-height: 520px;
  padding: 12px;
}

.history-panel .art-card {
  min-height: 0;
  padding: 8px;
  padding-bottom: 36px;
  content-visibility: auto;
  contain-intrinsic-size: 260px 296px;
}

.art-card .art {
  height: calc(100% - 6px);
  min-height: 220px;
}

.art-card img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.art-card.has-image {
  cursor: zoom-in;
}

.art-card.has-image:hover img {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.04);
}

.art-card.has-image:active img {
  transform: scale(1.012);
}

.preview-panel .art-card img {
  min-height: 496px;
}

.history-panel .art-card .art,
.history-panel .art-card img {
  min-height: 0;
  height: 100%;
}

.history-panel .art-card .art {
  aspect-ratio: 1 / 1;
}

.history-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(226, 232, 240, 0.36));
  color: var(--app-text-color-muted);
  font-size: 13px;
  font-weight: 900;
}

.history-panel .art-card.missing-image {
  cursor: default;
}

.history-panel .art-card .art-model-label {
  left: 14px;
  bottom: 44px;
  z-index: 2;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.history-panel .art-card .art-time-label {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 0 0 12px 12px;
  background: #26313d;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.history-card-actions {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  bottom: 36px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.history-panel .art-card:hover .history-card-actions,
.history-panel .art-card:focus-within .history-card-actions {
  opacity: 1;
  pointer-events: auto;
}

.history-panel .art-card:hover .art-model-label,
.history-panel .art-card:focus-within .art-model-label {
  opacity: 0;
  transform: translateY(6px);
}

.history-card-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.82);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.history-card-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-card-action:hover {
  transform: translateY(-2px);
  background: #20c987;
  box-shadow: 0 14px 26px rgba(32, 201, 135, 0.42);
}

.history-card-action-accent {
  background: rgba(20, 20, 22, 0.82);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
}

.history-card-action-accent:hover {
  background: #20c987;
  box-shadow: 0 14px 26px rgba(32, 201, 135, 0.42);
}

.history-card-action:not(.history-card-action-accent):hover {
  background: #20c987;
  box-shadow: 0 14px 26px rgba(32, 201, 135, 0.42);
}

.history-card-action[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.history-card-action[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  transform: translate(-50%, 0) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.history-card-action:hover::after,
.history-card-action:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.history-card-action:hover::before,
.history-card-action:focus-visible::before {
  opacity: 1;
}

.history-panel .art-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.history-check {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.art-card.selected .history-check {
  border-color: #2563eb;
  background: #2563eb;
}

.art-card span {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: white;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.art-card.loading .art {
  filter: grayscale(0.4) brightness(0.75);
  animation: pulse 0.9s infinite alternate;
}

.quick-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.quick-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

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

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.image-viewer.visible {
  opacity: 1;
  pointer-events: auto;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(16px);
}

.image-viewer-stage {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.image-viewer-stage.dragging {
  cursor: grabbing;
}

.image-viewer-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  width: min(82vw, 1200px);
  border-radius: 18px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
  user-select: none;
  transform-origin: center center;
  will-change: transform;
}

.image-viewer-toolbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px 18px 0 0;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 0 -12px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.image-viewer-toolbar button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #172554;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.image-viewer-toolbar button:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  transform: translateY(-1px);
}

.image-viewer-toolbar svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bbox-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bbox-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.bbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(16px);
}

.bbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--app-border-weak);
  border-radius: 22px;
  background: var(--app-elevated-bg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.bbox-head,
.bbox-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bbox-head h3 {
  font-size: 18px;
}

.bbox-head p {
  margin-top: 4px;
  color: var(--app-text-color-muted);
  font-size: 12px;
}

.bbox-head button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--app-ghost-bg);
  color: var(--app-text-color-secondary);
  font-size: 20px;
}

.bbox-image-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  padding-bottom: 4px;
}

.bbox-image-tabs button {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--app-ghost-bg);
  color: var(--app-text-color-muted);
  font-size: 12px;
  font-weight: 800;
}

.bbox-image-tabs button.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.bbox-image-tabs img {
  width: 100%;
  height: 92px;
  object-fit: cover;
}

.bbox-tab-badge,
.bbox-tab-count {
  position: absolute;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  line-height: 1;
}

.bbox-tab-badge {
  left: 8px;
  top: 8px;
  padding: 5px 8px;
}

.bbox-tab-count {
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
}

.bbox-tab-size {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 36px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.bbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  max-height: 62vh;
  overflow: hidden;
  border: 1px dashed var(--app-border-color-strong);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  user-select: none;
}

.bbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.bbox-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.bbox-box {
  position: absolute;
  border: 2px solid #38bdf8;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.5);
}

.bbox-box button {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
}

.bbox-box-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border-weak);
  border-radius: 16px;
  background: var(--app-ghost-bg);
}

.bbox-box-list:empty {
  display: none;
}

.bbox-coordinate-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border-weak);
  border-radius: 14px;
  background: var(--app-card-bg);
}

.bbox-coordinate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--app-text-color-secondary);
  font-size: 13px;
  font-weight: 800;
}

.bbox-coordinate-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bbox-coordinate-values span {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--app-border-weak);
  border-radius: 10px;
  color: var(--app-text-color-muted);
  font-size: 11px;
}

.bbox-coordinate-values b {
  color: #2563eb;
  font-size: 16px;
}

.viewer-divider {
  width: 1px;
  height: 30px;
  background: rgba(148, 163, 184, 0.36);
}

.viewer-download-button,
.viewer-reference-button {
  width: auto !important;
  padding: 0 14px !important;
  border: 1px solid rgba(37, 99, 235, 0.22) !important;
  background: rgba(37, 99, 235, 0.1) !important;
  color: #1d4ed8 !important;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.viewer-close-button {
  margin-left: 4px;
  font-size: 26px;
  line-height: 1;
}

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .brand,
  .sidebar-bottom {
    flex-shrink: 0;
  }

  .menu-list {
    display: flex;
    min-width: max-content;
  }

  .menu-item {
    width: auto;
  }

  .sidebar-bottom {
    display: none;
  }

  .workspace {
    height: auto;
  }

  .hero-card,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .inspiration-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
  }

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

@media (max-width: 520px) {
  .inspiration-panel {
    padding: 16px;
  }

  .inspiration-head {
    gap: 12px;
    margin-bottom: 14px;
  }

  .inspiration-head p {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .inspiration-head h2 {
    font-size: 28px;
  }

  .inspiration-head span {
    max-width: none;
    font-size: 13px;
    line-height: 1.65;
  }

  .inspiration-search input {
    height: 42px;
  }

  .inspiration-stats,
  .inspiration-grid,
  .inspiration-actions {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-card {
    padding: 22px;
  }

  .hero-mosaic,
  .model-grid,
  .settings-row,
  .preview-grid {
    grid-template-columns: 1fr;
  }

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

body.light-mode .menu-item.active,
body.light-mode .menu-item:hover,
body.light-mode .theme-switch .active {
  background: #e5f3ee;
  color: #0f5138;
}

body.light-mode .workspace {
  background:
    radial-gradient(circle at 18% 0%, rgba(16, 194, 132, 0.14), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(16, 174, 194, 0.1), transparent 30%),
    linear-gradient(180deg, #f4fbf8 0%, #edf3f1 100%);
}

body.light-mode .hero-card,
body.light-mode .panel,
body.light-mode .user-card {
  border-color: rgba(20, 34, 52, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.13);
}

body.light-mode .hero-card {
  background:
    radial-gradient(circle at 40% 30%, rgba(16, 194, 132, 0.16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #effff9 52%, #ffffff 100%);
}

body.light-mode .user-card {
  border: 1px solid rgba(20, 34, 52, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

body.light-mode .tabs,
body.light-mode .prompt-box,
body.light-mode .model-card,
body.light-mode select,
body.light-mode .art-card {
  border-color: rgba(20, 34, 52, 0.14);
  background: #ffffff;
  color: #142234;
}

body.light-mode .tabs {
  background: #e9f0f3;
  box-shadow: inset 0 0 0 1px rgba(20, 34, 52, 0.05);
}

body.light-mode .prompt-box {
  box-shadow: inset 0 0 0 1px rgba(20, 34, 52, 0.03);
}

body.light-mode .model-card.active,
body.light-mode .model-card:hover {
  border-color: rgba(14, 146, 99, 0.42);
  background: #f2fff9;
  box-shadow: 0 0 0 3px rgba(14, 146, 99, 0.1);
}

body.light-mode .tabs button {
  color: #475569;
}

body.light-mode .tabs button.active {
  color: #ffffff;
}

body.light-mode textarea {
  color: #142234;
}

body.light-mode textarea::placeholder {
  color: #8c939d;
}

body.light-mode .upload-box {
  color: #475569;
}

body.light-mode .reference-add {
  background: #f8fafc;
}

body.light-mode .upload-box strong,
body.light-mode .model-card b {
  color: #142234;
}

body.light-mode .user-card {
  border: 1px solid rgba(20, 34, 52, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

body.light-mode .avatar {
  background: #dff8ee;
  color: #0e9263;
  box-shadow: inset 0 0 0 1px rgba(14, 146, 99, 0.12);
}

body.light-mode .ghost-btn {
  border-color: rgba(20, 34, 52, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

body.light-mode .art-card span {
  background: rgba(15, 23, 42, 0.72);
}

body.light-mode .history-panel .art-card .art-time-label {
  background: #e9f0f7;
  color: #1e3a5f;
}

body.light-mode .history-card-actions {
  background: rgba(15, 23, 42, 0.38);
}

body.light-mode .sidebar {
  border-right: 2px solid #d7e3ea;
  box-shadow: 10px 0 28px rgba(20, 34, 52, 0.08);
}

body.light-mode .hero-card {
  border: 2px solid #d3e2ea;
  box-shadow: 0 22px 48px rgba(20, 34, 52, 0.16);
}

body.light-mode .generator-panel,
body.light-mode .preview-panel {
  border: 2px solid #d7e3ea;
  box-shadow: 0 20px 46px rgba(20, 34, 52, 0.15);
}

body.light-mode .generator-panel {
  background: #ffffff;
}

body.light-mode .preview-panel {
  background: #ffffff;
}

body.light-mode .tabs {
  border: 1px solid #d3e2ea;
  background: #e8f0f4;
}

body.light-mode .prompt-box {
  border: 2px solid #d7e3ea;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 34, 52, 0.06);
}

body.light-mode .model-card {
  border: 1.5px solid #d3e2ea;
  background: #fbfdfd;
  box-shadow: 0 8px 18px rgba(20, 34, 52, 0.05);
}

body.light-mode .model-card.active {
  border: 2px solid rgba(14, 146, 99, 0.48);
  background: #effcf7;
  box-shadow: 0 0 0 4px rgba(14, 146, 99, 0.12);
}

body.light-mode select {
  border: 1.5px solid #d3e2ea;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(20, 34, 52, 0.05);
}

body.light-mode .art-card {
  border: 2px solid #d7e3ea;
  background: #f8fbfc;
  box-shadow: 0 14px 30px rgba(20, 34, 52, 0.1);
}

body.light-mode .user-card {
  border: 2px solid #d7e3ea;
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(20, 34, 52, 0.12);
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.login-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.login-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 15% 0%, rgba(16, 194, 132, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
  transform: translateY(16px) scale(0.98);
  transition: 0.2s ease;
}

.login-modal.visible .login-dialog {
  transform: translateY(0) scale(1);
}

.login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf3f1;
  color: #475569;
  font-size: 24px;
  line-height: 1;
}

.login-dialog-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-dialog-head p {
  color: #0e9263;
  font-weight: 900;
}

.login-dialog-head h2 {
  color: #142234;
  font-size: 30px;
  font-weight: 950;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #142234;
  font-weight: 850;
}

.login-form input {
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid #d3e2ea;
  border-radius: 14px;
  outline: 0;
  background: #ffffff;
  color: #142234;
}

.login-form input:focus {
  border-color: rgba(14, 146, 99, 0.58);
  box-shadow: 0 0 0 4px rgba(14, 146, 99, 0.1);
}

.login-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
}

.login-message {
  min-height: 22px;
  margin-top: 16px;
  color: #475569;
  font-weight: 700;
  text-align: center;
}

.login-message[data-type="success"] {
  color: #0e9263;
}

.login-message[data-type="error"] {
  color: #dc2626;
}

.login-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: #718096;
  font-weight: 750;
}

.login-footer a {
  color: #0e9263;
  font-weight: 950;
  text-decoration: none;
}

.login-reset-link {
  margin-top: 6px;
}

.profile-dialog {
  width: min(460px, 100%);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: var(--app-hover-gradient);
  color: #ffffff;
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 18px 34px rgba(16, 194, 132, 0.24);
}

.profile-head p,
.profile-info-card span,
.profile-points-card span {
  color: #0e9263;
  font-size: 13px;
  font-weight: 900;
}

.profile-head h2 {
  color: #142234;
  font-size: 30px;
  font-weight: 950;
}

.profile-info-card,
.profile-points-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #dce8ee;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-info-card {
  display: grid;
  justify-content: stretch;
}

.profile-info-card strong {
  color: #142234;
  font-size: 22px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.profile-points-card {
  justify-content: flex-start;
}

.profile-points-detail-btn {
  margin-left: auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #142234;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(20, 34, 52, 0.14);
  transition: transform 0.16s ease, background 0.16s ease;
}

.profile-points-detail-btn:hover {
  transform: translateY(-1px);
  background: #0e9263;
}

.points-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff56a, #18d48f);
  color: #102019;
  font-size: 28px;
  font-weight: 950;
  box-shadow: 0 16px 28px rgba(16, 194, 132, 0.26);
}

.profile-points-card strong {
  display: block;
  margin-top: 4px;
  color: #142234;
  font-size: 28px;
  font-weight: 950;
}

.profile-points-card b {
  font: inherit;
}

.point-logs-dialog {
  width: min(680px, 100%);
}

.point-logs-summary {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #dce8ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  font-weight: 900;
}

.point-logs-summary strong {
  color: #142234;
}

.point-logs-list {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.point-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #ffffff;
}

.point-log-item strong {
  display: block;
  color: #142234;
  font-size: 15px;
  font-weight: 950;
}

.point-log-item span {
  display: block;
  margin-top: 5px;
  color: #7a8797;
  font-size: 12px;
  line-height: 1.45;
}

.point-log-amount {
  display: grid;
  justify-items: end;
  white-space: nowrap;
}

.point-log-amount b {
  color: #0e9263;
  font-size: 20px;
  font-weight: 950;
}

.point-log-item.is-minus .point-log-amount b {
  color: #dc2626;
}

.point-log-amount small,
.point-logs-empty {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.point-logs-empty {
  padding: 26px 12px;
  text-align: center;
}

.profile-security-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profile-security-entry {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border-color: rgba(15, 146, 99, 0.2);
  background: rgba(15, 146, 99, 0.08);
  color: #0d7554;
  font-weight: 950;
}

.profile-bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.profile-bottom-actions .profile-charge-btn {
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.account-security-modal .login-backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px) saturate(1.05);
}

.account-security-modal .account-security-dialog {
  width: min(620px, 100%);
  padding: 44px 48px 46px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(6, 182, 212, 0.14), transparent 34%),
    #ffffff;
  color: #111827;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
}

.account-security-modal .login-close {
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border: 0;
  background: #ecfeff;
  color: #111827;
  font-size: 28px;
  box-shadow: none;
}

.account-security-modal .account-security-head {
  gap: 12px;
  margin-bottom: 30px;
  padding-right: 54px;
}

.account-security-modal .account-security-head p {
  color: #ffb000;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.account-security-modal .account-security-head h2 {
  color: #ffffff;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.08;
  text-shadow: none;
}

.account-security-modal .account-security-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 17px 20px;
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 16px;
  background: #ecfeff;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.account-security-modal .account-security-notice strong {
  color: #111827;
  font-weight: 950;
}

.account-security-modal .account-security-form {
  display: grid;
  gap: 24px;
}

.account-security-modal .account-security-form label {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  color: #bdbdbd;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
}

.account-security-modal .account-security-form input {
  display: block;
  width: 100%;
  height: 54px;
  min-width: 0;
  padding: 0 20px;
  border: 1.5px solid #d1e7ee;
  border-radius: 16px;
  outline: 0;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  box-shadow: none;
}

.account-security-modal .account-security-form input::placeholder {
  color: #94a3b8;
}

.account-security-modal .account-security-form input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.14);
}

.account-security-modal .account-code-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 16px;
  align-items: stretch;
}

.account-security-modal .account-code-row .email-code-btn {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 15px;
  font-weight: 950;
  box-shadow: none;
}

.account-security-modal .account-code-row .email-code-btn:disabled {
  background: #cffafe;
  color: #0e7490;
  box-shadow: none;
}

.account-security-modal .account-submit-btn {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #ffffff;
  font-size: 17px;
  font-weight: 950;
  box-shadow: none;
}

.account-security-modal .account-submit-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 22px 42px rgba(6, 182, 212, 0.32);
}

.account-security-modal .profile-message {
  margin-top: 16px;
  color: #bdbdbd;
  font-weight: 800;
  text-align: center;
}

.account-security-modal .profile-message[data-type="success"] {
  color: #ffb000;
}

.account-security-modal .profile-message[data-type="error"] {
  color: #ba1a1a;
}

.register-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 102, 255, 0.08), transparent 30%),
    radial-gradient(circle at 78% 82%, rgba(16, 194, 132, 0.08), transparent 32%),
    #f8f9ff;
  color: #0b1c30;
  font-family: "Space Grotesk", var(--font-main);
}

.register-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.register-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 520px);
  padding: 92px clamp(22px, 5vw, 48px) 38px;
  border: 1px solid rgba(194, 198, 216, 0.6);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 28px 80px rgba(11, 28, 48, 0.1);
  backdrop-filter: blur(18px);
}

.register-card .auth-brand {
  position: absolute;
  top: 28px;
  left: clamp(22px, 5vw, 48px);
  color: #0b1c30;
}

.register-heading {
  max-width: 470px;
  margin-bottom: 34px;
}

.register-heading span {
  color: #0050cb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.register-heading h1 {
  margin: 10px 0 10px;
  color: #0b1c30;
  font-size: clamp(38px, 5vw, 52px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.register-heading p {
  color: #424656;
  font-size: 16px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 470px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #424656;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #c2c6d8;
  border-radius: 12px;
  outline: 0;
  background: #ffffff;
  color: #0b1c30;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form input:focus {
  border-color: #0050cb;
  box-shadow: 0 0 0 4px rgba(0, 80, 203, 0.1);
}

.email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
}

.email-code-btn {
  height: 52px;
  border-radius: 12px;
  white-space: nowrap;
}

.auth-form small {
  color: #727687;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.password-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 2px;
}

.password-strength b {
  height: 4px;
  border-radius: 999px;
  background: #d3e4fe;
}

.password-strength b:first-child {
  background: #0050cb;
}

.terms-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 12px !important;
  color: #424656 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  line-height: 1.6;
}

.terms-row input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: #0050cb;
}

.terms-row a {
  color: #0050cb;
  font-weight: 800;
}

.terms-body {
  min-height: 100vh;
  margin: 0;
  background: #0b0b0e;
  color: #f7f7fb;
  font-family: var(--font-main);
  overflow-x: hidden;
  overflow-y: auto;
}

.terms-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 11, 14, 0.92);
  backdrop-filter: blur(16px);
}

.terms-topbar strong {
  grid-column: 2;
  font-size: 18px;
  font-weight: 900;
}

.terms-back {
  justify-self: start;
  color: #a8a8b6;
  font-size: 16px;
  font-weight: 700;
}

.terms-page {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 34px 24px 72px;
}

.terms-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 34px;
}

.terms-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 111, 0, 0.12);
  color: #ff7a1a;
  font-size: 24px;
  font-weight: 900;
}

.terms-hero h1 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.terms-hero p {
  margin: 0;
  color: #8f8f9d;
  font-size: 14px;
  font-weight: 600;
}

.terms-card {
  margin: 0 0 24px;
  padding: 24px;
  border: 1px solid rgba(122, 122, 150, 0.28);
  border-radius: 14px;
  background: #1c1c2d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.terms-card h2 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.terms-card p {
  margin: 0;
  color: #b6b6c2;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.9;
}

.terms-intro h2 {
  margin-bottom: 12px;
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 12px;
  background: #0050cb;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 80, 203, 0.18);
}

.auth-submit:hover {
  background: #003fa4;
  transform: translateY(-1px);
}

.auth-message {
  min-height: 22px;
  width: 100%;
  max-width: 470px;
  margin-top: 18px;
  color: #424656;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.auth-message[data-type="success"] {
  color: #0050cb;
}

.auth-message[data-type="error"] {
  color: #ba1a1a;
}

.register-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 470px;
  margin-top: 12px;
  color: #424656;
  font-size: 14px;
  font-weight: 600;
}

.register-actions a {
  color: #0050cb;
  font-weight: 800;
}

.register-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  padding: clamp(28px, 4vw, 56px);
  overflow: hidden;
  background: #dceff5;
}

.register-art-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(248, 249, 255, 0.18), rgba(0, 80, 203, 0.04)),
    url("./first.png");
  background-position: center;
  background-size: cover;
  filter: saturate(0.98);
}

.register-art-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 42%),
    linear-gradient(0deg, rgba(11, 28, 48, 0.08), transparent 36%);
}

.register-orb {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  filter: blur(34px);
  pointer-events: none;
}

.register-orb-a {
  top: 18%;
  left: 18%;
  width: 240px;
  height: 240px;
  background: rgba(0, 102, 255, 0.14);
}

.register-orb-b {
  right: 12%;
  bottom: 18%;
  width: 320px;
  height: 320px;
  background: rgba(179, 197, 255, 0.24);
}

.register-showcase,
.register-quote {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  background: rgba(248, 249, 255, 0.7);
  box-shadow: 0 24px 80px rgba(11, 28, 48, 0.12);
  backdrop-filter: blur(18px);
}

.register-showcase {
  margin-bottom: auto;
  padding: clamp(22px, 3vw, 32px);
}

.register-showcase p {
  color: #0050cb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.register-showcase h2 {
  margin: 10px 0 12px;
  color: #0b1c30;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.register-showcase span {
  color: #424656;
  font-size: 16px;
  line-height: 1.7;
}

.register-quote {
  padding: clamp(20px, 2.4vw, 26px);
}

.register-quote strong,
.register-quote span {
  display: block;
}

.register-quote strong {
  color: #0b1c30;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
}

.register-quote span {
  margin-top: 10px;
  color: #424656;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.pricing-page {
  min-height: 100vh;
  overflow: auto;
  background: #ffffff;
  color: #2f3a4a;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.pricing-header {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 28px;
}

.pricing-header nav {
  display: flex;
  gap: 18px;
}

.pricing-header a {
  color: #1f2937;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

.pricing-header a.active {
  color: #0e9263;
}

.pricing-main {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 56px));
  min-height: calc(100vh - 54px);
  margin: 0 auto;
  padding: 70px 0 54px;
}

.pricing-hero {
  max-width: 760px;
  margin: 0 auto 38px;
  text-align: center;
}

.pricing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #0e9263;
  text-decoration: none;
}

.pricing-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
}

.pricing-brand strong {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.pricing-hero p {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.9;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 220px));
  justify-content: center;
  gap: 26px;
}

.pricing-card {
  position: relative;
  min-height: 350px;
  padding: 28px 28px 30px;
  border: 1px solid #e8edf2;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.05);
}

.pricing-card.recommended em {
  position: absolute;
  top: 0;
  right: 18px;
  padding: 7px 12px;
  border-radius: 0 0 8px 8px;
  background: #10c284;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.pricing-card h2 {
  color: #2f3a4a;
  font-size: 30px;
  line-height: 1;
  text-align: center;
}

.pricing-card h2 span {
  color: #7a8797;
  font-size: 13px;
  font-weight: 800;
}

.pricing-points {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 28px;
  color: #0e9263;
  font-size: 14px;
  font-weight: 950;
}

.pricing-card ul {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
  list-style: none;
  text-align: center;
}

.pricing-card li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #8b97a7;
  font-size: 13px;
}

.pricing-card li span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pricing-card li b {
  color: #6b7686;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pricing-card button {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  background: #142234;
  color: #ffffff;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(20, 34, 52, 0.16);
  transition: 0.2s ease;
}

.pricing-card button:hover {
  transform: translateY(-2px);
  background: #0e9263;
}

.inspiration-card-actions button:hover {
  transform: translateY(-1px);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  width: min(1040px, 100%);
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  gap: 22px;
}

.contact-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 20px;
  min-height: 300px;
  padding: 32px 24px;
  text-align: center;
}

.contact-card h3 {
  color: var(--app-text-color-primary);
  font-size: 18px;
  font-weight: 900;
}

.contact-card p {
  color: var(--app-text-color-muted);
  font-size: 14px;
  line-height: 1.7;
}

.contact-qr-box {
  display: grid;
  place-items: center;
  width: 156px;
  height: 156px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #718096;
  font-size: 14px;
  overflow: hidden;
}

.contact-qr-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-email-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 42px;
  padding: 0 26px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  color: var(--app-text-color-muted);
  font-size: 15px;
  font-weight: 700;
}

.contact-email-box a {
  color: var(--app-accent-color);
  font-weight: 900;
}

.redeem-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 22px;
  width: min(920px, 100%);
  margin: 34px auto 0;
  padding: 24px;
  border: 1px solid #e8edf2;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.05);
}

.payment-qr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 24px;
  width: min(760px, 100%);
  margin: 20px auto 0;
  padding: 26px;
  border: 1px solid #e8edf2;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.08);
}

.payment-qr-panel.hidden {
  display: none;
}

.payment-qr-panel h2 {
  margin-bottom: 10px;
  color: #2f3a4a;
  font-size: 24px;
}

.payment-qr-panel p {
  margin-bottom: 14px;
  color: #7a8797;
  font-size: 14px;
  line-height: 1.7;
}

.payment-qr-panel a {
  color: #0e9263;
  font-size: 13px;
  font-weight: 950;
}

.payment-qr-box {
  display: grid;
  place-items: center;
  width: 280px;
  height: 280px;
  justify-self: center;
  border-radius: 18px;
  background: #f7fafc;
}

.payment-qr-box img {
  display: block;
  width: 260px;
  height: 260px;
}

.redeem-panel h2 {
  margin-bottom: 8px;
  color: #2f3a4a;
  font-size: 22px;
}

.redeem-panel p {
  color: #7a8797;
  font-size: 13px;
  line-height: 1.7;
}

.redeem-panel form {
  display: flex;
  gap: 10px;
}

.redeem-panel input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e8edf2;
  border-radius: 999px;
  outline: none;
}

.redeem-panel input:focus {
  border-color: rgba(16, 194, 132, 0.55);
  box-shadow: 0 0 0 4px rgba(16, 194, 132, 0.1);
}

.redeem-panel button {
  min-width: 108px;
  border-radius: 999px;
  background: #142234;
  color: #ffffff;
  font-weight: 950;
}

.redeem-panel button:hover {
  background: #0e9263;
}

.redeem-message {
  grid-column: 1 / -1;
  min-height: 20px;
  color: #7a8797;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.redeem-message.success {
  color: #0e9263;
}

.redeem-message.error {
  color: #d14343;
}

.pricing-notice {
  width: 100%;
  margin: 36px auto 0;
  color: #b7c0cb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .redeem-panel {
    grid-template-columns: 1fr;
  }

  .payment-qr-panel {
    grid-template-columns: 1fr;
  }

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

  .register-shell {
    padding: 28px 18px;
  }

  .register-card {
    padding-top: 92px;
    padding-bottom: 38px;
  }
}

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

  .pricing-main {
    width: min(100% - 28px, 520px);
    padding-top: 38px;
  }

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

  .register-card {
    padding: 88px 20px 34px;
    border-radius: 22px;
  }

  .register-card .auth-brand {
    left: 20px;
  }
}

@media (min-width: 1280px) {
  .workspace {
    padding: clamp(26px, 2.4vw, 42px);
  }

  .content-grid {
    grid-template-columns: minmax(440px, 0.88fr) minmax(520px, 1.12fr);
  }
}

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

  .preview-panel .art-card,
  .generating-preview {
    min-height: min(520px, 68vh);
  }

  .preview-panel .art-card img {
    min-height: min(496px, 62vh);
  }
}

@media (max-width: 900px) {
  .app-shell {
    min-height: 100dvh;
  }

  .sidebar {
    gap: 14px;
    padding: 12px 14px;
  }

  .brand {
    justify-content: flex-start;
    padding: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 17px;
  }

  .menu-list {
    gap: 8px;
  }

  .menu-item {
    height: 40px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .workspace {
    min-height: auto;
    padding: 20px;
  }

  .hero-card {
    min-height: auto;
  }

  .history-panel .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--app-border-weak);
  }

  .menu-list {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .menu-list::-webkit-scrollbar {
    display: none;
  }

  .menu-item {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 16px;
  }

  .topbar h1 {
    font-size: clamp(28px, 11vw, 38px);
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .top-actions .primary-btn,
  .top-actions .ghost-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
  }

  .hero-card {
    padding: 18px;
    border-radius: 18px;
  }

  .hero-copy h2 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .hero-mosaic {
    display: none;
  }

  .panel,
  .generator-panel,
  .preview-panel {
    border-radius: 18px;
  }

  .generator-panel,
  .preview-panel {
    padding: 16px;
  }

  textarea {
    min-height: 132px;
    font-size: 15px;
  }

  .upload-dropzone {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-list {
    width: 100%;
  }

  .reference-thumb,
  .reference-add {
    width: 72px;
    height: 72px;
  }

  .upload-dropzone > span {
    min-width: 0;
    text-align: left;
  }

  .model-grid,
  .settings-row,
  .wan-grid,
  .pricing-grid,
  .bbox-coordinate-values {
    grid-template-columns: 1fr;
  }

  .switch-row,
  .wan-bbox-tools,
  .wan-color-tools,
  .generating-preview-head,
  .bbox-head,
  .bbox-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-panel .art-card,
  .generating-preview {
    min-height: min(420px, 62vh);
  }

  .preview-panel .art-card img {
    min-height: min(396px, 58vh);
  }

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

  .history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .history-actions button {
    width: 100%;
  }

  .login-modal {
    padding: 14px;
  }

  .login-dialog {
    width: 100%;
    max-height: calc(100dvh - 28px);
    overflow: auto;
    padding: 22px;
    border-radius: 22px;
  }

  .register-shell {
    align-items: flex-start;
    min-height: 100dvh;
    padding: 18px 12px;
  }

  .register-card {
    width: 100%;
    padding: 86px 18px 30px;
    border-radius: 20px;
  }

  .register-heading h1 {
    font-size: clamp(34px, 12vw, 44px);
  }

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

  .account-code-row,
  .profile-security-actions {
    grid-template-columns: 1fr;
  }

  .profile-bottom-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-bottom-actions .profile-charge-btn {
    width: 100%;
  }

  .account-security-dialog {
    padding: 28px 20px 30px;
  }

  .account-security-modal .account-security-dialog {
    padding: 28px 18px 30px;
    border-radius: 24px;
  }

  .account-security-modal .account-code-row {
    grid-template-columns: 1fr;
  }

  .account-security-modal .account-security-head {
    padding-right: 46px;
  }

  .email-code-btn {
    width: 100%;
  }

  .image-viewer-stage img {
    width: min(94vw, 900px);
    max-height: 72dvh;
    object-fit: contain;
  }

  .image-viewer-toolbar {
    left: 12px;
    right: 12px;
    bottom: 10px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
    transform: none;
  }

  .image-viewer-toolbar button {
    width: 38px;
    height: 38px;
  }

  .viewer-divider {
    display: none;
  }

  .viewer-download-button,
  .viewer-reference-button {
    flex: 1 1 120px;
    min-width: 0;
  }

  .bbox-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 12px;
    border-radius: 18px;
  }

  .bbox-stage {
    min-height: 300px;
    max-height: 56dvh;
  }

  .bbox-stage img {
    max-height: 56dvh;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding: 10px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .tabs button,
  .primary-btn,
  .ghost-btn {
    min-height: 42px;
  }

  .model-card {
    padding: 12px;
  }

  .history-panel .preview-grid {
    grid-template-columns: 1fr;
  }

  .history-actions {
    grid-template-columns: 1fr;
  }

  .register-card {
    padding-inline: 16px;
  }

  .login-dialog {
    padding: 20px;
  }
}

.account-security-modal .account-security-dialog {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(6, 182, 212, 0.14), transparent 34%),
    #ffffff;
  color: #111827;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
}

.account-security-modal .login-backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px) saturate(1.05);
}

.account-security-modal .login-close {
  background: #ecfeff;
  color: #111827;
}

.account-security-modal .account-security-head p {
  color: #0891b2;
}

.account-security-modal .account-security-head h2 {
  color: #111827;
  text-shadow: none;
}

.account-security-modal .account-security-notice {
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 16px;
  background: #ecfeff;
  color: #334155;
}

.account-security-modal .account-security-notice strong,
.account-security-modal .account-security-form label {
  color: #111827;
}

.account-security-modal .account-security-form input {
  border: 1.5px solid #d1e7ee;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
}

.account-security-modal .account-security-form input::placeholder {
  color: #94a3b8;
}

.account-security-modal .account-security-form input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.14);
}

.account-security-modal .account-code-row .email-code-btn {
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  background: #ecfeff;
  color: #0e7490;
}

.account-security-modal .account-code-row .email-code-btn:disabled {
  background: #cffafe;
  color: #0e7490;
}

.account-security-modal .account-submit-btn {
  border-radius: 999px;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(6, 182, 212, 0.28);
}

.account-security-modal .account-submit-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 22px 42px rgba(6, 182, 212, 0.32);
}

.account-security-modal .profile-message {
  color: #64748b;
}

.account-security-modal .profile-message[data-type="success"] {
  color: #0891b2;
}

.account-security-modal .profile-message[data-type="error"] {
  color: #dc2626;
}
