/* ===== Global ===== */
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; }
* { box-sizing: border-box; }
.section { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: none; z-index: 1; }
.section.active { display: block; z-index: 10; }
@keyframes loadSpin { 0%,100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.2) rotate(10deg); } }
.section-fade-in { animation: sectionFadeIn 0.6s ease forwards; }
.section-fade-out { animation: sectionFadeOut 0.5s ease forwards; }
@keyframes sectionFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sectionFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== Section 1: Login ===== */
#sectionLogin {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    justify-content: center; align-items: center;
    background: #FFB6D9; overflow: hidden;
}
#sectionLogin.active { display: flex; }
#sectionLogin .login-container {
    background: rgba(255,255,255,0.95); padding: 50px 60px; border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2); text-align: center; min-width: 400px;
    animation: loginFadeIn 0.8s ease-in; position: relative; z-index: 2;
}
@keyframes loginFadeIn { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
#sectionLogin .title { color: #333; font-size: 42px; margin-bottom: 40px; font-weight: 500; letter-spacing: 3px; text-shadow: 2px 2px 4px rgba(0,0,0,0.1); }
#sectionLogin .login-form { display: flex; flex-direction: column; gap: 20px; }
#sectionLogin .input-field { padding: 16px 20px; font-size: 16px; border: 2px solid #e0e0e0; border-radius: 10px; outline: none; transition: all 0.3s ease; background: rgba(255,255,255,0.8); }
#sectionLogin .input-field::placeholder { color: #999; }
#sectionLogin .input-field:focus { border-color: #FFB6D9; background: rgba(255,255,255,1); box-shadow: 0 0 10px rgba(255,182,217,0.3); }
#sectionLogin .login-btn { padding: 16px; font-size: 18px; font-weight: 500; color: #fff; background: linear-gradient(135deg, #FFB6D9 0%, #FFA0C8 100%); border: none; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; letter-spacing: 2px; margin-top: 10px; }
#sectionLogin .login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,182,217,0.4); }
@media (max-width: 600px) {
    #sectionLogin .login-container { min-width: 320px; padding: 40px 30px; }
    #sectionLogin .title { font-size: 32px; }
}

/* ===== Section 2: Particle Text ===== */
#sectionParticle { background: #FFB6D9; }
#sectionParticle canvas.particle-canvas { display: block; position: relative; z-index: 2; }
#sectionParticle .ui { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: none; }
#sectionParticle .ui-input { display: none; }

/* ===== Section 3: Birthday Cake ===== */
#sectionCake { overflow: hidden; }
#sectionCake .cake-bg { width: 100%; height: 100%; background: #FFB6D9; position: absolute; top: 0; left: 0; }
#sectionCake #cakeSvg { display: block; position: relative; margin-top: calc(-10em - 100px); left: 50%; transform: translateX(-50%); }
#sectionCake .birthday-text {
    position: fixed; bottom: 450px; left: 50%; transform: translateX(-50%);
    font-family: 'Pacifico', 'Brush Script MT', cursive; font-size: 52px; color: #FFD700;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.4); text-align: center; z-index: 10;
    animation: cakeFadeInText 1s 7s ease-out forwards; opacity: 0; white-space: nowrap;
}
#sectionCake .cake-topper {
    position: fixed; top: calc(50% - 50px); left: 50%;
    transform: translateX(calc(-50% + 110px));
    background: linear-gradient(135deg, #FFD700, #FFA500); color: #8B4513;
    font-family: 'KaiTi', '楷体', serif; font-size: 13px; font-weight: bold;
    padding: 4px 10px; border: 2px solid #8B4513; border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4); z-index: 100;
    animation: cakeFadeInTopper 1s 6.5s ease-out forwards; opacity: 0; white-space: nowrap;
}
#sectionCake .cake-topper::before {
    content: ''; position: absolute; bottom: -50px; left: 50%; transform: translateX(-50%);
    width: 2px; height: 50px; background: linear-gradient(to bottom, #8B4513, transparent);
}
#sectionCake .velas {
    background: #fff; border-radius: 20px; position: relative; top: 554px;
    margin-left: 49.5%; width: 10px; height: 70px;
    transform: translateY(-600px); backface-visibility: hidden;
    animation: cakeIn 500ms 6s ease-out forwards;
}
#sectionCake .velas:after, #sectionCake .velas:before {
    background: rgba(255,0,0,0.4); content: ""; position: absolute; width: 100%; height: 4.44px;
}
#sectionCake .velas:after { top: 25%; left: 0; }
#sectionCake .velas:before { top: 45%; left: 0; }
#sectionCake .fuego {
    border-radius: 100%; position: absolute; top: -40px; left: 70%;
    margin-left: -4.4px; width: 13.33px; height: 36px;
}
#sectionCake .fuego:nth-child(1) { animation: cakeFuego 2s 6.5s infinite; }
#sectionCake .fuego:nth-child(2) { animation: cakeFuego 1.5s 6.5s infinite; }
#sectionCake .fuego:nth-child(3) { animation: cakeFuego 1s 6.5s infinite; }
#sectionCake .fuego:nth-child(4) { animation: cakeFuego 0.5s 6.5s infinite; }
#sectionCake .fuego:nth-child(5) { animation: cakeFuego 0.2s 6.5s infinite; }
@keyframes cakeFuego {
    0%,100% { background: rgba(254,248,97,0.5); box-shadow: 0 0 40px 10px rgba(248,233,209,0.2); transform: translateY(0) scale(1); }
    50% { background: rgba(255,50,0,0.1); box-shadow: 0 0 40px 20px rgba(248,233,209,0.2); transform: translateY(-20px) scale(0); }
}
@keyframes cakeIn { to { transform: translateY(0); } }
@keyframes cakeFadeInText { from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.8); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes cakeFadeInTopper { from { opacity: 0; transform: translateX(calc(-50% + 110px)) scale(0.8); } to { opacity: 1; transform: translateX(calc(-50% + 110px)) scale(1); } }
#sectionCake .come { animation: cakeComing 2s; opacity: 1; }
@keyframes cakeComing { from { opacity: 0; } to { opacity: 1; } }
#sectionCake .cake-bubbles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; list-style: none; margin: 0; padding: 0; }
#sectionCake .cake-bubbles li { position: absolute; list-style: none; display: block; width: 50px; height: 50px; background-color: rgba(255,255,255,0.15); bottom: -160px; animation: cakeBubbleSquare 30s infinite; }
#sectionCake .cake-bubbles li:nth-child(1) { left: 10%; }
#sectionCake .cake-bubbles li:nth-child(2) { left: 20%; width: 80px; height: 80px; animation-delay: 2s; animation-duration: 12s; }
#sectionCake .cake-bubbles li:nth-child(3) { left: 30%; width: 80px; height: 80px; animation-delay: 5s; animation-duration: 14s; }
#sectionCake .cake-bubbles li:nth-child(4) { left: 60%; width: 80px; height: 80px; animation-delay: 6s; animation-duration: 19s; }
#sectionCake .cake-bubbles li:nth-child(5) { left: 70%; width: 80px; height: 80px; animation-delay: 3s; animation-duration: 19s; }
#sectionCake .cake-bubbles li:nth-child(6) { left: 80%; width: 80px; height: 80px; animation-delay: 4s; animation-duration: 19s; }
#sectionCake .cake-bubbles li:nth-child(7) { left: 90%; width: 80px; height: 80px; animation-delay: 8s; animation-duration: 19s; }
#sectionCake .cake-bubbles li:nth-child(8) { left: 100%; width: 80px; height: 80px; animation-delay: 5s; animation-duration: 19s; }
@keyframes cakeBubbleSquare { 0% { transform: translateY(0); } 100% { transform: translateY(-900px) rotate(600deg); } }
#sectionCake .action-buttons {
    position: fixed; bottom: 230px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 300px; z-index: 1000; animation: cakeFadeInButtons 1s ease-in;
}
@keyframes cakeFadeInButtons { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
#sectionCake .btn-like, #sectionCake .btn-dislike {
    padding: 15px 40px; font-size: 20px; font-family: 'Microsoft YaHei', Arial, sans-serif; font-weight: 500;
    border: 3px solid #fff; border-radius: 50px; cursor: pointer; transition: all 0.3s ease;
    background: rgba(255,255,255,0.2); color: #fff; backdrop-filter: blur(10px);
}
#sectionCake .btn-like { background: linear-gradient(135deg, rgba(255,107,129,0.8), rgba(255,142,83,0.8)); }
#sectionCake .btn-like:hover { transform: scale(1.1); box-shadow: 0 8px 25px rgba(255,107,129,0.5); }
#sectionCake .btn-dislike { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.8); }
#sectionCake .scroll-hint { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); text-align: center; color: rgba(255,255,255,0.8); font-size: 14px; z-index: 999; }
#sectionCake .scroll-hint p { margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
#sectionCake .arrow-down { width: 15px; height: 15px; border-right: 2px solid white; border-bottom: 2px solid white; transform: rotate(45deg); margin: 0 auto; animation: cakeArrowBounce 1.5s infinite; }
@keyframes cakeArrowBounce { 0% { transform: rotate(45deg) translate(0,0); opacity: 0; } 50% { opacity: 1; } 100% { transform: rotate(45deg) translate(10px,10px); opacity: 0; } }

