* {
    margin: 0;
    padding: 0;
}

:root {
    --primary: #fff;
    --bg-envelope-color: #f5edd1;
    --envelope-tab: #ecdeb8;
    --envelope-cover: #e6cfa7;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --txt-color: #444;
    --heart-color: rgb(252, 8, 231);
}
.one {
    background-color: #cccccc;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.background {
    height: 100vh;
    width: 100%;
    position: relative;
}
.one {
    width: 100%;
    height: 100%;
}
.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container {
    height: 100%;
    width: 100%;
    top: 1.5rem;
    display: grid;
    position: absolute;
    place-items: center;
    transition: transform 0.3s ease;
}
.container > .envelope-wrapper {
    background: var(--bg-envelope-color);
    box-shadow: 0 0 40px var(--shadow-color);
    transition: transform 0.3s ease;
    transform-origin: center center;
    cursor: url('icons/envelope-closed.cur'), auto;
}
.container > .envelope-wrapper.open {
    cursor: url('icons/cursor.cur'), auto;
}
.envelope-wrapper > .envelope {
    position: relative;
    width: 700px;
    height: 336px;
}
.envelope-wrapper > .envelope::before {
    content: "";
    position: absolute;
    top: 0;
    z-index: 2;
    border-top: 210px solid var(--envelope-tab);
    border-right: 350px solid transparent;
    border-left: 350px solid transparent;
    transform-origin: top;
    transition: all 0.5s ease-in-out 0.7s;
}
.envelope-wrapper > .envelope::after {
    content: "";
    position: absolute;
    z-index: 2;
    width: 0px;
    height: 0px;
    border-top: 210px solid transparent;
    border-right: 350px solid var(--envelope-cover);
    border-bottom: 140px solid var(--envelope-cover);
    border-left: 350px solid var(--envelope-cover);
}
.envelope > .letter {
    position: absolute;
    right: 20%;
    bottom: 0;
    width: 60%;
    height: 98%;
    background: var(--primary);
    text-align: center;
    transition: all 1s ease-in-out;
    box-shadow: 0 0 5px var(--shadow-color);
    padding: 20px 20px 70px 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    z-index: 1;
}

.envelope > .letter > .text {
    font-family: "Ma Shan Zheng", "Comic Neue", cursive;
    color: var(--txt-color);
    text-align: left;
    font-size: 18px;
    line-height: 1.8;
    min-height: 150%;
    padding-bottom: 100px;
}

/* 隐藏滚动条但保持功能 */
.envelope > .letter::-webkit-scrollbar {
    display: none;
}

.envelope > .letter {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 添加滚动提示 */
/* .envelope > .letter::after {
    content: '';
    position: absolute;
    bottom: 30px;
    left: 48%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    animation: bounce 2s infinite;
} */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

.heart {
    position: absolute;
    top: 51%;
    left: 50%;
    width: 42px;
    height: 42px;
    background: rgb(255, 131, 151);
    z-index: 4;
    transform: translate(-50%, -20%) rotate(45deg);
    transition: transform 0.5s ease-in-out 1s;
    box-shadow: 0 1px 6px var(--shadow-color);
    cursor: url('icons/envelope-closed.cur') 16 16, auto;
}
.heart:before,
.heart:after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    background: rgb(255, 131, 151);
    border-radius: 50%;
}
.heart:before {
    top: -21px;
}
.heart:after {
    right: 21px;
}
.flap > .envelope:before {
    transform: rotateX(180deg);
    z-index: 0;
}
.flap > .envelope > .letter {
    bottom: 200px;
    transform: scale(1.5);
    transition-delay: 1s;
}
.flap > .heart {
    transform: rotate(90deg);
    transition-delay: 0.4s;
}
.love {
    text-align: center;
    font-weight:140;
    font-size: 22px;
    margin-top: 15px;
}
.pana {
    width: 100%;
    margin-top: 0.3rem;
}
.pana img {
    width: 1.5rem;
    margin: auto;
}

#window #gif img {
    opacity: 1;
    transition: opacity 0.3s, width 0.3s;
    width: 15rem;
}
#gif {
    pointer-events: none;
}

#window:hover #gif img {
    opacity: 1;
    width: 15rem;
}

