/* ============================================
   Neubrutalism Design System
   ============================================ */

:root {
  --yellow: #FFEB3B;
  --red: #FF5252;
  --blue: #2196F3;
  --black: #000;
  --white: #fff;
  --gray-light: #f5f5f5;
  --gray-mid: #ccc;
  --border-width: 3px;
  --shadow-offset: 5px;
  --radius: 0.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--yellow);
  color: var(--black);
  line-height: 1.6;
  min-height: 100dvh;
}

/* ============================================
   Navigation Bar
   ============================================ */

.navbar {
  background: var(--white);
  border-bottom: var(--border-width) solid var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.3rem;
  background: var(--yellow);
  color: var(--black);
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--black);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 200ms;
}

.nav-link:hover {
  background: var(--yellow);
}

.nav-link.active {
  background: var(--black);
  color: var(--white);
}

.nav-link.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-nav-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  background: transparent;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 200ms, transform 100ms, box-shadow 200ms;
}

.btn-nav-outline:hover {
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--black);
  transform: translate(-1px, -1px);
}

.btn-nav-outline:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.btn-nav-fill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--black);
  transition: background 200ms, transform 100ms, box-shadow 200ms;
}

.btn-nav-fill:hover {
  background: #ff6b6b;
  box-shadow: 4px 4px 0 var(--black);
  transform: translate(-1px, -1px);
}

.btn-nav-fill:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--black);
}

/* Nav Authed (logged-in) */
.nav-authed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav-lang {
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--black);
  background: transparent;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 200ms;
}

.btn-nav-lang:hover {
  background: var(--yellow);
}

.nav-credits-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--black);
  background: transparent;
  border: 2px solid var(--black);
  border-radius: 0.4rem;
  box-shadow: 2px 2px 0 var(--black);
  white-space: nowrap;
}

.btn-nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: transparent;
  border: 2px solid var(--black);
  border-radius: 50%;
  cursor: pointer;
  transition: background 200ms;
}

.btn-nav-avatar:hover {
  background: var(--yellow);
}

.avatar-initials {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--black);
}

/* Nav Dropdown */
.nav-avatar-wrap {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 10rem;
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: var(--radius);
  z-index: 100;
  overflow: hidden;
}

.dropdown-user {
  padding: 0.5rem 0.75rem;
}

.dropdown-username {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-plan {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--black);
  opacity: 0.55;
  margin: 0.125rem 0 0 0;
}

.dropdown-separator {
  height: 1px;
  background: var(--black);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms;
  user-select: none;
  outline: none;
}

.dropdown-item:hover {
  background: var(--yellow);
}

.dropdown-item:hover .dropdown-item-icon {
  opacity: 1;
}

.dropdown-item-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.dropdown-logout {
  color: var(--red);
}

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ============================================
   Header
   ============================================ */

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
  text-transform: uppercase;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--black);
}

.description {
  font-size: 1rem;
  color: var(--black);
  opacity: 0.75;
  margin-top: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Section Title
   ============================================ */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--black);
}

/* ============================================
   Upload Area
   ============================================ */

.upload-area {
  position: relative;
  padding: 1.25rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 200ms;
}

.upload-area:hover {
  background: var(--gray-light);
}

.upload-area.drag-over {
  background: var(--yellow);
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.upload-icon {
  width: 3rem;
  height: 3rem;
  color: var(--black);
  opacity: 0.35;
}

.upload-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--black);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--black);
  opacity: 0.45;
}

/* Preview Grid */

.upload-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
  pointer-events: none;
}

.upload-previews:not(:empty) {
  pointer-events: auto;
}

.upload-previews:not(:empty) ~ .upload-placeholder {
  display: none;
}

.preview-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-light);
  animation: fadeSlideUp 300ms ease-out;
}

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

.preview-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transition: background 200ms, transform 100ms;
  pointer-events: auto;
}

.preview-remove:hover {
  background: #ff6b6b;
  transform: scale(1.1);
}

.preview-add {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  pointer-events: auto;
  transition: background 200ms;
}

.preview-add:hover {
  background: var(--yellow);
}

