/* 密碼保護畫面樣式 */
.password-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.password-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.password-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.password-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.password-subtitle {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.password-hint {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.password-input {
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', sans-serif;
}

.password-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', sans-serif;
}

.password-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.password-button:active {
    transform: translateY(0);
}

.password-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    animation: shake 0.5s ease-in-out;
}

.password-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.password-particles::before,
.password-particles::after {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    animation: float-sparkle 6s linear infinite;
}

.password-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.password-particles::after {
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes float-sparkle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 字體定義 */
@font-face {
    font-family: 'ChenYuluoyan';
    src: url('ChenYuluoyan-2.0-Thin.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 全域樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

/* 粒子動畫容器 */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    pointer-events: none;
    opacity: 0.8;
}

.heart-particle {
    color: #ff6b6b;
    font-size: 20px;
    animation: float-heart 8s linear infinite;
}

.star-particle {
    color: #ffd700;
    font-size: 16px;
    animation: float-star 6s linear infinite;
}

/* 音樂控制按鈕 */
.music-control {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-control:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.music-control.playing {
    animation: musicPulse 2s infinite;
}

.music-icon {
    display: block;
    animation: none;
}

.music-control.playing .music-icon {
    animation: bounce 1s infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.4); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 載入畫面 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.loading-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.loading-animation {
    animation: fadeInUp 1s ease-out 1s both;
}

.heart {
    width: 50px;
    height: 50px;
    background: #ff6b6b;
    position: relative;
    transform: rotate(-45deg);
    animation: heartbeat 1.5s ease-in-out infinite;
    margin: 0 auto;
}

.heart:before,
.heart:after {
    content: '';
    width: 50px;
    height: 50px;
    position: absolute;
    left: 25px;
    top: 0;
    background: #ff6b6b;
    border-radius: 25px;
    transform: rotate(-45deg);
    transform-origin: 0 25px;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 25px 25px;
}

/* 主要內容 */
#main-content {
    opacity: 0;
    transition: opacity 1s ease-in;
}

#main-content.show {
    opacity: 1;
}

/* 頁面基本樣式 */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
    box-sizing: border-box;
}

/* 旅行頁面需要更多空間 */
#memory-page {
    min-height: 100vh;
    height: auto; /* 允許內容決定高度 */
    align-items: flex-start;
    padding: 3rem 2rem;
}

.page-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

/* 首頁樣式 */
#welcome-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: slideInDown 1s ease-out;
}

/* 發光文字效果 */
.glowing-text {
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 15px #ff6b6b,
        0 0 20px #ff6b6b,
        0 0 35px #ff6b6b,
        0 0 40px #ff6b6b;
    animation: glow 2s ease-in-out infinite alternate;
}

/* 打字機效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #fff;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* 手寫字體 */
.handwriting {
    font-family: 'ChenYuluoyan', 'Dancing Script', cursive;
    font-weight: normal;
    font-size: 1.1em;
    line-height: 1.8;
}

.welcome-text {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    animation: slideInUp 1s ease-out 0.5s both;
}

.welcome-subtitle {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    animation: slideInUp 1s ease-out 1s both;
}

.scroll-hint {
    animation: slideInUp 1s ease-out 1.5s both;
}

.scroll-hint span {
    display: block;
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.scroll-arrow {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

/* 旅行回憶頁面樣式 */
#memory-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

#memory-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1" fill="white" opacity="0.1"/></svg>') repeat;
    animation: float 20s infinite linear;
    pointer-events: none;
}

.travel-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.travel-subtitle {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.9;
    font-weight: 300;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 0 1rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .countries-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .countries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1.5rem auto 0;
    }
}

@media (max-width: 480px) {
    .countries-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.country-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.country-card:hover::before {
    opacity: 1;
    animation: shine 0.6s ease-in-out;
}

.country-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.country-flag {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.country-emoji {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.country-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.country-subtitle {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    opacity: 0.8;
}

.country-subt.gift-blessing {
    font-size: 0.9rem;
    color: #d4af37;
    font-style: italic;
    margin-top: 1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .countries-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .country-card {
        padding: 1.5rem;
    }
    
    .travel-title {
        font-size: 2.5rem;
    }
}

/* 浪漫影片頁面樣式 */
#romance-page {
    /* 覆蓋基礎 .page 樣式 */
    padding: 0 !important;
    background: #000 !important;
    overflow: hidden;
    position: relative;
    min-height: 100vh;
    height: 100vh;
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
}

#romance-page .background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#romance-page .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

#romance-page .overlay-text {
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    z-index: 3;
}

#romance-page .romance-message {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.9);
    animation: fadeInUp 1s ease-out;
    font-family: 'ChenYuluoyan', 'Noto Sans TC', sans-serif;
    line-height: 1.2;
    color: white;
}

