@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&family=Montserrat:wght@300;400;600&display=swap');

:root {
    --primary-color: #ff6b88;
    --secondary-color: #a12c5a;
    --background-color: #fff9fb;
    --text-color: #333;
    --accent-color: #ffd1dc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M50 25L40 40 25 45 40 55 35 70 50 60 65 70 60 55 75 45 60 40z" stroke="%23ffd1dc" fill="none" stroke-width="1" opacity="0.3"/></svg>');
    background-size: 100px 100px;
    position: relative;
    padding-bottom: 3rem;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header::before, header::after {
    content: "♥";
    position: absolute;
    font-size: 8rem;
    opacity: 0.1;
    color: white;
}

header::before {
    top: -2rem;
    left: 10%;
}

header::after {
    bottom: -2rem;
    right: 10%;
}

main {
    /* max-width: 900px; */
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 3rem;
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
}

section::after {
    content: "♥";
    position: absolute;
    bottom: -10px;
    right: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

h2 {
    font-family: 'Dancing Script', cursive;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
    position: relative;
}

h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--accent-color);
    margin: 0.5rem auto;
}

.introduction p {
    font-size: 1.2rem;
    text-align: center;
    font-style: italic;
    color: var(--primary-color);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

.photos {
    text-align: center;
    padding: 2rem;
    width: 100vw;
}

.photos img {
    width: 600px;
    height: 600px;
    object-fit: cover;
    margin: 1rem;
    border-radius: 50%;
    border: 5px solid var(--accent-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.photos img:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.message {
    text-align: center;
    background-color: rgba(255, 107, 136, 0.05);
}

.message p {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.links {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.links a {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(161, 44, 90, 0.3);
}

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 添加响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .photos img {
        width: 200px;
        height: 200px;
        margin: 0.5rem;
    }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

/* 添加到之前的CSS文件底部 */

.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 4px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(odd)::after {
    right: -14px;
}

.timeline-item:nth-child(even)::after {
    left: -14px;
}

.timeline-item .date {
    color: var(--primary-color);
    font-weight: bold;
}

.timeline-item .event {
    margin-top: 5px;
    font-style: italic;
}

.photo-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.highlight {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
}

.promise-content {
    background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0.7)), 
                url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M20 10L16 16 10 18 16 22 14 28 20 24 26 28 24 22 30 18 24 16z" fill="%23ffd1dc" opacity="0.3"/></svg>');
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
}

.promise-content p {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.promise-content p::before {
    content: "❤";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .timeline::before {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }
    
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 15px;
        right: auto;
    }
}

/* 添加省略号样式 */
.timeline-item.ellipsis {
    text-align: center;
    margin: 30px 0;
}

.timeline-item.ellipsis::after {
    background-color: var(--accent-color);
    border: 2px dashed var(--primary-color);
}

.timeline-item.ellipsis .event {
    font-size: 1.5rem;
    letter-spacing: 5px;
    color: var(--primary-color);
    font-weight: bold;
}

/* 特殊样式用于一周年纪念日 */
.timeline-item.special::after {
    background-color: var(--primary-color);
    border: 4px solid gold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.timeline-item.special .date,
.timeline-item.special .event {
    font-weight: bold;
    color: var(--secondary-color);
}

/* 适配移动端的省略号 */
@media (max-width: 768px) {
    .timeline-item.ellipsis {
        padding-left: 70px;
        text-align: left;
    }
}

/* 照片轮播样式 */
.carousel-container {
    position: relative;
    width: 100%;
    /* max-width: 800px; */
    height: 800px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: rgba(0,0,0,0.05);
    opacity: 0;
    transition: opacity 0.8s ease;
    padding: 10px;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 107, 136, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 0.9;
}

.thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
}

@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
}

/* 移除之前的照片样式，以免冲突 */
.photos .photo-container {
    display: none;
}

/* 轮播图懒加载样式 */
.carousel-item {
    opacity: 0;
    transition: opacity 0.8s ease;
    background-color: rgba(248, 248, 248, 0.1);
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item.loaded {
    background-color: transparent;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: pulse 1.5s infinite;
    z-index: 5;
    transition: opacity 0.3s ease;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
}

.carousel-container {
    position: relative;
}

.carousel-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(248, 248, 248, 0.8);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

.carousel-container.loading::after {
    content: '❤️ 加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

/* 音乐播放器样式 */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.music-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 107, 136, 0.8);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

.music-toggle .music-off {
    display: none;
}

.music-toggle.paused .music-on {
    display: none;
}

.music-toggle.paused .music-off {
    display: block;
}

.music-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse-ring 2s ease infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* 添加播放动画 */
.music-toggle:not(.paused) .music-on {
    animation: beat 1s infinite alternate;
    display: block;
}

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