/* ============================================================
   StyleStudio - Premium SaaS Design System & Styling
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Variables & Theme Tokens
   ------------------------------------------------------------ */
:root {
  /* Color Palette - Sleek Dark Theme with Vibrant Accents */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(31, 41, 55, 0.6);
  --bg-card-hover: rgba(55, 65, 81, 0.7);
  --bg-glass: rgba(17, 24, 39, 0.75);
  
  /* Accent Gradients & Colors */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #3b82f6 100%);
  --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(236, 72, 153, 0.4));
  --gradient-card: linear-gradient(145deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.9));
  
  /* Text Colors */
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  
  /* UI Borders & Rings */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(139, 92, 246, 0.5);
  --ring-focus: 0 0 0 3px rgba(139, 92, 246, 0.3);
  
  /* Shadows & Effects */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.35);
  
  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Slider position variable */
  --slider-pos: 50%;
}

/* ------------------------------------------------------------
   2. Reset & Global Styles
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.14) 0%, transparent 60%),
              radial-gradient(circle at 80% 40%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
              var(--bg-primary);
  background-attachment: fixed;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ------------------------------------------------------------
   3. Header Styling
   ------------------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  user-select: none;
}

.logo-icon {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.6rem;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.logo-text {
  color: var(--text-main);
}

.nav-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   4. Main Layout & Hero
   ------------------------------------------------------------ */
.main {
  flex: 1;
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

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

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ------------------------------------------------------------
   5. File Upload Zone
   ------------------------------------------------------------ */
.upload-section {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.upload-zone {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: 3.2rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-purple);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.upload-icon {
  font-size: 3.2rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.upload-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.upload-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.upload-hint {
  margin-top: 0.8rem;
  font-size: 0.8rem !important;
  color: var(--text-subtle) !important;
}

.upload-preview {
  position: relative;
  max-height: 380px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-preview img {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.btn-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  border: 2px solid var(--bg-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
}

.btn-remove:hover {
  transform: scale(1.1);
  background: #dc2626;
}

/* ------------------------------------------------------------
   6. Category Selection & Custom Prompt
   ------------------------------------------------------------ */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-bounce);
  color: var(--text-main);
  text-align: center;
}

.category-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: var(--shadow-md);
}

.category-card.selected {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.25));
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
}

.category-icon {
  font-size: 2.3rem;
  margin-bottom: 0.6rem;
}

.category-name {
  font-weight: 700;
  font-size: 1rem;
}

.category-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.prompt-section {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: fadeIn 0.4s ease-out;
}

.prompt-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.prompt-input-group {
  display: flex;
  gap: 0.75rem;
}

.prompt-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.prompt-input:focus {
  border-color: var(--accent-purple);
  box-shadow: var(--ring-focus);
}

.btn-transform {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  white-space: nowrap;
}

.btn-transform:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
  filter: brightness(1.1);
}

/* ------------------------------------------------------------
   7. Loading Section & Animations
   ------------------------------------------------------------ */
.loading-section {
  padding: 3.5rem 1rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease-out;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 450px;
  margin: 0 auto;
}

.spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
  width: 75%;
  height: 75%;
  top: 12.5%;
  left: 12.5%;
  border-top-color: var(--accent-pink);
  animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
  width: 50%;
  height: 50%;
  top: 25%;
  left: 25%;
  border-top-color: var(--accent-blue);
  animation-delay: -0.6s;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.loading-steps {
  display: flex;
  gap: 1.5rem;
  margin: 0.5rem 0;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
  transition: var(--transition-normal);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
  transition: var(--transition-normal);
}

.loading-step.active {
  color: var(--text-main);
  font-weight: 600;
}

.loading-step.active .step-dot {
  background: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple);
  transform: scale(1.3);
}

.loading-step.completed {
  color: var(--accent-emerald);
}

.loading-step.completed .step-dot {
  background: var(--accent-emerald);
}

/* ------------------------------------------------------------
   8. Result Section & Image Comparison (FIXED CLIP-PATH SLIDER)
   ------------------------------------------------------------ */
.result-section {
  animation: fadeIn 0.5s ease-out;
}

.result-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

/* Side-by-side View */
.compare-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.2rem;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

.compare-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.compare-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 5;
}

.before-label {
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-main);
}

.after-label {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
}

/* Slider View - Robust Clip-Path Implementation */
.slider-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
}

.slider-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
}

.slider-before, .slider-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slider-before img, .slider-after img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Use CSS clip-path inset so image dimensions and ratios never stretch */
.slider-after {
  clip-path: inset(0 0 0 var(--slider-pos, 50%));
}

.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--slider-pos, 50%);
  width: 3px;
  background: #ffffff;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.slider-handle span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--accent-purple);
}

.slider-range {
  width: 100%;
  max-width: 400px;
  accent-color: var(--accent-purple);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* View Toggle Buttons */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: var(--transition-normal);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-retry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-retry:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.privacy-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-md);
  color: var(--accent-emerald);
  font-size: 0.85rem;
  max-width: 600px;
  text-align: center;
}

/* ------------------------------------------------------------
   9. Footer & Toast Notifications
   ------------------------------------------------------------ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUp 0.3s ease-out;
}

.toast-info {
  border-left: 4px solid var(--accent-blue);
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-error {
  border-left: 4px solid #ef4444;
}

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

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

/* ------------------------------------------------------------
   10. Responsive Design
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .compare-container {
    grid-template-columns: 1fr;
  }
  
  .compare-divider {
    transform: rotate(90deg);
    margin: -0.5rem auto;
  }

  .prompt-input-group {
    flex-direction: column;
  }

  .btn-transform {
    justify-content: center;
  }

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

/* ------------------------------------------------------------
   AI 엔진 선택기
   ------------------------------------------------------------ */
.engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.engine-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  background: var(--gradient-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.engine-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.engine-card.selected {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
}

.engine-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gradient-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.engine-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.engine-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.engine-status {
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-subtle);
}

.engine-status.ok {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.engine-status.warn {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
}

.engine-status.off {
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.12);
}

/* ------------------------------------------------------------
   오류 패널 — 실패를 숨기지 않는다
   ------------------------------------------------------------ */
.error-panel {
  max-width: 720px;
  margin: 32px auto;
  padding: 24px 28px;
  background: rgba(127, 29, 29, 0.28);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: var(--radius-lg);
}

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

.error-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.error-icon {
  font-size: 1.3rem;
}

.error-message {
  color: #fecaca;
  line-height: 1.6;
  word-break: break-word;
}

.error-hint {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
  word-break: break-word;
}

.error-panel .btn-retry {
  margin-top: 18px;
}

/* ------------------------------------------------------------
   A/B 엔진 비교 결과
   ------------------------------------------------------------ */
.result-meta {
  margin: -12px 0 24px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.82rem;
  word-break: break-word;
}

.ab-section {
  max-width: 1180px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.ab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.ab-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.ab-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  cursor: zoom-in;
  display: block;
}

.ab-card-head h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ab-card-head p {
  font-size: 0.76rem;
  color: var(--text-subtle);
  line-height: 1.5;
  word-break: break-word;
}

.ab-download {
  padding: 10px 14px;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ab-download:hover {
  background: var(--gradient-glow);
}

.ab-card-failed {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.22);
}

.ab-error {
  color: #fecaca;
  font-size: 0.88rem;
  line-height: 1.6;
}

.ab-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}
