@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Kosugi+Maru&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #FFE5B4 0%, #FFCCCB 50%, #E6E6FA 100%);
    font-family: 'Kosugi Maru', 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    position: relative;
}

.face {
    width: 100%;
}

/* 背景装饰 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-hearts {
    position: absolute;
    font-size: 20px;
    color: rgba(255, 192, 203, 0.6);
    animation: float 8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
        opacity: 1;
    }
}

/* 首页样式 */
.home-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    transition: all 0.8s ease;
}

.home-page.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.title-section {
    text-align: center;
    margin-bottom: 50px;
}

.main-title {
    font-family: 'Kosugi Maru', cursive;
    font-size: 3.2em;
    color: #FF69B4;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1), 0 0 20px rgba(255, 105, 180, 0.3);
    }

    to {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1), 0 0 30px rgba(255, 105, 180, 0.5);
    }
}

.subtitle {
    font-size: 1.3em;
    color: #9370DB;
    font-weight: 400;
    margin-bottom: 10px;
}

.date-text {
    font-size: 1em;
    color: #DDA0DD;
    font-style: italic;
}

/* 信封样式 - 吉伊卡哇风格 */
.envelope-container {
    position: relative;
    margin-bottom: 40px;
}

.envelope {
    width: 300px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: envelopePulse 2s ease-in-out infinite;
    perspective: 1000px;
}

@keyframes envelopePulse {

    0%,
    100% {
        transform: scale(1) rotateY(0deg);
    }

    50% {
        transform: scale(1.02) rotateY(2deg);
    }
}

.envelope:hover {
    transform: scale(1.05) rotateY(-5deg);
    animation: none;
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFF8DC 0%, #F0F8FF 100%);
    border: 2px solid #FFB6C1;
    position: relative;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.3);
    border-radius: 8px;
}

.envelope-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFF 0%, #FFF8DC 100%);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-radius: 6px;
}

.envelope-flap {
    width: 102%;
    height: 60%;
    background: linear-gradient(135deg, #FFB6C1 0%, #FF91A4 100%);
    position: absolute;
    top: -2px;
    left: -1%;
    clip-path: polygon(0 0, 100% 0, 50% 90%);
    box-shadow: 0 3px 15px rgba(255, 182, 193, 0.4);
    z-index: 3;
    border: 2px solid #FF91A4;
    border-bottom: none;
    transform-style: preserve-3d;
    transform-origin: 50% 0%;
    backface-visibility: hidden;
    border-radius: 8px 8px 0 0;
}

.envelope-flap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.envelope-sides {
    position: absolute;
    top: 45%;
    left: 0;
    right: 0;
    height: 55%;
    z-index: 2;
}

.envelope-side-left {
    position: absolute;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(45deg, #F0F8FF 0%, #FFF8DC 100%);
    clip-path: polygon(0 0, 100% 100%, 0 100%);
    border-right: 1px solid #FFB6C1;
}

.envelope-side-right {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(45deg, #FFF8DC 0%, #F0F8FF 100%);
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
    border-left: 1px solid #FFB6C1;
}

.envelope-seal {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #FFE4E1, #FFC0CB);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: #FF69B4;
    box-shadow: 0 3px 15px rgba(255, 192, 203, 0.5);
    z-index: 3;
    border: 3px solid #FFC0CB;
    padding: 5px;
}

.envelope-content {
    width: 80%;
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #9370DB;
    font-weight: 600;
    font-size: 0.9em;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(255, 182, 193, 0.3);
    border: 1px solid #FFB6C1;
}

/* 信纸样式 */
.letter-paper {
    position: absolute;
    width: 85%;
    height: 120%;
    background: linear-gradient(135deg, #FFFAFA 0%, #f9f8f4 100%);
    top: 85%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -5px 20px rgba(255, 182, 193, 0.3);
    border: 2px solid #FFB6C1;
    border-bottom: none;
    z-index: 5;
    padding: 20px 15px;
    font-family: 'Kosugi Maru', cursive;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    cursor: pointer;
}

.letter-paper:hover {
    box-shadow: 0 -8px 30px rgba(255, 182, 193, 0.4);
    transform: translateX(-50%) translateY(-2px);
}

.letter-paper.show {
    opacity: 1;
    top: -10%;
    transform: translateX(-50%) translateY(0);
    animation: letterFloat 2s ease-in-out infinite;
    z-index: 6;
}

@keyframes letterFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0px);
    }

    50% {
        transform: translateX(-50%) translateY(-3px);
    }
}

.letter-paper.slide-out {
    transform: translateX(-50%) translateY(-300px) rotateZ(-5deg);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.6, 0, 0.4, 1);
    z-index: 10;
}

