/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 确保主容器在模态窗口流程完成前完全隐藏 */
.container {
    display: none;
    opacity: 0;
    transition: opacity 1s ease;
}

body {
    font-family: 'Noto Serif SC', serif;
    background-color: #fff5f5;
    color: #4a4a4a;
    line-height: 1.6;
    background-image: linear-gradient(to bottom, #fff5f5, #ffecec);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff5f5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader .heart {
    position: relative;
    width: 50px;
    height: 45px;
    margin-bottom: 20px;
}

.loader .heart:before,
.loader .heart:after {
    content: "";
    position: absolute;
    left: 25px;
    top: 0;
    width: 25px;
    height: 40px;
    background: #ff6b6b;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
    animation: pulse 1s infinite alternate;
}

.loader .heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
    animation-delay: 0.3s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(-45deg);
    }
}

/* 导航样式 */
.nav {
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
    overflow: hidden;
}

.nav ul {
    display: flex;
    list-style: none;
    justify-content: space-around;
    padding: 0;
}

.nav li {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    color: #666;
    flex: 1;
}

.nav li i {
    margin-right: 5px;
    color: #ff6b6b;
}

.nav li:hover {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.nav li.active {
    background-color: #ff6b6b;
    color: white;
}

.nav li.active i {
    color: white;
}

/* 内容区域样式 */
.content {
    position: relative;
    min-height: 500px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.15);
    overflow: hidden;
    margin-bottom: 30px;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow-y: auto;
    max-height: 800px;
    transform: translateX(30px);
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #ff6b6b;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5em;
    position: relative;
}

h1:after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background-color: #ff6b6b;
    margin: 10px auto;
}

/* 爱的道歉页面 */
.letter {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.letter p {
    margin-bottom: 15px;
    font-size: 18px;
    line-height: 1.8;
}

.letter .signature {
    text-align: right;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 24px;
    color: #ff6b6b;
    margin-top: 30px;
}

.heart-container {
    position: relative;
    height: 100px;
}

.floating-heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    transform: rotate(45deg);
    opacity: 0.7;
}

.floating-heart:before,
.floating-heart:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.floating-heart:before {
    top: -10px;
    left: 0;
}

.floating-heart:after {
    top: 0;
    left: -10px;
}

.floating-heart:nth-child(1) {
    left: 10%;
    animation: float 10s infinite ease-in-out;
}

.floating-heart:nth-child(2) {
    left: 50%;
    animation: float 12s infinite ease-in-out 1s;
}

.floating-heart:nth-child(3) {
    left: 80%;
    animation: float 8s infinite ease-in-out 2s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(45deg);
    }
    50% {
        transform: translateY(-50px) rotate(45deg);
    }
    100% {
        transform: translateY(0) rotate(45deg);
    }
}

/* 美好回忆页面 */
.gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.note {
    font-style: italic;
    text-align: center;
    color: #999;
    margin-bottom: 20px;
}

.photo-placeholder {
    width: 100%;
    max-width: 500px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #aaa;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-placeholder:hover {
    background-color: #f5f5f5;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.placeholder-img {
    width: 100%;
    height: auto;
    max-width: 400px;
    margin-bottom: 15px;
}

.photo-placeholder p {
    text-align: center;
    font-size: 16px;
    color: #999;
}

/* 照片库样式 - 用于添加照片后的展示 */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.photo {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.photo:hover {
    transform: scale(1.03);
}

.photo img {
    width: 100%;
    height: auto;
    display: block;
}

.memory-text {
    width: 100%;
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.memory-text h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 22px;
}

.memory-text p {
    margin-bottom: 10px;
}

/* 爱的承诺页面 */
.promise-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.promise {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.promise:hover {
    transform: translateY(-5px);
}

.promise i {
    font-size: 30px;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.promise h3 {
    margin-bottom: 10px;
    color: #ff6b6b;
}

.love-quote {
    text-align: center;
    margin-top: 30px;
    font-size: 20px;
    font-style: italic;
    color: #888;
}

/* 互动惊喜页面 */
.surprise-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.message-generator,
.interactive-heart {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
}

.message-generator h3,
.interactive-heart h3 {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.message-box {
    min-height: 120px;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.message-box:before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 40px;
    color: #ff6b6b;
    opacity: 0.2;
    font-family: 'Ma Shan Zheng', cursive;
}

.message-box:after {
    content: '"';
    position: absolute;
    bottom: 0;
    right: 15px;
    font-size: 40px;
    color: #ff6b6b;
    opacity: 0.2;
    font-family: 'Ma Shan Zheng', cursive;
}

.message-box p {
    font-size: 18px;
    line-height: 1.5;
    color: #666;
    position: relative;
    z-index: 1;
}

.heart-game {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.big-heart {
    position: relative;
    width: 100px;
    height: 90px;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.big-heart:before,
.big-heart:after {
    content: "";
    position: absolute;
    left: 50px;
    top: 0;
    width: 50px;
    height: 80px;
    background: #ff6b6b;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
    transition: background-color 0.3s ease;
}

.big-heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.big-heart:hover {
    transform: scale(1.1);
}

.big-heart.pulse:before,
.big-heart.pulse:after {
    animation: heart-pulse 0.8s infinite alternate;
}

@keyframes heart-pulse {
    0% {
        background-color: #ff6b6b;
    }
    100% {
        background-color: #ff3d3d;
    }
}

.big-heart span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
}

/* 音乐控制 */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#music-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ff6b6b;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

#music-toggle:hover {
    transform: scale(1.1);
}

#music-toggle .fa-volume-mute {
    display: none;
}

#music-toggle.muted .fa-music {
    display: none;
}

#music-toggle.muted .fa-volume-mute {
    display: block;
}

/* 音乐提示文本 */
.music-tooltip {
    background-color: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    position: absolute;
    bottom: 60px;
    right: 0;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.music-tooltip:after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 107, 107, 0.9);
}

