/* ============================================================
   style.css —《和你有关的日子》表白网页样式
   色调：浅粉 + 米白 + 暖色调，温柔电影感
   ============================================================ */

/* ==================== CSS 变量 ==================== */
:root {
  --pink-light: #fce4ec;
  --pink: #f8bbd0;
  --pink-deep: #e57373;
  --cream: #faf7f2;
  --cream-dark: #f5ebe0;
  --brown-light: #8d6e63;
  --brown: #5d4037;
  --white: #ffffff;
  --text: #4a3728;
  --text-light: #795548;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* 字体：优先使用系统字体，保证离线可用 */
  --font-title: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 容器 ==================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== 章节通用 ==================== */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  position: relative;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--brown);
  text-align: center;
  margin-bottom: 48px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ==================== 第一屏：首页封面 ==================== */
/*
  背景替换：修改下面 background-image 的路径
  例如：background-image: url('../assets/images/cover-bg.jpg');
  如果不使用图片，可以删除背景图，使用纯色渐变
*/
.hero {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 30%, #fce4ec 60%, #fdf2f5 100%);
  /* 替换为你的照片：
  background-image: url('../assets/images/cover-bg.jpg');
  background-size: cover;
  background-position: center;
  */
  position: relative;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, rgba(252,228,236,0.6) 100%);
  /*
    如果你使用照片背景，调整这里的透明度让文字可读：
    例如 background: rgba(252,228,236,0.55);
  */
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.4) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(248,187,208,0.3) 0%, transparent 50%);
  animation: heroShine 8s ease-in-out infinite;
}

@keyframes heroShine {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, -1%); }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--brown-light);
  letter-spacing: 0.06em;
}

.btn-start {
  margin-top: 16px;
  padding: 14px 40px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  color: var(--white);
  background: linear-gradient(135deg, #e57373, #f06292);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 15px rgba(229, 115, 115, 0.35);
  transition: all var(--transition);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(229, 115, 115, 0.45);
}

.btn-start:active {
  transform: translateY(0);
}

.scroll-hint {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--brown-light);
  font-size: 0.85rem;
  opacity: 0.7;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ==================== 第二屏：故事开始 ==================== */
.story-intro {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.story-text {
  max-width: 650px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 2.2;
  color: var(--text-light);
  text-align: center;
}

.story-text p {
  margin-bottom: 20px;
}

/* ==================== 第三屏：回忆时间线 ==================== */
.timeline-section {
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
}

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

/* 时间线中间那条线 */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, var(--pink) 5%, var(--pink) 95%, transparent 100%);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  gap: 24px;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* 通过 JS 赋予的 class 控制左/右排版（因为编辑模式下会有插入按钮打乱 nth-child） */
.timeline-item.timeline-left {
  flex-direction: row;
}

.timeline-item.timeline-right {
  flex-direction: row-reverse;
}

.timeline-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  background: var(--pink-deep);
  border-radius: 50%;
  border: 3px solid var(--pink-light);
  margin-top: 6px;
  z-index: 2;
  box-shadow: 0 0 0 4px rgba(229,115,115,0.15);
}

.timeline-item.timeline-left .timeline-dot {
  order: 2;
  margin-left: 0;
}

.timeline-item.timeline-right .timeline-dot {
  order: 1;
  margin-right: 0;
}

.timeline-item.timeline-left .timeline-content {
  text-align: right;
  order: 1;
}

.timeline-item.timeline-right .timeline-content {
  text-align: left;
  order: 2;
}

.timeline-content {
  flex: 1;
  max-width: 260px;
}

/* 编辑模式：时间线节点间插入按钮 */
.timeline-insert-btn {
  display: none;
  width: 28px;
  height: 28px;
  margin: 0 auto 60px;
  border-radius: 50%;
  border: 1.5px dashed rgba(229, 115, 115, 0.3);
  background: rgba(255, 255, 255, 0.85);
  color: var(--pink-deep);
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s;
  z-index: 3;
  position: relative;
}

body.editing .timeline-insert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-insert-btn:hover {
  background: var(--pink-light);
  border-color: var(--pink-deep);
  transform: scale(1.15);
  box-shadow: 0 2px 10px rgba(229, 115, 115, 0.2);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--pink-deep);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 12px;
}

.timeline-photo {
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.timeline-photo:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-strong);
}

/* 编辑模式下的照片占位区 */
.timeline-photo-placeholder {
  width: 100%;
  max-width: 220px;
  min-height: 140px;
  border: 2px dashed #e0c0c0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #c49a9a;
  background: rgba(255, 220, 220, 0.3);
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 10px;
}

