:root {
  --china-red: #c51924;
  --deep-red: #911a22;
  --forest: #2f7d4b;
  --sky: #bfe9f4;
  --gold: #f2b94b;
  --cream: #fff7e8;
  --ink: #2d2d2d;
  --muted: #6d6258;
  --line: rgba(98, 45, 30, 0.14);
  --phone-width: 430px;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 244, 207, 0.75), transparent 36%),
    linear-gradient(135deg, #f8eee0 0%, #dfeff1 46%, #f9efe6 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.phone-shell {
  position: relative;
  width: min(100vw, var(--phone-width));
  height: 100dvh;
  max-height: 920px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 24px 70px rgba(48, 30, 22, 0.24);
  isolation: isolate;
}

.slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 520ms cubic-bezier(0.22, 0.8, 0.2, 1);
  will-change: transform;
}

.page {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px 20px 94px;
  background: linear-gradient(180deg, #fff8ea 0%, #fff0de 100%);
  scrollbar-width: none;
}

.page::-webkit-scrollbar {
  display: none;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 18%, rgba(242, 185, 75, 0.18), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(191, 233, 244, 0.58), transparent 26%),
    radial-gradient(circle at 50% 98%, rgba(47, 125, 75, 0.14), transparent 32%);
}

.content {
  position: relative;
  z-index: 2;
}

.kicker,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(197, 25, 36, 0.1);
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2 {
  margin-top: 14px;
  color: var(--deep-red);
  line-height: 1.15;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(18px);
}

h1 {
  font-size: 38px;
  max-width: 320px;
}

h2 {
  font-size: 30px;
}

.is-active h1,
.is-active h2 {
  animation: titleIn 720ms ease forwards;
}

.lead,
.subtitle,
.body-text {
  color: #55443c;
  line-height: 1.75;
}

.lead {
  margin-top: 14px;
  max-width: 292px;
  font-size: 18px;
  font-weight: 700;
}

.subtitle {
  margin-top: 8px;
  font-size: 15px;
}

.body-text {
  margin-top: 18px;
  font-size: 15px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, #cf1f2d, #8f141d);
  box-shadow: 0 12px 25px rgba(150, 28, 33, 0.25);
}

.secondary-btn {
  color: var(--deep-red);
  background: #fff6e4;
  border: 1px solid rgba(197, 25, 36, 0.24);
}

.primary-btn:active,
.secondary-btn:active,
.product-card:active {
  transform: scale(0.96);
  filter: brightness(0.98);
}

.page-action {
  width: 100%;
  margin-top: 20px;
}

.compact {
  min-width: 132px;
}

.cover-page {
  display: flex;
  align-items: flex-end;
  padding-top: 32px;
  background: linear-gradient(180deg, #bdeaf4 0%, #fff3dc 54%, #f8dfbc 100%);
}

.cover-page::before {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 238, 151, 0.62), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 38%);
}

.cover-content {
  width: 100%;
  padding-bottom: 18px;
}

.cover-content .primary-btn {
  width: 100%;
  margin-top: 26px;
}

.cover-visual {
  position: absolute;
  inset: 0 0 0;
  z-index: 1;
  pointer-events: none;
}

.mountain-visual {
  position: absolute;
  left: -14px;
  right: -14px;
  bottom: 190px;
  width: calc(100% + 28px);
  opacity: 0.95;
}

.skyline-visual {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 104px;
  width: 100%;
}

.ribbon {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.ribbon-top {
  top: 36px;
  right: -42px;
  width: 260px;
  animation: ribbonDrift 5s ease-in-out infinite;
}

.ambient {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.cloud {
  width: 92px;
  height: 34px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 32px 4px 0 rgba(255, 255, 255, 0.58), 16px -12px 0 rgba(255, 255, 255, 0.72);
  animation: cloudFloat 8s ease-in-out infinite;
}

.cloud-one {
  left: 24px;
  top: 98px;
}

.cloud-two {
  right: 42px;
  top: 178px;
  transform: scale(0.8);
  animation-delay: -3s;
}

.sun-glow {
  left: 50%;
  top: 82px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 222, 113, 0.74), rgba(255, 222, 113, 0));
  animation: glowPulse 4s ease-in-out infinite;
}