.preview-add-icon {
  width: 2rem;
  height: 2rem;
  color: var(--black);
  opacity: 0.35;
}

/* ============================================
   Input Card
   ============================================ */

.input-section {
  margin-bottom: 3rem;
}

.input-card {
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 200ms ease-out, transform 200ms ease-out;
}

.input-card:focus-within {
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 var(--black);
  transform: translate(-1px, -1px);
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: var(--border-width) solid var(--black);
  background: var(--gray-light);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--black);
  opacity: 0.6;
}

.create-num-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
}

.create-num-input {
  width: 3rem;
  padding: 0.4rem 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  color: var(--black);
  background: var(--white);
  border: var(--border-width) solid var(--black);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--black);
  outline: none;
  -moz-appearance: textfield;
}

.create-num-input::-webkit-inner-spin-button,
.create-num-input::-webkit-outer-spin-button {
  opacity: 1;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================
   Language Toggle
   ============================================ */

.lang-toggle {
  display: flex;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-btn {
  padding: 0.35rem 0.85rem;
  border: none;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms, color 200ms;
}

.lang-btn + .lang-btn {
  border-left: 2px solid var(--black);
}

.lang-btn.active {
  background: var(--black);
  color: var(--white);
}

.lang-btn:hover:not(.active) {
  background: var(--yellow);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  background: var(--red);
  border: var(--border-width) solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 200ms, transform 100ms, box-shadow 200ms;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: #ff6b6b;
  box-shadow: 6px 6px 0 var(--black);
  transform: translate(-2px, -2px);
}

.btn-primary:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--black);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 4px 4px 0 var(--black);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 200ms, transform 100ms, box-shadow 200ms;
}

.btn-secondary:hover {
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--black);
  transform: translate(-2px, -2px);
}

.btn-secondary:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--black);
}

/* ============================================
   Result Section
   ============================================ */

.result-section {
  margin-bottom: 3rem;
  animation: fadeSlideUp 420ms ease-out;
}

.result-card {
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
}

.result-content {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.result-content::-webkit-scrollbar {
  height: 6px;
}

.result-content::-webkit-scrollbar-thumb {
  background: var(--black);
  border-radius: 3px;
}

.result-image-item {
  border: var(--border-width) solid var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  flex: 0 0 280px;
  scroll-snap-align: start;
}

.result-image-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor: pointer;
}

.result-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--black);
  opacity: 0.5;
  font-size: 0.9rem;
  padding: 2rem;
}

/* ============================================
   Showcase Section
   ============================================ */

.showcase-section {
  margin-bottom: 2rem;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.showcase-card {
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.showcase-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.label-before {
  background: var(--black);
  color: var(--white);
}

.label-after {
  background: var(--blue);
  color: var(--white);
}

.showcase-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--black);
  max-width: 68ch;
}

.showcase-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 2px solid var(--black);
}

.showcase-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.showcase-result {
  font-size: 0.85rem;
}

.showcase-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  padding-top: 1.5rem;
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: var(--border-width) solid var(--black);
  box-shadow: 4px 4px 0 var(--yellow);
  border-radius: var(--radius);
  z-index: 500;
  animation: toastIn 300ms ease-out;
  white-space: nowrap;
}

.toast.fade-out {
  animation: toastOut 300ms ease-out forwards;
}

/* ============================================
   Error Banner（红色 Neubrutalism 错误提示）
   ============================================ */

.error-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #FFF5F5;
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.85rem 2rem 0.85rem 1.25rem;
  border: var(--border-width) solid var(--red);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--red);
  border-radius: var(--radius);
  z-index: 600;
  max-width: 480px;
  width: calc(100% - 2rem);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: errorBannerIn 300ms ease-out;
}

.error-banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.error-banner-msg {
  flex: 1;
  line-height: 1.45;
}

.error-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--red);
  opacity: 0.6;
  padding: 0;
  margin-left: 0.25rem;
}

.error-banner-close:hover {
  opacity: 1;
}

.error-banner.fade-out {
  animation: errorBannerOut 300ms ease-out forwards;
}

/* ============================================
   Inline Error（生图区域下方错误提示）
   ============================================ */

