:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f0f2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.8), transparent 35%),
    #f1edf0;
}

button,
input {
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(100vw, 576px);
  height: min(100vh, 1280px);
  min-height: 560px;
  overflow: hidden;
  background: #fff;
  isolation: isolate;
}

.wechat-header {
  position: relative;
  z-index: 20;
  height: 65px;
  background: rgba(255, 255, 255, 0.98);
  color: #101010;
}

.nav-bar {
  position: relative;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.045);
}

.nav-bar h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
}

.nav-bar h1 span {
  margin-left: 3px;
}

.nav-back {
  appearance: none;
  position: absolute;
  left: 27px;
  top: 21px;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-left: 2px solid #1b1b1b;
  border-bottom: 2px solid #1b1b1b;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transform: rotate(45deg);
}

.nav-back:focus-visible {
  outline: 3px solid rgba(77, 139, 255, 0.42);
  outline-offset: 7px;
}

.nav-menu {
  position: absolute;
  right: 17px;
  top: 11px;
  width: 142px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 17px;
  border: 1px solid #edf0f2;
  border-radius: 24px;
  box-shadow: 0 0 12px rgba(130, 140, 150, 0.06);
}

.menu-dots {
  margin-top: -6px;
  font-size: 24px;
  letter-spacing: 2px;
  color: #151719;
}

.menu-circle {
  position: relative;
  display: block;
  width: 27px;
  height: 27px;
  border: 3px solid #151719;
  border-radius: 50%;
}

.menu-circle::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #151719;
}

.greeting-stage {
  position: relative;
  height: calc(100% - 65px);
  overflow: hidden;
  background-image: url("./assets/autumn-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #ddd5d1;
}

.greeting-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 240, 236, 0.03), transparent 24%),
    linear-gradient(0deg, rgba(255, 218, 216, 0.12), transparent 24%);
}

.card-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.greeting-card {
  position: absolute;
  width: min(77%, 445px);
  min-height: 78px;
  display: grid;
  grid-template-rows: 32px 1fr;
  overflow: hidden;
  border: 1px solid rgba(134, 119, 112, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--tint) 0 34%, rgba(255, 255, 255, 0.96) 34% 100%);
  box-shadow:
    0 8px 18px rgba(95, 71, 71, 0.18),
    0 1px 4px rgba(95, 71, 71, 0.1);
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.95);
  animation: card-in 700ms cubic-bezier(0.18, 0.78, 0.25, 1) forwards;
  animation-delay: var(--delay);
}

.greeting-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.28), transparent 70%);
  transform: translateX(-120%);
  animation: sheen 6s ease-in-out var(--shine-delay) infinite;
}

.greeting-card.is-retiring {
  pointer-events: none;
  animation: card-out 450ms ease-in forwards;
}

.card-sender {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-bottom: 1px solid rgba(104, 102, 97, 0.08);
  color: #161616;
  font-size: 16px;
  font-weight: 700;
}

.card-sender span {
  margin-left: 2px;
  color: #fac733;
}

.card-message {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px 13px;
  color: #111;
  font-size: clamp(18px, 4.8vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.home-indicator {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 10px;
  width: 167px;
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  transform: translateX(-50%);
}

.cover-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  background:
    linear-gradient(180deg, rgba(20, 15, 24, 0.05), transparent 38%, rgba(15, 12, 18, 0.05)),
    url("./assets/cover.png") center / 100% 100% no-repeat;
  color: #fff;
  transition:
    opacity 680ms ease,
    transform 680ms cubic-bezier(0.2, 0.75, 0.2, 1),
    visibility 680ms;
}

.cover-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(13, 10, 18, 0.14) 0%,
    rgba(13, 10, 18, 0.02) 28%,
    transparent 58%,
    rgba(13, 10, 18, 0.12) 100%
  );
}

.cover-screen.is-leaving {
  visibility: hidden;
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
}

.live-clock {
  position: absolute;
  z-index: 2;
  top: 3.5%;
  left: 50%;
  width: 92%;
  text-align: center;
  transform: translateX(-50%);
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.36),
    0 1px 1px rgba(0, 0, 0, 0.2);
}

.live-date {
  margin: 0 0 1px;
  font-size: clamp(17px, 4.4vw, 25px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.live-time {
  display: block;
  margin: 0;
  font-size: clamp(72px, 20vw, 116px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.tap-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 4.2%;
  margin: 0;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(20, 17, 24, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: hint-pulse 2.2s ease-in-out infinite;
}

@keyframes card-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes card-out {
  from {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 0;
    filter: blur(2px);
    transform: translate3d(0, -14px, 0) scale(0.97);
  }
}

@keyframes sheen {
  0%,
  72%,
  100% {
    transform: translateX(-120%);
  }
  86% {
    transform: translateX(120%);
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.72;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
  }
}

@media (max-width: 420px) {
  .phone-shell {
    min-height: 100vh;
  }

  .nav-back {
    left: 21px;
  }

  .nav-menu {
    right: 10px;
    width: 122px;
  }

  .card-message {
    font-size: clamp(16px, 4.7vw, 22px);
  }

  .home-indicator {
    bottom: 7px;
    width: 128px;
    height: 5px;
  }
}
