* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body, html { width: 100%; height: 100%; overflow: hidden; background-color: #f4eeda; font-family: 'STKaiti', '楷体', serif; }

#main-container {
    width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

#intro-text {
    position: absolute; text-align: center; color: #5d4037; font-size: 8vw;
    font-weight: bold; letter-spacing: 0.5em; line-height: 1.5;
    transition: opacity 1.5s ease, transform 1.5s ease; z-index: 100;
}

#envelope-wrapper {
    position: relative; width: 85%; max-width: 400px; aspect-ratio: 3 / 2;
    z-index: 50; opacity: 0; transform: translateY(-100vh) rotate(10deg);
    transition: all 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer;
}
#envelope-wrapper.dropped { opacity: 1; transform: translateY(0) rotate(0deg); }

.envelope {
    position: relative; width: 100%; height: 100%;
    background-color: #fdfcf5; border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.envelope-back { position: absolute; width: 100%; height: 100%; background: #eae4d3; border-radius: 8px; z-index: 1; }

.letter {
    position: absolute; bottom: 5%; left: 5%; width: 90%; height: 90%;
    background: #fff; border-radius: 4px; 
    z-index: 2; 
    padding: 20px; box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
    transition: transform 0.8s ease, width 0.8s ease, height 0.8s ease, top 0.8s ease, left 0.8s ease, box-shadow 0.8s ease;
    overflow-y: auto; transform-origin: center;
}
.letter-content { color: #3e2723; line-height: 1.8; font-size: 1rem; }
.letter-content h2 { font-size: 1.3rem; margin-bottom: 15px; border-bottom: 1px solid #ddd; padding-bottom: 5px; }
.letter-content p { margin-bottom: 10px; text-indent: 2em; }
.letter-content .signature { text-align: right; margin-top: 25px; font-weight: bold; }

.envelope-front-cover {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3; pointer-events: none; border-radius: 8px; overflow: hidden;
}
.envelope-front-cover::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #fdfcf5; clip-path: polygon(0% 0%, 50% 55%, 100% 0%, 100% 100%, 0% 100%);
}

.flap {
    position: absolute; top: 0; left: 0; width: 100%; height: 60%;
    z-index: 4; transform-origin: top;
    transition: transform 0.8s ease-in-out, z-index 0.1s;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.flap::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #fdfcf5; 
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.wax-seal {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 50px; background: radial-gradient(#d32f2f 60%, #b71c1c);
    border-radius: 50%; box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    display: flex; justify-content: center; align-items: center;
    color: #ffca28; font-size: 24px; font-weight: bold; border: 2px solid #b71c1c; transition: opacity 0.5s;
    z-index: 5;
}

.envelope.open .flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .wax-seal { opacity: 0; }
.envelope.pull-out .letter {
    width: 92vw; height: 85vh; bottom: auto; top: 50%; left: 50%;
    transform: translate(-50%, -50%); box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.letter.bring-to-front { z-index: 100 !important; }

#notification {
    position: fixed; top: -120px; left: 2%; width: 96%;
    background: #ffffff; border-radius: 18px; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); z-index: 1000; 
    transition: top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color:#111;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
#notification.show { top: 15px; }

.notif-left { display: flex; flex-direction: column; flex: 1; }

.notif-header { display: flex; align-items: center; margin-bottom: 8px; }
.notif-app-icon{
    width:20px;height:20px;margin-right:8px;
    display:flex;justify-content:center;align-items:center;
}
.notif-app-icon img{width:20px;height:20px;object-fit:contain;display:block;}
.notif-app-name { font-size:13px;color:#888;letter-spacing:.5px; }

.notif-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.notif-desc { font-size:14px;color:#666;opacity:1; }

.notif-avatar {
    width: 46px; height: 46px; border-radius: 10px; object-fit: cover; margin-left: 15px;
    background: #333;
}

#wechat-ui {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #ededed; z-index: 2000; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.4s ease;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111;
}
#wechat-ui.show { transform: translateX(0); }

.wechat-header {
    background: #ededed; height: 60px; display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; font-weight: 500; font-size: 17px; border-bottom: 1px solid #d9d9d9;
}
.wechat-header .back { display: flex; align-items: center; font-size: 16px; font-weight: normal; }
.wechat-header .back i { font-style: normal; margin-right: 4px; font-size: 20px; }
.wechat-header .title { font-weight: bold; }
.wechat-header .more { letter-spacing: 2px; font-weight: bold; font-size: 20px; margin-top: -8px;}

.wechat-body { 
    flex: 1; padding: 20px 15px; overflow-y: auto; 
    background-color: #ededed;
    background-image: url('./聊天背景图.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
}

.chat-row { display: flex; align-items: flex-start; margin-bottom: 20px; width: 100%; }
.chat-row.left { justify-content: flex-start; }
.chat-row.right { justify-content: flex-end; }

.avatar { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; background: #ddd; }
.chat-row.left .avatar { margin-right: 12px; }
.chat-row.right .avatar { margin-left: 12px; }

.bubble {
    max-width: 65%; padding: 10px 14px; border-radius: 8px; font-size: 16px;
    line-height: 1.4; word-break: break-word; position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.chat-row.left .bubble { background: #ffffff; color: #111; }
.chat-row.right .bubble { background: #95ec69; color: #111; }

.bubble::before { content: ''; position: absolute; top: 14px; width: 0; height: 0; border-style: solid; }
.chat-row.left .bubble::before { left: -6px; border-width: 5px 6px 5px 0; border-color: transparent #ffffff transparent transparent; }
.chat-row.right .bubble::before { right: -6px; border-width: 5px 0 5px 6px; border-color: transparent transparent transparent #95ec69; }

.video-bubble {
    width: 140px; height: 180px; padding: 0; border-radius: 8px; overflow: hidden;
    display: flex; justify-content: center; align-items: center; cursor: pointer;
    background: #222; position: relative;
}
.video-bubble::before { display: none; }
.play-icon {
    width: 40px; height: 40px; background: rgba(255,255,255,0.7); border-radius: 50%;
    display: flex; justify-content: center; align-items: center; padding-left: 4px;
    color: #333; font-size: 20px; z-index: 2;
}
.video-duration {
    position: absolute; bottom: 5px; right: 8px; font-size: 12px; color: white;
    background: rgba(0,0,0,0.5); padding: 2px 5px; border-radius: 4px;
}

.wechat-footer {
    height: 56px; background: #f7f7f7; display: flex; align-items: center; padding: 0 10px;
    border-top: 1px solid #d9d9d9;
}
.footer-icon {
    width: 32px; height: 32px; display: flex; justify-content: center; align-items: center;
    border-radius: 50%; border: 1.5px solid #333; color: #333; font-size: 20px; margin: 0 5px;
}
.footer-input { flex: 1; height: 38px; background: #ffffff; border-radius: 4px; margin: 0 10px; }
.footer-icon.plus { font-size: 24px; font-weight: 300; line-height: 28px; }

#video-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 3000; opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
#video-overlay.show { opacity: 1; pointer-events: auto; }

.video-animate-wrapper {
    position: absolute; overflow: hidden; display: flex; justify-content: center; align-items: center;
    background: #000; transform-origin: center center;
}
.video-animate-wrapper video { width: 100%; height: auto; max-height: 100%; object-fit: contain; }

.player-ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
.player-ui * { pointer-events: auto; }

.player-close-btn {
    position: absolute; top: 40px; left: 20px; width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.5); border-radius: 50%; color: #fff;
    display: flex; justify-content: center; align-items: center; font-size: 18px; cursor: pointer;
}

.player-bottom-controls {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 30px 20px 40px 20px; display: flex; flex-direction: column; gap: 20px;
}

.controls-main-row { display: flex; align-items: center; width: 100%; color: #fff; gap: 15px; }
.player-play-toggle { cursor: pointer; font-size: 18px; width: 20px; display: flex; justify-content: center; }
.player-time-display { font-size: 12px; color: #ccc; white-space: nowrap; font-family: sans-serif; }

.player-slider-container { flex: 1; height: 2px; background: rgba(255,255,255,0.3); position: relative; border-radius: 1px; cursor: pointer; }
.player-slider-fill { width: 0%; height: 100%; background: #fff; border-radius: 1px; }
.player-slider-dot { position: absolute; top: 50%; left: 0%; width: 10px; height: 10px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); }
.player-speed-text { font-size: 13px; color: #fff; cursor: pointer; white-space: nowrap; }

.controls-icon-row { display: flex; justify-content: center; gap: 25px; width: 100%; }
.control-circle-btn {
    width: 42px; height: 42px; background: rgba(255,255,255,0.15); border-radius: 50%;
    display: flex; justify-content: center; align-items: center; color: #fff; cursor: pointer;
}