/* ===== CSS 重置和基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 高级配色 */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --accent-gold: #d4af37;
    --accent-light: #f4e4c1;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;

    /* 字体 */
    --font-serif: 'Playfair Display', 'Noto Serif SC', serif;
    --font-sans: 'Inter', -apple-system, sans-serif;

    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== 背景粒子画布 ===== */
/* ===== 雪花背景 ===== */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.2;
    }
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

/* ===== 主容器 ===== */
.container {
    position: relative;
    z-index: 1;
}

/* ===== Section 通用样式 ===== */
.section {
    min-height: 100vh;
    min-height: 100dvh;
    /* 支持动态视口高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
}

.content {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Section 1: 开场 ===== */
.section-intro {
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

/* 圣诞树图标 */
.christmas-tree-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0;
    animation: treeAppear 1.5s ease-out 0.3s both, treeSway 3s ease-in-out 2s infinite;
}

@keyframes treeAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes treeSway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}

.date-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-bottom: var(--spacing-xl);
    font-weight: 300;
    animation: fadeIn 1.5s ease-out 0.5s both;
}

.title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 15vw, 5rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 1s ease-out both;
}

.title-line:nth-child(1) {
    animation-delay: 0.8s;
    font-size: 0.5em;
    color: var(--text-secondary);
}

.title-line:nth-child(2) {
    animation-delay: 1.1s;
}

.title-line.highlight {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.subtitle {
    font-size: clamp(0.875rem, 3vw, 1.125rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s both;
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0;
    animation: fadeInBounce 1.5s ease-out 2s both;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--accent-gold));
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

/* ===== Section 2: 祝福 ===== */
.section-blessing {
    background: var(--bg-primary);
}

/* Section图标 */
.section-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    animation: iconBounce 1s ease-out 0.5s both, iconFloat 3s ease-in-out 1.5s infinite;
}

@keyframes iconBounce {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }

    50% {
        transform: translateY(10px) scale(1.1);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.blessing-text {
    margin: var(--spacing-2xl) 0;
}

.text-line {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    font-weight: 300;
    line-height: 1.6;
    margin: var(--spacing-sm) 0;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.blessing-text:nth-child(2) .text-line {
    transition-delay: 0.2s;
}

.content.visible .text-line {
    opacity: 1;
    transform: translateY(0);
}

.content.visible .text-line:nth-child(2) {
    transition-delay: 0.15s;
}

.content.visible .blessing-text:nth-child(2) .text-line:nth-child(1) {
    transition-delay: 0.3s;
}

.content.visible .blessing-text:nth-child(2) .text-line:nth-child(2) {
    transition-delay: 0.45s;
}

/* ===== Section 3: 时光 ===== */
.section-time {
    background: var(--bg-secondary);
    position: relative;
}

/* 装饰球 */
.ornament {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: ornamentSwing 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px currentColor);
}

.ornament-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.ornament-2 {
    top: 25%;
    right: 15%;
    animation-delay: 1s;
}

.ornament-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
}

@keyframes ornamentSwing {

    0%,
    100% {
        transform: rotate(-10deg) translateY(0);
    }

    50% {
        transform: rotate(10deg) translateY(-10px);
    }
}

.time-display {
    margin-bottom: var(--spacing-xl);
}

.time-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    margin-bottom: var(--spacing-md);
}

.clock {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 300;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-sm);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.date {
    font-size: clamp(1rem, 4vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
}

.time-message {
    font-size: clamp(0.875rem, 3.5vw, 1rem);
    color: var(--text-muted);
    font-weight: 300;
    font-style: italic;
}

/* ===== Section 4: 心意 ===== */
.section-message {
    background: var(--bg-primary);
}

/* 礼物装饰 */
.gifts-decoration {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s both;
}

.gift-icon {
    font-size: 2rem;
    display: inline-block;
    animation: giftBounce 2s ease-in-out infinite;
}

.gift-icon:nth-child(1) {
    animation-delay: 0s;
}

.gift-icon:nth-child(2) {
    animation-delay: 0.3s;
}

.gift-icon:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes giftBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

.quote-mark {
    font-family: var(--font-serif);
    font-size: 4rem;
    color: var(--accent-gold);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

.quote-mark.closing {
    margin-top: var(--spacing-sm);
    margin-bottom: 0;
    transform: rotate(180deg);
}

.message-content {
    padding: var(--spacing-lg) 0;
}

.message-content p {
    font-size: clamp(1.125rem, 4.5vw, 1.5rem);
    font-weight: 300;
    margin: var(--spacing-sm) 0;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.content.visible .message-content p {
    opacity: 1;
    transform: translateY(0);
}

.content.visible .message-content p:nth-child(1) {
    transition-delay: 0.1s;
}

.content.visible .message-content p:nth-child(2) {
    transition-delay: 0.2s;
}

.content.visible .message-content p:nth-child(3) {
    transition-delay: 0.3s;
}

.content.visible .message-content p:nth-child(4) {
    transition-delay: 0.4s;
}

.content.visible .message-content p:nth-child(5) {
    transition-delay: 0.5s;
}

.content.visible .message-content p:nth-child(6) {
    transition-delay: 0.6s;
}

.message-highlight {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
    color: var(--accent-gold) !important;
    font-weight: 400 !important;
    margin: var(--spacing-md) 0 !important;
}

/* ===== Section 5: 结尾 ===== */
.section-ending {
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

/* 铃铛装饰 */
.bells-decoration {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s both, bellRing 2s ease-in-out 1.5s infinite;
    letter-spacing: var(--spacing-sm);
}

@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-15deg);
    }

    20%,
    40% {
        transform: rotate(15deg);
    }
}

.snowflake {
    font-size: 3rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    animation: floatSnowflake 3s ease-in-out infinite;
}

.ending-message {
    margin: var(--spacing-xl) 0;
}

.wish {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: var(--spacing-md);
    color: var(--accent-light);
}

.wish-detail {
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 300;
    margin: var(--spacing-sm) 0;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.content.visible .wish-detail {
    opacity: 1;
    transform: translateX(0);
}

.content.visible .wish-detail:nth-child(2) {
    transition-delay: 0.1s;
}

.content.visible .wish-detail:nth-child(3) {
    transition-delay: 0.2s;
}

.content.visible .wish-detail:nth-child(4) {
    transition-delay: 0.3s;
}

.content.visible .wish-detail:nth-child(5) {
    transition-delay: 0.4s;
}

.signature {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.signature-line {
    width: 60px;
    height: 1px;
    background: var(--accent-gold);
}

.signature-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    font-weight: 300;
}

/* ===== 动画关键帧 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(1);
    }

    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

@keyframes floatSnowflake {

    0%,
    100% {
        opacity: 0.6;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* ===== 响应式优化 ===== */
@media (min-width: 768px) {
    .section {
        padding: var(--spacing-2xl);
    }
}

/* 横屏提示（可选） */
@media (orientation: landscape) and (max-height: 500px) {
    body::before {
        content: '建议竖屏浏览以获得最佳体验';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: var(--bg-secondary);
        padding: var(--spacing-md) var(--spacing-lg);
        border-radius: 8px;
        z-index: 9999;
        font-size: 0.875rem;
        color: var(--text-secondary);
        text-align: center;
    }
}

/* ===== 触摸优化 ===== */
@media (hover: none) and (pointer: coarse) {
    .section {
        scroll-snap-align: start;
    }

    .container {
        scroll-snap-type: y mandatory;
    }
}