.timeline-photo-placeholder:hover {
  border-color: #e57373;
  color: #d47474;
  background: rgba(255, 200, 200, 0.45);
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(229, 115, 115, 0.2);
}

/* ==================== 过渡段落 ==================== */
.transition-section {
  min-height: auto;
  padding: 60px 0 50px;
  background: var(--cream);
  /* 顶部用伪元素做渐变过渡，从时间线底部的 cream 平滑接入 */
  position: relative;
}

.transition-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
  pointer-events: none;
}

/* section4b 前一段是城市记忆（cream），无需渐变过渡 */
#section4b.transition-section::before {
  height: 20px;
  background: transparent;
}

.transition-text {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.2rem;
  line-height: 2.4;
  color: var(--brown);
  text-align: center;
  letter-spacing: 0.05em;
}

.transition-text p {
  margin-bottom: 20px;
}

/* 段落间装饰分隔 */
.transition-divider {
  text-align: center;
  margin: 8px 0;
  color: var(--pink);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  opacity: 0.65;
  user-select: none;
  pointer-events: none;
}

/* ==================== 第四屏：城市记忆 ==================== */
.city-memories-section {
  background: var(--cream);
}

.city-memories {
  max-width: 900px;
  margin: 0 auto;
}

/* 城市大相框 */
.city-frame {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 48px;
  border: 3px solid #f0d6d6;
  transition: all var(--transition);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.city-frame.visible {
  opacity: 1;
  transform: translateY(0);
}

.city-frame:hover {
  box-shadow: var(--shadow-strong);
}

/* 相框头部 — 城市名 + 时间 */
.city-frame-header {
  padding: 20px 28px 16px;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
  text-align: center;
  border-bottom: 2px solid #f0d6d6;
}

.city-frame-name {
  display: block;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.08em;
}

.city-frame-date {
  display: block;
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--brown-light);
  letter-spacing: 0.05em;
}

.city-frame-date-placeholder {
  color: #c49a9a;
  font-style: italic;
}

/* 相框内部照片网格 — 固定每行3张 */
.city-frame-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 28px;
}

/* 单张照片卡片 */
.city-photo-item {
  border-radius: 12px;
  overflow: hidden;
  background: #fdf7f7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all var(--transition);
  position: relative;
}

.city-photo-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.city-photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.city-photo-item:hover img {
  transform: scale(1.04);
}

/* 照片标题 */
.city-photo-title {
  padding: 12px 14px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-light);
  text-align: center;
  letter-spacing: 0.03em;
  min-height: 24px;
}

.city-photo-title-placeholder {
  color: #c49a9a;
  font-weight: 400;
  font-style: italic;
}