/* 当音乐按钮有闪烁提示时显示提示文本 */
#music-toggle.attention + .music-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 鼠标悬停在音乐按钮上时也显示提示文本 */
#music-toggle:hover + .music-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 音乐控制增强样式 */
#music-toggle.attention-highlight {
    animation: attention-pulse 1.5s infinite;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
    background-color: #f1c40f;
    transform: scale(1.2);
}

#music-toggle.attention-highlight .fa-music {
    color: #8e44ad;
}

@keyframes attention-pulse {
    0% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); }
    50% { box-shadow: 0 0 25px rgba(241, 196, 15, 0.9); }
    100% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); }
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
    }
    
    .nav li {
        padding: 10px;
        border-bottom: 1px solid #f1f1f1;
    }
    
    .nav li:last-child {
        border-bottom: none;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .letter p {
        font-size: 16px;
    }
    
    .promise-container,
    .surprise-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 15px;
    }
    
    .page {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .letter {
        padding: 15px;
    }
}

/* 照片轮播组件样式 */
.photo-carousel {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 宽高比 */
    background-color: #000;
    overflow: hidden;
}

.carousel-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.6);
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.7;
}

.carousel-nav:hover {
    background-color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

.carousel-controls {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
    z-index: 10;
}

.play-pause-btn {
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.play-pause-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.photo-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.carousel-progress {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #ff6b6b;
    transition: width 0.3s ease;
}

.loading-photos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 轮播触摸滑动样式 */
.carousel-track.dragging {
    cursor: grabbing;
}

/* 轮播响应式调整 */
@media (max-width: 768px) {
    .carousel-container {
        padding-bottom: 85%; /* 移动设备上更高一些 */
    }
    
    .carousel-nav {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .carousel-controls {
        bottom: 40px;
    }
    
    .carousel-progress {
        bottom: 15px;
    }
}

/* 隐藏的小作文样式 */
.hidden-diary {
    display: none;
    background-color: #fff8f8;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(255, 105, 105, 0.2);
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    border-left: 5px solid #ff6b6b;
}

.hidden-diary.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.hidden-diary h4 {
    color: #ff6b6b;
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
}

.hidden-diary .unlock-message {
    font-weight: bold;
    color: #ff9a9e;
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}

.hidden-diary p {
    line-height: 1.8;
    color: #666;
    text-indent: 2em;
    margin-bottom: 10px;
}

/* 点击提示样式 */
.click-hint {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    animation: pulse 2s infinite;
}

.hint-progress {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 10px auto;
    width: 80%;
    max-width: 200px;
    overflow: hidden;
}

.hint-progress-bar {
    height: 100%;
    background-color: #ff6b6b;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 心形动画修改 */
.big-heart {
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.big-heart:active {
    transform: scale(0.9);
}

.big-heart.unlock-animation {
    animation: heart-unlock 1.5s ease;
}

@keyframes heart-unlock {
    0% { transform: scale(1); }
    20% { transform: scale(1.5); }
    40% { transform: rotate(-20deg) scale(1.5); }
    60% { transform: rotate(20deg) scale(1.5); }
    80% { transform: rotate(0) scale(1.5); }
    100% { transform: scale(1); }
}

/* 特殊消息样式优化 */
.special-message {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: opacity 0.5s;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 音乐按钮移动设备优化 */
#music-toggle.mobile {
    width: 50px;
    height: 50px;
    bottom: 30px;
    right: 30px;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    animation: attention-pulse 2s infinite;
    z-index: 1000;
}

#music-toggle.mobile:after {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    background: transparent;
    border: 2px solid rgba(255, 107, 107, 0.5);
    border-radius: 50%;
    top: -10px;
    left: -10px;
    animation: ripple 1.5s infinite;
}

.music-tooltip {
    transition: opacity 0.3s ease;
    z-index: 999;
}

/* 加强音乐提示动画 */
@keyframes mobile-music-attention {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 107, 107, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
} 