body {
    margin: 0;
    padding: 0;
    background: #fdc9d1;
    font-size: 12px;
    overflow: auto
}

#mainDiv {
    width: 100%;
    height: 100%
}

#loveHeart {
    float: left;
    width: 670px;
    height: 620px;
    position: relative;
}

#garden {
    width: 100%;
    height: 100%
}

#elapseClock {
    text-align: right;
    font-size: 18px;
    margin-top: 10px;
    margin-bottom: 10px
}

#words {
    font-family: "sans-serif";
    width: 500px;
    font-size: 24px;
    color: #666
}

#messages {
    display: none
}

#elapseClock .digit {
    font-family: "digit";
    font-size: 36px
}

#loveu {
    padding: 5px;
    font-size: 22px;
    margin-top: 80px;
    margin-right: 120px;
    text-align: right;
    display: none
}

#loveu .signature {
    margin-top: 10px;
    font-size: 20px;
}

#clickSound {
    display: none
}

#code {
    float: left;
    width: 440px;
    margin-top: 60px !important;
    height: 400px;
    color: #333;
    font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", "sans-serif";
    font-size: 12px
}

#code .string {
    color: #2a36ff
}

#code .keyword {
    color: #7f0055;
    font-weight: bold
}

#code .placeholder {
    margin-left: 15px
}

#code .space {
    margin-left: 7px
}

#code .comments {
    color: #3f7f5f
}

#copyright {
    margin-top: 40px;
    text-align: center;
    width: 100%;
    color: #666
}

#errorMsg {
    width: 100%;
    text-align: center;
    font-size: 24px;
    position: absolute;
    top: 100px;
    left: 0
}

#copyright a {
    color: #666
}

/* 图片预览 Lightbox */
.lightbox-overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); display: none; align-items: center; justify-content: center; z-index: 1000; }
.lightbox-overlay.visible { display: flex; }

/* Lightbox 操作按钮样式 */
.lightbox-overlay .lb-toolbar { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 12px; z-index: 5; }
.lightbox-overlay .lb-btn { background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 20px; padding: 8px 12px; font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.lightbox-overlay .lb-btn:active { transform: translateY(1px); }
.lightbox-overlay img { cursor: grab; }
.lightbox-overlay img:active { cursor: grabbing; }
.lightbox-overlay img { max-width: 85vw; max-height: 85vh; border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,0.45); }
.lightbox-overlay .lb-prev, .lightbox-overlay .lb-next, .lightbox-overlay .lb-close { position: absolute; background: rgba(255,255,255,0.22); color: #fff; border: none; outline: none; cursor: pointer; transition: background .2s ease, transform .2s ease; box-shadow: 0 6px 18px rgba(0,0,0,0.3); }
.lightbox-overlay .lb-prev:hover, .lightbox-overlay .lb-next:hover, .lightbox-overlay .lb-close:hover { background: rgba(255,255,255,0.36); transform: scale(1.06); }
.lightbox-overlay .lb-prev, .lightbox-overlay .lb-next { top: 50%; width: 44px; height: 44px; border-radius: 22px; font-size: 28px; line-height: 44px; text-align: center; }
.lightbox-overlay .lb-prev { left: 20px; }
.lightbox-overlay .lb-next { right: 20px; }
.lightbox-overlay .lb-close { top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 20px; font-size: 24px; line-height: 40px; text-align: center; }
.lightbox-overlay .lb-counter { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; letter-spacing: 0.3px; }

/* 时间轴样式 */
.timeline-container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.timeline-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-title {
    text-align: center;
    font-size: 28px;
    color: #d63384;
    margin-bottom: 30px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline {
    position: relative;
    padding: 0;
}

/* 取消中轴线 */
.timeline::before {
    display: none;
}

/* 取消标记点 */
.timeline-marker {
    display: none;
}

/* 改为单列卡片布局 */
.timeline-item {
    position: relative;
    margin: 20px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateY(0);
}

/* 统一内容宽度与居中（柔和玻璃拟态） */
.timeline-content {
    background: rgba(255,255,255,0.28);
    backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(214, 51, 132, 0.15);
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    position: relative;
}

/* 内容子元素渐进式淡入 */
.timeline-content > .timeline-date,
.timeline-content > h3,
.timeline-content > p,
.timeline-content > .timeline-photo {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .6s ease, transform .6s ease;
}

.timeline-item.animate .timeline-content > * {
    opacity: 1;
    transform: translateY(0);
}

/* 轻微的分段延迟 */
.timeline-item.animate .timeline-content > :nth-child(1) { transition-delay: .08s; }
.timeline-item.animate .timeline-content > :nth-child(2) { transition-delay: .16s; }
.timeline-item.animate .timeline-content > :nth-child(3) { transition-delay: .24s; }
.timeline-item.animate .timeline-content > :nth-child(4) { transition-delay: .32s; }

/* 照片网格与懒加载 */
.timeline-photo { margin-top: 10px; }
.timeline-photo .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.timeline-photo .photo-grid > div { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px; }
.timeline-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); opacity: 0; transform: scale(0.96); transition: opacity .5s ease, transform .5s ease, box-shadow .3s ease; }
.timeline-photo img { cursor: zoom-in; }
.timeline-photo img.loaded { opacity: 1; transform: scale(1); }
.timeline-photo img:hover { transform: scale(1.03); box-shadow: 0 10px 28px rgba(214, 51, 132, 0.28); }