#romance-page .romance-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    animation: fadeInUp 1s ease-out 0.5s both;
    font-family: 'ChenYuluoyan', 'Noto Sans TC', sans-serif;
    color: white;
}

/* 響應式設計 - 影片頁面 */
@media (max-width: 768px) {
    .romance-message {
        font-size: 2rem;
    }
    
    .romance-subtitle {
        font-size: 1.2rem;
    }
    
    .overlay-text {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .romance-message {
        font-size: 1.5rem;
    }
    
    .romance-subtitle {
        font-size: 1rem;
    }
}

/* 祝福卡片樣式 */
#blessing-page {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    perspective: 1000px;
}

.blessing-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform: perspective(1000px) rotateX(5deg);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.blessing-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

.blessing-card:hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(5deg);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

/* 移除浮動卡片效果 - 保持靜態 */
.floating-card {
    transition: transform 0.3s ease;
}

.card-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #e91e63;
}

.blessing-text p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.8;
    font-family: 'ChenYuluoyan', 'Noto Sans TC', sans-serif;
}

.signature {
    margin-top: 2rem;
    font-style: italic;
    color: #e91e63;
    font-weight: 500;
}

/* 禮物頁面樣式 */
#gift-page {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: #333;
}

.gifts-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.gift-box {
    width: 250px;
    height: 250px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gift-box:hover {
    transform: scale(1.05);
}

.scratch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.scratch-overlay p {
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    padding: 1rem;
}

.gift-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gift-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e91e63;
}

.gift-content p {
    font-size: 1rem;
    text-align: center;
    line-height: 1.6;
}

/* 特別驚喜頁面樣式 */
#celebration-gift-page {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd700 50%, #ff9a9e 100%);
    position: relative;
    overflow: hidden;
}

.celebration-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-shapes {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.3);
    animation: floatShapes 12s infinite linear;
    pointer-events: none;
}

.floating-shapes:nth-child(1) { top: 15%; left: 15%; animation-delay: 0s; }
.floating-shapes:nth-child(2) { top: 70%; right: 20%; animation-delay: 3s; }
.floating-shapes:nth-child(3) { top: 30%; left: 75%; animation-delay: 6s; }
.floating-shapes:nth-child(4) { top: 85%; left: 25%; animation-delay: 9s; }

@keyframes floatShapes {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.3; }
    25% { transform: translateY(-15px) rotate(90deg) scale(1.1); opacity: 0.6; }
    50% { transform: translateY(-30px) rotate(180deg) scale(1); opacity: 0.4; }
    75% { transform: translateY(-15px) rotate(270deg) scale(1.1); opacity: 0.6; }
    100% { transform: translateY(0) rotate(360deg) scale(1); opacity: 0.3; }
}

.celebration-title {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-size: 3.5rem;
    margin-bottom: 2rem;
}

.gifts-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    z-index: 2;
    position: relative;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gifts-container {
        flex-direction: column;
        gap: 2rem;
    }
}

.surprise-box {
    width: 350px;
    height: 400px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.8s ease;
}

.box-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ff9a9e);
    border: 3px solid #ffd700;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform-origin: center top;
    transition: all 0.8s ease;
    z-index: 3;
}

.box-title {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: bold;
}

.box-subtitle {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 2rem;
    font-style: italic;
    opacity: 0.9;
}

.box-ornament {
    font-size: 3.5rem;
    margin: 1rem 0;
    animation: giftBounce 2s infinite;
}

@keyframes giftBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.reveal-hint {
    font-size: 1rem;
    color: #fff;
    margin-top: 2rem;
    opacity: 0.8;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; text-shadow: 0 0 15px #ffd700; }
}

.box-content {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: rotateX(-90deg);
    transition: all 0.8s ease;
    z-index: 2;
}

.surprise-box.opened .box-cover {
    transform: rotateX(-90deg);
}

.surprise-box.opened .box-content {
    opacity: 1;
    transform: rotateX(0deg);
}

/* 影片容器樣式 */
.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#surprise-video {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.video-message {
    text-align: center;
    color: #333;
}

.video-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #ff6b6b;
}

.video-message p {
    font-size: 1rem;
    line-height: 1.4;
    opacity: 0.8;
}

/* 播放影片按鈕 */
.play-video-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff9a9e);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.play-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff5252, #ff8a80);
}

