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

body {
    font-family: 'Arial', sans-serif;
    background: url('img/background1_compressed.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 黑屏覆盖层 */
.black-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-text {
    text-align: center;
    color: white;
}

.intro-line {
    font-size: 2rem;
    font-weight: bold;
    margin: 30px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s ease;
}

.intro-line.show {
    opacity: 1;
    transform: translateY(0);
}

/* 照片墙背景 */
.photo-wall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgb(122, 105, 91);
    backdrop-filter: blur(5px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 20px;
}

.photo-wall img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.photo-wall img:hover {
    opacity: 0.6;
    transform: scale(1.05);
}

/* 照片删除按钮 */
.photo-wall .photo-item {
    position: relative;
    display: inline-block;
}

.photo-wall .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.photo-wall .photo-item:hover .delete-btn {
    opacity: 1;
}

.photo-wall .delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* 主容器 */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 600px;
    width: 90%;
}

/* To my love 标题 */
.to-my-love {
    font-size: 6rem;
    font-weight: bold;
    color: #bac6e5;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

/* 密钥输入区域 */
.key-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.key-input-section .key-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.key-input-section input {
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
    backdrop-filter: blur(10px);
    width: 250px;
    transition: all 0.3s ease;
}

.key-input-section input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.key-input-section input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.key-input-section .key-display {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    letter-spacing: 3px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-input-section button {
    padding: 15px 30px;
    background: rgba(136, 22, 10, 0.8);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-input-section button:hover {
    background: rgba(136, 22, 10, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(136, 22, 10, 0.4);
}

/* 当标题和访客信息隐藏时的容器样式 */
.container.player-only {
    justify-content: center;
    padding: 0;
}

/* 标题 */
.title {
    font-size: 4rem;
    font-weight: bold;
    color: rgb(255, 181, 181);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    letter-spacing: 5px;
    transition: opacity 0.5s ease;
}

.title.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 访客信息 */
.visitor-info {
    text-align: center;
    color: white;
    font-weight: bold;
    margin-bottom: 30px;
    padding: 20px 40px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s ease;
}

.visitor-info.hidden {
    opacity: 0;
    pointer-events: none;
}

.visitor-info p {
    margin: 0;
    font-size: 1.1rem;
}

.visitor-info span {
    color: #fced9f;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}


/* 播放器容器 */
.player-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

/* 当只有播放器时的容器样式 */
.container.player-only .player-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

/* 箭头 */
.arrow {
    font-size: 3rem;
    color: white;
    cursor: pointer;
    padding: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    user-select: none;
}

.arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 播放器 */
.player {
    width: 90vw;
    height: 60vw;
    max-width: 1000px;
    max-height: 600px;
    min-width: 600px;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 当只有播放器时的样式 */
.container.player-only .player {
    width: 80vw;
    height: 50vw;
    max-width: 1200px;
    max-height: 700px;
    min-width: 800px;
    min-height: 500px;
}

/* 初始屏幕 */
.initial-screen {
    text-align: center;
    color: white;
    padding: 40px;
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.initial-screen p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* 密钥输入组件 */
.key-input-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.key-input-container input {
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    margin-bottom: 10px;
    width: 200px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

.key-display {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    letter-spacing: 3px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.initial-screen button {
    padding: 10px 20px;
    background: #88160a;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.initial-screen button:hover {
    background: #6b1208;
}

/* 视频封面 */
.video-cover {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.play-button {
    font-size: 4rem;
    color: white;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    z-index: 2;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);

}

.video-cover:hover .play-button {
    transform: scale(1.2);
}

.video-title {
    font-size: 1.5rem;
    color: white;
    text-align: center;
    z-index: 2;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight:700;/* 粗体 */
}

/* 视频播放器 */
#videoPlayer {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

/* 信件按钮（播放器下方） */
.letter-button-below {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    width: 90vw;
    max-width: 1000px;
    min-width: 600px;
}

/* 浮动照片墙刷新按钮 */
.refresh-button-floating {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.refresh-button-floating:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.refresh-button-floating .refresh-icon {
    font-size: 1.8rem;
    color: white;
    transition: transform 0.3s ease;
}

.refresh-button-floating:hover .refresh-icon {
    transform: rotate(180deg);
}

/* 浮动信件按钮（播放器居中时的样式） */
.letter-button-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: rgba(136, 22, 10, 0.3);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.letter-button-floating:hover {
    background: rgba(136, 22, 10, 0.5);
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

.letter-button-floating .letter-icon {
    font-size: 2rem;
    color: white;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

.letter-button-floating .letter-text {
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
    text-align: center;
    transition: transform 0.3s ease;
}

/* 悬停时保持文字稳定 */
.letter-button-floating:hover .letter-icon,
.letter-button-floating:hover .letter-text {
    transform: scale(0.909); /* 1/1.1 ≈ 0.909 来抵消父元素的缩放 */
}

.letter-button-below:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.letter-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.letter-text {
    color: rgb(79, 33, 3);
    font-size: 1.2rem;
    font-weight: bold;
}

/* 信件按钮脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

.modal-content .key-input-container {
    margin-bottom: 20px;
}

.modal-content .key-input-container input {
    margin-bottom: 10px;
}

.modal-content .key-display {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    letter-spacing: 3px;
    text-align: center;
    background: #f5f5f5;
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 200px;
    margin: 0 auto;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.modal-content button:first-child {
    background: #88160a;
    color: white;
}

.modal-content button:first-child:hover {
    background: #6b1208;
}

.modal-content button:last-child {
    background: #ddd;
    color: #333;
}

.modal-content button:last-child:hover {
    background: #ccc;
}

/* 信件内容 */
.letter-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.letter-image {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    min-height: 400px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.letter-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
}


/* 图片上传区域 */
.upload-area {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

#imageUpload {
    display: none;
}

.upload-label {
    display: block;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.upload-label:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.clear-photos-btn {
    display: block;
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.clear-photos-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .visitor-info {
        padding: 10px 20px;
        margin-bottom: 20px;
    }
    
    .visitor-info p {
        font-size: 1rem;
    }
    
    .player {
        width: 95vw;
        height: 65vw;
        min-width: 300px;
        min-height: 200px;
    }
    
    .letter-button-below {
        margin-top: 20px;
        padding: 15px 30px;
        width: 95vw;
        min-width: 300px;
    }
    
    .letter-icon {
        font-size: 2rem;
    }
    
    .letter-text {
        font-size: 1rem;
    }
    
    .key-input-container input {
        width: 150px;
    }
    
    .key-display {
        min-width: 150px;
        font-size: 1.2rem;
    }
}

/* 滚动条样式 */
.letter-content::-webkit-scrollbar,
.letter-image::-webkit-scrollbar {
    width: 8px;
}

.letter-content::-webkit-scrollbar-track,
.letter-image::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.letter-content::-webkit-scrollbar-thumb,
.letter-image::-webkit-scrollbar-thumb {
    background: #88160a;
    border-radius: 4px;
}

.letter-content::-webkit-scrollbar-thumb:hover,
.letter-image::-webkit-scrollbar-thumb:hover {
    background: #6b1208;
}
