/* ===== 基础重置与变量 ===== */
:root {
    --primary: #c9a96e;
    --primary-dark: #b08d55;
    --primary-light: #e0c89a;
    --bg: #faf7f2;
    --bg-dark: #f0ebe3;
    --text: #4a4036;
    --text-light: #8a7e72;
    --text-lighter: #b5ada4;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(74, 64, 54, 0.08);
    --shadow: 0 4px 20px rgba(74, 64, 54, 0.12);
    --shadow-lg: 0 8px 40px rgba(74, 64, 54, 0.15);
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

/* ===== 加载动画 ===== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-heart {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    position: relative;
}

.loader-heart::before,
.loader-heart::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 40px;
    background: var(--primary);
    border-radius: 20px 20px 0 0;
    animation: heartbeat 1.2s ease-in-out infinite;
}

.loader-heart::before {
    left: 11px;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.loader-heart::after {
    left: 11px;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.loader p {
    color: var(--text-light);
    font-size: 0.875rem;
    letter-spacing: 2px;
}

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

/* ===== 主内容 ===== */
.main-content {
    transition: opacity 0.8s ease;
    width: 100%;
}

/* ===== Hero 区域 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-dark) 100%);
    width: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0.3;
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease 0.3s both;
    width: 100%;
    max-width: 100%;
    padding: 0 8px;
}

.hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    line-height: 1.5;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-line1 {
    display: block;
    font-size: 1.35rem;
}

.hero-line2 {
    display: block;
    font-size: 2.1rem;
    letter-spacing: 0.5px;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 1px;
    margin-bottom: 48px;
}

.scroll-hint {
    animation: bounce 2s ease-in-out infinite;
}

.scroll-hint span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-lighter);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: rotate(45deg);
}

/* ===== 通用区域标题 ===== */
.section-header {
    text-align: center;
    padding: 48px 20px 32px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.section-header p {
    font-size: 0.875rem;
    color: var(--text-lighter);
}

/* ===== 视频区域 ===== */
.videos-section {
    padding: 0 16px 40px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.videos-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
}

.video-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.video-card:active {
    transform: scale(0.98);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #000;
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--white);
    opacity: 0.5;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.play-button svg {
    width: 24px;
    height: 24px;
    color: var(--primary-dark);
    margin-left: 3px;
}

.video-card:active .play-button {
    transform: translate(-50%, -50%) scale(0.9);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

.video-info {
    padding: 16px;
}

.video-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.video-info p {
    font-size: 0.8125rem;
    color: var(--text-lighter);
}

/* ===== 旅行清单 ===== */
.bucket-list-section {
    padding: 0 16px 40px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.bucket-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

.bucket-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px dashed rgba(201, 169, 110, 0.2);
    transition: background 0.2s ease;
}

.bucket-item:last-child {
    border-bottom: none;
}

.bucket-item:active {
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
}

.bucket-check {
    font-size: 1.25rem;
    color: var(--primary);
    flex-shrink: 0;
}

.bucket-name {
    font-size: 0.9375rem;
    color: var(--text);
    letter-spacing: 0.5px;
}

/* ===== 分隔线 ===== */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 20px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.divider-icon {
    color: var(--primary);
    font-size: 1.25rem;
    opacity: 0.6;
}

/* ===== 信件区域 ===== */
.letter-section {
    padding: 0 16px 60px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.envelope-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    cursor: pointer;
    perspective: 1000px;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #d4a574 0%, #c9956a 100%);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
}

.envelope-front {
    position: absolute;
    inset: 0;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(135deg, #e8b896 0%, #d4a574 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    border-radius: 4px 4px 0 0;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
}

.envelope-pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(135deg, #c9956a 0%, #b8855a 100%);
    clip-path: polygon(0 100%, 100% 100%, 100% 0, 50% 100%, 0 0);
    z-index: 2;
    border-radius: 0 0 4px 4px;
}

.envelope-stamp {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.5rem;
    z-index: 4;
    opacity: 0.8;
}

.envelope-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text);
    letter-spacing: 2px;
    transition: opacity 0.3s ease;
}

.envelope.open .envelope-label {
    opacity: 0;
}

.envelope-letter {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.envelope.open .envelope-letter {
    transform: translateY(-120%);
    z-index: 5;
}

.letter-paper {
    background: var(--white);
    border-radius: 8px;
    padding: 28px 20px;
    box-shadow: var(--shadow);
    min-height: 360px;
    position: relative;
    background-image: 
        linear-gradient(90deg, transparent 0%, transparent 97%, rgba(201, 169, 110, 0.05) 97%),
        repeating-linear-gradient(
            transparent,
            transparent 31px,
            rgba(201, 169, 110, 0.08) 31px,
            rgba(201, 169, 110, 0.08) 32px
        );
    background-size: 100% 100%, 100% 32px;
}

.letter-body {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease 0.8s, visibility 0.6s ease 0.8s;
}

.envelope.open .letter-body {
    opacity: 1;
    visibility: visible;
}

.letter-text-center {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 2.2;
    margin-bottom: 2px;
    text-align: center;
    text-indent: 0;
}

.letter-body-centered {
    text-align: center;
}

.letter-seal {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease 1s, visibility 0.4s ease 1s;
}

.envelope.open .letter-seal {
    opacity: 0.3;
    visibility: visible;
}

/* 信封关闭时，信件内容区域完全隐藏 */
.envelope:not(.open) .envelope-letter {
    opacity: 0;
    pointer-events: none;
}

.envelope.open .envelope-letter {
    opacity: 1;
    pointer-events: auto;
}

.envelope-hint {
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--text-lighter);
    letter-spacing: 1px;
    transition: opacity 0.3s ease;
}

.envelope.open + .envelope-hint {
    opacity: 0;
}

/* ===== 视频模态框 ===== */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 20px;
    z-index: 1;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.video-wrapper {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-lighter);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* ===== 响应式适配 ===== */
@media (min-width: 768px) {
    .hero-title {
        font-size: 2.4rem;
    }
    
    .hero-line1 {
        font-size: 2.4rem;
    }
    
    .hero-line2 {
        font-size: 3.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .envelope {
        width: 360px;
        height: 230px;
    }
    
    .letter-paper {
        padding: 36px 32px;
        min-height: 420px;
    }
    
    .letter-text-center {
        font-size: 1rem;
    }
}

/* 当信封打开后，为信件内容添加点击关闭功能 */
.letter-paper {
    cursor: default;
}

/* 已读状态的信件样式（可选） */
.envelope.read .envelope-back {
    background: linear-gradient(135deg, #c9a0dc 0%, #b08d55 100%);
}