/* 编辑模式：照片上传占位区 */
.city-photo-placeholder {
  width: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  color: var(--pink-deep);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.city-photo-placeholder:hover {
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
  color: #fff;
}

/* 编辑模式：照片删除按钮 */
.city-photo-delete-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #d32f2f;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

body.editing .city-photo-item:hover .city-photo-delete-btn {
  display: flex;
}

.city-photo-delete-btn:hover {
  background: #fee;
  transform: scale(1.1);
}

/* 编辑模式：城市删除按钮 */
.city-frame-delete-btn {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 14px;
  border-radius: 14px;
  border: 1px solid rgba(211, 47, 47, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #d32f2f;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
}

body.editing .city-frame:hover .city-frame-delete-btn {
  display: block;
}

.city-frame-delete-btn:hover {
  background: #fee;
  border-color: #d32f2f;
}

/* 编辑模式：城市相框虚线边框 */
body.editing .city-frame {
  border-style: dashed;
  border-color: rgba(229, 115, 115, 0.3);
}

/* 「+ 添加照片」按钮 */
.add-photo-btn {
  display: none;
  min-height: 160px;
  border: 2px dashed rgba(229, 115, 115, 0.25);
  border-radius: 12px;
  background: transparent;
  color: var(--pink-deep);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.3s;
}

body.editing .add-photo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-photo-btn:hover {
  background: rgba(252, 228, 236, 0.4);
  border-color: var(--pink-deep);
}

/* 「+ 添加城市」按钮 */
.add-city-btn {
  display: none;
  width: 100%;
  padding: 18px;
  border: 2px dashed rgba(229, 115, 115, 0.3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--pink-deep);
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.3s;
}

body.editing .add-city-btn {
  display: block;
}

.add-city-btn:hover {
  background: rgba(252, 228, 236, 0.5);
  border-color: var(--pink-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(229, 115, 115, 0.15);
}

/* ==================== 第五屏：我正在改变着 ==================== */
.changing-section {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.changing-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 喜好记录图片 */
.changing-pref-image-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin-bottom: 40px;
}

.changing-pref-image {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.changing-pref-image.visible {
  opacity: 1;
  transform: translateY(0);
}

.changing-pref-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-strong);
}

/* 编辑模式：图片上传占位 */
.changing-pref-placeholder {
  width: 100%;
  max-width: 500px;
  min-height: 300px;
  border: 2px dashed #e0c0c0;
  border-radius: var(--radius);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  font-size: 1rem;
  color: #c49a9a;
  background: rgba(255, 220, 220, 0.3);
  cursor: pointer;
  transition: all var(--transition);
}

body.editing .changing-pref-placeholder {
  display: flex;
}

/* 编辑模式下：图片仍然可见半透明，并显示更换按钮 */
body.editing .changing-pref-image-wrap .changing-pref-image {
  opacity: 0.5;
}

.changing-pref-change-btn {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
}

body.editing .changing-pref-change-btn {
  display: block;
}

.changing-pref-placeholder:hover {
  border-color: #e57373;
  color: #d47474;
  background: rgba(255, 200, 200, 0.45);
  box-shadow: 0 4px 16px rgba(229, 115, 115, 0.2);
}

/* 文字行 */
.changing-lines {
  width: 100%;
}

.changing-line {
  padding: 20px 0;
  border-bottom: 1px solid rgba(141, 110, 99, 0.1);
  font-size: 1.05rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
  line-height: 1.8;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.changing-line.visible {
  opacity: 1;
  transform: translateX(0);
}

.changing-line:last-child {
  border-bottom: none;
}

.changing-line::before {
  content: '✎ ';
  color: var(--pink-deep);
  opacity: 0.5;
  font-size: 0.85rem;
}

/* ==================== 第六屏：愿望清单 ==================== */
.wishlist-section {
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
}

.wishlist {
  max-width: 600px;
  margin: 0 auto;
}

.wishlist-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px dashed rgba(141, 110, 99, 0.15);
  font-size: 1.05rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

.wishlist-item:last-child {
  border-bottom: none;
}

.wishlist-checkbox {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-deep);
  font-size: 0.8rem;
  transition: all var(--transition);
  background: var(--white);
}

/* ==================== 第七屏：正式表白 ==================== */
.confession-section {
  background: linear-gradient(135deg, #fce4ec 0%, #fdf2f5 50%, #fce4ec 100%);
  min-height: 100vh;
}

.confession-box {
  max-width: 650px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}

.typewriter {
  text-align: left;
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text);
  white-space: pre-wrap;
}

.typewriter .cursor::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--pink-deep);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.confession-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease 0.3s;
}

.confession-buttons.show {
  opacity: 1;
  transform: translateY(0);
}

.btn-yes,
.btn-super-yes {
  padding: 14px 36px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.btn-yes {
  background: linear-gradient(135deg, #e57373, #f06292);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(229, 115, 115, 0.35);
}

.btn-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(229, 115, 115, 0.5);
}

.btn-super-yes {
  background: var(--white);
  color: var(--pink-deep);
  border: 2px solid var(--pink);
  box-shadow: 0 4px 15px rgba(248, 187, 208, 0.3);
}

.btn-super-yes:hover {
  background: var(--pink-light);
  transform: translateY(-2px);
}

/* ==================== 音乐按钮 ==================== */
.music-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  box-shadow: var(--shadow-strong);
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.music-btn:hover {
  transform: scale(1.1);
}

.music-btn.playing {
  background: var(--pink-light);
  animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(229, 115, 115, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(229, 115, 115, 0.5); }
}

/* ==================== 导航点 ==================== */
.nav-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(141, 110, 99, 0.25);
  cursor: pointer;
  transition: all var(--transition);
}

.nav-dot:hover,
.nav-dot.active {
  background: var(--pink-deep);
  transform: scale(1.4);
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px 36px;
  max-width: 460px;
  text-align: center;
  box-shadow: var(--shadow-strong);
  transform: scale(0.9);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-text {
  font-size: 1.2rem;
  line-height: 2;
  color: var(--brown);
  font-weight: 500;
}

/* ==================== 照片预览 ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
  color: var(--white);
  margin-top: 16px;
  font-size: 1rem;
  opacity: 0.8;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.3s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

/* ==================== 爱心动画 ==================== */
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 250;
}

.heart {
  position: absolute;
  font-size: 1.5rem;
  animation: heartFall linear forwards;
  pointer-events: none;
}

