/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  height: 100%;
  max-width: 414px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #fff;
}

@media (min-width: 415px) {
  body {
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #app {
    height: 100vh;
    max-height: 896px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
  }
}

/* ===== Page Common ===== */
.page {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
}

.page-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Paper texture overlay */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 10;
}

/* ===== Page 1: 首页·主题引入 ===== */
.page1-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #5a5a5a 0%, #424242 100%);
  animation: page1BgTransition 4s ease-in-out forwards;
  animation-delay: 1s;
}

@keyframes page1BgTransition {
  0% { background: linear-gradient(180deg, #5a5a5a 0%, #424242 100%); }
  100% { background: linear-gradient(160deg, #F0F9F1 0%, #D5EEDC 50%, #C8E6C9 100%); }
}

.page1-earth-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  max-width: 280px;
  aspect-ratio: 1;
  z-index: 2;
}

.page1-earth {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page1-earth-gray {
  filter: grayscale(20%) brightness(0.7);
  opacity: 1;
  animation: grayEarthFadeOut 4s ease-in-out forwards;
  animation-delay: 1s;
}

.page1-earth-green {
  opacity: 0;
  animation: greenEarthFadeIn 4s ease-in-out forwards, page1EarthBreath 2s ease-in-out infinite;
  animation-delay: 1s, 5s;
}

@keyframes grayEarthFadeOut {
  0% { opacity: 1; filter: grayscale(20%) brightness(0.7); transform: scale(0.95); }
  70% { opacity: 0.3; }
  100% { opacity: 0; filter: grayscale(0%) brightness(1); transform: scale(1); }
}

@keyframes greenEarthFadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  30% { opacity: 0.3; }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes page1EarthBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.page1-vegetation {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 179, 66, 0.4) 0%, transparent 70%);
  opacity: 0;
  animation: vegetationFade 3s ease-in-out forwards;
  animation-delay: 2s;
  pointer-events: none;
}

@keyframes vegetationFade {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 0.6; transform: scale(1.05); }
}

.page1-text {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 24px;
  z-index: 3;
}

.page1-title {
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 600;
  color: #E0E0E0;
  letter-spacing: 2px;
  opacity: 0;
  transform: translateY(10px);
  animation: titleFadeIn 1.2s ease forwards, titleColorShift 4s ease forwards;
  animation-delay: 1.5s, 1s;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.page1-subtitle {
  font-size: clamp(13px, 3.5vw, 16px);
  color: #BDBDBD;
  margin-top: 12px;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(8px);
  animation: titleFadeIn 1s ease forwards, subtitleColorShift 3s ease forwards;
  animation-delay: 4s, 3.5s;
}

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

@keyframes titleColorShift {
  0% { color: #E0E0E0; }
  100% { color: #2E5934; }
}

@keyframes subtitleColorShift {
  0% { color: #BDBDBD; }
  100% { color: #4A7C59; }
}

/* ===== Page 2: 核心互动页 ===== */
.page2-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #E8F5E9 0%, #D5EEDC 40%, #C8E6C9 100%);
}

.page2-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.page2-text {
  text-align: center;
  padding: 14% 24px 0;
  flex-shrink: 0;
}

.page2-title {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 600;
  color: #2E5934;
  letter-spacing: 1px;
  line-height: 1.4;
  opacity: 0;
  animation: page2FadeIn 0.8s ease forwards;
}

.page2-subtitle {
  font-size: clamp(12px, 3.2vw, 15px);
  color: #4A7C59;
  margin-top: 10px;
  letter-spacing: 1px;
  opacity: 0;
  animation: page2FadeIn 0.8s ease forwards;
  animation-delay: 0.2s;
}

@keyframes page2FadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page2-scene {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 8%;
}

.page2-furniture {
  width: 62%;
  max-width: 240px;
  object-fit: contain;
  opacity: 0;
  animation: furniturePopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.4s;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 4px 12px rgba(74, 124, 89, 0.08));
}

@keyframes furniturePopIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Eco Icons */
.eco-icon {
  position: absolute;
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(74, 124, 89, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  z-index: 5;
  opacity: 0;
  animation: iconPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.eco-icon:active {
  transform: scale(0.92);
}

.eco-icon-inner {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-icon-inner svg {
  width: 100%;
  height: 100%;
}

.eco-icon-water {
  top: 32%;
  left: 6%;
  animation-delay: 0.6s;
}

.eco-icon-trash {
  bottom: 18%;
  left: 10%;
  animation-delay: 0.75s;
}

.eco-icon-bike {
  bottom: 20%;
  right: 8%;
  animation-delay: 0.9s;
}

@keyframes iconPopIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Water effect */
.eco-icon-water .effect-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(174, 213, 129, 0.6) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.eco-icon-water.active .effect-glow {
  animation: greenPulse 0.8s ease-out;
}

@keyframes greenPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.8); }
}

.eco-icon-water .effect-drop {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 16px;
  background: #A8DADC;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0;
  pointer-events: none;
}

.eco-icon-water.active .effect-drop {
  animation: dropFloat 0.8s ease-in-out;
}

@keyframes dropFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px) rotate(10deg); }
}

.eco-icon-water.active .eco-icon-inner {
  animation: waterWiggle 0.6s ease-in-out;
}

@keyframes waterWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-6deg) translateY(-2px); }
  75% { transform: rotate(6deg) translateY(-2px); }
}

/* Trash bounce effect */
.eco-icon-trash.active {
  animation: trashBounce 0.7s ease;
}

@keyframes trashBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  20% { transform: translateY(-14px) scale(0.95); }
  40% { transform: translateY(0) scale(1.02); }
  60% { transform: translateY(-7px) scale(0.98); }
  80% { transform: translateY(0) scale(1); }
}