/* Cake section mobile responsive */
@media (max-width: 768px) {
    #sectionCake .action-buttons { gap: 40px; bottom: 180px; }
    #sectionCake .btn-like, #sectionCake .btn-dislike {
        padding: 10px 24px; font-size: 14px; border-width: 2px; border-radius: 30px;
    }
    #sectionCake .scroll-hint { bottom: 120px; font-size: 12px; }
    #sectionCake .arrow-down { width: 12px; height: 12px; }
    #sectionCake .birthday-text { font-size: 32px; bottom: 380px; }
    #sectionCake .cake-topper { font-size: 11px; padding: 3px 8px; }
}
@media (max-width: 400px) {
    #sectionCake .action-buttons { gap: 30px; bottom: 160px; }
    #sectionCake .btn-like, #sectionCake .btn-dislike {
        padding: 8px 20px; font-size: 13px;
    }
    #sectionCake .scroll-hint { bottom: 100px; }
    #sectionCake .birthday-text { font-size: 26px; bottom: 350px; }
}

/* ===== Section 4: Memories ===== */
#sectionMemories { font-family: "Microsoft YaHei", sans-serif; color: white; overflow-x: hidden; overflow-y: auto; }
#sectionMemories .mem-wrapper { background: #FFB6D9; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#sectionMemories .mem-page-section { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding-top: 50px; overflow-y: auto; }
#sectionMemories .timeline-content { width: 100%; max-width: 800px; margin: 0 auto; padding-bottom: 100px; position: relative; z-index: 10; }
#sectionMemories .timeline-header { text-align: center; margin-bottom: 40px; margin-top: 20px; animation: memFadeIn 1s ease; }
#sectionMemories .timeline-header h2 { font-size: 36px; font-weight: normal; text-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 10px; }
#sectionMemories .timeline-header p { font-size: 16px; opacity: 0.9; }
@keyframes memFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
#sectionMemories .timeline-box { position: relative; padding: 20px; }
#sectionMemories .timeline-box::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.5); transform: translateX(-50%); }
#sectionMemories .timeline-box::after { content: ""; display: table; clear: both; }
#sectionMemories .memory-card {
    background: rgba(255,255,255,0.95); border-radius: 12px; padding: 20px; margin-bottom: 100px !important;
    width: 45%; position: relative; color: #ee9ca7; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    animation: memSlideIn 0.8s ease forwards; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#sectionMemories .memory-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
