:root {
    --pastel-blue: #e3f2fd;
    --pastel-pink: #fce4ec;
    --accent-blue: #90caf9;
    --accent-pink: #f48fb1;
    --text-color: #5d4037;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Serif SC', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #fce4ec 50%, #f3e5f5 100%);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sparkles for dreamy effect */
.sparkle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
    animation: twinkle var(--duration) ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes twinkle {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0.8; }
}

/* ✅ Floating Hearts (Pure CSS Heart Shape) */
.heart-particle {
    position: absolute;
    top: 0; /* 配合 translateY(110vh) 从底部升起 */
    left: 50%;
    width: var(--size, 16px);
    height: var(--size, 16px);
    background: var(--accent-pink);
    opacity: var(--opacity, 0.6);
    pointer-events: none;
    transform: translate3d(-50%, 110vh, 0) rotate(45deg);
    animation: rise var(--duration, 8s) linear infinite;
    filter: drop-shadow(0 6px 10px rgba(244, 143, 177, 0.18));
    will-change: transform, opacity;
    border-radius: 4px; /* 让转角更圆润一点 */
}

/* 两个圆拼成心形上半部分 */
.heart-particle::before,
.heart-particle::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
}

.heart-particle::before {
    top: -50%;
    left: 0;
}

.heart-particle::after {
    top: 0;
    left: -50%;
}

/* ✅ 更像“飘起”的心：不再 360° 乱转，只做轻微漂移 */
@keyframes rise {
    0% {
        transform: translate3d(-50%, 110vh, 0) rotate(45deg) scale(0.75);
        opacity: 0;
    }
    12% {
        opacity: var(--opacity, 0.6);
    }
    100% {
        transform: translate3d(calc(-50% + var(--drift, 0px)), -15vh, 0) rotate(45deg) scale(1.1);
        opacity: 0;
    }
}

/* Background Decorations */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    border: 30px solid transparent;
    border-image: radial-gradient(var(--accent-pink) 20%, transparent 80%) 30;
}

.flower {
    position: absolute;
    width: 180px;
    height: 180px;
    opacity: 0.8;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
    animation: float 8s ease-in-out infinite;
}

.flower-1 { top: -20px; left: -20px; transform: rotate(-10deg); }
.flower-2 { top: -20px; right: -20px; transform: rotate(10deg); }
.flower-3 { bottom: -20px; left: -20px; transform: rotate(-170deg); }
.flower-4 { bottom: -20px; right: -20px; transform: rotate(170deg); }
.flower-5 { top: 50%; left: -50px; transform: translateY(-50%) rotate(-90deg); width: 120px; }
.flower-6 { top: 50%; right: -50px; transform: translateY(-50%) rotate(90deg); width: 120px; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(var(--rot, 0deg)); }
    33% { transform: translate(10px, -10px) rotate(calc(var(--rot, 0deg) + 5deg)); }
    66% { transform: translate(-5px, 15px) rotate(calc(var(--rot, 0deg) - 3deg)); }
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 90%;
    width: 500px;
}

/* App Sections */
#app {
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

section {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    animation: fadeIn 1s ease-out;
}

section.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Typography */
.title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--accent-pink);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.love-text {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--accent-pink);
}

/* Buttons */
.primary-btn {
    background: linear-gradient(45deg, var(--accent-pink), var(--accent-blue));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(244, 143, 177, 0.3);
}

.primary-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(244, 143, 177, 0.5);
}

/* Gallery & Story */
.gallery-container {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow: hidden;
}

.photo-viewer {
    position: relative;
    width: 80%;
    max-width: 600px;
    height: 70%;
    perspective: 1000px;
}

.photo-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    padding: 15px 15px 60px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: rotateY(90deg) translateZ(100px);
}

.photo-card.active {
    opacity: 1;
    transform: rotateY(0) translateZ(0);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.photo-card .caption {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: #8d6e63;
    padding: 0 10px;
}

/* Chat Box */
.chat-box {
    margin-bottom: 5vh;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 150px;
    justify-content: center;
}

#ai-avatar {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.typing-text {
    font-size: 1.1rem;
    line-height: 1.6;
    min-height: 1.6em;
}

.next-btn {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.next-btn:hover {
    background: var(--accent-pink);
    color: white;
}

.hidden { display: none; }
