/* SugarCube Anime to Real Life Converter Styles
   Composes css/design-system.css primitives (.sc-card, .sc-button, .sc-input) and --sc-* tokens. */

.atr-page { overflow: clip; }
.atr-container { width: min(var(--sc-container, 1180px), calc(100% - 40px)); margin: 0 auto; }

/* Breadcrumb */
.atr-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  color: var(--sc-color-muted, #5f6f67);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
}
.atr-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--sc-color-brand-700, #047857);
  text-decoration: none;
  font-weight: 500;
}
.atr-breadcrumb strong {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sc-color-ink, #102019);
}

/* Hero Section */
.atr-hero { padding: 42px 0 30px; }
.atr-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(36px, 7vw, 88px);
  align-items: center;
}
.atr-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sc-color-brand-700, #047857);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.atr-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sc-color-brand-500, #10b981);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}
.atr-hero h1 {
  max-width: 700px;
  margin: 18px 0 0;
  font-size: clamp(3.25rem, 6vw, 6.2rem);
  line-height: var(--sc-leading-tight, 0.95);
  letter-spacing: -0.065em;
  font-weight: 900;
  color: var(--sc-color-ink, #102019);
}
.atr-gradient-text {
  color: var(--sc-color-brand-700, #047857);
}
.atr-lead {
  max-width: 580px;
  margin: 24px 0 0;
  color: var(--sc-color-muted, #5f6f67);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: var(--sc-leading-copy, 1.65);
}
.atr-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  color: var(--sc-color-muted, #5f6f67);
  font-size: 0.85rem;
  font-weight: 600;
}
.atr-hero-meta span::before {
  content: '✓';
  margin-right: 6px;
  color: var(--sc-color-brand-500, #10b981);
}

.atr-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
}
.atr-portrait-card {
  position: relative;
  width: 180px;
  height: 230px;
  border-radius: var(--sc-radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--sc-color-border, #dbe7e1);
  box-shadow: var(--sc-shadow-sm);
  background: var(--sc-color-surface-muted, #f1f5f3);
}
.atr-portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.atr-portrait-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: var(--sc-radius-sm, 6px);
  background: rgba(16, 32, 25, 0.75);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(4px);
}
.atr-magic {
  font-size: 1.5rem;
  color: var(--sc-color-brand-500, #10b981);
  animation: sc-pulse 2s infinite ease-in-out;
}

/* Workspace Section */
.atr-workspace-wrap { padding: 20px 0 60px; }
.atr-workspace {
  padding: 32px;
}
.atr-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--sc-color-border, #dbe7e1);
  margin-bottom: 24px;
}
.atr-workspace-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sc-color-ink, #102019);
}
.atr-workspace-title i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sc-color-brand-500, #10b981);
}
.atr-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--sc-color-muted, #5f6f67);
}
.atr-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.atr-step b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sc-color-surface-muted, #f1f5f3);
  color: var(--sc-color-muted, #5f6f67);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.atr-step.active {
  color: var(--sc-color-brand-700, #047857);
}
.atr-step.active b {
  background: var(--sc-color-brand-500, #10b981);
  color: #ffffff;
}
.atr-step-sep {
  width: 16px;
  height: 1px;
  background: var(--sc-color-border, #dbe7e1);
}

.atr-file { display: none; }

.atr-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
}

/* Upload Area */
.atr-upload-side { display: flex; flex-direction: column; gap: 16px; }
.atr-upload-board {
  position: relative;
  min-height: 320px;
  border: 2px dashed var(--sc-color-border-strong, #bfd4c9);
  border-radius: var(--sc-radius-lg, 16px);
  background: var(--sc-color-surface-muted, #f1f5f3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--sc-motion-fast, 160ms) var(--sc-ease);
  overflow: hidden;
}
.atr-upload-board:hover, .atr-upload-board.drag-over {
  border-color: var(--sc-color-brand-500, #10b981);
  background: var(--sc-color-brand-50, #ecfdf5);
}
.atr-upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.atr-upload-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--sc-radius-md, 12px);
  background: var(--sc-color-brand-50, #ecfdf5);
  color: var(--sc-color-brand-500, #10b981);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.atr-upload-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sc-color-ink, #102019);
  margin-bottom: 6px;
}
.atr-upload-help {
  font-size: 0.82rem;
  color: var(--sc-color-muted, #5f6f67);
  max-width: 260px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.atr-upload-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--sc-radius-md, 10px);
  background: var(--sc-color-surface, #ffffff);
  border: 1px solid var(--sc-color-border, #dbe7e1);
  color: var(--sc-color-ink, #102019);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--sc-shadow-sm);
}

/* Dual-support Preview & Toolbar State Selectors */
.atr-upload-board.has-file .atr-upload-empty,
.atr-upload-board.has-image .atr-upload-empty {
  display: none !important;
}

.atr-upload-preview {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.atr-upload-preview.active,
.atr-upload-preview.show,
.atr-upload-board.has-file .atr-upload-preview,
.atr-upload-board.has-image .atr-upload-preview {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.atr-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.atr-preview-toolbar {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: rgba(16, 32, 25, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.atr-preview-toolbar.active,
.atr-preview-toolbar.show,
.atr-upload-board.has-file .atr-preview-toolbar,
.atr-upload-board.has-image .atr-preview-toolbar {
  display: flex !important;
}

.atr-preview-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.atr-preview-info strong {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.atr-preview-info span {
  font-size: 0.72rem;
  color: var(--sc-color-brand-500, #10b981);
}

/* Samples */
.atr-samples {
  display: flex;
  align-items: center;
  gap: 12px;
}
.atr-samples-label {
  font-size: 0.78rem;
  color: var(--sc-color-muted, #5f6f67);
  line-height: 1.3;
}
.atr-sample {
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--sc-radius-md, 12px);
  border: 1.5px solid var(--sc-color-border, #dbe7e1);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  background: var(--sc-color-surface-muted, #f1f5f3);
  transition: border-color var(--sc-motion-fast, 160ms) var(--sc-ease);
}
.atr-sample:hover {
  border-color: var(--sc-color-brand-500, #10b981);
}
.atr-sample img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Controls Column */
.atr-controls { display: flex; flex-direction: column; }
.atr-control-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sc-color-ink, #102019);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.atr-control-label span:nth-child(2) {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sc-color-muted, #5f6f67);
}

.atr-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.atr-preset {
  padding: 10px 14px;
  color: var(--sc-color-ink, #102019);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.atr-preset:hover { border-color: var(--sc-color-brand-500, #10b981); }
.atr-preset.active {
  border-color: var(--sc-color-brand-500, #10b981);
  background: var(--sc-color-brand-50, #ecfdf5);
  color: var(--sc-color-brand-600, #059669);
}

.atr-prompt-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.atr-prompt-wrap textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  padding-bottom: 52px;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}
.atr-prompt-wrap textarea:focus {
  outline: none;
}
.atr-copy {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.atr-generate {
  margin-top: 22px;
  width: 100%;
  min-height: 52px;
  font-size: 1.02rem;
}

.atr-fine-print {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--sc-color-muted, #5f6f67);
  text-align: center;
}

/* Status Bar & Spinner */
.atr-status {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--sc-radius-md, 12px);
  font-size: 0.88rem;
  font-weight: 600;
}
.atr-status.active,
.atr-status.show,
.atr-status.processing,
.atr-status.loading,
.atr-status.error,
.atr-status.success {
  display: flex !important;
}
.atr-status.processing,
.atr-status.loading {
  background: var(--sc-color-surface-muted, #f1f5f3);
  color: var(--sc-color-ink, #102019);
  border: 1px solid var(--sc-color-border, #dbe7e1);
}
.atr-status.success {
  background: var(--sc-color-brand-50, #ecfdf5);
  color: var(--sc-color-brand-700, #047857);
  border: 1px solid var(--sc-color-brand-500, #10b981);
}
.atr-status.error {
  background: #fef2f2;
  color: var(--sc-color-danger, #b42335);
  border: 1px solid #fca5a5;
}
.atr-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sc-spin 0.75s linear infinite;
}

/* Result Section */
.atr-result {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--sc-color-border, #dbe7e1);
  align-items: center;
}
.atr-result.active,
.atr-result.show {
  display: grid !important;
}

.atr-result-frame {
  position: relative;
  width: 100%;
  max-height: 480px;
  border-radius: var(--sc-radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--sc-color-border, #dbe7e1);
  background: var(--sc-color-surface-muted, #f1f5f3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.atr-result-frame img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}
.atr-result-copy { display: flex; flex-direction: column; text-align: left; }
.atr-result-copy h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sc-color-ink, #102019);
  margin: 8px 0 12px;
}
.atr-result-copy p {
  font-size: 0.95rem;
  color: var(--sc-color-muted, #5f6f67);
  line-height: 1.6;
  margin-bottom: 24px;
}
.atr-result-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* History Section */
.atr-history {
  display: none;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--sc-color-border, #dbe7e1);
}
.atr-history.has-items,
.atr-history.active,
.atr-history.show {
  display: block !important;
}

.atr-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.atr-history-head h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--sc-color-ink, #102019);
  margin: 0;
}
.atr-history-count {
  font-size: 0.82rem;
  color: var(--sc-color-muted, #5f6f67);
}
.atr-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* Button Primitives */
.atr-icon-btn {
  min-width: var(--sc-control-height, 44px);
  min-height: var(--sc-control-height, 44px);
  border-radius: var(--sc-radius-md, 10px);
  border: 1px solid var(--sc-color-border, #dbe7e1);
  background: var(--sc-color-surface-muted, #f1f5f3);
  color: var(--sc-color-ink, #102019);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
}

.atr-btn {
  padding: 0 22px;
  font-size: 0.88rem;
}



/* Sections & Showcase */
.atr-section { padding: 80px 0; }
.atr-section-soft {
  background: var(--sc-color-surface-muted, #f1f5f3);
  border-block: 1px solid var(--sc-color-border, #dbe7e1);
}
.atr-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.atr-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.atr-compare-card {
  position: relative;
  border-radius: var(--sc-radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--sc-color-border, #dbe7e1);
  background: var(--sc-color-surface, #ffffff);
  aspect-ratio: 3/4;
  margin: 0;
  box-shadow: var(--sc-shadow-sm);
}
.atr-compare-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.atr-compare-card span {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: var(--sc-radius-sm, 6px);
  background: rgba(16, 32, 25, 0.75);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.atr-showcase-copy h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 900;
  line-height: var(--sc-leading-tight, 1.1);
  color: var(--sc-color-ink, #102019);
  margin: 12px 0 16px;
}
.atr-showcase-copy p {
  font-size: 1rem;
  color: var(--sc-color-muted, #5f6f67);
  line-height: var(--sc-leading-copy, 1.6);
}
.atr-points {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 28px;
}
.atr-point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.atr-point b {
  width: 32px;
  height: 32px;
  border-radius: var(--sc-radius-md, 10px);
  background: var(--sc-color-brand-500, #10b981);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}
.atr-point strong {
  display: block;
  font-size: 0.95rem;
  color: var(--sc-color-ink, #102019);
  margin-bottom: 2px;
}
.atr-point span {
  font-size: 0.85rem;
  color: var(--sc-color-muted, #5f6f67);
}

/* How It Works Grid */
.atr-section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.atr-section-head h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 900;
  color: var(--sc-color-ink, #102019);
  margin: 12px 0 10px;
}
.atr-section-head p {
  font-size: 1rem;
  color: var(--sc-color-muted, #5f6f67);
}

.atr-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.atr-how-card {
  overflow: hidden;
}
.atr-how-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.atr-how-body {
  padding: 20px;
}
.atr-how-body small {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sc-color-brand-700, #047857);
  letter-spacing: 0.06em;
}
.atr-how-body h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--sc-color-ink, #102019);
  margin: 6px 0 8px;
}
.atr-how-body p {
  font-size: 0.85rem;
  color: var(--sc-color-muted, #5f6f67);
  line-height: 1.5;
  margin: 0;
}

/* FAQ Layout */
.atr-faq-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: start;
}
.atr-faq-title h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--sc-color-ink, #102019);
  margin: 10px 0 12px;
}
.atr-faq-title p {
  font-size: 0.9rem;
  color: var(--sc-color-muted, #5f6f67);
  line-height: 1.6;
}

/* Final CTA */
.atr-final { padding: 60px 0 80px; }
.atr-final-card {
  background: var(--sc-color-brand-50, #ecfdf5);
  border: 1px solid var(--sc-color-brand-500, #10b981);
  border-radius: var(--sc-radius-xl, 24px);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.atr-final-card h2 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--sc-color-ink, #102019);
  margin: 0 0 6px;
}
.atr-final-card p {
  font-size: 0.95rem;
  color: var(--sc-color-muted, #5f6f67);
  margin: 0;
}

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

@media (max-width: 980px) {
  .atr-hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .atr-tool-grid { grid-template-columns: 1fr; }
  .atr-upload-side { border-right: 0; border-bottom: 1px solid var(--sc-color-border, #dbe7e1); padding-bottom: 24px; }
  .atr-upload-board { min-height: 280px; }
  .atr-result { grid-template-columns: 1fr; }
  .atr-showcase, .atr-faq-layout { grid-template-columns: 1fr; gap: 32px; }
  .atr-how-grid { grid-template-columns: 1fr; }
  .atr-final-card { flex-direction: column; text-align: center; }
}

@media (max-width: 680px) {
  .atr-container { width: min(100% - 24px, 1180px); }
  .atr-breadcrumb { min-height: 46px; font-size: .74rem; }
  .atr-hero { padding: 24px 0 20px; }
  .atr-hero h1 { margin-top: 14px; font-size: clamp(2.45rem, 11vw, 3.5rem); line-height: .98; }
  .atr-lead { margin-top: 18px; font-size: .96rem; line-height: 1.62; }
  .atr-hero-visual { flex-direction: column; }
}

input, textarea { font-size: 16px; }
