/* ========== 恋爱日记前端样式 ========== */
:root {
    --primary: #ff6b81;
    --primary-dark: #ee5a6f;
    --primary-light: #ff8fa3;
    --primary-bg: #fff0f3;
    --gradient-1: linear-gradient(135deg, #ff6b81 0%, #ff9ff3 50%, #feca57 100%);
    --gradient-2: linear-gradient(135deg, #a29bfe 0%, #fd79a8 100%);
    --gradient-3: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg: #fef9fb;
    --white: #fff;
    --text: #2d3436;
    --text-light: #636e72;
    --card-shadow: 0 4px 24px rgba(255,107,129,0.1);
    --card-shadow-hover: 0 8px 32px rgba(255,107,129,0.2);
    --radius: 16px;
    --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

/* ========== 导航栏 ========== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,107,129,0.1);
    transition: all 0.3s;
}

.navbar.scrolled { box-shadow: 0 2px 20px rgba(255,107,129,0.1); }

.nav-container {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px;
}

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand .logo { font-size: 28px; }
.nav-brand h1 { font-size: 18px; background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
    padding: 6px 14px; border-radius: 20px; font-size: 14px; color: var(--text-light);
    transition: all 0.3s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
    background: var(--primary-bg); color: var(--primary);
}

.mobile-menu-btn {
    display: none; background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--text);
}

/* ========== Hero区域 ========== */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--gradient-1); position: relative; overflow: hidden;
    padding: 80px 24px 40px;
}

.hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative; text-align: center; color: var(--white);
    animation: fadeInUp 1s ease;
}

.hero-avatars {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    margin-bottom: 24px;
}

.hero-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.6);
    object-fit: cover; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center; font-size: 36px;
}

.hero-heart {
    font-size: 32px; animation: heartbeat 1.5s ease infinite;
}

.hero-content h1 {
    font-size: clamp(28px, 6vw, 48px); font-weight: 700; margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-names {
    font-size: clamp(18px, 4vw, 28px); margin-bottom: 16px;
    opacity: 0.95;
}

.hero-counter {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
    padding: 12px 28px; border-radius: 50px;
    font-size: clamp(16px, 3vw, 22px); font-weight: 600;
    margin-bottom: 20px;
}

.hero-counter .number {
    font-size: clamp(28px, 5vw, 42px);
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.hero-story {
    max-width: 500px; margin: 0 auto; font-size: 15px;
    opacity: 0.85; line-height: 1.8;
}

.scroll-hint {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    animation: bounce 2s infinite; color: rgba(255,255,255,0.7);
    font-size: 24px;
}

/* ========== 内容容器 ========== */
.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

.section {
    padding: 60px 0;
}

.section-header {
    text-align: center; margin-bottom: 40px;
}

.section-header h2 {
    font-size: clamp(22px, 4vw, 30px); margin-bottom: 8px;
    background: var(--gradient-3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.section-header p { color: var(--text-light); font-size: 15px; }

.section-divider {
    width: 40px; height: 3px; background: var(--gradient-1);
    margin: 12px auto 0; border-radius: 2px;
}

/* ========== 时间线 ========== */
.timeline-container { position: relative; padding: 20px 0; }

.timeline-line {
    position: absolute; left: 50%; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, var(--primary-light), var(--primary));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative; display: flex; margin-bottom: 40px;
    animation: fadeInUp 0.6s ease;
}

.timeline-item:nth-child(odd) { flex-direction: row; padding-right: calc(50% + 30px); text-align: right; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; padding-left: calc(50% + 30px); }

.timeline-dot {
    position: absolute; left: 50%; top: 20px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--white); border: 3px solid var(--primary);
    transform: translateX(-50%); z-index: 1;
}

.timeline-dot .icon {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    font-size: 24px; white-space: nowrap;
}

.timeline-card {
    background: var(--white); border-radius: var(--radius-sm);
    padding: 20px; box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s; width: 100%;
}

.timeline-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }

.timeline-date {
    font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 6px;
}

.timeline-card h3 { font-size: 16px; margin-bottom: 6px; }

.timeline-card p { font-size: 14px; color: var(--text-light); line-height: 1.6; }

.timeline-images {
    display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap;
}
.timeline-images img {
    width: 80px; height: 80px; object-fit: cover; border-radius: 8px;
}

/* ========== 相册 ========== */
.album-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.album-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--card-shadow);
    cursor: pointer; transition: all 0.3s;
}

