/* ============================================================
   style.css — 恋爱纪念日网站样式表
   修改网站外观时编辑此文件即可
   ============================================================ */

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

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
  background: linear-gradient(135deg, #FFF0F5 0%, #FFFDD0 50%, #F0FFF0 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== 飘落粒子（樱花/爱心）容器 ===== */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: -40px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  opacity: 0.7;
  font-size: 20px;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ===== 主容器 ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 15px;
  position: relative;
  z-index: 1;
}

/* ===== 顶部装饰 ===== */
.header-decoration {
  text-align: center;
  margin-bottom: 10px;
}

.header-decoration span {
  font-size: 28px;
  display: inline-block;
  animation: floatHeart 2s ease-in-out infinite;
}

.header-decoration span:nth-child(2) { animation-delay: 0.3s; }
.header-decoration span:nth-child(3) { animation-delay: 0.6s; }

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

/* ===== 标题 ===== */
.main-title {
  text-align: center;
  font-size: 36px;
  color: #E87A90;
  margin: 10px 0 5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
  letter-spacing: 4px;
}

.sub-title {
  text-align: center;
  font-size: 15px;
  color: #C9A0A0;
  margin-bottom: 30px;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 300;
  letter-spacing: 2px;
}

/* ===== 纪念日计时器卡片 ===== */
.timer-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,240,245,0.92));
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 35px 20px 30px;
  margin-bottom: 35px;
  text-align: center;
  box-shadow:
    0 8px 32px rgba(255,182,193,0.25),
    0 2px 8px rgba(255,182,193,0.15);
  border: 1px solid rgba(255,182,193,0.3);
  position: relative;
}

.timer-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255,182,193,0.08) 0%, transparent 50%);
  animation: shimmer 8s ease-in-out infinite;
  pointer-events: none;
  border-radius: 24px;
}

@keyframes shimmer {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10%, 10%); }
}

.timer-label {
  font-size: 18px;
  color: #E8A0A8;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
}

.timer-display {
  font-size: 46px;
  color: #D4617A;
  font-weight: 700;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(212,97,122,0.15);
  white-space: nowrap;
}

/* 计时器数字跳动效果：由 JS 动态添加 bounce 类控制 */
.timer-digit {
  display: inline-block;
  transition: transform 0.05s;
}

.timer-digit.bounce {
  animation: digitPop 0.3s ease;
}

@keyframes digitPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.timer-heart {
  display: inline-block;
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

.timer-love-message {
  margin-top: 12px;
  font-size: 14px;
  color: #C9A0A0;
  position: relative;
  z-index: 1;
  font-family: 'Noto Sans SC', sans-serif;
}

/* ===== 区块通用标题 ===== */
.section-title {
  text-align: center;
  font-size: 24px;
  color: #D4617A;
  margin: 40px 0 20px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #FFB6C1, #E8A0A8);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ===== 相册轮播 ===== */
.album-section {
  margin-bottom: 35px;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 8px 30px rgba(255,182,193,0.25),
    0 2px 8px rgba(0,0,0,0.05);
  background: #fff;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

/* 占位色块 - 柔和粉彩色调 */
.placeholder-photo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  font-family: 'Noto Sans SC', sans-serif;
  transition: transform 0.3s ease;
}

.placeholder-photo:hover {
  transform: scale(1.02);
}

.placeholder-photo .camera-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 28px;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.3);
}

.placeholder-photo .replace-hint {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
}