/* 影片彈窗樣式 */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: #666;
    font-size: 1rem;
}

.video-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

#modal-video {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
    }
}

/* 旅行照片彈窗樣式 */
.travel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.travel-modal.show {
    display: flex;
}

.travel-modal-content {
    max-width: 95vw;
    max-height: 95vh;
}

.travel-photo-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

#travel-modal-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

@media (max-width: 768px) {
    .travel-modal-content {
        margin: 1rem;
        padding: 1rem;
    }
    
    #travel-modal-image {
        max-height: 60vh;
    }
}

/* 影片粒子動畫 */
@keyframes videoParticleFloat {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(var(--random-x, 100px), var(--random-y, -100px)) scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--random-x, 200px), var(--random-y, -200px)) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

/* 夢想啟航頁面樣式 */
#dream-gift-page {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d1b69 100%);
    position: relative;
    overflow: hidden;
}

.starry-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: shootingStar 3s infinite;
}

.shooting-star:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
    transform: translateX(-50px);
}

@keyframes shootingStar {
    0% { transform: translateX(-100px) translateY(-100px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(100vw) translateY(100vh); opacity: 0; }
}

.constellation {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, #fff, transparent),
        radial-gradient(2px 2px at 40% 70%, #fff, transparent),
        radial-gradient(1px 1px at 90% 40%, #fff, transparent),
        radial-gradient(1px 1px at 60% 10%, #fff, transparent);
    animation: twinkle 4s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.dream-title {
    font-family: '辰宇落雁體', serif;
    color: #e6e6fa;
    text-shadow: 0 0 20px #9370db;
    font-size: 3.5rem;
    margin-bottom: 2rem;
}

.dream-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
    z-index: 2;
    position: relative;
}

.dream-sphere {
    width: 350px;
    height: 350px;
    position: relative;
    cursor: pointer;
    transition: all 1s ease;
}

.sphere-surface {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #9370db, #4b0082, #191970);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 
        0 0 50px rgba(147, 112, 219, 0.6),
        inset 0 0 50px rgba(255, 255, 255, 0.1);
    transition: all 1s ease;
    z-index: 3;
}

.sphere-glow {
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 60%, rgba(147, 112, 219, 0.3));
    animation: sphereGlow 3s infinite;
    z-index: -1;
}

@keyframes sphereGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

.dream-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: 
        radial-gradient(1px 1px at 30% 20%, #fff, transparent),
        radial-gradient(1px 1px at 70% 80%, #fff, transparent),
        radial-gradient(1px 1px at 20% 70%, #fff, transparent);
    animation: particleFloat 6s infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.dream-symbol {
    font-size: 4rem;
    color: #e6e6fa;
    margin-bottom: 1rem;
    animation: symbolPulse 2s infinite;
}

@keyframes symbolPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.dream-hint {
    font-size: 1.2rem;
    color: #e6e6fa;
    opacity: 0.9;
    animation: hintGlow 3s infinite;
}

@keyframes hintGlow {
    0%, 100% { text-shadow: 0 0 10px #9370db; }
    50% { text-shadow: 0 0 20px #9370db, 0 0 30px #9370db; }
}

.dream-content {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, #e6e6fa, #d8bfd8, #dda0dd);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 1s ease;
    z-index: 2;
}

.dream-sphere.revealed .sphere-surface {
    opacity: 0;
    transform: scale(0);
}

.dream-sphere.revealed .dream-content {
    opacity: 1;
    transform: scale(1);
}

/* 通用禮物揭曉樣式 */
.gift-reveal {
    text-align: center;
    padding: 2rem;
    color: #333;
}

.gift-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: iconBounce 2s infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gift-title {
    font-family: '辰宇落雁體', serif;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #8b4513;
}

#dream-gift-page .gift-title {
    color: #4b0082;
}

.gift-description {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
}

.gift-blessing {
    font-family: '辰宇落雁體', serif;
    font-size: 1.1rem;
    color: #8b4513;
    font-style: italic;
    opacity: 0.8;
}

#dream-gift-page .gift-blessing {
    color: #f4e4bc;
    text-shadow: 
        0 0 10px rgba(244, 228, 188, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

/* 贊助金額樣式 */
.sponsorship-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin: 1.5rem 0;
    font-family: 'Arial', sans-serif;
}

.currency-symbol {
    font-size: 1.5rem;
    color: #d4af37;
    font-weight: bold;
    margin-right: 0.3rem;
}

.amount-counter {
    font-size: 3rem;
    font-weight: bold;
    color: #d4af37;
    min-width: 200px;
    text-align: center;
    font-family: 'Arial', 'Microsoft JhengHei', sans-serif;
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.8),
        0 0 20px rgba(212, 175, 55, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.3);
    animation: amountGlow 2s ease-in-out infinite alternate;
}

@keyframes amountGlow {
    from {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    }
    to {
        text-shadow: 0 0 30px rgba(212, 175, 55, 1), 0 0 40px rgba(212, 175, 55, 0.8);
    }
}

/* 數字跳動動畫 */
@keyframes countUp {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.amount-counter.counting {
    animation: countUp 0.3s ease-in-out;
}

/* Ending 頁面樣式 */
#ending-page {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    position: relative;
    overflow: hidden;
}

.ending-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
    padding: 2rem;
}

.ending-image {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-img {
    max-height: 70vh;
    width: auto;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.end-img:hover {
    transform: scale(1.02);
}

.ending-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ending-message {
    font-family: '辰宇落雁體', serif;
    font-size: 3.5rem;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
    animation: fadeInUp 2s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .ending-container {
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;
    }
    
    .end-img {
        max-height: 50vh;
        max-width: 90vw;
    }
    
    .ending-message {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .ending-message {
        font-size: 2rem;
    }
    
    .end-img {
        max-height: 40vh;
    }
}

/* 頁面過場動畫效果 */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s ease-in-out;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

.transition-content {
    text-align: center;
    color: white;
}

.transition-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulseTransition 1s infinite;
}

.transition-text {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
}

@keyframes pulseTransition {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* 頁面滑動效果 */
.page {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s ease;
}

.page.slide-out-up {
    transform: translateY(-100vh);
    opacity: 0;
}

.page.slide-in-down {
    transform: translateY(100vh);
    opacity: 0;
}

.page.slide-in-active {
    transform: translateY(0);
    opacity: 1;
}

/* 滑動指示器 */
.scroll-indicator {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scroll-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.scroll-dot.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.scroll-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.scroll-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.scroll-dot.active::after {
    opacity: 1;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes heartbeat {
    0% {
        transform: rotate(-45deg) scale(1);
    }
    50% {
        transform: rotate(-45deg) scale(1.1);
    }
    100% {
        transform: rotate(-45deg) scale(1);
    }
}

/* 新增動畫效果 */
@keyframes glow {
    from {
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 15px #ff6b6b,
            0 0 20px #ff6b6b,
            0 0 35px #ff6b6b,
            0 0 40px #ff6b6b;
    }
    to {
        text-shadow: 
            0 0 2px #fff,
            0 0 5px #fff,
            0 0 8px #ff6b6b,
            0 0 12px #ff6b6b,
            0 0 18px #ff6b6b,
            0 0 25px #ff6b6b;
    }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: white }
}

@keyframes float {
    0%, 100% {
        transform: perspective(1000px) rotateX(5deg) translateY(0px);
    }
    50% {
        transform: perspective(1000px) rotateX(5deg) translateY(-10px);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes float-heart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes float-star {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(180deg) scale(0);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255,107,107,0.4);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 煙花效果 */
.firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
    animation: firework-explosion 1.5s ease-out forwards;
    z-index: 1000;
}

@keyframes firework-explosion {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1) translate(var(--dx, 0), var(--dy, 0));
        opacity: 0;
    }
}

/* 彈跳進入動畫 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.9) translateY(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0px);
    }
}

/* 滑入動畫 */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 漸變背景動畫 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 增強頁面背景 */
#welcome-page {
    background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

#memory-page {
    background: linear-gradient(-45deg, #ffecd2, #fcb69f, #ffecd2, #fcb69f);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

#blessing-page {
    background: linear-gradient(-45deg, #a8edea, #fed6e3, #a8edea, #fed6e3);
    background-size: 400% 400%;
    animation: gradientShift 18s ease infinite;
}

#gift-page {
    background: linear-gradient(-45deg, #ff9a9e, #fad0c4, #ff9a9e, #fad0c4);
    background-size: 400% 400%;
    animation: gradientShift 22s ease infinite;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .welcome-text {
        font-size: 1.4rem;
    }
    
    .memory-item {
        flex-direction: column !important;
        text-align: center;
    }
    
    .memory-text {
        text-align: center !important;
    }
    
    .blessing-card {
        padding: 2rem;
    }
    
    .gifts-container {
        flex-direction: column;
        align-items: center;
    }
    
    .page {
        padding: 1rem;
    }
}
