/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --pink-50: #fff5f7;
  --pink-100: #ffe4ec;
  --pink-200: #ffc9d9;
  --pink-300: #ffa6c1;
  --pink-400: #ff7aa2;
  --pink-500: #ff4d85;
  --pink-600: #e83e73;
  --pink-700: #c71585;
  --glass-bg: rgba(255, 255, 255, 0.28);
  --glass-bg-strong: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-border-strong: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(200, 50, 120, 0.18);
  --text-primary: #4a1e33;
  --text-secondary: #7a3d5c;
  --text-muted: #a06b8a;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== 动态背景层 ===== */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: opacity 2s ease-in-out;
  opacity: 1;
}

.bg-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(40px) saturate(1.2);
  transform: scale(1.1);
  opacity: 0.6;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(255, 200, 220, 0.25) 0%,
    rgba(255, 180, 210, 0.15) 40%,
    rgba(255, 200, 220, 0.2) 100%
  );
  pointer-events: none;
}

/* ===== 工具类 ===== */
.hidden {
  display: none !important;
}

/* ===== iOS 玻璃态通用类 ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
}

/* ===== 加载动画 ===== */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 100%);
  transition: opacity 1s ease, visibility 1s ease;
}

.loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

#loaderCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.loader-text {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 300px;
  pointer-events: none;
}

.loader-title {
  display: block;
  font-size: 26px;
  font-weight: 600;
  color: var(--pink-700);
  letter-spacing: 3px;
  margin-bottom: 8px;
  animation: pulse 2s ease-in-out infinite;
}

.loader-sub {
  display: block;
  font-size: 13px;
  color: #db7093;
  letter-spacing: 1.5px;
  opacity: 0.8;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
}

/* ===== 密保问题（Gate） ===== */
.gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  animation: gateFadeIn 0.8s ease;
}

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

.gate-card {
  position: relative;
  z-index: 2;
  padding: 48px 40px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  animation: gatePop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gatePop {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gate-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: gateIconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 105, 180, 0.3));
}

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

.gate-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.gate-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  opacity: 0.9;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 50px;
  outline: none;
  font-family: inherit;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.gate-input:focus {
  border-color: var(--pink-400);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 5px rgba(255, 77, 133, 0.12);
  transform: scale(1.02);
}

.gate-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
  letter-spacing: 2px;
  text-transform: none;
}

.gate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(255, 77, 133, 0.35);
}

.gate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 77, 133, 0.5);
}

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

.gate-btn-heart {
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.gate-error {
  height: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: #ff4757;
  font-weight: 500;
  transition: all 0.3s ease;
}

.gate-error.show {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.gate-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.hint-dot {
  width: 6px;
  height: 6px;
  background: var(--pink-400);
  border-radius: 50%;
  opacity: 0.5;
}

.hint-dot:nth-child(2) {
  opacity: 0.7;
  transform: scale(1.2);
}

.hint-dot:nth-child(1) {
  opacity: 0.3;
}

/* 漂浮爱心背景 */
.gate-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.gate-hearts span {
  position: absolute;
  font-size: 24px;
  color: rgba(255, 105, 180, 0.3);
  animation: gateHeartFloat 8s ease-in-out infinite;
}

.gate-hearts span:nth-child(1) { left: 10%; animation-delay: 0s; font-size: 20px; }
.gate-hearts span:nth-child(2) { left: 30%; animation-delay: 1.5s; font-size: 30px; }
.gate-hearts span:nth-child(3) { left: 55%; animation-delay: 3s; font-size: 18px; }
.gate-hearts span:nth-child(4) { left: 75%; animation-delay: 2s; font-size: 26px; }
.gate-hearts span:nth-child(5) { left: 90%; animation-delay: 4s; font-size: 22px; }

@keyframes gateHeartFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-20vh) rotate(360deg);
    opacity: 0;
  }
}

/* 成功通过动画 */
.gate.pass .gate-card {
  animation: gatePass 1s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes gatePass {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

.gate.pass {
  animation: gateFadeOut 0.8s ease 0.5s forwards;
}

@keyframes gateFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ===== 主应用容器 ===== */
.app {
  min-height: 100vh;
  padding-top: 90px;
  animation: fadeInUp 1s ease 0.3s both;
  position: relative;
  z-index: 1;
}

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

/* ===== 顶部导航 ===== */
.navbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1100px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  border-radius: 50px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.heart-icon {
  font-size: 22px;
  color: var(--pink-500);
  animation: heartbeat 1.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(255, 77, 133, 0.3));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.2); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
  80% { transform: scale(1); }
}

.nav-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-600), var(--pink-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 7px 14px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.6);
  color: var(--pink-600);
  transform: translateY(-1px);
}

.music-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

.music-btn.playing {
  animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 133, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 77, 133, 0); }
}