@keyframes heartFall {
  0% {
    transform: translateY(-10vh) rotate(0deg) scale(0.8);
    opacity: 1;
  }
  30% {
    opacity: 1;
    transform: translateY(30vh) rotate(120deg) scale(1.1);
  }
  100% {
    transform: translateY(110vh) rotate(360deg) scale(0.3);
    opacity: 0;
  }
}

/* 图片占位（加载失败时显示） */
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  color: #8d6e63;
  font-family: var(--font-body);
  min-height: 160px;
}

/* ==================== 编辑模式 ==================== */

/* 编辑工具栏 */
.edit-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.edit-toolbar:hover {
  opacity: 1;
}

.toolbar-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  border: 1.5px solid rgba(229, 115, 115, 0.3);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  color: var(--brown-light);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.25s;
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: var(--pink-light);
  border-color: var(--pink-deep);
  color: var(--brown);
}

.toolbar-btn.active {
  background: var(--pink-deep);
  color: #fff;
  border-color: var(--pink-deep);
}

.toolbar-btn.finalize-btn {
  border-color: rgba(229, 115, 115, 0.5);
  font-weight: 500;
}

.toolbar-btn.reset-btn {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* 编辑模式下的 item 通用样式 */
body.editing .editable-item {
  position: relative;
  border-radius: 12px;
  transition: box-shadow 0.25s, outline 0.25s;
  outline: 1.5px dashed transparent;
}

body.editing .editable-item:hover {
  outline-color: rgba(229, 115, 115, 0.35);
  box-shadow: 0 0 0 6px rgba(229, 115, 115, 0.06);
}

/* 编辑/删除按钮 - 悬停出现 */
.item-actions {
  position: absolute;
  top: -12px;
  right: -8px;
  display: none;
  gap: 4px;
  z-index: 10;
}

body.editing .editable-item:hover .item-actions {
  display: flex;
}

.item-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.item-edit-btn {
  background: #fff;
  color: var(--brown);
}

.item-edit-btn:hover {
  background: var(--pink-light);
  color: var(--pink-deep);
}

.item-delete-btn {
  background: #fff;
  color: var(--brown);
}

.item-delete-btn:hover {
  background: #fee;
  color: #d32f2f;
}

/* 添加按钮 */
.add-item-btn {
  display: none;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--pink-deep);
  background: transparent;
  border: 2px dashed rgba(229, 115, 115, 0.3);
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.3s;
}

body.editing .add-item-btn {
  display: block;
}

.add-item-btn:hover {
  background: rgba(252, 228, 236, 0.5);
  border-color: var(--pink-deep);
}

/* 可编辑文本 */
.editable-text {
  cursor: text;
  border-radius: 4px;
  transition: background 0.2s;
}

body.editing .editable-text {
  padding: 2px 6px;
}

body.editing .editable-text:hover {
  background: rgba(229, 115, 115, 0.08);
  outline: 1px dashed rgba(229, 115, 115, 0.25);
  outline-offset: 2px;
}

/* 原地编辑：textarea */
.inline-editor {
  width: 100%;
  min-height: 60px;
  padding: 8px 12px;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  border: 2px solid var(--pink-deep);
  border-radius: 8px;
  background: #fff;
  resize: vertical;
  outline: none;
}

.inline-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: flex-end;
}

.inline-editor-save,
.inline-editor-cancel {
  padding: 4px 14px;
  font-size: 0.8rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.inline-editor-save {
  background: var(--pink-deep);
  color: #fff;
}

.inline-editor-save:hover {
  background: #d32f2f;
}

.inline-editor-cancel {
  background: #eee;
  color: #666;
}

.inline-editor-cancel:hover {
  background: #ddd;
}

/* 照片上传提示 */
body.editing .timeline-photo,
body.editing .city-photo-item img {
  cursor: pointer;
  position: relative;
}

body.editing .timeline-photo:hover::after,
body.editing .city-photo-item img:hover::after {
  content: '点击替换照片';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.9rem;
  border-radius: inherit;
  font-family: var(--font-body);
  pointer-events: none;
}

body.editing .city-photo-item .city-photo-title {
  cursor: text;
}

/* 最终完成状态 */
body.finalized .edit-toolbar {
  opacity: 0.25;
  pointer-events: none;
}

body.finalized .edit-toolbar:hover {
  opacity: 0.85;
  pointer-events: auto;
}

body.finalized .editable-item:hover {
  outline: none !important;
  box-shadow: none !important;
}

/* 完成状态下右下角显示解锁按钮 */
.finalized-badge {
  display: none;
  position: fixed;
  bottom: 88px;
  right: 32px;
  z-index: 100;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(229,115,115,0.2);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brown-light);
  transition: all 0.3s;
  opacity: 0;
  pointer-events: none;
}

