* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html,
#root {
  width: 100%;
  height: 100%;
}

.container {
  width: 100%;
  height: 100%;
  background-color: #fff;
  position: relative;
}

.mainStage {
  width: 100%;
  height: 100%;
  background-color: #fff;
  position: relative;
  background: url(images/main.jpg) center center no-repeat;
  background-size: cover;
  padding: 24px;
}

.conversation_box {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  background: rgba(26, 24, 24, 0.85);
  border: 2px solid #c4a45f;
  border-radius: 10px;
  padding: 20px;
  color: #fff;
  user-select: none;
  z-index: 99;
}

.conversation_name {
  color: #c4a45f;
  font-size: 20px;
  margin-bottom: 10px;
}

.conversation_content {
  font-size: 18px;
  line-height: 1.6;
  position: relative;
  display: inline-block;
}

.pen {
  width: 100px;
  height: 100px;
  background: url(images/pen.png) center center no-repeat;
  background-size: cover;
  position: absolute;
  right: -24px;
  bottom: -24px;
  transform-origin: right bottom;
  transform: rotate(45deg);
  display: none;
}

.pen.writing {
  animation: penWriting 0.5s ease-in-out infinite;
  display: block;
}
@keyframes penWriting {
  0% {
    transform: rotate(45deg);
  }
  25% {
    transform: rotate(43deg) translate(-1px, -1px);
  }
  75% {
    transform: rotate(47deg) translate(1px, 1px);
  }
  100% {
    transform: rotate(45deg);
  }
}

/* 添加光标效果 */
.conversation_content.typing::after {
  content: "|";
  animation: cursor 0.8s infinite;
  margin-left: 2px;
}

@keyframes cursor {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.conversation_next {
  position: absolute;
  bottom: 16px;
  right: 20px;
  width: 16px;
  height: 16px;
  border-right: 3px solid #c4a45f;
  border-bottom: 3px solid #c4a45f;
  transform: rotate(45deg);
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: rotate(45deg) translate(-3px, -3px);
  }
  50% {
    transform: rotate(45deg) translate(3px, 3px);
  }
}

.mailStage {
  width: 100%;
  height: 100%;
  background-color: black;
  position: relative;
  overflow: hidden;
  perspective: 1000px;
}

.scroll-reveal {
  width: 100%;
  height: 100%;
  background: url(images/mail_bg.jpg) center center no-repeat;
  background-size: cover;
  animation: unfoldScroll 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: center top;
  transform-style: preserve-3d;
  position: relative;
}

@keyframes unfoldScroll {
  0% {
    transform: rotateY(90deg) rotateX(45deg);
    opacity: 0.3;
  }
  100% {
    transform: rotateY(0deg) rotateX(0deg);
    opacity: 1;
  }
}

.mail {
  width: 200px;
  position: fixed;
  left: 50%;
  top: -200px;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0;
  animation: mailDrop 2s cubic-bezier(0.4, 0, 0.2, 1) 2s forwards, floating 2s ease-in-out 4s infinite;
}

.mail img {
  width: 100%;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
  animation: glowing 2s ease-in-out infinite;
  transition: all 0.3s ease;
  cursor: pointer;
}

.mail:hover img {
  animation: rotatingGlow 2s linear infinite;
}

@keyframes rotatingGlow {
  0% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)) drop-shadow(20px 0 30px rgba(255, 255, 255, 0.4)) drop-shadow(0 20px 30px rgba(255, 255, 255, 0.4))
      drop-shadow(-20px 0 30px rgba(255, 255, 255, 0.4)) drop-shadow(0 -20px 30px rgba(255, 255, 255, 0.4));
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8)) drop-shadow(-20px 0 30px rgba(255, 255, 255, 0.4)) drop-shadow(0 -20px 30px rgba(255, 255, 255, 0.4))
      drop-shadow(20px 0 30px rgba(255, 255, 255, 0.4)) drop-shadow(0 20px 30px rgba(255, 255, 255, 0.4));
  }
}

@keyframes glowing {
  0% {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 60px rgba(255, 255, 255, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
  }
}

@keyframes floating {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes mailDrop {
  0% {
    top: -200px;
    opacity: 0;
    transform: translateX(-50%);
  }
  15% {
    opacity: 1;
  }
  100% {
    top: 50%;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.transition-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  background: white;
}

.transition-flash.active {
  animation: fadeInOut 2.5s cubic-bezier(0.33, 0, 0.67, 1) forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.slide-image {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 70%;
  z-index: 10;
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.8);
  animation: slideIn 0.8s ease forwards;
}

.slide-image.leaving img {
  animation: slideOut 0.8s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.2);
  }
}