/* ===== Hero 区域 ===== */
.hero {
  position: relative;
  max-width: 1100px;
  margin: 30px auto 50px;
  padding: 0 16px;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 48px 40px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero-date {
  font-size: 14px;
  color: var(--pink-600);
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.hero-title {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.highlight {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-style: italic;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  font-size: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  color: white;
  box-shadow: 0 6px 20px rgba(255, 77, 133, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 77, 133, 0.45);
}

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

.btn-ghost {
  background: rgba(255, 255, 255, 0.45);
  color: var(--pink-600);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

/* 统计数据 */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 0 16px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-heart {
  background: linear-gradient(135deg, #ff6b6b, #ff4757, #ff6b81);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

/* 漂浮爱心 */
.floating-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-hearts span {
  position: absolute;
  font-size: 20px;
  color: rgba(255, 105, 180, 0.35);
  animation: floatUp 9s ease-in-out infinite;
}

.floating-hearts span:nth-child(1) { left: 8%; animation-delay: 0s; font-size: 18px; }
.floating-hearts span:nth-child(2) { left: 22%; animation-delay: 1.5s; font-size: 26px; }
.floating-hearts span:nth-child(3) { left: 42%; animation-delay: 3s; font-size: 16px; }
.floating-hearts span:nth-child(4) { left: 60%; animation-delay: 2s; font-size: 24px; }
.floating-hearts span:nth-child(5) { left: 78%; animation-delay: 4s; font-size: 20px; }
.floating-hearts span:nth-child(6) { left: 92%; animation-delay: 1s; font-size: 22px; }

@keyframes floatUp {
  0% {
    transform: translateY(100%) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-120%) rotate(360deg);
    opacity: 0;
  }
}

/* ===== 通用 section ===== */
.section {
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.title-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 77, 133, 0.5);
}

.add-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-600);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}

.add-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.add-btn span {
  font-size: 16px;
  font-weight: 700;
}

/* ===== 日记卡片 ===== */
.diary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.diary-card {
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.diary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(255, 105, 180, 0.25);
}

.diary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.diary-card:hover::before {
  opacity: 1;
}

.diary-date {
  font-size: 12px;
  color: var(--pink-600);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.diary-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-preview {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diary-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.tag {
  padding: 3px 10px;
  background: rgba(255, 105, 180, 0.15);
  color: var(--pink-600);
  font-size: 11px;
  border-radius: 10px;
  font-weight: 500;
}

.diary-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 100, 100, 0.15);
  color: #e74c3c;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.diary-card:hover .diary-delete {
  opacity: 1;
}

.diary-delete:hover {
  background: rgba(255, 100, 100, 0.3);
  transform: scale(1.1);
}

/* ===== 照片墙 ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  grid-auto-rows: 170px;
}

.photo-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.photo-item:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(255, 105, 180, 0.3);
  z-index: 2;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.photo-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.photo-item:hover .photo-item-delete {
  opacity: 1;
}

.photo-item-delete:hover {
  background: rgba(255, 77, 77, 0.8);
  transform: scale(1.1);
}

/* ===== 空状态 ===== */
.empty-state {
  padding: 50px 24px;
  text-align: center;
  border-radius: 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}

/* ===== 底部 ===== */
.footer {
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 28px 20px;
  text-align: center;
  border-radius: 20px;
}

.footer-heart {
  font-size: 24px;
  color: var(--pink-500);
  margin-bottom: 8px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  opacity: 0.8;
}

/* ===== 弹窗通用 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 28px;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.modal-footer .btn {
  padding: 10px 22px;
  font-size: 14px;
}

/* 日记表单 */
.input-title {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  outline: none;
  font-family: inherit;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.input-title:focus {
  border-color: var(--pink-400);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 77, 133, 0.1);
}

.input-title::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.diary-date-input {
  font-size: 13px;
  color: var(--pink-600);
  font-weight: 600;
  margin-bottom: 14px;
  padding: 0 4px;
}

.input-content {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  outline: none;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.input-content:focus {
  border-color: var(--pink-400);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 77, 133, 0.1);
}

.input-content::placeholder {
  color: var(--text-muted);
}

.diary-tags-input {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.tags-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  padding-top: 5px;
  flex-shrink: 0;
}

.tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.tag-option {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-secondary);
  font-size: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  user-select: none;
}

.tag-option:hover {
  background: rgba(255, 255, 255, 0.6);
}

.tag-option.active {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 77, 133, 0.3);
}

/* 图片查看器 */
.photo-viewer {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: modalPop 0.3s ease;
}

.photo-viewer img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.photo-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--text-primary) !important;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.photo-delete-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: rgba(231, 76, 60, 0.85);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-family: inherit;
}

.photo-delete-btn:hover {
  background: rgba(231, 76, 60, 1);
  transform: translateY(-1px);
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 悬浮音乐按钮 ===== */
.floating-music {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
}

/* ===== 3D 旋转隧道 ===== */
.tunnel-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0 20px;
}

.tunnel-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 500px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tunnel {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: tunnelSpin 30s linear infinite;
}

@keyframes tunnelSpin {
  from { transform: rotateY(0deg) rotateX(5deg); }
  to { transform: rotateY(360deg) rotateX(5deg); }
}