body.finalized .finalized-badge {
  opacity: 0.5;
  pointer-events: auto;
}

.finalized-badge:hover {
  opacity: 1 !important;
  background: var(--pink-light);
  border-color: var(--pink-deep);
}

/* 恢复默认确认弹窗 */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.confirm-dialog p {
  margin-bottom: 20px;
  color: var(--text);
  line-height: 1.7;
}

.confirm-dialog-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-dialog-btns button {
  padding: 8px 24px;
  border-radius: 20px;
  border: none;
  font-family: var(--font-body);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.confirm-btn-cancel {
  background: #eee;
  color: #666;
}

.confirm-btn-cancel:hover {
  background: #ddd;
}

.confirm-btn-ok {
  background: var(--pink-deep);
  color: #fff;
}

.confirm-btn-ok:hover {
  background: #d32f2f;
}

@media (max-width: 480px) {
  .edit-toolbar {
    top: 8px;
    right: 8px;
    flex-direction: row;
    gap: 6px;
  }

  .toolbar-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .item-actions {
    top: -10px;
    right: -4px;
  }
}

/* ==================== 动画辅助类 ==================== */
/* 淡入上滑 */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fade-up.delay-1 { animation-delay: 0.2s; }
.fade-up.delay-2 { animation-delay: 0.4s; }
.fade-up.delay-3 { animation-delay: 0.6s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动触发的显示 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 愿望清单动画 */
.wishlist-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wishlist-item.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ==================== 响应式：平板 ==================== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .container {
    padding: 0 20px;
  }

  /* 时间线改为左对齐 */
  .timeline::before {
    left: 7px;
  }

  .timeline-item,
  .timeline-item.timeline-left,
  .timeline-item.timeline-right {
    flex-direction: row;
    gap: 20px;
  }

  .timeline-item.timeline-left .timeline-dot,
  .timeline-item.timeline-right .timeline-dot {
    order: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 4px;
  }

  .timeline-item.timeline-left .timeline-content,
  .timeline-item.timeline-right .timeline-content {
    text-align: left;
    order: 1;
    max-width: none;
    flex: 1;
  }

  .city-frame-photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 20px;
  }

  .city-photo-item img {
    height: 170px;
  }

  .changing-pref-placeholder {
    min-height: 220px;
  }

  .confession-box {
    padding: 32px 20px;
  }

  .confession-buttons {
    flex-direction: column;
    align-items: center;
  }

  .nav-dots {
    right: 8px;
    gap: 8px;
  }

  .nav-dot {
    width: 8px;
    height: 8px;
  }
}

/* ==================== 响应式：手机 ==================== */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .btn-start {
    padding: 12px 32px;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.35rem;
    margin-bottom: 32px;
  }

  .section {
    padding: 60px 0;
  }

  .story-text {
    font-size: 0.95rem;
    line-height: 2;
  }

  .timeline-content {
    max-width: none;
  }

  .timeline-photo {
    max-width: 160px;
  }

  .city-frame-photos {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }

  .city-frame-name {
    font-size: 1.15rem;
  }

  .city-frame-date {
    font-size: 0.8rem;
  }

  .city-photo-item img {
    height: 140px;
  }

  .changing-line {
    font-size: 0.95rem;
    padding: 16px 0;
  }

  .typewriter {
    font-size: 0.9rem;
    line-height: 2;
  }

  .music-btn {
    width: 42px;
    height: 42px;
    bottom: 20px;
    right: 16px;
  }

  .nav-dots {
    display: none;
  }
}

/* ============================================================
   照片墙首页 / 主题页 / 视图切换
   ============================================================ */

/* 视图切换：默认隐藏所有 section，仅 .active 显示 */
.section {
  display: none;
}

.section.active {
  display: flex;
}

/* ---- 照片墙网格 ---- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: min(640px, calc(100vw - 48px));
  margin: 8px auto 0;
}

.theme-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--white);
  transition: transform var(--transition), box-shadow var(--transition);
}

.theme-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-strong);
}

.theme-card-cover {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
}

.theme-card-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
}

.theme-card-emoji {
  font-size: 3rem;
}

.theme-card-title {
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brown);
  text-align: center;
  letter-spacing: 0.04em;
}

/* 编辑模式：主题卡片右上角操作按钮 */
.theme-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  gap: 6px;
  z-index: 5;
}

body.editing .theme-card:hover .theme-card-actions {
  display: flex;
}

.theme-card-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.theme-card-btn:hover {
  transform: scale(1.1);
}