/* Bike leaf effect */
.leaf-container {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.falling-leaf {
  position: absolute;
  width: 18px;
  height: 22px;
  background: #7CB342;
  border-radius: 0 80% 0 80%;
  opacity: 0;
  transform: rotate(45deg);
}

.falling-leaf::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20%;
  width: 60%;
  height: 1px;
  background: #5A8F3C;
  transform: rotate(-20deg);
}

.falling-leaf.animate {
  animation: leafFall 1.5s ease-in forwards;
}

@keyframes leafFall {
  0% { opacity: 0; transform: translateY(0) rotate(45deg) translateX(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(80px) rotate(120deg) translateX(30px); }
}

/* ===== Page 3: 结尾升华页 ===== */
.page3-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #E8F5E9 0%, #A5D6A7 45%, #66BB6A 100%);
}

.page3-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  z-index: 2;
}

.page3-title {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 600;
  color: #FFFFFF;
  text-align: center;
  letter-spacing: 1px;
  line-height: 1.5;
  margin-bottom: 6%;
  text-shadow: 0 1px 6px rgba(46, 89, 52, 0.3);
  opacity: 0;
  animation: page3TextIn 1s ease forwards;
  animation-delay: 0.3s;
}

.page3-earth-wrap {
  position: relative;
  width: 68%;
  max-width: 260px;
  aspect-ratio: 1;
}

.page3-earth {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  animation: page3EarthIn 1.2s ease forwards, earthFloat 4s ease-in-out infinite;
  animation-delay: 0.5s, 1.7s;
  filter: drop-shadow(0 8px 24px rgba(46, 89, 52, 0.15));
}

@keyframes page3EarthIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

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

.page3-drops {
  position: absolute;
  inset: -10%;
  pointer-events: none;
}

.drop {
  position: absolute;
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, #A8DADC 0%, #81C784 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0;
  animation: dropFloat3 3s ease-in-out infinite;
}

.drop::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.drop-1 { top: 15%; left: 10%; animation-delay: 1s; }
.drop-2 { top: 25%; right: 5%; animation-delay: 1.5s; }
.drop-3 { top: 45%; left: 0; animation-delay: 2s; }
.drop-4 { top: 50%; right: 0; animation-delay: 0.8s; }
.drop-5 { bottom: 30%; left: 15%; animation-delay: 2.2s; }
.drop-6 { bottom: 20%; right: 12%; animation-delay: 1.8s; }

@keyframes dropFloat3 {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.8); }
  20% { opacity: 0.7; transform: translateY(-4px) scale(1); }
  50% { opacity: 0.5; transform: translateY(4px) scale(0.9); }
  80% { opacity: 0.7; transform: translateY(-2px) scale(1); }
}

.page3-subtitle {
  font-size: clamp(12px, 3.2vw, 15px);
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  letter-spacing: 1px;
  margin-top: 6%;
  text-shadow: 0 1px 4px rgba(46, 89, 52, 0.2);
  opacity: 0;
  animation: page3TextIn 1s ease forwards;
  animation-delay: 0.8s;
}

@keyframes page3TextIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating leaves */
.page3-leaves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 28px;
  height: 34px;
  background: #7CB342;
  border-radius: 0 85% 0 85%;
  opacity: 0.85;
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.leaf::before {
  content: "";
  position: absolute;
  top: 45%;
  left: 15%;
  width: 55%;
  height: 1.5px;
  background: #5A8F3C;
  transform: rotate(-15deg);
}

.leaf-1 {
  top: 5%;
  left: 5%;
  width: 36px;
  height: 44px;
  animation: leafDrift1 6s ease-in-out infinite;
}

.leaf-2 {
  top: 8%;
  right: 8%;
  width: 32px;
  height: 40px;
  animation: leafDrift2 7s ease-in-out infinite;
  animation-delay: 1s;
}

.leaf-3 {
  bottom: 18%;
  left: 6%;
  width: 22px;
  height: 28px;
  animation: leafDrift3 5s ease-in-out infinite;
  animation-delay: 0.5s;
}

.leaf-4 {
  bottom: 12%;
  right: 10%;
  width: 34px;
  height: 42px;
  animation: leafDrift1 6.5s ease-in-out infinite;
  animation-delay: 2s;
}

.leaf-5 {
  top: 42%;
  right: 3%;
  width: 18px;
  height: 24px;
  animation: leafDrift2 4.5s ease-in-out infinite;
  animation-delay: 1.5s;
}

.leaf-6 {
  bottom: 35%;
  left: 3%;
  width: 16px;
  height: 20px;
  animation: leafDrift3 5.5s ease-in-out infinite;
  animation-delay: 3s;
}

@keyframes leafDrift1 {
  0%, 100% { transform: translate(0, 0) rotate(30deg); opacity: 0.7; }
  33% { transform: translate(8px, -12px) rotate(50deg); opacity: 0.9; }
  66% { transform: translate(-6px, 8px) rotate(20deg); opacity: 0.75; }
}

@keyframes leafDrift2 {
  0%, 100% { transform: translate(0, 0) rotate(-20deg); opacity: 0.75; }
  50% { transform: translate(-10px, 10px) rotate(10deg); opacity: 0.9; }
}

@keyframes leafDrift3 {
  0%, 100% { transform: translate(0, 0) rotate(45deg); opacity: 0.65; }
  40% { transform: translate(6px, -8px) rotate(60deg); opacity: 0.85; }
  80% { transform: translate(-4px, 6px) rotate(35deg); opacity: 0.7; }
}
