:root {
  --bg: #edf2f6;
  --bg-glow:
    radial-gradient(circle at top, rgba(145, 205, 250, 0.28), transparent 40%),
    radial-gradient(circle at 85% 14%, rgba(201, 232, 255, 0.34), transparent 28%);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-muted: rgba(244, 247, 251, 0.94);
  --border: rgba(23, 35, 51, 0.07);
  --border-strong: rgba(23, 35, 51, 0.12);
  --text-primary: #142031;
  --text-secondary: #5c6b7d;
  --accent: #118fcb;
  --accent-strong: #0c78ab;
  --success: #0f8f71;
  --warning: #af6b1f;
  --shadow: 0 24px 56px rgba(16, 31, 51, 0.06);
  --shadow-soft: 0 12px 28px rgba(16, 31, 51, 0.035);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  background-image: var(--bg-glow);
  overscroll-behavior-x: none;
  touch-action: pan-y;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 72%);
  pointer-events: none;
  opacity: 0.26;
}

body.is-lightbox-open {
  overflow: hidden;
}

button,
input,
a {
  font: inherit;
}

.page-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 28px 18px 56px;
  overflow-x: clip;
}

.hero-card,
.card {
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 102px;
  padding: 24px 28px 24px 26px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  z-index: 10;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -86px;
  width: 260px;
  height: 198px;
  background: radial-gradient(circle, rgba(17, 143, 203, 0.17), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.eyebrow,
.section-label,
.helper-text,
.step-text,
.badge {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero-card h1 {
  margin: 0;
  font-family: "Hiragino Sans GB", "PingFang SC", "STHeiti", "Microsoft YaHei", sans-serif;
  font-size: clamp(24px, 5.2vw, 42px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.04;
  white-space: nowrap;
  align-self: center;
  position: relative;
  z-index: 2;
}

.hero-logo-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -3px;
  margin-top: 0;
  margin-bottom: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.96;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(245, 250, 253, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 10px 24px rgba(17, 39, 66, 0.06);
}

.hero-logo {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.hero-copy,
.section-copy,
.helper-text,
.trust-list p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meta span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text-secondary);
  font-size: 12px;
}

.main-stack {
  margin-top: 20px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.card {
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
}

.card h2 {
  margin: 8px 0 8px;
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 12px;
  width: 100%;
  min-height: 250px;
  margin-top: 20px;
  padding: 28px 24px;
  border-radius: 28px;
  border: 1px dashed rgba(17, 143, 203, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 252, 0.9)),
    radial-gradient(circle at top, rgba(17, 143, 203, 0.075), transparent 58%);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.upload-dropzone:active {
  transform: scale(0.996);
}

.upload-dropzone:hover {
  border-color: rgba(17, 143, 203, 0.36);
  box-shadow: 0 16px 36px rgba(17, 143, 203, 0.05);
}

.upload-dropzone input {
  display: none;
}

.upload-icon {
  width: 60px;
  height: 60px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(17, 143, 203, 0.16), rgba(17, 143, 203, 0.05));
  border: 1px solid rgba(17, 143, 203, 0.14);
  position: relative;
}

.upload-icon::before,
.upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.upload-icon::before {
  width: 22px;
  height: 2px;
  border-radius: 999px;
}

.upload-icon::after {
  width: 2px;
  height: 22px;
  border-radius: 999px;
}

.upload-headline {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.upload-subcopy {
  max-width: 28ch;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 14px;
}

.thumb-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.thumb-item {
  min-width: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(18, 33, 54, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.thumb-item:hover {
  transform: translateY(-2px);
  border-color: rgba(17, 143, 203, 0.14);
  box-shadow: 0 18px 34px rgba(18, 33, 54, 0.07);
}

.thumb-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
}

.thumb-caption {
  padding: 8px 8px 10px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
  word-break: break-all;
}

.preview-frame,
.result-frame {
  margin-top: 18px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.preview-frame img,
.result-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.result-frame {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 251, 0.95)),
    radial-gradient(circle at top right, rgba(17, 143, 203, 0.06), transparent 30%);
}

.result-grid {
  margin-top: 0;
  gap: 16px;
}

.result-grid .thumb-item {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 32, 49, 0.06);
  box-shadow:
    0 20px 34px rgba(18, 33, 54, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.result-grid .thumb-item:hover {
  transform: translateY(-3px);
  border-color: rgba(17, 143, 203, 0.12);
  box-shadow:
    0 24px 42px rgba(18, 33, 54, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.result-grid .thumb-item img {
  aspect-ratio: 0.88;
  background: linear-gradient(180deg, rgba(246, 249, 252, 0.96), rgba(240, 245, 249, 0.94));
}

.thumb-actions {
  display: grid;
  gap: 6px;
  padding: 0 10px 12px;
}

.thumb-hint {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 18, 28, 0.82);
  display: none;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 18px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.lightbox-tip {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 13px;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 58px;
  margin-top: 20px;
  border: 0;
  border-radius: 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  background: linear-gradient(180deg, #8dc6ea, #72b4de);
  color: white;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(114, 180, 222, 0.22);
}

.primary-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.secondary-button {
  background: rgba(19, 34, 50, 0.045);
  color: var(--text-primary);
}

.stepper {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

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

.status-stat {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.66);
}

.status-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-stat-value {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.step {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 12px;
  opacity: 0.42;
}

.step.is-active,
.step.is-complete {
  opacity: 1;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: white;
}

.step.is-active .step-dot {
  border-color: rgba(16, 148, 215, 0.42);
  background: rgba(16, 148, 215, 0.18);
  box-shadow: 0 0 0 6px rgba(16, 148, 215, 0.08);
}

.step.is-complete .step-dot {
  background: rgba(15, 143, 113, 0.18);
  border-color: rgba(15, 143, 113, 0.36);
}

.result-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-head h2 {
  margin-bottom: 6px;
}

.result-head .section-copy {
  max-width: 22ch;
}

.result-actions {
  display: grid;
  gap: 12px;
}

.trust-list {
  display: grid;
  gap: 14px;
}

.trust-list article {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--border);
}

.trust-list h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.trust-list p {
  margin: 0;
}

@media (min-width: 720px) {
  .page-shell {
    padding-top: 42px;
  }

  .main-stack {
    gap: 20px;
  }

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

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

  .hero-card {
    min-height: 112px;
    padding: 26px 32px 26px 30px;
  }

  .card {
    padding: 28px 24px;
  }

  .hero-logo-wrap {
    width: 46px;
    height: 46px;
  }
}