.theme-card-delete:hover {
  background: #fee;
}

/* 编辑模式：新增主题按钮 */
.add-theme-btn {
  grid-column: 1 / -1;
  padding: 18px;
  border: 2px dashed rgba(229, 115, 115, 0.4);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  color: var(--pink-deep);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.3s;
}

.add-theme-btn:hover {
  background: rgba(252, 228, 236, 0.6);
  border-color: var(--pink-deep);
}

/* ---- 表白入口按钮 ---- */
.btn-confession-entry {
  margin-top: 8px;
  padding: 16px 44px;
  font-size: 1.1rem;
  font-family: var(--font-body);
  color: var(--white);
  background: linear-gradient(135deg, #e57373, #f06292);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(229, 115, 115, 0.4);
  transition: all var(--transition);
}

.btn-confession-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(229, 115, 115, 0.5);
}

/* ---- 返回照片墙按钮 ---- */
.back-to-wall {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 99;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--brown);
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.back-to-wall:hover {
  background: var(--pink-light);
  transform: translateX(-2px);
}

.back-arrow {
  font-size: 1.1rem;
}

/* ---- 自定义「照片集」主题 ---- */
.gallery-theme-section {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.gallery-theme-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.gallery-item-title {
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-light);
  text-align: center;
  min-height: 24px;
}

.gallery-item-title-placeholder {
  color: #bcaaa4;
  font-style: italic;
}

.gallery-item-placeholder {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-light);
  font-size: 0.95rem;
  background: rgba(252, 228, 236, 0.35);
  cursor: pointer;
}

.gallery-item-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #d32f2f;
  display: none;
}

body.editing .gallery-item:hover .gallery-item-delete {
  display: block;
}

.gallery-add-btn {
  grid-column: 1 / -1;
}

/* ---- 响应式：照片墙 ---- */
@media (max-width: 768px) {
  .theme-grid {
    gap: 14px;
    width: min(520px, calc(100vw - 40px));
  }

  .theme-card-cover {
    height: 150px;
  }

  .gallery-theme-content {
    gap: 16px;
  }

  .gallery-item img,
  .gallery-item-placeholder {
    height: 190px;
  }
}

@media (max-width: 480px) {
  .theme-grid {
    grid-template-columns: 1fr;
    width: min(340px, calc(100vw - 40px));
  }

  .theme-card-cover {
    height: 200px;
  }

  .btn-confession-entry {
    padding: 14px 32px;
    font-size: 1rem;
  }

  .back-to-wall {
    top: 12px;
    left: 12px;
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .gallery-theme-content {
    grid-template-columns: 1fr;
  }

  .gallery-item img,
  .gallery-item-placeholder {
    height: 220px;
  }
}

/* ============================================================
   扩展：首页纪念日 / 经历日记筛选 / 猫咪 / 里程碑 / 结尾
   ============================================================ */

/* ---- 首页：在一起天数 + 纪念日倒计时 ---- */
.relationship-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: center;
  align-items: center;
  margin: 4px 0 8px;
  padding: 18px 26px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(229, 115, 115, 0.12);
  color: var(--brown);
}

.days-together {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px;
}

.days-number {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pink-deep);
  letter-spacing: 0.02em;
}

.days-label {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--brown-light);
  letter-spacing: 0.08em;
}

.next-anniversary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--text-light);
}

.next-anniversary strong {
  color: var(--pink-deep);
  font-size: 1.1rem;
}

/* ---- 经历日记：筛选工具栏 ---- */
.timeline-toolbar {
  max-width: 640px;
  margin: 0 auto 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-search {
  width: 100%;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  border: 1.5px solid rgba(229, 115, 115, 0.25);
  border-radius: 50px;
  background: var(--white);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.timeline-search:focus {
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(229, 115, 115, 0.1);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.category-chip {
  padding: 6px 16px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--brown-light);
  background: var(--white);
  border: 1.5px solid rgba(229, 115, 115, 0.2);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.category-chip:hover {
  border-color: var(--pink-deep);
  color: var(--pink-deep);
}

.category-chip.active {
  background: var(--pink-deep);
  border-color: var(--pink-deep);
  color: #fff;
}

.timeline-filter-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timeline-filter-select {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--text-light);
  border: 1.5px solid rgba(229, 115, 115, 0.2);
  border-radius: 10px;
  background: var(--white);
  outline: none;
  cursor: pointer;
}

/* ---- 经历日记：分组标题 + 分类标签 ---- */
.timeline-year-header {
  text-align: center;
  margin: 44px 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.1em;
}

.timeline-year-header:first-child {
  margin-top: 0;
}

.timeline-month-header {
  text-align: center;
  margin: 20px 0 6px;
  font-size: 0.9rem;
  color: var(--brown-light);
  letter-spacing: 0.08em;
}

.timeline-category {
  display: inline-block;
  margin: 6px 0 10px;
  font-size: 0.75rem;
  padding: 2px 12px;
  border-radius: 50px;
  background: #fce4ec;
  color: #d47474;
  letter-spacing: 0.04em;
}

.timeline-category-edit {
  display: inline-block;
  margin: 6px 0 10px;
}

.timeline-category-select {
  font-size: 0.78rem;
  font-family: var(--font-body);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1.5px solid rgba(229, 115, 115, 0.35);
  color: var(--text-light);
  background: #fff;
  cursor: pointer;
}

.timeline-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--brown-light);
  font-size: 0.95rem;
}

