body { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* 信封容器 */
.envelope-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.envelope-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 声音开关 */
.sound-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    margin-left: 2%;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    color: white;
}

.sound-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    cursor: pointer;
    transition: background 0.25s ease;
}

.switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease;
}

.sound-switch.muted {
    background: #ccc;
}

.sound-switch.muted .switch-handle {
    transform: translateX(18px);
}

.sound-label {
    min-width: 56px;
}

/* 信封主体 */
.envelope {
    width: 320px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}
.envelope:hover {
    transform: translateY(-5px) scale(1.02);
}
.envelope:hover .envelope-seal {
    transform: translate(-50%, -50%) scale(1.1);
}

/* 信封身体 */
.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8e0 100%);
    border-radius: 4px;
    position: relative;
    box-shadow:
        0 10px 40px rgba(255, 107, 53, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    border: 1px solid rgba(255, 107, 53, 0.15);
}

/* 信封纹理 */
.envelope-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 107, 53, 0.03) 10px,
            rgba(255, 107, 53, 0.03) 20px
        );
    pointer-events: none;
}

/* 信封文字 */
.envelope-text {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}
.envelope-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ff6b35;
    margin: 0 0 12px 0;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(255, 107, 53, 0.1);
}
.envelope-hint {
    font-size: 14px;
    color: #888;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
    0%, 100% { opacity: 0.6; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(3px); }
}

/* 信封翻盖 */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;
}
.flap-triangle {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffd4c4 0%, #ffc4b0 100%);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 107, 53, 0.2);
}
.envelope.opening .envelope-flap {
    transform: rotateX(180deg);
}
.envelope.opening {
    animation: envelopeOpen 0.8s ease forwards;
}
@keyframes envelopeOpen {
    0% { transform: scale(1); }
    30% { transform: scale(1.05) translateY(-10px); }
    60% { transform: scale(0.98) translateY(5px); }
    100% { transform: scale(1.1); opacity: 0; }
}

/* 信封封印 */
.envelope-seal {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    transition: transform 0.3s ease;
}
.seal-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow:
        0 3px 10px rgba(255, 107, 53, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 主内容容器 */
.preface-container {
    max-width: 800px;
    width: 90%;
    margin: 80px auto 20px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease;
    cursor: pointer;
}
.preface-container.visible {
    opacity: 1;
    transform: scale(1);
}

h1 { font-size: 32px; font-weight: 800; color: #ff6b35; margin-bottom: 40px; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); opacity: 0; animation: fadeInUp 0.8s ease-out forwards; }

.text-layer { margin-bottom: 30px; font-size: 18px; line-height: 1.8; color: #555; display: flex; align-items: flex-start; justify-content: center; gap: 15px; opacity: 0; transform: translateY(20px); transition: all 0.8s ease-out; }
.text-layer.visible { opacity: 1; transform: translateY(0); }
.text-content { text-align: left; flex: 1; }
.text-layer:nth-child(3) .text-content, .text-layer:nth-child(5) .text-content { text-align: center; font-weight: 600; font-size: 20px; color: #333; }

.voice-btn { background: none; border: none; cursor: pointer; font-size: 20px; color: #ff6b35; padding: 5px; border-radius: 50%; transition: all 0.3s ease; opacity: 0.7; margin-top: 2px; }
.voice-btn:hover { background: rgba(255, 107, 53, 0.1); opacity: 1; transform: scale(1.1); }

.cta-button { animation: none !important; display: inline-block; padding: 15px 40px; background: linear-gradient(45deg, #ff6b35, #f7931e); color: white; text-decoration: none; border-radius: 50px; font-size: 18px; font-weight: 600; box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3); transition: all 0.3s ease; margin-top: 30px; opacity: 0; transform: translateY(20px); }
.cta-button.visible { opacity: 1; transform: translateY(0); }
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4); }

.top-controls { position: absolute; top: 20px; right: 20px; display: flex; gap: 15px; z-index: 1000; }
.control-btn { background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 20px; padding: 8px 15px; font-size: 16px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.1); backdrop-filter: blur(5px); transition: all 0.3s ease; display: flex; align-items: center; gap: 5px; color: white; }
.control-btn:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }

/* 点击跳转提示 */
.click-hint {
    font-size: 13px;
    color: #aaa;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    pointer-events: none;
}
.click-hint.visible {
    opacity: 1;
    transform: translateY(0);
}
.click-hint.hidden {
    opacity: 0 !important;
}

.play-message { background: rgba(255, 107, 53, 0.1); border: 2px dashed #ff6b35; padding: 10px 25px; border-radius: 20px; font-size: 16px; font-weight: bold; color: #ff6b35; display: inline-block; margin: -20px auto 30px auto; animation: pulse 2s infinite; cursor: pointer; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

@media (max-width: 768px) {
    .preface-container { padding: 30px 20px; width: 95%; }
    h1 { font-size: 26px; margin-bottom: 30px; }
    .text-layer { font-size: 16px; flex-direction: row; }
    .text-layer:nth-child(3) .text-content, .text-layer:nth-child(5) .text-content { font-size: 18px; }
}