@charset "utf-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: '思源黑体', 'HarmonyOS Sans', 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
}

/* 全屏背景 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/xj/bj.jpg') no-repeat center center;
    background-size: cover;
    z-index: 0;
}

/* 主舞台 - 居中容器 */
.stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ========== 信封样式 ========== */
.envelope-container {
    position: relative;
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    opacity: 0;
    transform: translate(25%, -8%) rotate(6deg);
    transition: all 0.85s cubic-bezier(0.34, 1.3, 0.55, 1);
    cursor: pointer;
}

.envelope-container.show {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
}

.envelope {
    position: relative;
    width: 100%;
}

.envelope-img {
    width: 100%;
    height: auto;
    display: block;
}

/* 信封上的文字 - 图片版 */
.envelope-text-img {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.envelope-text-img img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 红色印章“点击查看” */
.envelope-seal {
    position: absolute;
    bottom: 10%;
    right: 14%;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 20;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    width: auto;
    height: auto;
}

.envelope-seal img {
    display: block;
    width: auto;
    height: auto;
    max-width: 300px;
    max-height: 300px;
}

.envelope-seal:hover {
    transform: scale(1.05);
}

/* 信封关闭按钮 - 右上角 */
.envelope-close {
    position: absolute;
    top: 50px;
    right: 70px;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 30;
    width: auto;
    height: auto;
}

.envelope-close img {
    display: block;
    width: auto;
    height: auto;
    max-width: 72px;
    max-height: 72px;
}

.envelope-close:hover {
    transform: scale(1.1);
}

.envelope-close:active {
    transform: scale(0.95);
}

/* ========== 信纸样式 ========== */
.letter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
    z-index: 100;
    background: rgba(0,0,0,0.7);
    padding: 30px;
    box-sizing: border-box;
}

.letter-container.show {
    visibility: visible;
    opacity: 1;
}

.letter-paper {
    position: relative;
    width: 100%;
    max-width: 750px;
    border-radius: 8px 28px 8px 28px;
    box-shadow: 0 30px 50px rgba(0,0,0,0.5);
    background: transparent;
}

.letter-bg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

/* 信纸内容区域 - 保持之前正常工作的设置 */
.letter-content {
    position: absolute;
    top: 12%;
    left: 12%;
    width: 76%;
    height: 73%;
    overflow-y: auto;
    z-index: 2;
    font-family: '霞鹜文楷', 'LXGW WenKai', '方正楷体', 'KaiTi', 'Microsoft YaHei', serif;
    font-size: 1.0rem;
    font-weight: 600;
    line-height: 1.8;
    color: #0e0d0c;
    padding-right: 12px;
    padding-bottom: 20px;
    background: transparent;
    white-space: pre-wrap;
}

/* 滚动条美化 - 细滚动条 */
.letter-content::-webkit-scrollbar {
    width: 4px;
}
.letter-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}
.letter-content::-webkit-scrollbar-thumb {
    background: #be8e4b;
    border-radius: 4px;
}



/* 进入官网按钮 - 相对于信纸定位 */
.letter-enter-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    transform: none;
    z-index: 20;
    cursor: pointer;
    transition: 0.2s ease;
    width: auto;
    height: auto;
}

.letter-enter-btn img {
    display: block;
    width: auto;
    height: auto;
    max-width: 250px;
    max-height: 250px;
}

.letter-enter-btn:hover {
    transform: scale(1.05);
}

.letter-enter-btn:active {
    transform: scale(0.98);
}

/* 落款样式 - 右下角 */
.signature {
    text-align: right;
    margin-top: 0px;
    padding-top: -95px;
    padding-right: 15px;
    font-size: 0.9rem;
    font-weight: normal;
    color: #3a2a1f;
    font-family: '思源黑体', 'Microsoft YaHei', sans-serif;
    letter-spacing: 1px;
    border-top: 1px dashed rgba(190,142,75,0.3);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .stage {
        padding: 20px;
    }
    
    .envelope-container {
        transform: translate(15%, -5%) rotate(4deg);
        transition: all 0.7s cubic-bezier(0.34, 1.2, 0.55, 1);
    }
    
    .envelope-seal {
        bottom: 12%;
        right: 8%;
    }
    .envelope-seal img {
        max-width: 60px;
        max-height: 60px;
    }
    
    .envelope-close {
        top: 12px;
        right: 12px;
    }
    .envelope-close img {
        max-width: 28px;
        max-height: 28px;
    }
    
    /* 小窗口时调整内容区高度和按钮位置 */
    .letter-content {
        font-size: 0.85rem;
        font-weight: 500;
        line-height: 1.6;
        top: 8%;
        left: 8%;
        width: 84%;
        height: 74%;
        padding-bottom: 50px;
    }
    
    .letter-enter-btn {
        bottom: 10px;
    }
    .letter-enter-btn img {
        max-width: 100px;
        max-height: 35px;
    }
    
    .signature {
        font-size: 0.7rem;
        padding-right: 10px;
        margin-top: 15px;
        padding-top: 10px;
    }
    .letter-enter-btn {
        bottom: 15px;
    }
    .letter-enter-btn img {
        max-width: 120px;
        max-height: 42px;
    }
}

@media (max-width: 480px) {
    .letter-content {
        height: 70%;
        padding-bottom: 60px;
    }
    .letter-enter-btn {
        bottom: 5px;
    }
}