/* Index页面基础样式 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow-x: hidden;
    overflow-y: hidden;
}

html {
    overflow-x: hidden;
}

/* 主容器 */
.integrated-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* 屏幕基础样式 - 淡出淡入效果 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* 第一屏：封面 */
.screen-1 {
    background: #ee9ca7;
    background: linear-gradient(to bottom right, #ee9ca7 0%, #ee9ca7 100%);
}

.login-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 0;
    height: 400px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.login-title {
    font-size: 40px;
    transition-duration: 1s;
    transition-timing-function: ease-in-out;
    font-weight: 200;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
    color: white;
}

/* 生日快乐文字动画效果 */
.login-title.animate-to-center {
    animation: moveDown 1.5s ease-in-out forwards;
}

@keyframes moveDown {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100px);
    }
}

.login-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: 0;
    background-color: white;
    font-family: 'Microsoft YaHei';
    border: 0;
    padding: 10px 15px;
    color: #ee9ca7;
    border-radius: 3px;
    width: 250px;
    cursor: pointer;
    font-size: 18px;
    transition-duration: 0.25s;
    margin: 0 auto;
    display: block;
}

.login-button:hover {
    background-color: #f5f7f9;
}

/* 第二屏：粒子动画 */
.screen-2 {
    font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #666;
    font-size: 16px;
    line-height: 1.5em;
}

