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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Dancing Script', cursive;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}


.container {
    max-width: 800px;
    width: 100%;
}

.letter-container {
    background: linear-gradient(145deg, #fff5f8 0%, #ffe8f0 100%);
    background-image: 
        linear-gradient(transparent 49px, rgba(255, 192, 203, 0.3) 49px, rgba(255, 192, 203, 0.3) 51px, transparent 51px);
    background-size: 50px 50px;
    padding: 60px;
    margin: 0 auto 30px;
    box-shadow: 
        0 20px 40px rgba(255, 105, 180, 0.2),
        0 0 0 1px rgba(255, 182, 193, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 105, 180, 0.1);
    border-radius: 15px;
    position: relative;
    transform: rotate(-1deg);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 182, 193, 0.4);
}


@keyframes gentle-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.letter-container:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(255, 105, 180, 0.3),
        0 0 0 1px rgba(255, 182, 193, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 30px rgba(255, 105, 180, 0.2);
}


.letter-header {
    margin-bottom: 30px;
}

.date {
    text-align: right;
    font-size: 18px;
    color: #d63384;
    margin-bottom: 20px;
    font-weight: 500;
    position: relative;
}


.greeting {
    font-size: 26px;
    color: #c2185b;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(255, 105, 180, 0.3);
    position: relative;
}


.letter-content {
    margin-bottom: 40px;
    min-height: 300px;
}

.letter-paragraph {
    font-size: 22px;
    line-height: 2.2;
    color: #5d4e75;
    text-align: justify;
    font-weight: 500;
    letter-spacing: 1px;
    position: relative;
}

.letter-paragraph::after {
    content: '|';
    animation: blink 1s infinite;
    color: #ff69b4;
    font-weight: normal;
    font-size: 20px;
}

@keyframes blink {
    0%, 50% { opacity: 1; transform: scale(1); }
    51%, 100% { opacity: 0; transform: scale(0.8); }
}

.letter-footer {
    text-align: right;
    position: relative;
}


.signature {
    display: inline-block;
    text-align: left;
    position: relative;
}

.closing {
    font-size: 20px;
    color: #c2185b;
    margin-bottom: 8px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 105, 180, 0.2);
}

.sender {
    font-size: 18px;
    color: #ad1457;
    margin-top: 20px;
    font-weight: 500;
    position: relative;
}


.sender-name {
    font-size: 26px;
    color: #880e4f;
    margin-top: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(255, 105, 180, 0.3);
    position: relative;
}


.controls {
    text-align: center;
}

.control-btn {
    background: linear-gradient(45deg, #ff6b9d, #f06292);
    color: white;
    border: none;
    padding: 15px 35px;
    margin: 0 10px;
    border-radius: 30px;
    font-size: 18px;
    font-family: 'Dancing Script', cursive;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(255, 105, 180, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(255, 105, 180, 0.5),
        0 0 0 3px rgba(255, 255, 255, 0.4);
}

.control-btn:hover::before {
    width: 100%;
    height: 100%;
}

.control-btn:active {
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 打字机效果的字符 */
.typed-char {
    opacity: 0;
    animation: fadeInChar 0.3s ease-in-out forwards;
}

@keyframes fadeInChar {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-2px) scale(1.1);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* 响应式设计 */
@media (max-width: 768px) {
    .letter-container {
        padding: 40px 30px;
        transform: none;
    }
    
    .letter-container:hover {
        transform: none;
    }
    
    .letter-paragraph {
        font-size: 20px;
        line-height: 2;
    }
    
    .greeting {
        font-size: 22px;
    }
    
    .date {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .letter-container {
        padding: 30px 20px;
    }
    
    .letter-paragraph {
        font-size: 18px;
        line-height: 1.8;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin: 5px;
    }
}