.album-card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-hover); }

.album-cover {
    width: 100%; height: 200px; object-fit: cover;
    background: linear-gradient(135deg, #ffe0e6, #fff0f3);
    display: flex; align-items: center; justify-content: center; font-size: 48px;
}

.album-info { padding: 16px; }
.album-info h3 { font-size: 15px; margin-bottom: 4px; }
.album-info p { font-size: 13px; color: var(--text-light); }

/* ========== 照片灯箱 ========== */
.lightbox {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9); z-index: 200; display: none;
    align-items: center; justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 32px; cursor: pointer; background: none; border: none; }
.lightbox-nav { position: absolute; top: 50%; color: #fff; font-size: 36px; cursor: pointer; background: rgba(0,0,0,0.5); border: none; padding: 10px 16px; border-radius: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ========== 日记 ========== */
.diary-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.diary-card {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--card-shadow);
    transition: all 0.3s; cursor: pointer;
    border-left: 4px solid var(--primary);
}

.diary-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }

.diary-meta {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
    font-size: 13px; color: var(--text-light);
}

.diary-card h3 { font-size: 16px; margin-bottom: 8px; }

.diary-excerpt {
    font-size: 14px; color: var(--text-light); line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.diary-images {
    display: flex; gap: 6px; margin-top: 12px; overflow: hidden;
}
.diary-images img {
    width: 60px; height: 60px; object-fit: cover; border-radius: 6px;
}

/* 日记详情模态 */
.diary-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 200; display: none;
    align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(5px);
}
.diary-modal.active { display: flex; }
.diary-modal-content {
    background: var(--white); border-radius: var(--radius);
    max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto;
    padding: 32px; animation: fadeInUp 0.3s ease;
}
.diary-modal-content h2 { margin-bottom: 12px; }
.diary-modal-content .diary-meta { margin-bottom: 16px; }
.diary-modal-content .diary-body { line-height: 1.8; font-size: 15px; }
.diary-modal-close { float: right; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ========== 纪念日 ========== */
.anniversary-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.anniversary-card {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--card-shadow);
    text-align: center; transition: all 0.3s;
}

.anniversary-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }

.anniversary-icon { font-size: 40px; margin-bottom: 10px; }
.anniversary-card h3 { font-size: 16px; margin-bottom: 6px; }
.anniversary-date { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }

.anniversary-countdown {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--primary-bg); color: var(--primary);
    padding: 6px 16px; border-radius: 20px; font-size: 14px; font-weight: 600;
}

.anniversary-passed {
    background: #e0fce8; color: #27ae60;
}

/* ========== 情话墙 ========== */
.lovewords-container {
    columns: 2; column-gap: 16px;
}

.loveword-card {
    break-inside: avoid; background: var(--white); border-radius: var(--radius-sm);
    padding: 20px; margin-bottom: 16px; box-shadow: var(--card-shadow);
    transition: all 0.3s; position: relative; overflow: hidden;
}

.loveword-card::before {
    content: '"'; position: absolute; top: -10px; left: 10px;
    font-size: 60px; color: var(--primary-bg); font-family: serif;
}

.loveword-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }

.loveword-text { font-size: 15px; line-height: 1.8; position: relative; z-index: 1; }
.loveword-author { font-size: 13px; color: var(--text-light); margin-top: 8px; text-align: right; }

/* ========== 恋爱打卡 ========== */
.checkin-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.checkin-card {
    background: var(--white); border-radius: var(--radius-sm);
    padding: 20px; box-shadow: var(--card-shadow);
    text-align: center; transition: all 0.3s;
    position: relative;
}

