:root {
  color-scheme: light;
  --ink: #20222a;
  --muted: #6b6f7a;
  --paper: #f7f0e6;
  --paper-strong: #fff9ef;
  --coral: #e85d4f;
  --teal: #2a9d8f;
  --yellow: #f2b84b;
  --violet: #6d5bd0;
  --blue: #d8eef2;
  --line: #d8cfc1;
  --shadow: 0 24px 70px rgba(32, 34, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #17191f;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 90px rgba(0, 0, 0, 0.4);
}

.screen {
  display: none;
  min-height: 100svh;
  padding: 24px;
}

.screen.is-active {
  display: block;
}

.screen-hero,
.screen-loading {
  position: relative;
  padding: 0;
  color: #fff;
}

.hero-media,
.loading-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade,
.loading-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(32, 34, 42, 0.28), rgba(32, 34, 42, 0.55) 36%, rgba(32, 34, 42, 0.92));
}

.hero-content,
.loading-content {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 44px 26px 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.screen-hero .eyebrow,
.screen-loading .eyebrow {
  color: var(--yellow);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 5px;
  background: currentColor;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 20px;
  font-size: 42px;
  line-height: 1.12;
  font-weight: 900;
}

.hero-content p,
.loading-content p {
  margin-top: 18px;
  max-width: 330px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.58;
}

.primary-action,
.secondary-action,
.ghost-action {
  border: 0;
  border-radius: 0;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 26px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(242, 184, 75, 0.28);
}

.secondary-action {
  min-height: 50px;
  background: var(--paper-strong);
  color: var(--ink);
  font-weight: 800;
  border: 1px solid var(--line);
}

.ghost-action {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: max(4px, env(safe-area-inset-top));
}

.topbar h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
}

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 24px 0 22px;
}

.progress span {
  height: 5px;
  background: rgba(32, 34, 42, 0.14);
}

.progress span.is-done {
  background: var(--coral);
}

.upload-grid {
  display: block;
}

.upload-card {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.upload-card img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-card.has-image img {
  display: block;
}

.upload-card.has-image .upload-icon,
.upload-card.has-image strong,
.upload-card.has-image small {
  display: none;
}

.upload-card.has-image::after {
  content: "点击更换";
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  background: rgba(32, 34, 42, 0.72);
  color: #fff;
  font-size: 12px;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--blue);
  color: var(--ink);
  font-size: 30px;
  font-weight: 300;
}

.upload-card strong,
.upload-card small {
  position: relative;
  z-index: 1;
}

.upload-card strong {
  font-size: 17px;
}

.upload-card small {
  max-width: 124px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}

.choice-block {
  margin-top: 24px;
}

.demo-action {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  background: rgba(216, 238, 242, 0.78);
  color: var(--ink);
  border: 1px solid #b9d8de;
  font-weight: 900;
}

.block-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.block-title span {
  font-size: 20px;
  font-weight: 900;
}

.block-title small {
  color: var(--muted);
  font-size: 12px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  background: var(--paper-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
}

.chip.is-selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.sticky-action {
  position: sticky;
  bottom: 18px;
  margin-top: 28px;
}

.loading-content {
  justify-content: center;
}

.loading-content h2 {
  margin-top: 18px;
  font-size: 32px;
  line-height: 1.2;
}

.vhs-frame {
  position: relative;
  height: 210px;
  margin-top: 30px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
}

.api-status {
  margin-top: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  line-height: 1.45;
}

.vhs-frame::before,
.vhs-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.vhs-frame::after {
  inset: auto 18px 18px;
  height: 40px;
  background: rgba(32, 34, 42, 0.4);
}

.scanline {
  position: absolute;
  inset: -40% 0 auto;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: scan 1.5s linear infinite;
}

.vhs-frame span {
  position: absolute;
  left: 26px;
  bottom: 24px;
  color: var(--yellow);
  font-size: 46px;
  font-weight: 900;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.timeline span {
  height: 5px;
  background: rgba(255, 255, 255, 0.24);
}

.timeline span.is-active {
  background: var(--yellow);
}

@keyframes scan {
  to {
    transform: translateY(500%);
  }
}

.screen-result {
  background: var(--paper);
}

.result-card {
  position: relative;
  margin-top: 26px;
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.poster-caption {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--ink);
  color: #fff;
}

.poster-caption strong {
  font-size: 18px;
  line-height: 1.3;
}

.poster-caption span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.result-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
  margin-top: 16px;
}

.result-actions .primary-action {
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  width: min(330px, calc(100vw - 44px));
  padding: 12px 14px;
  background: rgba(32, 34, 42, 0.92);
  color: #fff;
  text-align: center;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 760px) {
  body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
  }

  .app-shell {
    min-height: 860px;
    max-height: 920px;
  }

  .screen,
  .hero-content,
  .loading-content {
    min-height: 860px;
  }
}