.bird {
  position: absolute;
  z-index: 3;
  width: 24px;
  height: 10px;
  border-top: 2px solid rgba(75, 61, 54, 0.64);
  border-radius: 50%;
}

.bird::after {
  content: "";
  position: absolute;
  right: -17px;
  top: -2px;
  width: 24px;
  height: 10px;
  border-top: 2px solid rgba(75, 61, 54, 0.64);
  border-radius: 50%;
}

.bird-one {
  left: 78px;
  top: 156px;
  animation: birdFly 8s linear infinite;
}

.bird-two {
  left: 240px;
  top: 138px;
  transform: scale(0.78);
  animation: birdFly 9s linear infinite reverse;
}

.impression-panel,
.student-card,
.scene-card,
.square-layout {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 243, 0.78);
  box-shadow: 0 14px 34px rgba(80, 47, 28, 0.08);
}

.impression-panel {
  padding: 16px;
}

.impression-panel h3 {
  color: var(--forest);
  font-size: 18px;
}

.impression-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.impression-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px 12px;
  align-items: center;
  min-height: 84px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(91, 65, 44, 0.1);
}

.impression-card h4 {
  color: #3b3029;
  font-size: 17px;
}

.impression-card p {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.card-icon {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.red-memory {
  background: linear-gradient(135deg, #d82731, #8f141d);
}

.red-memory::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 9px;
  width: 24px;
  height: 23px;
  border-radius: 3px 3px 0 0;
  background: #fff0d1;
}

.red-memory::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 9px;
  width: 3px;
  height: 28px;
  background: #fff0d1;
  box-shadow: 4px 2px 0 #ffd66a;
}

.green-mountain {
  background: linear-gradient(135deg, #89d4df, #3a9c64);
}

.green-mountain::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 9px;
  width: 38px;
  height: 26px;
  clip-path: polygon(0 100%, 36% 26%, 54% 58%, 76% 10%, 100% 100%);
  background: #277443;
}

.golden-gift {
  background: linear-gradient(135deg, #f2b94b, #f7dc86);
}

.golden-gift::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 28px;
  height: 26px;
  border-radius: 4px;
  background: #bd4b33;
}

.golden-gift::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 9px;
  width: 7px;
  height: 35px;
  background: #fff6ce;
}

.float-card {
  animation: cardFloat 4.2s ease-in-out infinite;
}

.float-card:nth-child(2) {
  animation-delay: -0.9s;
}

.float-card:nth-child(3) {
  animation-delay: -1.8s;
}

.float-card:nth-child(4) {
  animation-delay: -2.4s;
}

.red-page {
  color: #fff7e8;
  background: linear-gradient(180deg, #7f161f 0%, #2c2c2c 100%);
}

.red-page::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 213, 126, 0.18), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(197, 25, 36, 0.22), transparent 32%);
}

.red-page h2,
.red-page .kicker,
.red-page .subtitle,
.red-page .body-text {
  color: #fff7e8;
}

.red-page .kicker {
  background: rgba(255, 247, 232, 0.12);
}

.memorial-scene {
  position: relative;
  padding: 12px 10px 0;
  background: rgba(255, 247, 232, 0.1);
  border-color: rgba(255, 247, 232, 0.18);
  overflow: hidden;
}

.memorial-scene img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
}