#sectionMemories .memory-card:nth-child(odd) { float: left; clear: left; margin-top: 0 !important; }
#sectionMemories .memory-card:nth-child(even) { float: right; clear: right; margin-top: 100px !important; }
@keyframes memSlideIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
#sectionMemories .date-tag { position: absolute; top: -12px; background: #ee9ca7; color: white; padding: 5px 15px; border-radius: 15px; font-size: 13px; font-weight: bold; box-shadow: 0 2px 8px rgba(238,156,167,0.4); }
#sectionMemories .card-body img { margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
#sectionMemories .card-body p { font-size: 15px; line-height: 1.6; color: #666; font-weight: 300; }
#sectionMemories .next-page-btn {
    text-align: center; margin: 40px auto; padding: 18px 40px; background: rgba(255,255,255,0.3);
    border-radius: 30px; cursor: pointer; width: 280px; transition: all 0.3s; font-size: 16px;
    position: relative; z-index: 10; backdrop-filter: blur(10px);
}
#sectionMemories .next-page-btn:hover { background: rgba(255,255,255,0.5); transform: scale(1.05); box-shadow: 0 5px 20px rgba(0,0,0,0.15); }
#sectionMemories .mem-bubbles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; list-style: none; margin: 0; padding: 0; }
#sectionMemories .mem-bubbles li { position: absolute; list-style: none; display: block; width: 40px; height: 40px; background-color: rgba(255,255,255,0.15); bottom: -160px; animation: memSquare 25s infinite; }
#sectionMemories .mem-bubbles li:nth-child(1) { left: 10%; }
#sectionMemories .mem-bubbles li:nth-child(2) { left: 20%; width: 80px; height: 80px; animation-delay: 2s; animation-duration: 17s; }
#sectionMemories .mem-bubbles li:nth-child(3) { left: 25%; animation-delay: 4s; }
#sectionMemories .mem-bubbles li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-duration: 22s; background-color: rgba(255,255,255,0.25); }
#sectionMemories .mem-bubbles li:nth-child(5) { left: 70%; }
@keyframes memSquare { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(-1000px) rotate(600deg); opacity: 0; } }
@media (max-width: 768px) {
    #sectionMemories .timeline-box::before { left: 30px; }
    #sectionMemories .memory-card { width: 80%; margin-left: 60px; float: none !important; }
    #sectionMemories .memory-card:nth-child(even) { margin-top: 100px !important; }
    #sectionMemories .timeline-header h2 { font-size: 28px; }
}