/* ---- 我们的小猫 ---- */
.cat-section {
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
}

.cats {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

.cat-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
}

.cat-card-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.06em;
}

.cat-card-delete-btn {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  border-radius: 14px;
  border: 1px solid rgba(211, 47, 47, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #d32f2f;
  cursor: pointer;
}

body.editing .cat-card-delete-btn {
  display: block;
}

.cat-card-intro {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 2;
  min-height: 1.5em;
  margin-bottom: 22px;
}

.cat-card-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cat-photo-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fdf7f7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

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

.cat-photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.cat-photo-title {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
  min-height: 22px;
}

.cat-photo-title-placeholder {
  color: #c49a9a;
  font-style: italic;
}

.cat-photo-date {
  padding: 0 12px 12px;
  font-size: 0.78rem;
  color: #c49a9a;
  text-align: center;
  min-height: 18px;
}

.cat-photo-date-placeholder {
  color: #d9b8b8;
  font-style: italic;
}

.cat-photo-placeholder {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  color: var(--pink-deep);
  font-size: 0.9rem;
  cursor: pointer;
}

.cat-photo-delete-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #d32f2f;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 5;
}

body.editing .cat-photo-item:hover .cat-photo-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-add-btn {
  grid-column: 1 / -1;
}

/* ---- 未来与心愿：里程碑 ---- */
.wishlist-title {
  max-width: 600px;
  margin: 48px auto 20px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.05em;
}

.milestones {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.milestone-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

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

.milestone-item.done {
  border: 2px solid #f8bbd0;
}

.milestone-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.milestone-body {
  flex: 1;
}

.milestone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
}

.milestone-desc {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-top: 4px;
}

.milestone-date {
  font-size: 0.8rem;
  color: #c49a9a;
  margin-top: 6px;
}

.milestone-toggle-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  border-radius: 14px;
  border: 1px solid rgba(229, 115, 115, 0.35);
  background: #fff;
  color: var(--pink-deep);
  cursor: pointer;
}

body.editing .milestone-toggle-btn {
  display: block;
}

