/* 全局与基础设置 */
body > .container, .container { max-width: 100% !important; width: 100% !important; padding: 0 !important; margin: 0 !important; min-height: 100vh !important; }
:root { --primary-accent: #ff7675; --text-dark: #2d3436; --envelope-bg: #fdfdfd; --envelope-shadow: rgba(0,0,0,0.15); --wax-color: #c0392b; }
body, html { margin: 0; padding: 0; width: 100%; font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #fdfbf7; overflow-x: hidden; }
.navbar-wrapper { background: transparent !important; backdrop-filter: none !important; border: none !important; box-shadow: none !important; position: absolute !important; width: 100%; z-index: 100; }
.nav-links li a, .logo, .nav-right { color: #fff !important; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.search-box input { background: rgba(255,255,255,0.2) !important; border: 1px solid rgba(255,255,255,0.3) !important; color: #fff !important; }

/* Hero Section */
.hero-section { position: relative; width: 100vw; height: 100vh; background-size: cover; background-position: center; background-attachment: fixed; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5)); z-index: 1; }
.hero-content { position: relative; z-index: 10; text-align: center; color: #fff; width: 100%; max-width: 900px; padding: 0 20px; animation: fadeInUp 1.2s ease; }
.danmaku-zone { position: absolute; top: 100px; left: 0; width: 100%; bottom: 250px; z-index: 5; pointer-events: none; }

/* 1. 弹幕主容器 */
.dm-item {
    position: absolute;
    display: inline-flex;  /* 核心修改1: 使用 inline-flex 替代 flex */
    align-items: center;   /* 垂直居中 */
    justify-content: center; /* 水平居中 (虽然内容是左对齐，但这是良好实践) */
    
    /* 基础样式 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px; /* 保持胶囊形状 */
    
    /* 核心修改2: 重新调整内边距，左右对称 */
    padding: 6px 18px; 
    gap: 10px; /* 头像和文字的间距 */

    /* 动画与定位 */
    left: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    /* 宽度自适应 */
    width: auto;
    max-width: none;
}

/* 弹幕头像 */
.dm-av {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0; 
    display: block; /* 确保图片没有额外的底部空间 */
}

/* 2. 弹幕文字的容器 (<span>) */
.dm-item span {
    white-space: nowrap; /* 强制文字不换行 */
    
    /* 样式 */
    color: #fff;
    font-size: 14px;
    
}

.dm-av { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.8); }

/* Couple Box */
.couple-box { display: flex; align-items: center; justify-content: center; gap: 120px; margin-bottom: 70px; position: relative; }
.couple-box::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 200px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); z-index: -1; }
.av-halo { width: 130px; height: 130px; position: relative; transition: 0.5s; cursor: pointer; }
.av-halo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid rgba(255,255,255,0.3); box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: 0.5s; }
.av-halo:hover img { transform: scale(1.1); border-color: #fff; box-shadow: 0 15px 40px rgba(255,154,158,0.5); }
.av-name { position: absolute; bottom: -40px; width: 160%; left: -30%; text-align: center; font-family: 'Noto Serif SC', serif; font-size: 18px; letter-spacing: 1px; text-shadow: 0 2px 5px rgba(0,0,0,0.6); opacity: 1; transform: translateY(0); }
.heart-center { font-size: 40px; color: #ff7675; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); cursor: pointer; filter: drop-shadow(0 0 15px rgba(255,118,117,0.8)); animation: heartbeat 1.5s infinite; background: rgba(255,255,255,0.95); width: 80px; height: 80px; line-height: 80px; border-radius: 50%; transition: 0.3s; }
.heart-center:hover { transform: translate(-50%, -50%) scale(1.1); background: #fff; }

/* Timer */
.timer-area { margin-bottom: 50px; }
.timer-title { font-family: 'Noto Serif SC', serif; font-size: 18px; letter-spacing: 4px; margin-bottom: 20px; color: rgba(255,255,255,0.95); font-weight: 400; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.timer-digits { display: flex; justify-content: center; gap: 40px; align-items: baseline; }
.t-unit { text-align: center; position: relative; }
.t-unit::after { content: ':'; position: absolute; right: -22px; top: -4px; font-size: 32px; opacity: 0.6; font-family: 'Lato', sans-serif; font-weight: 300; color: #fff; }
.t-unit:last-child::after { content: ''; }
.t-num { font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 60px; font-weight: 400; display: block; line-height: 1; color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.t-label { font-size: 14px; opacity: 0.9; margin-top: 10px; font-family: 'Noto Serif SC', serif; letter-spacing: 1px; color: #fff; }

/* Inputs */
.input-bar-glass { display: flex; align-items: center; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.4); padding: 6px 6px 6px 25px; border-radius: 60px; width: 100%; max-width: 500px; margin: 0 auto; box-shadow: 0 20px 50px rgba(0,0,0,0.25); transition: 0.3s; }
.wish-input-field { flex: 1; background: transparent; border: none; outline: none; font-size: 16px; color: #fff; font-weight: 500; }
.wish-input-field::placeholder { color: rgba(255,255,255,0.8); font-weight: 400; }
.wish-send-btn { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #ff7675; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; margin-left: 10px; }
.wish-send-btn:hover { transform: rotate(45deg) scale(1.1); }
.scroll-hint { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.9); animation: float 3s ease-in-out infinite; cursor: pointer; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; padding: 8px 20px; font-size: 14px; backdrop-filter: blur(5px); font-family: 'Noto Serif SC', serif; letter-spacing: 2px; }

/* Letter Overlay */
.letter-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(20px); z-index: 10000; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.5s ease; perspective: 2000px; }
.letter-overlay.active { display: flex; opacity: 1; }
.envelope-container { position: relative; width: 420px; height: 280px; transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s, pointer-events 0.8s; transform-style: preserve-3d; }
.letter-overlay.opened .envelope-container { transform: translateY(300px) scale(0.8); opacity: 0; pointer-events: none; }
.paper-texture { background-color: var(--envelope-bg); background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E"); }
.envelope-body { position: absolute; inset: 0; border-radius: 6px; box-shadow: 0 25px 50px rgba(0,0,0,0.25); z-index: 1; background: var(--envelope-bg); }
.letter-preview { position: absolute; top: 10px; left: 20px; right: 20px; bottom: 10px; background: #fffbf0; z-index: 2; border-radius: 4px; box-shadow: 0 -2px 5px rgba(0,0,0,0.05); transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1); }
.letter-overlay.opening .letter-preview { transform: translateY(-150px); z-index: 5; }
.envelope-pocket { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 100%, 0 100%); background: linear-gradient(to bottom, #f7f7f7, #ffffff); z-index: 3; border-radius: 0 0 6px 6px; pointer-events: none; }
.envelope-pocket::after { content:''; position:absolute; inset:0; background: linear-gradient(135deg, transparent 40%, rgba(0,0,0,0.05) 100%); pointer-events: none; }
.envelope-flap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; clip-path: polygon(0 0, 100% 0, 50% 60%); transform-origin: top; z-index: 4; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); background: #f0f0f0; border-top: 1px solid #fff; backface-visibility: hidden; }
.letter-overlay.opening .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.wax-seal-btn { position: absolute; top: 60%; left: 50%; transform: translate(-50%, -50%); z-index: 10; width: 60px; height: 60px; background: var(--wax-color); border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; color: #eebb44; font-size: 24px; border: 2px solid rgba(255,255,255,0.15); cursor: pointer; transition: 0.3s; }
.wax-seal-btn:hover { transform: translate(-50%, -50%) scale(1.1); background: #d35400; }
.letter-overlay.opening .wax-seal-btn { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(1.5); }
.letter-paper-full { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); width: 600px; max-width: 90%; max-height: 80vh; background: #fffbf0; background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px); background-size: 100% 40px; padding: 60px 50px; box-shadow: 0 30px 80px rgba(0,0,0,0.3); border-radius: 4px; z-index: 20; opacity: 0; pointer-events: none; transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); overflow-y: auto; text-align: left; }
.letter-overlay.opened .letter-paper-full { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.letter-content { font-family: 'Ma Shan Zheng', cursive; font-size: 24px; line-height: 40px; color: #444; white-space: pre-wrap; }
.close-letter { position: absolute; top: 20px; right: 25px; font-size: 28px; cursor: pointer; color: #ccc; transition: 0.3s; }
.close-letter:hover { color: #333; transform: rotate(90deg); }

/* Timeline Section */
.section-content {
    position: relative;
    /* 核心修改：将纯色渐变改为带有透明度的渐变 */
    background: linear-gradient(180deg, rgba(253, 251, 247, 0.8) 0%, rgba(255, 241, 235, 0.6) 100%);
    padding: 120px 20px 150px;
    min-height: 100vh;
    z-index: 20;
}
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35; /* 核心修改：从 0.6 降低到 0.35 */
    z-index: 0;
    pointer-events: none;
}
.blob-1 { top: 10%; left: -10%; width: 500px; height: 500px; background: #ff9a9e; }
.blob-2 { bottom: 20%; right: -10%; width: 600px; height: 600px; background: #a18cd1; }
.blob-3 {
    top: 40%;
    left: 30%;
    width: 300px;
    height: 300px;
    background: #fbc2eb;
    opacity: 0.25; /* 核心修改：从 0.4 降低到 0.25 */
}


.timeline-wrap { max-width: 1000px; margin: 0 auto; position: relative; z-index: 10; }
.timeline-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1) 10%, rgba(0,0,0,0.1) 90%, transparent); transform: translateX(-50%); }
.tl-node { position: relative; width: 50%; padding: 40px; box-sizing: border-box; opacity: 0; transform: translateY(50px); transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1); display: flex; flex-direction: column; }
.tl-node.visible { opacity: 1; transform: translateY(0); }
.tl-node:nth-child(odd) { left: 0; align-items: flex-end; text-align: right; padding-right: 60px; }
.tl-node:nth-child(even) { left: 50%; align-items: flex-start; text-align: left; padding-left: 60px; }
.tl-point { position: absolute; top: 45px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--primary-accent); z-index: 2; box-shadow: 0 0 0 6px rgba(255, 154, 158, 0.15); transition: 0.3s; }
.tl-node:nth-child(odd) .tl-point { right: -8px; }
.tl-node:nth-child(even) .tl-point { left: -8px; }
.tl-node:hover .tl-point { background: var(--primary-accent); box-shadow: 0 0 0 10px rgba(255, 154, 158, 0.2); transform: scale(1.2); }

.tl-card { background: rgba(255, 255, 255, 0.45); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 24px; padding: 30px; box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); width: 100%; max-width: 420px; position: relative; overflow: hidden; }
.tl-card::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transition: 0.5s; pointer-events: none; transform: skewX(-15deg); }
.tl-card:hover { transform: translateY(-8px); background: rgba(255, 255, 255, 0.65); box-shadow: 0 20px 60px -15px rgba(50, 50, 93, 0.1); }
.tl-card:hover::before { left: 100%; }

.tl-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.tl-node:nth-child(odd) .tl-header { flex-direction: row-reverse; }
.tl-date-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 60px; height: 60px; background: #fff; border-radius: 16px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); font-family: 'Lato', sans-serif; flex-shrink: 0; color: var(--text-dark); }
.date-day { font-size: 24px; font-weight: 700; line-height: 1; }
.date-ym { font-size: 10px; color: #999; text-transform: uppercase; margin-top: 2px; }
.tl-title { font-size: 20px; font-weight: 700; color: var(--text-dark); font-family: 'Noto Serif SC', serif; margin: 0; line-height: 1.3; }
.tl-desc { font-size: 15px; color: #666; line-height: 1.8; font-weight: 300; text-align: justify; }
.tl-node:nth-child(odd) .tl-desc { text-align: right; }

/* 九宫格 */
.img-grid-container { display: grid; gap: 5px; margin-bottom: 20px; border-radius: 12px; overflow: hidden; width: 100%; }
.img-item { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1/1; cursor: zoom-in; transition: transform 0.3s; background: #eee; }
.img-item:hover { transform: scale(1.05); z-index: 2; }
.grid-1 { display: block; max-height: 300px; overflow: hidden; }
.grid-1 .img-item { aspect-ratio: auto; width: 100%; height: auto; max-height: 300px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.empty-timeline-placeholder { background:rgba(255,255,255,0.4); backdrop-filter:blur(10px); display:inline-block; padding:30px 50px; border-radius:20px; border:1px solid rgba(255,255,255,0.6); }
.empty-timeline-placeholder i { font-size:40px; color:#aaa; margin-bottom:15px; display:block; }
.empty-timeline-placeholder span { color:#666; font-family:'Noto Serif SC' }

/* Lightbox */
.lightbox-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 20000; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; }
.lightbox-overlay.active { display: flex; opacity: 1; }
.lightbox-img { display: block; max-width: 95vw; max-height: 95vh; width: auto; height: auto; object-fit: scale-down; border-radius: 4px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }

/* 动画 */
@keyframes heartbeat { 0%,100%{transform:translate(-50%,-50%) scale(1);} 50%{transform:translate(-50%,-50%) scale(1.15);} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(40px);} to{opacity:1;transform:translateY(0);} }
@keyframes float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -10px); } }

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section { background-attachment: scroll; }
    .couple-box { gap: 60px; }
    .av-halo { width: 90px; height: 90px; } 
    .av-name { font-size: 14px; bottom: -25px; }
    .heart-center { font-size: 24px; width: 50px; height: 50px; line-height: 50px; }
    
    .t-num { font-size: 40px; } .timer-digits { gap: 15px; } .t-unit::after { font-size: 20px; right: -10px; top: 2px; }
    .input-bar-glass { width: 90%; padding: 5px 5px 5px 20px; }
    
    .section-content { padding-top: 60px; }
    .timeline-line { left: 30px; }
    .tl-node { width: 100%; padding: 0 0 0 60px; margin-bottom: 50px; text-align: left !important; align-items: flex-start !important; }
    .tl-node:nth-child(odd) { left: 0; padding-right: 0; }
    .tl-node:nth-child(even) { left: 0; padding-left: 60px; }
    .tl-point { left: 23px !important; right: auto !important; width: 12px; height: 12px; top: 25px; }
    .tl-card { width: 100%; max-width: 100%; padding: 20px; border-radius: 16px; }
    .tl-header { flex-direction: row !important; gap: 12px; margin-bottom: 15px; }
    .tl-desc { text-align: left !important; font-size: 14px; }
    
    .envelope-container { width: 300px; height: 180px; }
    .letter-paper-full { width: 90%; padding: 30px 20px; }
    .letter-content { font-size: 18px; line-height: 28px; }
}