.checkin-card.completed { border: 2px solid #27ae60; }
.checkin-card.completed::after {
    content: '✓'; position: absolute; top: 8px; right: 12px;
    color: #27ae60; font-size: 20px; font-weight: bold;
}

.checkin-icon { font-size: 32px; margin-bottom: 8px; }
.checkin-card h4 { font-size: 14px; }
.checkin-date { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ========== 视频合集 ========== */
.video-collection-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-collection-card {
    background: var(--white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--card-shadow);
    transition: all 0.3s; cursor: pointer;
}

.video-collection-card:hover { transform: translateY(-6px); box-shadow: var(--card-shadow-hover); }

.vc-cover {
    width: 100%; height: 180px; object-fit: cover;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

.vc-cover .play-icon {
    width: 50px; height: 50px; background: rgba(255,255,255,0.9);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--primary);
}

.vc-info { padding: 16px; }
.vc-info h3 { font-size: 15px; margin-bottom: 4px; }
.vc-info p { font-size: 13px; color: var(--text-light); }

/* 视频播放模态 */
.video-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 200; display: none;
    align-items: center; justify-content: center; padding: 20px;
}
.video-modal.active { display: flex; }
.video-modal-content {
    max-width: 900px; width: 100%; animation: fadeInUp 0.3s ease;
}
.video-modal-content video {
    width: 100%; border-radius: 8px; max-height: 70vh; background: #000;
}
.video-list {
    display: flex; gap: 8px; margin-top: 16px; overflow-x: auto;
    padding-bottom: 8px;
}
.video-list-item {
    flex-shrink: 0; padding: 8px 16px; background: rgba(255,255,255,0.1);
    border-radius: 8px; color: #fff; font-size: 13px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
}
.video-list-item:hover, .video-list-item.active {
    background: var(--primary); color: #fff;
}
.video-modal-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 32px; cursor: pointer; background: none; border: none; }

/* ========== 页脚 ========== */
.footer {
    text-align: center; padding: 40px 24px;
    color: var(--text-light); font-size: 13px;
}

.footer-hearts { font-size: 20px; margin-bottom: 8px; }

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

.fade-in { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ========== 加载动画 ========== */
.loading {
    display: flex; align-items: center; justify-content: center;
    padding: 40px; color: var(--text-light);
}

.loading-hearts span {
    display: inline-block; font-size: 20px; animation: heartbeat 1.5s ease infinite;
}
.loading-hearts span:nth-child(2) { animation-delay: 0.3s; }
.loading-hearts span:nth-child(3) { animation-delay: 0.6s; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-links { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(255,255,255,0.98); flex-direction: column;
        align-items: center; justify-content: center; gap: 16px; z-index: 99;
    }
    .nav-links.open { display: flex; }
    .nav-links a { font-size: 18px; padding: 10px 24px; }
    .mobile-menu-btn { display: block; z-index: 100; }
    
    .hero { min-height: 90vh; }
    .hero-avatar { width: 60px; height: 60px; font-size: 28px; }
    
    .timeline-line { left: 20px; }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: row; padding-left: 48px; padding-right: 0; text-align: left;
    }
    .timeline-dot { left: 20px; }
    
    .lovewords-container { columns: 1; }
    
    .diary-grid { grid-template-columns: 1fr; }
    .anniversary-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .checkin-grid { grid-template-columns: repeat(2, 1fr); }
    .video-collection-grid { grid-template-columns: 1fr; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    
    .section { padding: 40px 0; }
}

@media (max-width: 480px) {
    .nav-container { padding: 10px 16px; }
    .container { padding: 0 16px; }
    .hero-counter { padding: 10px 20px; }
    .checkin-grid { grid-template-columns: 1fr 1fr; }
    .album-grid { grid-template-columns: 1fr 1fr; }
    .album-cover { height: 140px; }
}

/* ========== 回到顶部 ========== */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; z-index: 90;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    font-size: 20px; cursor: pointer; box-shadow: 0 4px 12px rgba(255,107,129,0.3);
    display: none; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.back-to-top.visible { display: flex; }
.back-to-top:hover { transform: translateY(-2px); background: var(--primary-dark); }