.pine {
  position: absolute;
  bottom: 16px;
  z-index: 3;
  width: 34px;
  height: 76px;
  background:
    linear-gradient(#6a4429, #6a4429) center bottom / 7px 34px no-repeat,
    linear-gradient(135deg, transparent 50%, #1f613d 0) left 20px / 50% 28px no-repeat,
    linear-gradient(225deg, transparent 50%, #245f3e 0) right 20px / 50% 28px no-repeat,
    linear-gradient(135deg, transparent 50%, #2c7b4e 0) left 0 / 50% 32px no-repeat,
    linear-gradient(225deg, transparent 50%, #2d754c 0) right 0 / 50% 32px no-repeat;
}

.pine-left {
  left: 8px;
}

.pine-right {
  right: 8px;
}

.red-body {
  color: rgba(255, 247, 232, 0.88);
}

.slogan,
.quote-line,
.product-slogan {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0;
}

.slogan,
.quote-line {
  background: rgba(255, 247, 232, 0.1);
  color: #ffdb7a;
  border: 1px solid rgba(255, 219, 122, 0.24);
}

.book-strip {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.book-strip span {
  flex: 1;
  height: 34px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 247, 232, 0.22), rgba(255, 247, 232, 0.06));
  border: 1px solid rgba(255, 247, 232, 0.16);
}

.square-layout {
  padding: 14px;
  background: rgba(255, 247, 232, 0.1);
  border-color: rgba(255, 247, 232, 0.18);
}

.square-visual {
  display: block;
  width: 100%;
}

.keyword-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.keyword-card {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.16);
  border: 1px solid rgba(255, 247, 232, 0.18);
  color: #ffe7a1;
  font-size: 18px;
  font-weight: 900;
}

.product-page {
  background: linear-gradient(180deg, #fff9e8 0%, #eef6df 100%);
}

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

.product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 190px;
  padding: 10px;
  border: 1px solid rgba(70, 45, 25, 0.1);
  border-radius: 8px;
  background: #fffdf4;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 26px rgba(70, 45, 25, 0.08);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.product-card:hover {
  box-shadow: 0 16px 30px rgba(70, 45, 25, 0.12);
}

.product-card img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.product-card span {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 900;
}

.product-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.kiwi {
  border-color: rgba(72, 132, 54, 0.2);
}

.huimian {
  border-color: rgba(211, 143, 42, 0.24);
}

.sauce {
  border-color: rgba(136, 59, 34, 0.23);
}

.mushroom {
  border-color: rgba(126, 86, 55, 0.22);
}

.product-slogan {
  background: #fff6df;
  border: 1px solid rgba(242, 185, 75, 0.34);
  color: #7a3f25;
}

.invite-page {
  background: linear-gradient(180deg, #fff5df 0%, #e5f5ee 100%);
}

.invite-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.invite-tags span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(197, 25, 36, 0.16);
  color: var(--deep-red);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(79, 48, 28, 0.07);
}

.student-card {
  padding: 16px;
}

.student-card h3 {
  margin-bottom: 10px;
  color: var(--forest);
  font-size: 18px;
}

.student-card p {
  margin-top: 7px;
  color: #4d3d35;
  font-size: 13px;
  line-height: 1.45;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.button-row button {
  width: 100%;
}

.progress-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.88);
  border: 1px solid rgba(93, 55, 35, 0.12);
  box-shadow: 0 10px 30px rgba(55, 32, 20, 0.16);
  backdrop-filter: blur(12px);
}

.progress-bar span {
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 900;
}

.dots {
  display: flex;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(114, 82, 60, 0.24);
  transition: width 220ms ease, background 220ms ease;
}

.dot.is-current {
  width: 22px;
  border-radius: 999px;
  background: var(--china-red);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal.is-open {
  display: flex;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(31, 24, 20, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 2;
  width: min(360px, 100%);
  border-radius: 8px;
  padding: 24px 18px 18px;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgba(22, 14, 10, 0.32);
  animation: modalIn 220ms ease forwards;
}

.modal-panel h3 {
  padding-right: 34px;
  color: var(--deep-red);
  font-size: 21px;
}

.modal-panel p {
  margin-top: 12px;
  color: #59463b;
  line-height: 1.7;
  font-size: 15px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(197, 25, 36, 0.1);
  color: var(--deep-red);
  font-size: 24px;
  cursor: pointer;
}

.modal-confirm {
  width: 100%;
  margin-top: 18px;
}

@keyframes titleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cloudFloat {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(18px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.68;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.96;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes ribbonDrift {
  0%,
  100% {
    transform: rotate(4deg) translateY(0);
  }
  50% {
    transform: rotate(1deg) translateY(10px);
  }
}

@keyframes birdFly {
  0% {
    transform: translateX(-18px);
  }
  50% {
    transform: translateX(24px) translateY(-8px);
  }
  100% {
    transform: translateX(-18px);
  }
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 520px) {
  .phone-shell {
    height: min(100dvh, 880px);
    border-radius: 26px;
  }
}

@media (max-width: 360px) {
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 33px;
  }

  h2 {
    font-size: 26px;
  }

  .product-grid {
    gap: 10px;
  }

  .product-card {
    min-height: 184px;
  }
}
