/* ================== 全局重置与基础设置 ================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	/* 如果你配置了字体，可以将 'OurMemoryFont' 加在最前面 */
	font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
	/* 初始状态下，因为封面盖住了，我们先禁止主页底层滚动 */
	overflow: hidden; 
}

/* 当主页封面滑走后，通过 JS 给 body 加上这个类，允许向下滚动 */
body.unlocked {
	overflow: auto;
}

/* ================== 第一层：固定封面 ================== */
.cover {
	position: fixed; 
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	z-index: 10;
	background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), 
				url('../images/bg.jpg');
	background-size: cover; 
	background-position: center; 
	background-repeat: no-repeat; 
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1); 
}

.cover.slide-up {
	transform: translateY(-100%);
}

.cover-content h1 {
	font-size: 3.5rem;
	color: #333;
	margin-bottom: 15px;
	letter-spacing: 2px;
}

.cover-content p {
	font-size: 1.2rem;
	color: #555;
}

/* ================== 封面弹跳下箭头 ================== */
.scroll-arrow {
	position: absolute;
	bottom: 50px; 
	width: 24px;
	height: 24px;
	border-bottom: 3px solid #5b9bd5; 
	border-right: 3px solid #5b9bd5;
	transform: rotate(45deg);
	cursor: pointer;
	animation: bounce 2s infinite;
}

@keyframes bounce {
	0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
	40% { transform: translateY(-15px) rotate(45deg); }
	60% { transform: translateY(-7px) rotate(45deg); }
}

/* ================== 第二层：时间轴目录 ================== */
.timeline-section {
	min-height: 100vh;
	padding: 80px 20px;
	background: linear-gradient(180deg, #f4f9ff 0%, #d6eaff 100%);
	position: relative;
	z-index: 1; 
	overflow-x: hidden; 
}

.timeline-section h2 {
	text-align: center;
	margin-bottom: 50px;
	color: #333;
	font-size: 2rem;
}

.timeline {
	max-width: 900px;
	margin: 0 auto;
	position: relative;
}

/* 移动端默认：轴线在左侧 */
.timeline::after {
	content: '';
	position: absolute;
	width: 4px;
	background-color: #6aa5e3;
	top: 0;
	bottom: 0;
	left: 20px;
	border-radius: 2px;
}

/* 卡片基础状态 */
.timeline-item {
	margin-bottom: 40px;
	position: relative;
	width: 100%; 
	padding-left: 50px; 
	padding-right: 15px;
	opacity: 0; 
	transform: translateY(30px);
	transition: all 0.8s ease;
}

.timeline-item.visible {
	opacity: 1;
	transform: translateY(0);
}

/* 圆点装饰（移动端默认在左侧） */
.timeline-item::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	background-color: #6aa5e3;
	border-radius: 50%;
	border: 4px solid #fff;
	top: 15px; 
	left: 10px; 
	z-index: 1;
}

.timeline-date {
	font-size: 1.1rem;
	font-weight: bold;
	color: #4a8cdb;
	margin-bottom: 8px;
}

.timeline-content {
	background: #ffffff;
	padding: 20px;
	border-radius: 8px;
	color: #555;
	line-height: 1.6;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
	cursor: pointer;
	transition: transform 0.3s;
}

.timeline-content:hover {
	transform: scale(1.02);
}

/* === 响应式：电脑端变为左右交替紧凑排版 === */
@media screen and (min-width: 768px) {
	.timeline {
		display: flow-root; 
	}

	.timeline::after {
		left: 50%;
		transform: translateX(-50%);
	}

	.timeline-item {
		width: 50%; 
		margin-bottom: 60px; /* 增加上下间距，防止圆点重叠 */
	}

	.timeline-item:nth-child(odd) {
		float: left;
		clear: left; 
		padding-left: 0;
		padding-right: 45px; 
	}

	.timeline-item:nth-child(odd)::before {
		left: auto;
		right: -10px; 
	}

	.timeline-item:nth-child(even) {
		float: right;
		clear: right; 
		padding-left: 45px;
		padding-right: 0;
		margin-top: 80px; /* 错开高度，形成拉链感 */
	}

	.timeline-item:nth-child(even)::before {
		left: -10px;
	}
}


/* ================== 独立子页面的通用样式 ================== */
.sub-page-body {
	background-color: #fdfbfb;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-y: auto; 
}

/* 顶部页头 */
.sub-page-header {
	background-color: #ffffff;
	padding: 15px 20px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.05);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.back-link {
	text-decoration: none;
	color: #6aa5e3;
	font-weight: bold;
	font-size: 1.1rem;
}

.header-title {
	color: #777;
	font-size: 0.9rem;
}

/* 中间常规回忆内容区 */
.memory-content {
	flex: 1; 
	max-width: 800px;
	margin: 40px auto;
	padding: 0 20px;
}

.memory-content h1 { color: #333; margin-bottom: 10px; }
.memory-date { color: #6aa5e3; font-size: 0.9rem; margin-bottom: 30px; }
.memory-content p { color: #555; line-height: 1.8; margin-bottom: 15px; }

/* 底部页尾 (带跳动心跳和相伴天数) */
.sub-page-footer {
	text-align: center;
	padding: 30px 20px;
	background-color: #f4f9ff;
	border-top: 1px solid #e1edfc;
}

.footer-quote { color: #888; font-size: 0.9rem; margin-bottom: 15px; font-style: italic; letter-spacing: 1px; }
.footer-love { font-size: 1.1rem; font-weight: bold; color: #555; margin-bottom: 8px; }

.heart {
	display: inline-block;
	color: #ff7e67;
	font-size: 1.2rem;
	animation: heartbeat 1.5s infinite ease-in-out; 
}

@keyframes heartbeat {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.2); } 
}

.footer-days { font-size: 0.85rem; color: #999; }


/* ================== 信件/心里话页面专属样式 ================== */
.letter-content {
	flex: 1; 
	max-width: 700px;
	margin: 40px auto;
	padding: 40px;
	background-color: #fffaf0; 
	border-radius: 10px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.letter-content h1 { color: #4a8cdb; margin-bottom: 20px; text-align: center; font-weight: normal; }
.letter-content p { color: #555; line-height: 2; margin-bottom: 20px; text-indent: 2em; }
.letter-signature { text-align: right; margin-top: 50px; font-style: italic; color: #888; }


/* ================== 上下篇导航按钮样式 ================== */
.nav-container-wrapper {
	max-width: 800px;
	margin: 0 auto 40px auto;
	padding: 0 20px;
}

.page-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px dashed #ccc; 
	padding-top: 20px;
}

.page-nav a {
	text-decoration: none;
	color: #6aa5e3;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	transition: color 0.3s;
}

.page-nav a:hover { color: #4a8cdb; }
.nav-empty { flex: 1; }

/* 标题文字超长自动变成省略号 */
.nav-title {
	color: #777;
	margin: 0 5px;
	max-width: 150px; 
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: inline-block;
	vertical-align: middle;
}