.tunnel-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 120px;
  margin-left: -90px;
  margin-top: -60px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(255, 105, 180, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

.tunnel-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tunnel-center {
  position: relative;
  z-index: 5;
  text-align: center;
  pointer-events: none;
}

.tunnel-title {
  font-size: 52px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #ffd1dc 50%, #ff8fab 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 30px rgba(255, 105, 180, 0.5);
  letter-spacing: 4px;
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 182, 193, 0.5)); }
  50% { filter: drop-shadow(0 0 25px rgba(255, 105, 180, 0.8)); }
}

.tunnel-sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 3px;
  margin-bottom: 40px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-hint {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  animation: scrollBounce 2s ease-in-out infinite;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ===== 时间线 ===== */
.timeline-section {
  max-width: 1000px;
  margin: 0 auto 80px;
  padding: 60px 20px;
}

.timeline-header {
  text-align: center;
  margin-bottom: 50px;
}

.timeline-header .section-title {
  justify-content: center;
  margin-bottom: 10px;
}

.timeline-sub {
  font-size: 15px;
  color: var(--text-secondary);
  opacity: 0.85;
}

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

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: linear-gradient(180deg, var(--pink-300), var(--pink-500), var(--pink-700));
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 20px 40px;
  box-sizing: border-box;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 40px;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #fff, #ffe4ec);
  border: 3px solid var(--pink-400);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 3;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.timeline-item.left .timeline-dot {
  right: -22px;
}

.timeline-item.right .timeline-dot {
  left: -22px;
}

.timeline-card {
  padding: 24px;
  position: relative;
  transition: all 0.4s ease;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(255, 105, 180, 0.25);
}

.timeline-year {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.timeline-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.timeline-text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.timeline-text strong {
  color: var(--pink-600);
}

.timeline-photo {
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.25);
}

.timeline-item.left .timeline-photo {
  margin-left: auto;
}

.timeline-item.right .timeline-photo {
  margin-right: auto;
}

.timeline-photo {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.timeline-photo:hover {
  transform: scale(1.05);
}

.timeline-photo img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

/* ===== 表白语录 ===== */
.quotes-section {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 60px 20px;
}

.quotes-title {
  text-align: center;
  justify-content: center;
  margin-bottom: 40px;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.quote-card {
  padding: 28px 24px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.quote-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 80px;
  color: rgba(255, 105, 180, 0.2);
  font-family: Georgia, serif;
  line-height: 1;
}

.quote-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(255, 105, 180, 0.3);
}

.quote-text {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ===== section 通用 ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.title-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 77, 133, 0.5);
}

.photo-section,
.diary-section {
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .floating-music {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }
  .tunnel-section { min-height: 85vh; }
  .tunnel-container {
    height: 420px;
    perspective: 900px;
    perspective-origin: 50% 50%;
  }
  .tunnel {
    animation-duration: 25s;
  }
  .tunnel-ring {
    width: 140px;
    height: 180px;
    margin-left: -70px;
    margin-top: -90px;
    border-radius: 12px;
    border-width: 2px;
  }
  .tunnel-ring img {
    object-fit: cover;
  }
  .tunnel-title { font-size: 36px; letter-spacing: 2px; }
  .tunnel-sub { font-size: 14px; letter-spacing: 2px; margin-bottom: 24px; }
  .timeline::before { left: 24px; }
  .timeline-item { width: 100%; left: 0 !important; padding: 15px 15px 15px 60px; text-align: left !important; }
  .timeline-item.left .timeline-dot,
  .timeline-item.right .timeline-dot { left: 2px; right: auto; }
  .timeline-card { padding: 18px; }
  .timeline-title { font-size: 18px; }
  .timeline-text { font-size: 13px; }
  .timeline-photo { margin-left: 0 !important; margin-right: auto !important; }
  .timeline-photo img { height: 120px; }
  .quotes-section { padding: 40px 16px; }
  .quotes-grid { grid-template-columns: 1fr; gap: 14px; }
  .quote-card { padding: 22px 18px; }
  .quote-text { font-size: 14px; }
  .section-title { font-size: 22px; }
  .timeline-section { padding: 40px 16px; }
  .navbar {
    padding: 10px 14px;
    gap: 8px;
    top: 10px;
    width: calc(100% - 20px);
  }

  .nav-title {
    font-size: 16px;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 12px;
  }

  .music-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .app {
    padding-top: 76px;
  }

  .hero {
    margin-top: 16px;
    margin-bottom: 36px;
  }

  .hero-content {
    padding: 32px 22px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .hero-actions {
    gap: 8px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .stat-num {
    font-size: 18px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-item {
    padding: 0 8px;
  }

  .section-title {
    font-size: 22px;
  }

  .diary-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 130px;
    gap: 8px;
  }

  .photo-placeholder {
    font-size: 36px;
  }

  .modal {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 85vh;
    border-radius: 24px;
  }

  .diary-delete,
  .photo-item-delete {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .nav-links .nav-link:nth-child(n+3) {
    display: none;
  }
}
