html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

.wrapper {
  width: 100%;
  height: 100%;
}

header {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.header-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==================== 动画效果 ==================== */

/* 男孩 - 从左边飞入 */
.header-left {
  position: absolute;
  bottom: 5%;
  left: 0;
  width: 56%;
  z-index: 4;
  animation: flyInLeft 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.header-left img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(5px 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes flyInLeft {
  0% {
    opacity: 0;
    transform: translateX(-150px) rotate(-10deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

/* 女孩 - 从右边飞入 */
.header-right {
  position: absolute;
  bottom: 5%;
  right: 0;
  width: 45%;
  z-index: 3;
  animation: flyInRight 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.header-right img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(-5px 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes flyInRight {
  0% {
    opacity: 0;
    transform: translateX(150px) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

/* 书本 - 从下方弹入 */
.header-center {
  position: absolute;
  bottom: 5%;
  left: 23%;
  width: 52%;
  z-index: 1;
  animation: bounceUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  animation-delay: 1.2s;
  opacity: 0;
}

.header-center img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
  transform-origin: center bottom;
}

@keyframes bounceUp {
  0% {
    opacity: 0;
    transform: translateY(150px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 标题 - 从小到大、从下到上 */
.header-title {
  position: absolute;
  bottom: 55%;
  left: 25%;
  width: 52%;
  z-index: 3;
  animation: titleReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: 2.2s;
  opacity: 0;
}

.header-title img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.5));
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: translateY(150px) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 底部色块 */
.header-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15%;
  z-index: 2;
}

.header-bottom img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-fly {
  position: absolute;
  top: 0%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  z-index: 2;
  animation: flyUpPages 0.5s ease-out forwards;
  animation-delay: 2.2s;
  opacity: 0;
}

.header-fly img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.5));
}

@keyframes flyUpPages {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(200px) rotate(-5deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
}

main {
  position: relative;
  margin-top: -1px;
  z-index: 6;
  width: 100%;
  height: auto;
  background: linear-gradient(to bottom, #ffb54a, #f39819);
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.circle-1 {
  width: 400px;
  height: 400px;
  top: 50px;
  right: -10%;
  animation: floatCircle 6s ease-in-out infinite;
}

.circle-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: 5%;
  animation: floatCircle 8s ease-in-out infinite reverse;
}

.circle-3 {
  width: 200px;
  height: 200px;
  top: 30%;
  left: -50px;
  animation: floatCircle 5s ease-in-out infinite 1s;
}

@keyframes floatCircle {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

main ul {
  position: relative;
  z-index: 2;
  background-color: #fff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 30px;
  width: 55%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  list-style: none;
}

main ul li {
  flex: 0 0 calc(33.333% - 20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #f2f2f2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 1000px;
  box-shadow: 0 0 0 5px #d3d2d2;
  transition: all 0.6s ease-out;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease-out;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.2);
}

.card__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, #d3d2d2, #e4e4e4);
  transform: rotateX(-90deg);
  transform-origin: bottom;
  transition: all 0.6s ease-out;
}

.card:hover .card__content {
  transform: rotateX(0deg);
}

.card__title {
  margin: 0;
  font-size: var(--font-size-lg);
  color: #333;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover img {
  scale: 0;
}

.card__description {
  margin: 10px 0 0;
  font-size: var(--font-size-md);
  color: #777;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

footer {
  width: 55%;
  margin: 0 auto;
  padding: 45px 20px;
  height: auto;
  background-color: #ebebeb;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* ==================== 回到顶部按钮 ==================== */
.scroll-to-top {
  position: fixed;
  bottom: 15%;
  right: 60px;
  width: 50px;
  height: 50px;
  background: #feb957;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) rotate(-90deg);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease;
  z-index: 9999;
  box-shadow:
    0 6px 20px rgba(254, 185, 87, 0.4),
    0 2px 8px rgba(254, 185, 87, 0.3);
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) rotate(-90deg);
}

.scroll-to-top:hover {
  background: #af6805;
  transform: translateY(-5px) rotate(-90deg);
  box-shadow:
    0 8px 28px rgba(254, 185, 87, 0.5),
    0 4px 12px rgba(254, 185, 87, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px) rotate(-90deg);
}

.scroll-to-top img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ==================== 卡片入场动画 ==================== */
.card-enter {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    box-shadow 0.3s ease;
}

.card-enter.card-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .card-enter {
    transform: translateY(40px);
  }

  .card-enter.card-visible {
    transform: translateY(0);
  }
}