.music-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 450px;
    z-index: 1;
    transition: all 0.75s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.player {
    display: flex;
    justify-content: end;
    align-items: center;
    width: 100%;
    height: 70px;
}

.track-info {
    position: absolute;
    top: 0;
    left: -0.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    transition: all 0.25s ease;
}

.trackname {
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
}
.trackartist {
    font-size: 0.8rem;
    pointer-events: none;
}
.track-nav {
    gap: 0.2rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    transition: all 0.25s ease;
}

.music-container.hide {
    width: 140px;
}

.music-container.hide .track-info,
.music-container.hide .track-nav {
    transition: all 0s ease;
    opacity: 0;
}

.toggle-player {
    position: absolute;
    right: -1rem;
    top: -1rem;
    width: 2rem;
    z-index: 2;
    border-radius: 100%;
    cursor: pointer;
}

.sound-bars-lottie {
    position: absolute;
    top: 1.1rem;
    left: 4.5rem;
}
.sound-bars {
    width: 100%;
    width: 60px;
    height: 60px;
}
.prev-track,
.playpause-track,
.next-track {
    cursor: pointer;
    z-index: 100;
    border-radius: 100%;
    padding: 0.3rem;
}

.prev-track:hover,
.playpause-track:hover,
.next-track:hover {
    background-color: rgb(190, 190, 190);
    transition-duration: 0.5s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.playpause-track {
    cursor: pointer;
    z-index: 100;
    border-radius: 100%;
    padding: 0.3rem;
    transition: all 0.3s ease;
}

@font-face {
    font-family: 'CustomFont';
    src: url('csf.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.letter {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'CustomFont', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    -ms-overflow-style: none;
    scrollbar-width: none;
    z-index: 1;
}

/* 添加向下滑动箭头样式 */
.scroll-arrow {
    color: #ff4d6d; /* 设置箭头颜色为粉红色 */
    opacity: 0.9;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}

.scroll-arrow svg {
    stroke: #000; /* 黑色描边 */
    stroke-width: 2.5; /* 加粗描边 */
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.8)); /* 添加白色光晕 */
}

.scroll-arrow:hover {
    opacity: 1;
    transform: translateY(2px) translateX(-50%);
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .envelope-wrapper > .envelope {
        width: 100%;
        max-width: 700px;
    }
    
    .envelope > .letter {
        width: 100%;
        max-width: 60%;
    }
    
    .scroll-arrow {
        transform: scale(0.8);
    }
}

/* 添加字体声明 */
@font-face {
    font-family: 'PixFont';
    src: url('pix.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 移动设备提示页面样式 */
.mobile-tip {
    display: flex; /* 默认显示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f5edd1;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* 主内容默认隐藏 */
#main-content {
    display: none;
}

/* 桌面设备显示主内容 */
@media (min-width: 1025px) {
    #main-content {
        display: block;
    }
    
    .mobile-tip {
        display: none;
    }
}

.tip-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    width: 100%;
    max-width: 90%;
}

.tip-content h1 {
    font-family: 'PixFont', sans-serif;
    font-size: 28px;
    color: #444;
    line-height: 1.5;
    letter-spacing: 1px;
    margin: 0;
    padding: 0;
}

/* 移动设备适配 */
@media (max-width: 1024px) {
    #main-content {
        display: none !important;
    }
    
    .mobile-tip {
        display: flex;
    }
}

/* 鼠标图标样式 */
body {
    cursor: url('icons/envelope-closed.cur'), auto;
}

body.envelope-open {
    cursor: url('icons/cursor.cur'), auto;
}

/* 爱心悬停效果 */
.heart:hover {
    transform: translate(-50%, -20%) rotate(45deg) scale(1.2);
}

/* 信封打开时禁用爱心悬停效果 */
body.envelope-open .heart:hover {
    transform: translate(-50%, -20%) rotate(45deg);
}

/* 链接容器样式 */
.link-container {
    margin-top: 20px;
    position: relative;
}

.copy-link {
    font-family: 'PixFont', sans-serif;
    color: #444;
    text-decoration: none;
    font-size: 20px;
    padding: 8px 16px;
    border: 2px solid #444;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
}

.copy-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.copy-tip {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.copy-tip.show {
    opacity: 1;
}