/* ===== Section 5: Fireworks ===== */
#sectionFireworks { background: black; overflow: hidden; }
#sectionFireworks canvas { position: absolute; }
#sectionFireworks .fw-line-display { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); width: 80%; height: 120px; display: flex; align-items: center; justify-content: center; z-index: 10; }
#sectionFireworks .fw-text-line { font-family: 'KaiTi','STKaiti','楷体','SimKai',serif; font-size: clamp(40px,6vw,80px); letter-spacing: 8px; text-align: center; color: #fff; text-shadow: 0 0 40px rgba(255,255,255,0.6), 0 0 80px rgba(255,255,255,0.3); opacity: 0; transform: translateY(20px); }
#sectionFireworks .fw-text-line.in { animation: fwLineIn 0.6s cubic-bezier(0.22,1,0.36,1) forwards; }
#sectionFireworks .fw-text-line.out { animation: fwLineOut 0.5s cubic-bezier(0.55,0,0.55,0.2) forwards; }
@keyframes fwLineIn { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fwLineOut { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px); } }
@media (max-width: 768px) {
    #sectionFireworks .fw-line-display { top: 25%; width: 90%; }
    #sectionFireworks .fw-text-line { font-size: clamp(18px,4.5vw,28px); letter-spacing: 4px; }
}

/* ===== Custom Background Image ===== */
.custom-bg-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    z-index: 0; pointer-events: none;
}
.section-has-custom-bg { background: #000 !important; }
.section-has-custom-bg > *:not(.custom-bg-layer) { position: relative; z-index: 1; }

/* ===== Music Overlay ===== */
#wechatMusicOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 99999; backdrop-filter: blur(5px); }
@keyframes wechatPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