/* 照片骨架占位（可选） */
.photo-skeleton { width: 100%; height: 100%; border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.35), rgba(255,255,255,0.15)); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.timeline-content:hover {
    border-color: #d63384;
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.18);
}

/* 去掉左右箭头 */
.timeline-content::before,
.timeline-item:nth-child(odd) .timeline-content::before,
.timeline-item:nth-child(even) .timeline-content::before {
    display: none;
}

/* 时间轴标题：柔和渐变文字 */
.timeline-title {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #d63384 0%, #ff6f91 60%, #ffa3b1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 18px;
}

.timeline-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 6px;
    display: none; /* 按要求移除时间显示 */
}

.timeline-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #d63384;
    font-weight: bold;
}

.timeline-content p {
    margin: 0 0 14px 0;
    font-size: 16px;
    line-height: 1.65;
    color: #555;
}

.timeline-photo { margin-top: 10px; }
.photo-placeholder { margin: 0 auto; }

/* 响应式依旧保持单列 */
@media (max-width: 768px) {
    .timeline-item { margin: 16px 0; }
    .timeline-content { padding: 18px; border-radius: 14px; }
}

/* 进入视口时的轻甜心形弹出 */
.timeline-item.animate .timeline-content::after {
    content: '❤';
    position: absolute;
    right: 10px;
    top: -6px;
    font-size: 18px;
    color: #d63384;
    text-shadow: 0 0 12px rgba(214,51,132,0.3);
    animation: popHeart 1.6s ease-out;
    opacity: 0;
}
@keyframes popHeart {
    0% { opacity: 0; transform: translateY(6px) scale(0.8); }
    30% { opacity: 1; transform: translateY(0) scale(1.05); }
    100% { opacity: 0; transform: translateY(-12px) scale(0.9); }
}

/* 轻量心形粒子（进入视口短时浮动） */
.heart-sparkle {
    position: absolute;
    color: #e255a3;
    font-size: 14px;
    opacity: 0;
    animation: floatUpFade 1.8s ease-out forwards;
    pointer-events: none;
    text-shadow: 0 6px 12px rgba(214,51,132,0.22);
}
@keyframes floatUpFade {
    0% { opacity: 0; transform: translateY(8px) scale(0.9); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-22px) scale(1.05); }
}

/* 向下箭头引导（固定在屏幕底部居中，更显眼） */
.scroll-down-arrow {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d63384 0%, #ff6f91 60%, #ffa3b1 100%);
    box-shadow: 0 14px 28px rgba(214, 51, 132, 0.35), 0 0 18px rgba(255, 175, 195, 0.35);
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 1000;
    cursor: pointer;
    animation: arrowFloat 1.8s ease-in-out infinite;
}

/* 下一步箭头（时间轴完全展示后出现） */
.next-step-arrow {
    width: 56px;
    height: 56px;
    margin: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7b00 0%, #ffa64d 60%, #ffd1a6 100%);
    box-shadow: 0 14px 28px rgba(255, 123, 0, 0.35), 0 0 18px rgba(255, 200, 150, 0.35);
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 1000;
    cursor: pointer;
    animation: arrowFloat 1.8s ease-in-out infinite;
}
.next-step-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: translate(-50%, -65%) rotate(45deg);
}
.next-step-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(255, 123, 0, 0.32);
    animation: arrowPulse 2.2s ease-out infinite;
}
.scroll-down-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: translate(-50%, -65%) rotate(45deg);
}
.scroll-down-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(214, 51, 132, 0.32);
    animation: arrowPulse 2.2s ease-out infinite;
}
@keyframes arrowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}
@keyframes arrowPulse {
    0% { box-shadow: 0 0 0 0 rgba(214, 51, 132, 0.32); }
    60% { box-shadow: 0 0 0 16px rgba(214, 51, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 51, 132, 0); }
}

/* 图片预览 Lightbox 叠层 */
.lightbox-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.lightbox-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(0,0,0,0.35);
}
.lightbox-overlay.visible { display: flex; }

/* 婚礼动画区块整体占位，避免高度不足导致动画不完整 */
#wedding-section {
    position: relative;
    padding: 20px 0 60px;
    min-height: 560px;
}

/* --- Mobile adaptations (without affecting desktop) --- */
@media (max-width: 768px) {
  body { font-size: 14px; }
  #content { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 12px; }
  #code { float: none; width: 100%; height: auto; max-height: none; overflow: visible; margin-top: 0 !important; order: 1; }
  #loveHeart { float: none; width: 100%; /* keep original height to avoid canvas issues */ height: calc(var(--vh, 1vh) * 68); min-height: 420px; order: 2; }
  #words { width: 100%; font-size: 20px; }
  #loveu { margin-right: 0; text-align: center; }

  .timeline-container { max-width: 94vw; padding: 12px; margin: 20px auto; }
  .timeline-item { margin: 12px 0; }

  /* arrows a bit smaller on mobile */
  .scroll-down-arrow { width: 44px; height: 44px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
}

@media (max-width: 480px) {
  body { font-size: 13px; }
  #content { gap: 14px; }
  #elapseClock .digit { font-size: 30px; }
  #words { font-size: 18px; }
  #code { max-height: none; overflow: visible; }
  /* reduce wedding section min height slightly on very small screens */
  #wedding-section { min-height: 480px; }
  #loveHeart { height: calc(var(--vh, 1vh) * 72); min-height: 380px; }
}
