/* ============================================
   AI Anime Generator - Global Styles
   Primary: #6366f1 | Mobile-first responsive
   ============================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Navigation ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.quota-badge {
  font-size: 0.75rem;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
}

.btn-ghost {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--border);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fee2e2;
}

/* ---- Hero / Sections ---- */
main {
  padding-top: var(--nav-height);
}

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

/* ---- Hero ---- */
.hero {
  padding: 80px 0 64px;
  background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg) 100%);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---- Gallery (Home) — auto-scroll marquee ---- */
.gallery-marquee-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: opacity 0.4s ease;
}

.gallery-marquee-wrap.gallery-refreshing {
  opacity: 0.55;
}

.gallery-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.gallery-marquee:hover .gallery-track {
  animation-play-state: paused;
}

.gallery-track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
}

.gallery-marquee--left .gallery-track {
  animation: gallery-scroll-left 50s linear infinite;
}

.gallery-marquee--right .gallery-track {
  animation: gallery-scroll-right 55s linear infinite;
}

@keyframes gallery-scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes gallery-scroll-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-marquee--left .gallery-track,
  .gallery-marquee--right .gallery-track {
    animation: none;
  }
}

.gallery-item {
  position: relative;
  flex: 0 0 auto;
  width: 180px;
  height: 180px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.6));
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.gallery-item .overlay span {
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ---- Generator ---- */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.generator-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group label .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

textarea,
select,
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg);
}

textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.style-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-chip {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  transition: all var(--transition);
  user-select: none;
}

.style-chip:hover {
  border-color: var(--primary-light);
}

.style-chip.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* Prompt helpers */
.prompt-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prompt-quality {
  font-weight: 600;
}

.prompt-quality.low { color: #f59e0b; }
.prompt-quality.mid { color: var(--primary); }
.prompt-quality.high { color: #22c55e; }

.prompt-tips {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.prompt-tips-lead {
  margin: 0 0 8px;
  color: var(--text);
}

.prompt-tips-list {
  margin: 0;
  padding-left: 18px;
}

.prompt-tips-list li {
  margin-bottom: 6px;
}

.prompt-tips-list li:last-child {
  margin-bottom: 0;
}

.prompt-tips-list li strong {
  color: var(--primary);
}

.size-hint {
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 6px;
  font-weight: 500;
}

/* Templates */
.templates-toggle {
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 12px;
  display: inline-block;
}

.templates-grid {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 16px;
}

.templates-grid.open {
  display: grid;
}

.template-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  background: var(--bg-alt);
}

.template-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.template-card strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--text);
}

.template-card span {
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress */
.progress-panel {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
}

.progress-panel.active {
  display: block;
}

.progress-bar-wrap {
  height: 10px;
  background: white;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 5px;
  width: 0%;
  transition: width 0.2s linear;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#progressTime {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#progressTotal {
  font-size: 0.9rem;
}

#progressElapsed {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Results */
.results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-bg), rgba(124, 58, 237, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.results-summary-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.results-summary-time strong {
  color: var(--primary);
  font-size: 1rem;
}

.results-panel {
  min-height: 400px;
}

.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.results-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.result-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-alt);
}

.result-img-wrap {
  position: relative;
  cursor: zoom-in;
}

.hd-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow);
}

.result-hd-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.result-img-wrap:hover .result-hd-img {
  transform: scale(1.02);
}

.result-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.share-dropdown {
  position: relative;
  display: inline-block;
}

.share-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 10;
  margin-bottom: 4px;
}

.share-menu.open {
  display: block;
}

.share-menu a,
.share-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  border: none;
  background: none;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.share-menu a:hover,
.share-menu button:hover {
  background: var(--bg-alt);
}

/* ---- History ---- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.history-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.history-meta h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  word-break: break-word;
}

.history-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.pricing-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 16px 0;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin: 24px 0;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.pricing-features li.disabled::before {
  content: '✗';
  color: var(--text-muted);
}

/* ---- About ---- */
.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.about-feature {
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.about-feature .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.about-feature h4 {
  margin-bottom: 8px;
}

.about-feature p {
  font-size: 0.85rem;
  margin: 0;
}

/* ---- Footer ---- */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

.seo-articles a {
  display: block;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ---- Modals ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg);
  border-radius: var(--radius);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  border-radius: var(--radius);
}

.modal-pro {
  padding: 40px;
  text-align: center;
  max-width: 420px;
}

.modal-pro .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.modal-pro h3 {
  margin-bottom: 12px;
}

.modal-pro p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-pro-limit {
  max-width: 400px;
}

/* ---- Payment / Pro Upgrade ---- */
.payment-section {
  max-width: 480px;
  margin: 48px auto 0;
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.payment-section.payment-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.payment-section-title {
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 8px;
}

.payment-section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.pro-active-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.pro-active-banner span {
  font-size: 1.5rem;
  color: var(--success);
}

.pro-active-banner strong {
  display: block;
  color: #166534;
  margin-bottom: 4px;
}

.pro-active-banner p {
  font-size: 0.85rem;
  color: #15803d;
  margin: 0;
}

.payment-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.payment-tab {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.payment-tab:hover {
  border-color: var(--primary-light);
}

.payment-tab.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.payment-tab[data-pay-tab="wechat"].active {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}

.payment-tab[data-pay-tab="alipay"].active {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.payment-qr-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.payment-qr-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.payment-qr {
  width: 220px;
  height: 220px;
  min-width: 180px;
  min-height: 180px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  margin: 0 auto 8px;
  display: block;
  opacity: 1;
}

.payment-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.payment-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.payment-steps {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.payment-steps p {
  margin-bottom: 8px;
}

.payment-steps p:last-child {
  margin-bottom: 0;
}

.payment-contact {
  color: var(--primary);
  font-weight: 500;
}

.activation-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activation-form input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.05em;
}

.activation-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.modal-payment {
  padding: 28px;
  max-width: 400px;
  width: 100%;
}

.modal-payment h3 {
  text-align: center;
  margin-bottom: 8px;
}

.modal-payment-sub {
  text-align: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.modal-qr-wrap .payment-qr {
  width: 200px;
  height: 200px;
}

.payment-note-sm,
.payment-contact-sm {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}

.payment-contact-sm {
  color: var(--primary);
  margin-bottom: 16px;
}

.nav-pro-badge {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #78350f;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 4px;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.toast.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.toast.info {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid #c7d2fe;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 14px;
  }

  .quota-badge {
    display: none;
  }

  .history-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .history-thumb {
    margin: 0 auto;
  }

  .history-actions {
    justify-content: center;
  }

  .gallery-item {
    width: 140px;
    height: 140px;
  }

  .gallery-marquee--left .gallery-track {
    animation-duration: 35s;
  }

  .gallery-marquee--right .gallery-track {
    animation-duration: 40s;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 48px 0;
  }

  .generator-panel {
    padding: 20px;
  }

  .payment-section {
    margin-top: 32px;
    padding: 20px;
  }

  .payment-qr {
    width: 180px;
    height: 180px;
  }

  .modal-payment {
    padding: 20px;
    margin: 12px;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