/* ---- 结尾：我们在一起的日子 ---- */
.ending-section {
  background: linear-gradient(135deg, #fce4ec 0%, #fdf2f5 50%, #fce4ec 100%);
  min-height: 100vh;
}

.ending-box {
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 56px 40px;
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.ending-days {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ending-days-number {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pink-deep);
}

.ending-days-unit {
  font-size: 1.4rem;
  color: var(--brown-light);
}

.ending-anniversary {
  font-size: 1rem;
  color: var(--brown-light);
}

.ending-text {
  font-size: 1.05rem;
  line-height: 2.2;
  color: var(--text);
  text-align: center;
}

.ending-text p {
  margin-bottom: 8px;
}

/* ---- 扩展响应式 ---- */
@media (max-width: 768px) {
  .cat-card-photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .cat-photo-item img {
    height: 170px;
  }
}

@media (max-width: 480px) {
  .days-number {
    font-size: 2rem;
  }

  .relationship-panel {
    padding: 14px 18px;
    flex-direction: column;
    gap: 10px;
  }

  .cat-card {
    padding: 20px 16px;
  }

  .cat-card-photos {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .cat-photo-item img {
    height: 140px;
  }

  .ending-days-number {
    font-size: 3rem;
  }

  .ending-box {
    padding: 40px 20px;
  }
}

/* ============================================================
   我们一起经历的日子（第一次）/ 美食 / 纪念日
   ============================================================ */

/* ---- 我们一起经历的日子（第一次） ---- */
.firsttime-section {
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
}

.firsttimes {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.firsttime-item {
  text-align: center;
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

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

.firsttime-date {
  font-size: 0.85rem;
  color: var(--pink-deep);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.firsttime-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 8px;
}

.firsttime-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 14px;
}

.firsttime-photo {
  max-width: 240px;
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  margin: 0 auto;
  display: block;
}

.firsttime-photo-placeholder {
  max-width: 240px;
  min-height: 120px;
  margin: 0 auto;
  border: 2px dashed #e0c0c0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c49a9a;
  background: rgba(255, 220, 220, 0.3);
  cursor: pointer;
}

/* ---- 美食 ---- */
.food-section {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.foods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.food-item {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

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

.food-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.food-photo-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  color: var(--pink-deep);
  cursor: pointer;
}

.food-body {
  padding: 16px 18px 18px;
}

.food-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 6px;
}

.food-comment {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
}

.food-date {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #c49a9a;
}

/* 美食分组小标题（在外面吃的 / 大美女自己做的） */
.filterable-group-header {
  grid-column: 1 / -1;
  margin: 24px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.06em;
  text-align: center;
}

.filterable-group-header:first-child {
  margin-top: 0;
}

.food-type-select {
  margin-top: 8px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  padding: 3px 10px;
  border-radius: 50px;
  border: 1.5px solid rgba(229, 115, 115, 0.35);
  color: var(--text-light);
  background: #fff;
  cursor: pointer;
}

/* 美食网格中的年份分组标题横跨整行 */
.foods .timeline-year-header {
  grid-column: 1 / -1;
}

/* ---- 星级 ---- */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.stars-row {
  position: relative;
  display: inline-block;
  line-height: 1;
}

.stars-bg,
.stars-fg {
  font-size: 1.25rem;
  letter-spacing: 2px;
  line-height: 1;
}

.stars-bg {
  color: #e6d9d4;
}

.stars-fg {
  position: absolute;
  left: 0;
  top: 0;
  color: #f5a623;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.stars-num {
  font-size: 0.85rem;
  color: var(--brown-light);
  font-weight: 600;
}

.stars-editable {
  cursor: pointer;
}

.stars-editable .stars-bg {
  color: #d8c6c1;
}

/* ---- 纪念日 ---- */
.anniv-section {
  background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%);
}

.anniversaries {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 620px;
  margin: 0 auto;
}

.anniv-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow var(--transition);
}

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

.anniv-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.anniv-type {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.anniv-type-生日 { background: #fce4ec; color: #d47474; }
.anniv-type-节日 { background: #fff3e0; color: #e6953c; }
.anniv-type-纪念日 { background: #e8eaf6; color: #5c6bc0; }

.anniv-type-select {
  font-size: 0.8rem;
  font-family: var(--font-body);
  padding: 3px 10px;
  border-radius: 50px;
  border: 1.5px solid rgba(229, 115, 115, 0.35);
  color: var(--text-light);
  background: #fff;
  cursor: pointer;
}

.anniv-date {
  font-size: 0.85rem;
  color: var(--pink-deep);
  font-weight: 600;
}

.anniv-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 6px;
}

.anniv-desc {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 12px;
}

.anniv-photo {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: block;
}

.anniv-photo-placeholder {
  width: 100%;
  max-width: 320px;
  min-height: 100px;
  border: 2px dashed #e0c0c0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c49a9a;
  background: rgba(255, 220, 220, 0.3);
  cursor: pointer;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .foods {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .food-photo,
  .food-photo-placeholder {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .foods {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .firsttime-item {
    padding: 16px;
  }
}

/* ============================================================
   登录遮罩（Supabase Auth）
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 40%, #fdf2f5 100%);
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.06em;
}

.auth-subtitle {
  margin-top: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--brown-light);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-radius: 50px;
  background: #f6ece9;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px 0;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--brown-light);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--white);
  color: var(--pink-deep);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  border: 1.5px solid rgba(229, 115, 115, 0.25);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.auth-input:focus {
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(229, 115, 115, 0.1);
}

.auth-btn {
  padding: 12px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: #fff;
  background: linear-gradient(135deg, #e57373, #f06292);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 115, 115, 0.4);
}

.auth-otp-row {
  display: flex;
  gap: 8px;
}

.auth-otp-row .auth-input {
  flex: 1;
}

.auth-btn-send {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 0.85rem;
  background: var(--white);
  color: var(--pink-deep);
  border: 1.5px solid var(--pink);
  box-shadow: none;
}

.auth-btn-send:hover {
  background: var(--pink-light);
  box-shadow: none;
}

.auth-error {
  margin-top: 14px;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #d32f2f;
}

.logout-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 500;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.logout-btn:hover {
  background: var(--pink-light);
  transform: scale(1.08);
}