.letter-header {
    text-align: center;
    font-size: 1.4em;
    color: #FF69B4;
    font-weight: bold;
    margin-bottom: 15px;
    border-bottom: 2px solid #FFB6C1;
    padding-bottom: 8px;
}

.letter-preview {
    font-size: 1.1em;
    color: #4B0082;
    line-height: 1.6;
    text-align: left;
}

/* 按钮样式 */
.next-button {
    padding: 15px 40px;
    background: linear-gradient(45deg, #FFB6C1, #FF91A4);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.4);
    position: relative;
    overflow: hidden;
    font-family: 'Kosugi Maru', cursive;
}

.next-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 182, 193, 0.6);
}

.next-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.next-button:hover::before {
    left: 100%;
}

/* 明信片页面样式 */
.postcard-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(135deg, #DDA0DD 0%, #FFB6C1 100%); */
    background: url("images/bg_03_sp.jpg") no-repeat center top 2% / 100% auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.8s ease;
    z-index: 10;
}

.postcard-page.show {
    transform: translateY(0);
}

.postcard {
    width: 90%;
    max-width: 600px;
    height: 400px;
    background: #FFF;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    overflow: hidden;
    animation: postcardAppear 1s ease 0.5s both;
    border: 3px solid #FFB6C1;
}

@keyframes postcardAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotateY(-15deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.postcard-front {
    flex: 1;
    background: linear-gradient(45deg, #FFE4E1, #FFF8DC);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    position: relative;
}

.postcard-image {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #FFB6C1, #FF91A4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.3);
    border: 3px solid #FFC0CB;
}

.postcard-title {
    font-family: 'Kosugi Maru', cursive;
    font-size: 2em;
    color: #FF69B4;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.postcard-back {
    flex: 1;
    padding: 0px 6%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* background: #FFF; */
    /* background-image: url("./images/002.jpg"); */
    position: relative;
}

.postcard-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;

    right: 0;
    bottom: -8%;
    background-image: url("./images/002.jpg");
    background-size: 80%;
    background-repeat: no-repeat;
    background-position-y: bottom;
    background-position-x: -40px;
    opacity: 0.3;
    /* 调整这里的值来控制透明度 */
    z-index: -1;
}

.postcard-message {
    font-family: 'Kosugi Maru', cursive;
    font-size: 1.6em;
    color: #4B0082;
    line-height: 1.8;
    text-align: left;
    margin-bottom: 50px;
}

.postcard-signature {
    text-align: right;
    font-style: italic;
    color: #9370DB;
    font-size: 1.1em;
    font-family: 'Kosugi Maru', cursive;
}

.postcard-decoration {
    position: absolute;
    font-size: 2em;
    opacity: 0.4;
}

.back-button {
    position: fixed;
    top: 30px;
    left: 30px;
    padding: 10px 20px;
    background: rgb(53 47 47 / 30%);
    color: white;
    border: 2px solid #1f241c1c;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Kosugi Maru', cursive;
}

.back-button:hover {
    background: white;
    color: #FFB6C1;
}

/* 礼物按钮样式 */
.gift-button {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: linear-gradient(45deg, #FFB6C1, #FF91A4);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.4);
    z-index: 100;
    animation: giftButtonPulse 2s ease-in-out infinite;
    font-family: 'Kosugi Maru', cursive;
}

@keyframes giftButtonPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

.gift-button:hover {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 182, 193, 0.6);
    animation: none;
}

/* 刮刮乐页面样式 */
.scratch-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFE5B4 0%, #FFCCCB 50%, #E6E6FA 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.8s ease;
    z-index: 15;
    overflow-y: auto;
}