/* 6 种柔和粉彩色调 */
.color-1 { background: linear-gradient(135deg, #FFB6C1, #FFC0CB); }
.color-2 { background: linear-gradient(135deg, #DDA0DD, #E8C0E8); }
.color-3 { background: linear-gradient(135deg, #B0E0E6, #C8E8ED); }
.color-4 { background: linear-gradient(135deg, #FFDAB9, #FFE4C4); }
.color-5 { background: linear-gradient(135deg, #C8E6C9, #DCF0DD); }
.color-6 { background: linear-gradient(135deg, #F8C8DC, #FAD0E3); }

/* 轮播控制按钮 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #D4617A;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

/* 指示点 */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E8C0C8;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #D4617A;
  width: 26px;
  border-radius: 5px;
}

/* ===== 照片放大查看模态框 ===== */
.photo-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.photo-modal.show {
  display: flex;
}

.photo-modal-content {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: scaleIn 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-content img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== 时间线 ===== */
.timeline-section {
  margin-bottom: 35px;
}

.timeline {
  position: relative;
  padding: 20px 0;
}

/* 中间竖线 */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, #FFB6C1, #E8A0A8, #DDA0DD);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  animation: timelineAppear 0.8s ease forwards;
  opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.3s; }
.timeline-item:nth-child(3) { animation-delay: 0.5s; }

@keyframes timelineAppear {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 左右交替排列 */
.timeline-item:nth-child(odd) {
  justify-content: flex-start;
  padding-right: 50%;
}

.timeline-item:nth-child(even) {
  justify-content: flex-end;
  padding-left: 50%;
}

.timeline-content {
  width: 85%;
  max-width: 100%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow:
    0 4px 20px rgba(255,182,193,0.2),
    0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,182,193,0.2);
  position: relative;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 30px rgba(255,182,193,0.3),
    0 2px 8px rgba(0,0,0,0.06);
}

/* 时间线节点圆点 */
.timeline-dot {
  position: absolute;
  top: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 12px rgba(255,182,193,0.4);
  z-index: 2;
  border: 3px solid #fff;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,182,193,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,182,193,0); }
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -62px;
  background: linear-gradient(135deg, #FFB6C1, #FFC0CB);
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -62px;
  background: linear-gradient(135deg, #DDA0DD, #E8C0E8);
}

/* 时间线箭头 */
.timeline-content::after {
  content: '';
  position: absolute;
  top: 26px;
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.92);
  transform: rotate(45deg);
  border: 1px solid rgba(255,182,193,0.2);
}

.timeline-item:nth-child(odd) .timeline-content::after {
  right: -7px;
  border-left: none;
  border-bottom: none;
}

.timeline-item:nth-child(even) .timeline-content::after {
  left: -7px;
  border-right: none;
  border-top: none;
}

.timeline-date {
  font-size: 13px;
  color: #E8A0A8;
  margin-bottom: 4px;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 700;
}

.timeline-title {
  font-size: 16px;
  color: #D4617A;
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 13px;
  color: #A08080;
  line-height: 1.6;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 300;
}

.timeline-icon {
  margin-right: 6px;
}

/* ===== 便利贴区域 ===== */
.sticky-note-section {
  margin-bottom: 40px;
}

.sticky-note {
  max-width: 500px;
  margin: 0 auto;
  background: linear-gradient(145deg, #FFFDD0, #FFF8DC);
  border-radius: 4px;
  padding: 35px 30px 30px;
  position: relative;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.08),
    0 2px 6px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.6);
  border: 1px solid rgba(200,180,120,0.15);
  transform: rotate(-0.8deg);
  transition: transform 0.3s ease;
}

.sticky-note:hover {
  transform: rotate(0deg) scale(1.01);
}

/* 便利贴顶部胶带 */
.sticky-note::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: linear-gradient(180deg, rgba(200,180,120,0.25), rgba(200,180,120,0.1));
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 便利贴右上角折角 */
.sticky-note::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 30px 30px 0;
  border-color: transparent #F5E6CA transparent transparent;
}

.sticky-note-text {
  font-size: clamp(16px, 4vw, 22px);
  color: #8B6363;
  line-height: 1.8;
  text-align: center;
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.sticky-note-text::before {
  content: '💕';
  display: block;
  font-size: 24px;
  margin-bottom: 12px;
}

.sticky-note-text::after {
  content: '💕';
  display: block;
  font-size: 24px;
  margin-top: 12px;
}

/* ===== 恋爱日记 ===== */
.diary-section {
  margin-bottom: 40px;
}

.diary-card {
  max-width: 600px;
  margin: 0 auto;
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,248,250,0.95));
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow:
    0 8px 30px rgba(255,182,193,0.2),
    0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(255,182,193,0.2);
  overflow: hidden;
}

.diary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 8px;
  font-size: 13px;
  color: #C9A0A0;
  font-family: 'Noto Sans SC', sans-serif;
}

.diary-date {
  font-weight: 700;
  color: #D4617A;
}

.diary-status {
  font-size: 12px;
  transition: all 0.3s ease;
}

.diary-status.saved {
  color: #8BC48B;
}

.diary-textarea {
  width: 100%;
  min-height: 180px;
  max-height: 400px;
  padding: 12px 18px;
  border: none;
  background: transparent;
  font-family: 'Noto Sans SC', 'ZCOOL KuaiLe', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: #5A4040;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.diary-textarea::placeholder {
  color: #D0B0B0;
}

.diary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px 14px;
  font-size: 12px;
  color: #C9A0A0;
  font-family: 'Noto Sans SC', sans-serif;
}

.diary-count {
  font-size: 12px;
}

.diary-clear {
  background: none;
  border: 1px solid #E0C8C8;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  color: #C0A0A0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Sans SC', sans-serif;
}

.diary-clear:hover {
  background: #FFE0E0;
  border-color: #FFB6C1;
  color: #D4617A;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 30px 0 20px;
  color: #C9A0A0;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
}

.footer span {
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===== 悬浮音乐按钮 ===== */
.music-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB6C1, #E8A0A8);
  box-shadow: 0 4px 20px rgba(255,182,193,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
  border: 3px solid rgba(255,255,255,0.6);
}

.music-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(255,182,193,0.55);
}

.music-toggle:active {
  transform: scale(0.95);
}

.music-icon {
  font-size: 24px;
  transition: transform 0.3s ease;
  user-select: none;
}

.music-toggle.playing .music-icon {
  animation: musicSpin 3s ease-in-out infinite;
}

@keyframes musicSpin {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(12deg); }
  75% { transform: rotate(-12deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 480px) {
  .music-toggle {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }
  .music-icon { font-size: 20px; }
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
  .container { padding: 15px 12px; }
  .main-title { font-size: 26px; letter-spacing: 2px; }
  .timer-label { font-size: 14px; }
  .timer-love-message { font-size: 12px; }
  .timer-card { padding: 25px 14px 22px; }
  .section-title { font-size: 20px; margin: 30px 0 15px; }

  /* 时间线在手机端改为单列 */
  .timeline::before { left: 24px; }

  .timeline-item {
    padding-left: 55px !important;
    padding-right: 0 !important;
    justify-content: flex-start !important;
  }

  .timeline-item .timeline-content {
    width: 100%;
  }

  .timeline-item .timeline-dot {
    left: 4px !important;
    right: auto !important;
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .timeline-content::after { display: none; }

  .carousel-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .sticky-note {
    transform: rotate(0deg);
    padding: 30px 20px 25px;
  }

  /* 手机端通用：所有元素不溢出 */
  .carousel-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }

  .diary-textarea {
    font-size: 14px;
    min-height: 150px;
  }

  .sticky-note-text {
    font-size: 15px;
  }
}

@media (max-width: 400px) {
  .main-title { font-size: 22px; }
  .timer-label { font-size: 13px; }
  .timer-card { padding: 20px 10px 18px; }
  .section-title { font-size: 18px; }
  .timeline-item { padding-left: 45px !important; }
  .timeline-item .timeline-dot {
    width: 30px; height: 30px; font-size: 12px;
  }
}

@media (max-width: 360px) {
  .timer-display { font-size: 14px; letter-spacing: 0.3px; }
  .container { padding: 10px 8px; }
  .timer-card { padding: 18px 8px 16px; }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FFF0F5;
}

::-webkit-scrollbar-thumb {
  background: #FFB6C1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #E8A0A8;
}

/* ===== 选中文字颜色 ===== */
::selection {
  background: #FFB6C1;
  color: #fff;
}
