@font-face {
    font-family: 'LocalXingkai';
    src: url('./fonts/STXingkai.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'LocalKai';
    src: url('./fonts/SimKai.ttf') format('truetype');
    font-display: swap;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
background-color: #d9afd9;
background-image: linear-gradient(0deg, #d9afd9 0%, #97d9e1 100%);
    overflow: hidden;
}

#lyricBanner {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    padding: 18px 24px 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #eaffff;
    background: transparent;
    pointer-events: none;
}

#lyricCurrent {
    font-size: 30px;
    line-height: 1.5;
    width: min(92vw, 1100px);
    margin: 0 auto;
    font-family: 'LocalXingkai';
    color: #ba4a1bcb;
    text-shadow:
        0 0 2px rgba(255, 248, 238, 0.95),
        0 1px 8px rgba(255, 248, 238, 0.82);
}

#lyricNext {
    min-height: 24px;
    margin-top: 4px;
    font-size: 18px;
    width: min(92vw, 1100px);
    margin-left: auto;
    margin-right: auto;
    color: rgba(194, 98, 8, 0.86);
    text-shadow:
        0 0 2px rgba(255, 248, 238, 0.92),
        0 1px 6px rgba(255, 248, 238, 0.75);
    font-family: 'LocalXingkai';
}

.card {
    width: 700px;
    height: 300px;
    background-color: #f5efe6;
    color: #334756;
    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: 'LocalKai';
    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: 'LocalXingkai';

}
.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:hover::before {
    transform: rotateY(-180deg);
}
.card:hover::after {
    transform: rotateY(180deg);
}
.content {
    opacity: 0;
    transition: 2s;
}
.card:hover .content {
    opacity: 1;
}
/* 心动效果 */
/* 因为写动画太琐碎了 所以偷个懒 这里就不再写了 */
@keyframes change {
    30% {
      transform: rotate(45deg) scale(1.1) translateX(-70%);
    }
    40% {
      transform: rotate(45deg) scale(1.3) translateX(-70%);
    }
    45% {
      transform: rotate(45deg) scale(0.9) translateX(-70%);
    }
    50% {
      transform: rotate(45deg) scale(0.5) translateX(-70%);
    }
    70% {
      transform: rotate(45deg) scale(1) translateX(-70%);
    }
    80% {
      transform: rotate(45deg) scale(1.5) translateX(-70%);
    }
    90% {
      transform: rotate(45deg) scale(0.7) translateX(-70%);
    }
    95% {
      transform: rotate(45deg) scale(1.5) translateX(-70%);
    }
    100% {
      transform: rotate(45deg) scale(1.1) translateX(-70%);
    }
  } 
  .heart {
    position: absolute;
    right: -22px;
    bottom: -36px;
    width: 108px;
    height: 108px;
    cursor: pointer;
    background-image: url('birthday-cake.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 10px 18px rgba(76, 54, 91, 0.22));
  }

.heart::before {
    content: none;
}

.heart::after {
    content: none;
}
/* 中间的字体样式有点丑  调一下 */
.text {
    color: #7D6E83;
    margin-top: 45px;
    font-family: 'LocalXingkai';
}
.textTwo {
    color: #7D6E83;
    font-weight: bold;
    font-size: 25px;
    margin-top: 30px;
}
/* 神秘的box */
#box {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -200;
    opacity: 0;
    color: #00ffd1;
    padding: 18vh 0 4vh;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    background-image: url(v1.jpg);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: opacity 7s;
}

.birthday-card {
    width: min(780px, 72vw);
    margin: 0 auto;
}

.birthday-card__body {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 6vh 0 0;
}

.birthday-card__body p {
    min-height: 2.4em;
    margin-bottom: 22px;
    font-size: 24px;
    line-height: 1.75;
    color: #6f2f1f;
    text-align: center;
    font-family: 'LocalXingkai';
    text-shadow:
        0 0 2px rgba(255, 248, 240, 0.98),
        0 1px 8px rgba(255, 248, 240, 0.92);
}

.birthday-card__body p:last-child {
    margin-bottom: 0;
}

#greetingLine {
    width: 100%;
    font-size: 24px;
    margin-bottom: 26px;
}

#wishLine {
    width: min(760px, 66vw);
    font-size: 26px;
    line-height: 1.82;
}

#closingLine {
    width: 100%;
    font-size: 24px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    html,
    body {
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: none;
    }

    .card {
        width: 90vw;
        max-width: 420px;
        height: 320px;
        padding: 0 18px 46px;
        box-sizing: border-box;
    }

    .card::before,
    .card::after {
        font-size: 28px;
    }

    .text {
        margin-top: 24px;
        font-size: 0.95em;
        text-align: center;
    }

    .textTwo {
        width: 100%;
        margin-top: 20px;
        font-size: 22px;
        line-height: 1.45;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .heart {
        left: 50%;
        right: auto;
        bottom: -26px;
        width: 92px;
        height: 92px;
        transform: translateX(-50%);
    }

    #box {
        width: 100vw;
        height: 100dvh;
        padding: 16vh 0 2vh;
        max-width: 100vw;
        background-image: url(v2.jpg);
        background-size: cover;
        background-position: center top;
        overflow-y: hidden;
        overflow-x: hidden;
    }

    #lyricBanner {
        padding: 10px 12px 6px;
    }

    #lyricCurrent {
        width: 88vw;
        font-size: 18px;
        color: #eaffff;
        text-shadow: 0 0 12px rgba(0, 255, 209, 0.45);
    }

    #lyricNext {
        width: 88vw;
        min-height: 18px;
        font-size: 12px;
        color: rgba(234, 255, 255, 0.78);
        text-shadow: none;
    }

    .birthday-card {
        width: min(94vw, 560px);
    }

    .birthday-card__body {
        min-height: auto;
    }

    .birthday-card__body p {
        font-size: 16px;
        line-height: 1.68;
        color: #5a2216;
        text-shadow:
            0 0 3px rgba(255, 250, 246, 1),
            0 1px 10px rgba(255, 250, 246, 0.98),
            0 0 14px rgba(255, 250, 246, 0.82);
    }

    #greetingLine,
    #closingLine {
        font-size: 18px;
        margin-bottom: 12px;
    }

    #closingLine {
        margin-top: 12px;
        margin-bottom: 0;
    }

    #wishLine {
        width: 88vw;
        font-size: 18px;
        line-height: 1.72;
    }
}