.inline-error {
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  background: #FFF5F5;
  border: var(--border-width) solid var(--red);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--red);
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.45;
}

.inline-error-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

@keyframes errorBannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes errorBannerOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ============================================
   Spinner (for loading state)
   ============================================ */

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  background: transparent;
  border: 2px solid var(--white);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  background: transparent;
  border: 2px solid var(--white);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms;
  user-select: none;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.25rem;
  cursor: default;
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
}

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

/* ============================================
   Auth Pages
   ============================================ */

.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--black);
  text-align: center;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--black);
  opacity: 0.6;
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Social buttons */

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 200ms, transform 100ms, box-shadow 200ms;
}

.btn-social:hover {
  background: var(--gray-light);
  box-shadow: 4px 4px 0 var(--black);
  transform: translate(-1px, -1px);
}

.btn-social:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--black);
}

.btn-social svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Divider */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--black);
}

.auth-divider span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--black);
  opacity: 0.5;
  text-transform: uppercase;
}

/* Form */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
}

.form-input {
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  outline: none;
  transition: box-shadow 200ms;
}

.form-input:focus {
  box-shadow: 3px 3px 0 var(--black);
}

.form-input::placeholder {
  color: var(--black);
  opacity: 0.3;
}

.btn-auth-submit {
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

.auth-msg {
  padding: 0.75rem 1rem;
  border: var(--border-width) solid var(--black);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.auth-msg-error {
  background: #FFF0F0;
  color: #D32F2F;
}

.auth-msg-success {
  background: #F0FFF0;
  color: #2E7D32;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--black);
  opacity: 0.65;
}

.auth-footer a {
  color: var(--black);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 2px solid var(--black);
  }

  .container {
    padding: 1.25rem 1rem 2.5rem;
  }

  .header {
    margin-bottom: 2rem;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .showcase-arrow {
    transform: rotate(90deg);
    padding-top: 0;
    font-size: 1.5rem;
  }

  .input-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .result-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .result-content::-webkit-scrollbar {
    display: none;
  }

  .result-image-item {
    flex: auto;
    scroll-snap-align: none;
  }
}

/* ========== Settings Page ========== */
.settings-wrap {
  max-width: 42rem;
  margin: 0 auto;
}

.settings-card {
  background: var(--white);
  border: var(--border-width) solid var(--black);
  border-radius: 1rem;
  box-shadow: 4px 4px 0 var(--black);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.settings-card-header {
  padding: 1.5rem 1.5rem 0.5rem;
}

.settings-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-card-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.settings-card-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--black);
  border-radius: 0.5rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: capitalize;
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--black);
}

.settings-card-body {
  padding: 0 1.5rem 1.5rem;
}

.settings-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.settings-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.125rem;
}

.settings-stat-value {
  font-weight: 600;
}

.settings-progress {
  margin-bottom: 1rem;
}

.settings-progress-bar {
  height: 0.5rem;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e5e5;
  border: 1.5px solid var(--black);
}

.settings-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--yellow);
  transition: width 0.4s ease;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-settings-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--black);
  transition: all 150ms;
  background: var(--yellow);
  color: var(--black);
  box-shadow: 3px 3px 0 var(--black);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-settings-upgrade:hover {
  box-shadow: 5px 5px 0 var(--black);
  transform: translate(-1px, -1px);
}

.btn-settings-upgrade:active {
  box-shadow: 1px 1px 0 var(--black);
  transform: translate(1px, 1px);
}

.settings-account-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.settings-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-account-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
}

.settings-account-value {
  font-weight: 500;
}

@media (max-width: 768px) {
  .settings-wrap {
    max-width: 100%;
  }

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

/* ========== Pricing Page ========== */
.pricing-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.pricing-hero-title {
  font-size: 1.875rem;
  font-weight: 900;
}

.pricing-hero-desc {
  margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 56rem;
  margin: 0 auto;
}

.pricing-card {
  position: relative;
  border: var(--border-width) solid var(--black);
  border-radius: 0.5rem;
  background: var(--white);
  padding: 1.5rem;
  box-shadow: 4px 4px 0 var(--black);
}

.pricing-card-popular {
  border-color: var(--yellow);
  box-shadow: 4px 4px 0 var(--yellow), 0 0 0 1px var(--yellow);
}

.pricing-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 2px solid var(--black);
  border-radius: 0.5rem;
  background: var(--yellow);
  color: var(--black);
  box-shadow: 2px 2px 0 var(--black);
  white-space: nowrap;
}