.scratch-page.show {
    transform: translateX(0);
}

.scratch-page .container {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: auto;
    justify-content: center;
    max-width: 500px;
    width: 100%;
}

.scratch-page .title {
    text-align: center;
    margin-bottom: 30px;
}

.scratch-page .title h1 {
    font-family: 'Kosugi Maru', cursive;
    font-size: 2.8em;
    color: #FF69B4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.scratch-page .title p {
    font-size: 1.2em;
    color: #9370DB;
    font-weight: 400;
}

.scratch-card {
    position: relative;
    width: 350px;
    height: 200px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(255, 182, 193, 0.2);
    overflow: hidden;
    background: white;
    margin-bottom: 30px;
    border: 3px solid #FFB6C1;
}

.gift-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, rgba(255, 228, 225, 0.95), rgba(255, 218, 185, 0.95));
    color: #8B4B3B;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.gift-icon {
    font-size: 3em;
    margin-bottom: 10px;
    /* animation: pulse 2s infinite; */
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.gift-text {
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: 'Kosugi Maru', cursive;
}

.gift-subtitle {
    font-family: 'Kosugi Maru', cursive;
    font-size: 1.2em;
    opacity: 0.8;
    font-style: italic;
    color: #A0522D;
    -webkit-user-select: none;
    /*webkit浏览器*/
    -ms-user-select: none;
    /*IE10*/
    -khtml-user-select: none;
    /*早期浏览器*/
    user-select: none;
    -moz-user-select: none;
    /*火狐*/
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="pink" stroke-width="2"/></svg>') 10 10, crosshair;
    z-index: 2;
}

.instructions {
    text-align: center;
    max-width: 400px;
    margin-bottom: 20px;
}

.instructions h3 {
    color: #FF69B4;
    margin-bottom: 10px;
    font-size: 1.3em;
    font-family: 'Kosugi Maru', cursive;
}

.instructions p {
    color: #9370DB;
    line-height: 1.6;
}

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Kosugi Maru', cursive;
}

.btn-reset {
    background: linear-gradient(45deg, #FFB6C1, #FF91A4);
    color: white;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
}

.btn-share {
    background: linear-gradient(45deg, #DDA0DD, #D8BFD8);
    color: white;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 160, 221, 0.4);
}

.progress-bar {
    width: 100%;
    max-width: 350px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid #FFB6C1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #FFB6C1, #FF91A4);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 特效 */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFB6C1;
    border-radius: 50%;
    animation: sparkle 1.5s linear infinite;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.6em;
    }

    .envelope {
        width: 250px;
        height: 167px;
    }

    .postcard {
        flex-direction: column;
        height: auto;
        min-height: 500px;
    }

    .postcard-front,
    .postcard-back {
        flex: none;
    }

    .postcard-message {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2.2em;
    }

    .envelope {
        width: 200px;
        height: 133px;
    }

    .postcard-image {
        width: 80px;
        height: 80px;
        font-size: 2.5em;
    }

    .postcard-title {
        font-size: 1.5em;
        margin-bottom: 5%;
    }

    .scratch-page .title h1 {
        font-size: 2.3em;
    }

    .scratch-card {
        width: 300px;
        height: 180px;
    }

    .gift-text {
        font-size: 1.6em;
        letter-spacing: 1px;
    }

    .gift-icon {
        font-size: 2.5em;
        text-align: center;
        margin: 0 auto;
    }

    .gift-button {
        font-size: 1em;
        padding: 12px 24px;
    }
}