:root {
  color-scheme: dark;
  --ink: #fff9ef;
  --muted: rgba(255, 249, 239, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: rgba(15, 20, 24, 0.42);
  --accent: #f4c66d;
  --accent-2: #7fd0c5;
  --deep: #101923;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #111820;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(244, 198, 109, 0.22), transparent 28%),
    linear-gradient(155deg, #142431 0%, #23201e 42%, #0d1620 100%);
  color: var(--ink);
}

.lock-screen,
.album {
  min-height: 100svh;
}

.lock-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.lock-panel {
  width: min(100%, 420px);
  padding: 34px 24px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 19, 27, 0.68);
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 13vw, 64px);
  font-weight: 600;
}

.lock-copy {
  margin: 14px 0 30px;
  color: var(--muted);
  line-height: 1.8;
}

.password-form label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 249, 239, 0.86);
  font-size: 14px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
}

.password-row input,
.password-row button,
.next-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.password-row input {
  width: 100%;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  outline: none;
}

.password-row button,
.next-button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #f08f63);
  color: #261606;
  font-weight: 700;
}

.hint,
.error {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 13px;
}

.hint {
  color: var(--muted);
}

.error {
  color: #ffb3a8;
}

.album {
  display: none;
  position: relative;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.is-unlocked .lock-screen {
  display: none;
}

.is-unlocked .album {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.topbar {
  z-index: 2;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.counter {
  justify-self: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 18, 26, 0.46);
  color: rgba(255, 249, 239, 0.86);
  font-size: 14px;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.stage {
  position: relative;
  display: grid;
  align-items: center;
  height: calc(100vh - 150px);
  height: calc(100svh - 150px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.18);
  background-position: center;
  background-size: cover;
  box-shadow: 0 20px 60px var(--shadow);
  touch-action: pan-y;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.12) 44%, transparent 58%),
    radial-gradient(circle at 50% 12%, rgba(244, 198, 109, 0.16), transparent 38%);
  opacity: 0;
}

.stage.is-transitioning::before {
  animation: light-sweep 1600ms ease both;
}

.photo-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.025) translate3d(0, 0, 0);
  transition:
    opacity 1500ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 5200ms ease,
    filter 1500ms ease;
  will-change: opacity, transform;
}

.photo.is-visible {
  opacity: 1;
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.085) translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0);
}

.caption-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 54px 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(3, 9, 14, 0.68) 35%, rgba(3, 9, 14, 0.9));
  transition: opacity 900ms ease, transform 900ms ease;
}

.caption-panel.is-changing {
  opacity: 0;
  transform: translateY(12px);
}

.scene {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
}

.caption-panel h2 {
  margin: 0;
  max-width: 16em;
  color: var(--ink);
  font-size: clamp(20px, 6vw, 34px);
  font-weight: 500;
  line-height: 1.42;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

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

.next-button {
  width: 100%;
  cursor: pointer;
}

@keyframes light-sweep {
  0% {
    opacity: 0;
    transform: translateX(-38%);
  }

  38% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: translateX(38%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo,
  .caption-panel {
    transition-duration: 1ms;
  }

  .stage.is-transitioning::before {
    animation: none;
  }
}

@media (min-width: 720px) {
  .album {
    width: min(100%, 760px);
    margin: 0 auto;
  }

  .stage {
    height: calc(100vh - 138px);
    height: calc(100svh - 138px);
    max-height: calc(100svh - 138px);
  }
}