.pricing-card-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.pricing-card-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.125rem;
}

.pricing-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

.pricing-features {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pricing-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.pricing-check-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--yellow);
}

.pricing-card-action {
  margin-top: 1.5rem;
}

.btn-pricing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--black);
  transition: all 150ms;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  width: 100%;
}

.btn-pricing-current {
  background: #e5e5e5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-pricing-upgrade {
  background: var(--yellow);
  color: var(--black);
  box-shadow: 3px 3px 0 var(--black);
}

.btn-pricing-upgrade:hover {
  box-shadow: 5px 5px 0 var(--black);
  transform: translate(-1px, -1px);
}

.btn-pricing-upgrade:active {
  box-shadow: 1px 1px 0 var(--black);
  transform: translate(1px, 1px);
}

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

/* ============================================
   专业生图 - Params & Prompt
   ============================================ */

.params-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: var(--border-width) solid var(--black);
  background: #fafafa;
}

.params-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.params-group-full {
  width: 100%;
}

.params-label {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--black);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.param-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.param-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}

.param-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 2px solid #ccc;
  border-radius: var(--radius);
  background: var(--white);
  color: #888;
  cursor: pointer;
  transition: all 0.12s;
}

.param-btn:hover {
  border-color: var(--black);
  color: var(--black);
}

.param-btn.active {
  border-color: var(--black);
  background: var(--yellow);
  color: var(--black);
  box-shadow: 2px 2px 0 var(--black);
}

.prompt-area {
  position: relative;
  padding: 1rem 1.25rem;
  border-bottom: var(--border-width) solid var(--black);
}

.prompt-input {
  width: 100%;
  resize: vertical;
  padding: 0.75rem 1rem;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--white);
  outline: none;
  box-sizing: border-box;
}

.prompt-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 235, 59, 0.25);
}

.prompt-count {
  display: block;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.35rem;
}



/* ========== 历史记录 ========== */
.history-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.history-filter-bar {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #888;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.history-card {
  border: var(--border-width) solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.history-card-header:hover {
  background: #fafafa;
}

.history-card-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-card-title {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--black);
  margin: 0;
}

.history-card-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #888;
  margin: 0;
}

.history-card-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--black);
}

.history-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
  color: var(--black);
}

.history-card-body {
  border-top: var(--border-width) solid var(--black);
  padding: 1rem 1.25rem;
  background: #fafafa;
}

.history-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.history-section {
  margin-bottom: 0.75rem;
}

.history-section:last-child {
  margin-bottom: 0;
}

.history-section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  margin: 0 0 0.5rem 0;
}

.history-card-thumb {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
}

@media (max-width: 768px) {
  .history-card-thumb {
    width: 120px;
  }
}

/* ========== QR Code Modal ========== */
.qrcode-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-modal {
  background: var(--white);
  border: var(--border-width) solid var(--black);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--black);
  border-radius: 1rem;
  padding: 1.75rem;
  max-width: 360px;
  width: calc(100% - 2rem);
  text-align: center;
  position: relative;
}

.qrcode-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 1rem;
}

.qrcode-img {
  width: 220px;
  height: 220px;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--black);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .qrcode-img {
    width: 180px;
    height: 180px;
  }
}

.qrcode-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--black);
  opacity: 0.5;
  transition: opacity 200ms;
}

.qrcode-close:hover {
  opacity: 1;
}

.qrcode-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--black);
  font-weight: 600;
}

.qrcode-done-btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--yellow);
  color: var(--black);
  border: var(--border-width) solid var(--black);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--black);
  cursor: pointer;
  transition: all 150ms;
}

.qrcode-done-btn:hover {
  background: var(--black);
  color: var(--white);
  box-shadow: 2px 2px 0 var(--black);
  transform: translate(1px, 1px);
}