@import url("https://fontsapi.zeoseven.com/510/main/result.css");
@import url("https://fontsapi.zeoseven.com/220/main/result.css");
* {
  margin: 0;
  padding: 0;
}
body {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fefbf4;
}
#box p {
  margin: 0;
  margin-top: 1.5em;     /* 段与段之间的距离 */
  text-indent: 2em;      /* 段首空两格 */
  line-height: 2.5em;
}
#box p:first-child {
  margin-top: 0;
}

#box2 {
  margin-top: 80px; /* 和上面的 box 拉开距离，防止重叠 */
  padding: 0 5vw 10vh;
  font-size: 22px;
  line-height: 2.5em;
  font-family: "SanariFontB", sans-serif;
  color: #3a4846;
  text-align: left;
  white-space: pre-wrap; /* 保留换行格式 */
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  display: none; /* 初始隐藏，JS 控制显示 */
  opacity: 0;
  transition: opacity 2s;
}


/* 信封样式 */
.card {
  width: 700px;
  height: 300px;
  background-color: #e8e3c9; 
  color: #4b3f3f;
  box-shadow: 0px 0px 22px 5px rgb(237, 237, 237);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-size: 2.5em;
  font-family: "PING FANG SAN SHENG", sans-serif;
  text-shadow: 0 0 3px white;
  font-weight: normal;
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(23deg);
}
.card::before,
.card::after {
  content: '';
  width: 50%;
  height: 100%;
  color: #b7c4cf;
  font-size: 40px;
  position: absolute;
  font-family: "PING FANG SAN SHENG", sans-serif;
  font-weight: normal;
}
.card::before {
  content: '写给你的';
  left: 0;
  top: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: 2s;
  transform-origin: left;
}
.card::after {
  content: '一封信';
  right: 0;
  top: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  transform-origin: right;
  transition: 2s;
}
.card.active::before {
  transform: rotateY(-180deg);
}
.card.active::after {
  transform: rotateY(180deg);
}
.content {
  opacity: 0;
  transition: 2s;
}
.card.active .content {
  opacity: 1;
}

/* 文字样式 */
.text {
  color: #7d6e83;
  margin-top: 45px;
  font-family: "PING FANG SAN SHENG", sans-serif;
  font-weight: normal;
}
.textTwo {
  color: #7d6e83;
  font-weight: bold;
  font-size: 25px;
  margin-top: 30px;
}

/* 打字区域样式 */
#box {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0;
  width: 100vw;
  min-height: 100vh;
  padding: 5vh 5vw 10vh;
  box-sizing: border-box;
  background-color: #fefbf4;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 25px;
  font-family: "PING FANG SAN SHENG", sans-serif;
  color: #3a4846;
  line-height: 2.5em;
  text-align: left;
  transition: opacity 7s;
}

/* 横线背景 */
#box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2.2em,
    rgba(0, 0, 0, 0.06) 2.2em,
    rgba(0, 0, 0, 0.06) 2.3em
  );
  pointer-events: none;
  z-index: 0;
}
