body {
    font-family: "Palatino Linotype", "Book Antiqua", "PingFang SC", "Microsoft YaHei", serif;
    background-color: #fdfbf7;
    color: #4a4a4a;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

/* ==========================================
   秘密等待界面样式
   ========================================== */
#secret-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #2a2626; color: #fdfbf7;
    display: flex; justify-content: center; align-items: center; z-index: 2000;
}

.secret-content {
    text-align: center; animation: pulseFade 3s infinite alternate; padding: 20px;
}

.secret-content h2 {
    color: #d67a7a; font-size: 40px; margin-bottom: 15px; letter-spacing: 2px;
}

.countdown-text {
    font-size: 16px; margin-top: 25px; color: #a9a9a9;
}

.countdown-text span {
    color: #d67a7a; font-weight: bold; font-size: 18px;
}

@keyframes pulseFade {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* ==========================================
   主界面基础与盲盒样式
   ========================================== */
.container {
    max-width: 1000px; width: 100%; text-align: center; padding: 20px;
}

header h1 {
    color: #d67a7a; margin-bottom: 5px; margin-top: 20px;
}

header p {
    font-size: 14px; color: #888; margin-bottom: 40px; transition: color 0.5s;
}

.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px; padding-bottom: 30px;
}

.card {
    background-color: transparent; width: 100%; aspect-ratio: 3 / 4;
    perspective: 1000px; cursor: pointer;
}

.card-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-radius: 8px;
}

.card.is-flipped .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    border-radius: 8px; display: flex; flex-direction: column;
    justify-content: center; align-items: center; box-sizing: border-box;
}

.card-front {
    background-color: #e9baba; color: white; font-size: 20px;
    font-weight: bold; border: 2px dashed #ffffff;
}

.card-front::after { content: "💌"; font-size: 30px; margin-top: 10px; }

.card-back {
    background-color: white; transform: rotateY(180deg);
    padding: 12px; border: 1px solid #eaeaea;
}

.card-back img {
    width: 100%; height: 55%; object-fit: cover;
    border-radius: 4px; background-color: #f0f0f0;
}

.card-quote {
    font-size: 14px; font-style: italic; color: #555; margin: 15px 0;
    line-height: 1.6; flex-grow: 1; display: flex; align-items: center;
    text-align: center; padding: 0 5px;
}

/* ==========================================
   全新精美信纸样式 (无横线，高定信笺质感)
   ========================================== */
#letter-container {
    margin: 60px auto;
    animation: slideUpFade 1.5s ease-out forwards;
}

.letter-paper {
    background-color: #fffcf8; /* 温柔的暖白色 */
    padding: 50px 45px;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08), 0 5px 15px rgba(0,0,0,0.03);
    text-align: left;
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    border: 1px solid #f0e6d2; /* 淡淡的纸张边缘 */
    font-family: "Palatino Linotype", "FangSong", "STFangsong", serif; /* 使用更具古典文学感的字体 */
}

/* 信纸顶部的玫瑰渐变封边 */
.letter-paper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(to right, #f3d4d4, #d67a7a, #f3d4d4);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.letter-paper h3 {
    text-align: center;
    color: #c96b6b;
    margin-top: 10px;
    margin-bottom: 35px;
    letter-spacing: 4px;
    font-weight: normal;
    border-bottom: 1px dashed #eed8d8;
    padding-bottom: 20px;
}

.letter-body p {
    line-height: 2.2;
    color: #4a4a4a;
    font-size: 15px;
    margin-bottom: 20px;
    text-indent: 2em; /* 首行缩进两字符，像真实的信件 */
}

.letter-body p:first-child {
    text-indent: 0; /* 称呼不缩进 */
}

.signature {
    text-align: right;
    margin-top: 50px;
    color: #c96b6b;
}

.signature p {
    margin: 5px 0;
    font-size: 15px;
}

.signature .date {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   撒花特效
   ========================================== */
#confetti-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1000; overflow: hidden;
}

.confetti {
    position: absolute; top: -20px; opacity: 0.8; animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(110vh) rotate(720deg); }
}

/* ==========================================
   照片放大弹窗样式
   ========================================== */
.modal {
    display: none; position: fixed; z-index: 3000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px); justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}

.modal.show { display: flex; opacity: 1; }

.modal-content {
    max-width: 90%; max-height: 85%; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.close-btn {
    position: absolute; top: 20px; right: 30px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; cursor: pointer; transition: color 0.2s;
}

.close-btn:hover { color: #d67a7a; }

@keyframes zoomIn {
    from { transform: scale(0.9); } to { transform: scale(1); }
}