/* 第二屏主题颜色样式 - 使用body--ready类 */
.body--ready {
    background: -webkit-linear-gradient(top, #ee9ca7 0%, #ffdde1 120%);
    background: -moz-linear-gradient(top, #ee9ca7 0%, #ffdde1 120%);
    background: -o-linear-gradient(top, #ee9ca7 0%, #ffdde1 120%);
    background: -ms-linear-gradient(top, #ee9ca7 0%, #ffdde1 120%);
    background: linear-gradient(to top, #ee9ca7 0%, #ffdde1 120%);
}

.animation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* 高DPI设备优化 */
    image-rendering: auto;
    -webkit-image-rendering: auto;
    /* 启用硬件加速 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* 防止模糊 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 优化渲染性能 */
    will-change: transform;
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@font-face {
    font-family: 'BrushUpLife';
    src: url('/fonts/BrushUpLife.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'YangRenDongZhuShiTi-Semibold';
    src: url('/fonts/YRDZSSemibold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* head-text 样式 - 使用最高优先级选择器 */
.screen-4 .memories-container .memory-text .head-text,
.screen-4 .memory-text .head-text,
.memories-container .memory-text .head-text,
.memory-text .head-text,
.head-text,
#headTextContainer,
.memory-text #headTextContainer,
p.head-text,
p#headTextContainer {
    font-family: 'BrushUpLife', cursive !important;
    font-size: 36px !important;
    color: #FFFFFF !important;
    text-align: center !important;
    margin: 20px auto !important;
    max-width: 850px !important;
    padding: 10px !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8) !important;
    line-height: 1.4 !important;
}

/* 第四屏：回忆页面 */
.screen-4 {
    background: #ee9ca7;
    background: -webkit-linear-gradient(top left, #ee9ca7 0%, #ffdde1 100%);
    background: linear-gradient(to bottom right, #ee9ca7 0%, #ffdde1 100%);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 40px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.memories-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* WebKit浏览器滚动条样式 */
.memories-container::-webkit-scrollbar {
    width: 6px;
}

.memories-container::-webkit-scrollbar-track {
    background: transparent;
}

.memories-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    border: none;
}

/* 滚动条悬停效果 */
.memories-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* 第四屏样式 */
.memories-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.timeline.active {
    opacity: 1;
}

.timepoint {
    position: absolute;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.timepoint.active {
    opacity: 1;
}

.timepoint-1 {
    top: 20%;
}

.memory-group {
    text-align: center;
    margin: 0;
}

.memory-box {
    margin: 30px auto;
    max-width: 850px;
    text-align: center;
    padding: 10px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.memory-box.active {
    opacity: 1;
    transform: translateY(0);
}

.memory-triangle {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.memory-triangle.active {
    opacity: 1;
}

/* 文字样式 */
.memory-text {
    text-align: center;
    color: #FFFFFF;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    margin: 50px auto 0 auto;
    max-width: 850px;
    box-sizing: border-box;
}

.memory-text p:not(.head-text) {
    margin: 10px 0;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    font-size: 28px !important;
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    line-height: 1.8;
}

/* text1~text9 容器样式 - 与祝福语字体保持一致，添加阴影效果 */
.memory-content {
    padding: 20px;
    font-family: 'YangRenDongZhuShiTi-Semibold', cursive !important;
    font-size: 24px !important;
    color: #ffffff !important;
    line-height: 1.8;
    text-align: center;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.4) !important;
    margin: 0 auto 50px auto;
    max-width: 850px;
    box-sizing: border-box;
}

/* text1~text9 内的段落样式 */
.memory-content p {
    font-family: 'YangRenDongZhuShiTi-Semibold', cursive !important;
    color: #ffffff !important;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.4) !important;
}

/* 祝福语内容特殊样式 - 毛玻璃效果，与背景融为一体 */
#blessingContent {
    font-family: 'YangRenDongZhuShiTi-Semibold', cursive !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    padding: 20px 30px !important;
    line-height: 2 !important;
}

#blessingContent p {
    font-family: 'YangRenDongZhuShiTi-Semibold', cursive !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    margin: 12px 0 !important;
    letter-spacing: 1px !important;
}

#blessingContent p strong {
    font-weight: bold !important;
    color: #ffffff !important;
    font-size: 1.1em !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.memory-image-container {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 50px auto;
    overflow: visible;
    box-sizing: border-box;
}

/* 最后的图片和祝福语容器之间的空间 */
.memory-group:last-child .memory-image-container {
    margin-bottom: 30px;
}

/* 第四屏图片和祝福语容器样式统一 */
.memory-group-4 {
    width: 100% !important;
    max-width: 850px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.memory-group-4 .memory-box {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.memory-group-4 .memory-image-container,
.memory-group-4 .memory-content-container {
    width: 100% !important;
    max-width: 850px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 确保图片和内容宽度完全一致 */
.memory-image-container, .memory-content-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 确保最后一张图片和祝福语之间有30px间距 */
.memory-group-4 .memory-box-8 .memory-image-container {
    margin-bottom: 30px !important;
}

.memory-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    max-height: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin: 0;
    padding: 0;
}

/* 祝福内容样式 - 毛玻璃效果，与背景融为一体 */
.memory-content-container {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
    text-align: center;
    font-family: 'STKaiti', 'Microsoft YaHei', serif;
    font-size: 26px;
    color: #ffffff;
    box-sizing: border-box;
}

.memory-content-decoration-top,
.memory-content-decoration-bottom {
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto 100%;
    margin: 0 auto 15px auto;
    width: 100%;
    max-width: 600px;
    opacity: 0.6;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="600" height="30" viewBox="0 0 600 30"><path d="M50,15 Q150,5 300,15 Q450,25 550,15" stroke="%23ffffff" stroke-width="1.5" fill="none" stroke-linecap="round"/></svg>');
}

.memory-content-decoration-bottom {
    margin: 15px auto 0 auto;
    transform: rotate(180deg);
}

/* 发送者文本样式 - 与祝福语字体保持一致，添加阴影效果 */
.sender-text {
    font-family: 'YangRenDongZhuShiTi-Semibold', cursive !important;
    color: #ffffff !important;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.4) !important;
    font-size: 28px !important;
    text-align: center;
    margin: 20px 0;
    font-weight: bold;
}

/* 音乐控制 */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: none;
}

/* 音乐控制按钮显示状态 */
.music-control.show {
    display: block;
}

.music-btn {
    width: 50px;
    height: 50px;
    background: rgba(238, 156, 167, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.music-btn:hover {
    background: rgba(238, 156, 167, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.music-btn.playing {
    background: rgba(238, 156, 167, 0.9);
    animation: musicRotate 3s linear infinite;
}

/* 默认主题音乐按钮播放状态 */
.theme-default .music-btn.playing {
    background: rgba(238, 156, 167, 0.9);
}

/* SVG图标样式 */
.music-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* 音乐按钮暂停状态 - 移除旋转动画 */
.music-btn:not(.playing) {
    animation: none;
}

/* 音乐按钮旋转动画 */
@keyframes musicRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 第三屏元素初始隐藏 */
.gif-image,
.blessing-text,
.like-button {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.gif-image.show,
.blessing-text.show,
.like-button.show {
    opacity: 1;
}

/* 响应式设计 - 参考 integrated.css 优化 */
@media (max-width: 768px) {
    /* 统一盒模型 */
    * {
        box-sizing: border-box !important;
    }

    /* 第一屏移动端优化 */
    .login-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        padding: 40px 20px;
        height: auto;
        max-width: 100%;
    }

    .login-title {
        font-size: 30px;
        margin-bottom: 30px;
    }

    .login-button {
        width: 200px;
        font-size: 16px;
    }

    /* 第二屏移动端优化 */
    .screen-2 {
        min-height: 100vh;
        min-width: 100vw;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .animation-canvas {
        /* 移动端Canvas超高清优化 */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        /* 移动端硬件加速 */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        /* 移动端防止模糊 */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* 移动端优化渲染 */
        will-change: transform;
        /* 移动端触摸优化 */
        touch-action: none;
        /* 移动端字体渲染优化 */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* 第四屏移动端优化 - 完全居中布局 */
    .screen-4 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        padding: 20px 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .memories-container {
        width: 100% !important;
        padding: 0 15px !important;
        margin: 0 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .memory-group {
        width: 100% !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 内存盒容器 - 确保与图片宽度一致 */
    .memory-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 内存图片容器 - 作为宽度基准 */
    .memory-image-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 30px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 移动端图片优化 */
    .memory-image {
        width: 100% !important;
        height: auto !important;
        border-radius: 4px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

    /* 内存内容 - 确保文本居中 */
    .memory-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 30px auto !important;
        padding: 15px !important;
        text-align: center !important;
        font-size: 18px !important;
        box-sizing: border-box !important;
    }

    /* 内存文本 - 确保完全居中 */
    .memory-text {
        width: 100% !important;
        max-width: 100% !important;
        margin: 30px auto 0 auto !important;
        padding: 0 15px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .memory-text p:not(.head-text) {
        font-size: 20px !important;
        line-height: 1.6 !important;
    }

    /* head-text 移动端优化 */
    .screen-4 .memories-container .memory-text .head-text,
    .screen-4 .memory-text .head-text,
    .memories-container .memory-text .head-text,
    .memory-text .head-text,
    .head-text,
    #headTextContainer,
    .memory-text #headTextContainer,
    p.head-text,
    p#headTextContainer {
        font-family: 'BrushUpLife', cursive !important;
        font-size: 24px !important;
        padding: 5px !important;
        margin: 15px auto !important;
    }

    /* 第四屏特殊处理 - 确保图片和祝福语容器完全一致 */
    .memory-group-4 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .memory-group-4 .memory-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 确保图片和内容容器宽度完全一致 */
    .memory-group-4 .memory-box-8 .memory-image-container {
        width: calc(100% - 40px) !important;
        max-width: calc(100% - 40px) !important;
        margin: 0 auto 30px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .memory-group-4 .memory-box-9 .memory-content-container {
        width: calc(100% - 40px) !important;
        max-width: calc(100% - 40px) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 祝福语内容容器 */
    .memory-content-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 20px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 祝福语内容 - 核心样式 */
    #blessingContent {
        width: 100% !important;
        max-width: 100% !important;
        margin: 20px auto !important;
        padding: 15px !important;
        text-align: center !important;
        font-size: 18px !important;
        box-sizing: border-box !important;
    }

    /* 装饰元素 - 确保对齐 */
    .memory-content-decoration-top,
    .memory-content-decoration-bottom {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        height: 20px !important;
        box-sizing: border-box !important;
    }

    /* 发送者文本样式 */
    .sender-text {
        font-size: 20px !important;
        margin: 15px 0 !important;
    }

    /* 最后的图片和祝福语容器之间的空间 */
    .memory-group:last-child .memory-image-container {
        margin-bottom: 20px !important;
    }

    /* 时间线隐藏 */
    .timeline,
    .timepoint {
        display: none !important;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 375px) {
    .login-title {
        font-size: 24px;
    }

    .memory-content {
        font-size: 16px !important;
        padding: 10px !important;
    }

    .memory-text p:not(.head-text) {
        font-size: 18px !important;
    }

    .screen-4 .memories-container .memory-text .head-text,
    .screen-4 .memory-text .head-text,
    .memories-container .memory-text .head-text,
    .memory-text .head-text,
    .head-text,
    #headTextContainer,
    .memory-text #headTextContainer,
    p.head-text,
    p#headTextContainer {
        font-family: 'BrushUpLife', cursive !important;
        font-size: 20px !important;
    }

    #blessingContent {
        font-size: 16px !important;
        padding: 10px !important;
    }

    .sender-text {
        font-size: 18px !important;
    }
}
