/* =========================================================
   瑟莉丝的小蛋糕屋 —— 主题样式（覆盖 Bootstrap 5.3）
   ========================================================= */

:root {
  --cake-blue: #a9dcf2;
  --cake-pink: #ff9cbb;
  --cake-text: #fdf0f6;
  --cake-muted: #c3b3d9;
  --cake-border: rgba(214, 192, 235, 0.35);
  --cake-card-bg: rgba(255, 255, 255, 0.07);
  /* 自然缓动曲线 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --bs-body-bg: transparent;
  --bs-body-color: var(--cake-text);
  --bs-body-font-family: 'Georgia', 'Times New Roman', '华文楷体', '楷体', serif;
}

/* ---------- 全局背景（淡水蓝 × 粉的梦幻渐变） ---------- */
/* 渐变放到独立固定图层，用 transform 动画（GPU 合成），避免整屏 background 重绘导致的卡顿 */
html {
  scroll-behavior: smooth;
}
body {
  background: #4f7faf; /* 静态底色兜底 */
  min-height: 100vh;
  color: var(--cake-text);
  overflow-x: hidden;
}
.bg-gradient-layer {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background: linear-gradient(135deg, #4f7faf, #7ba6cb, #d3a3bb, #8f9fc4);
  background-size: 100% 100%;
  will-change: transform;
  pointer-events: none;
  animation: gradientShift 22s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-6%, 5%, 0); }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 25% 35%, rgba(169, 220, 242, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 75% 65%, rgba(255, 156, 187, 0.22) 0%, transparent 50%),
    radial-gradient(circle at 50% 18%, rgba(255, 190, 220, 0.12) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- 漂浮装饰元素 ---------- */
.ambient-objects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.floating-object {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.2;
  animation: floatAround 20s infinite ease-in-out;
  will-change: transform;
}
.floating-object:nth-child(1) { top: 5%; left: 5%; animation-duration: 22s; }
.floating-object:nth-child(2) { top: 80%; left: 90%; animation-duration: 19s; animation-delay: -4s; }
.floating-object:nth-child(3) { top: 15%; left: 85%; animation-duration: 25s; animation-delay: -8s; }
.floating-object:nth-child(4) { top: 70%; left: 8%; animation-duration: 20s; animation-delay: -12s; }
.floating-object:nth-child(5) { top: 40%; left: 45%; animation-duration: 27s; animation-delay: -3s; }
.floating-object:nth-child(6) { top: 25%; left: 30%; animation-duration: 23s; animation-delay: -9s; }
.floating-object:nth-child(7) { top: 90%; left: 25%; animation-duration: 21s; animation-delay: -15s; }
.floating-object:nth-child(8) { top: 5%; left: 55%; animation-duration: 24s; animation-delay: -6s; }

@keyframes floatAround {
  0%   { transform: translate(0, 0) rotate(0deg) scale(0.9); }
  25%  { transform: translate(25px, -35px) rotate(6deg) scale(1.05); }
  50%  { transform: translate(-20px, -15px) rotate(-4deg) scale(0.95); }
  75%  { transform: translate(-30px, 20px) rotate(2deg) scale(1.05); }
  100% { transform: translate(0, 0) rotate(0deg) scale(0.9); }
}

/* ---------- 背景粒子 ---------- */
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: sparkle 6s linear infinite;
}
@keyframes sparkle {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  20%  { opacity: 0.9; }
  50%  { opacity: 0.3; transform: translateY(-150px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-250px) scale(0); }
}

@keyframes heartPop {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0); }
  50%  { opacity: 1; transform: translate(-50%, -150%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -200%) scale(0.8); }
}

/* 鼠标点击 / 移动产生的临时特效 */
.mouse-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  background: radial-gradient(circle, #ffc2d9, transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  animation: mouseSparkle 1.5s ease-out forwards;
}
@keyframes mouseSparkle {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1.4); }
}
.heart-pop {
  position: fixed;
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  animation: heartPop 1s ease-out forwards;
}

/* ---------- 整体布局：左侧导航 + 右侧内容 ---------- */
.app-container {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 100vh;
  padding: 20px;
  animation: pageIn 0.9s var(--ease-out) both;
}
@keyframes pageIn {
  0%   { opacity: 0; transform: translateY(26px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 左侧导航栏（玻璃卡片分区） ---------- */
.sidebar-nav {
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 15px;
  gap: 18px;
  position: relative;
  z-index: 150;
  transition: transform 0.4s var(--ease-out);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 2px solid var(--cake-border);
  border-radius: 35px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: rgba(45, 27, 78, 0.35);
  border: 1px solid rgba(214, 192, 235, 0.25);
  border-radius: 10px;
  padding: 5px 9px;
  color: rgba(253, 240, 246, 0.65);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.3s, background 0.3s, color 0.3s;
}
.hamburger:hover {
  background: rgba(45, 27, 78, 0.55);
  color: rgba(253, 240, 246, 0.9);
}
.hamburger:active {
  transform: scale(0.92);
}

.nav-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--cake-border);
  border-radius: 25px;
  padding: 10px 15px;
  color: #f0e6f7;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s var(--ease-out), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  letter-spacing: 0.05em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.nav-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.nav-btn:hover::after {
  transform: translateX(100%);
}
.nav-btn:hover {
  background: rgba(255, 143, 171, 0.2);
  border-color: var(--cake-pink);
  transform: translateX(5px);
}
.nav-btn.active-module {
  background: rgba(169, 220, 242, 0.28);
  border-color: var(--cake-blue);
  box-shadow: 0 0 20px rgba(169, 220, 242, 0.55);
  color: #ffffff;
  font-weight: bold;
}

.secret-nav-btn {
  margin-top: auto;
  background: none;
  border: none;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s var(--ease-out);
  margin-bottom: 15px;
  white-space: nowrap;
  position: relative;
  isolation: isolate;
}
.secret-nav-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  transform: scale(1.05);
}
.secret-nav-btn.active-module {
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
}

/* ---------- 右侧内容区 ---------- */
.content-area {
  flex: 1;
  margin-left: 30px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border-radius: 35px;
  border: 2px solid var(--cake-border);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  max-height: calc(100vh - 40px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 内容卡片（玻璃质感） ---------- */
.cake-card {
  background: var(--cake-card-bg);
  border: 1px solid var(--cake-border);
  border-radius: 22px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* 模块显示切换 */
.module { display: none; }
.module.active {
  display: block;
  animation: moduleIn 0.55s var(--ease-out) both;
}
@keyframes moduleIn {
  0%   { opacity: 0; transform: translateY(18px) scale(0.975); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 模块标题 + 底部装饰线生长动画 */
.module-title {
  font-size: 2rem;
  color: #ffc2d9;
  margin-bottom: 25px;
  padding-left: 15px;
  border-left: 5px solid var(--cake-pink);
  text-shadow: 0 0 15px rgba(255, 143, 171, 0.4);
  position: relative;
  isolation: isolate;
}
/* 标题柔光：改为伪元素 opacity 动画（GPU 合成），不再每帧重绘 text-shadow */
.module-title::before {
  content: '';
  position: absolute;
  inset: -10px -16px;
  z-index: -1;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(255, 143, 171, 0.22), transparent 70%);
  opacity: 0.35;
  animation: titleGlow 2.2s ease-in-out infinite alternate;
  pointer-events: none;
}
.module-title::after {
  content: '';
  position: absolute;
  left: 15px;
  bottom: -8px;
  height: 3px;
  width: 90px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cake-pink), var(--cake-blue), transparent);
  border-radius: 3px;
  transition: transform 0.8s var(--ease-out);
}
.module.active .module-title::after {
  transform: scaleX(1);
}
@keyframes titleGlow {
  0%   { opacity: 0.2; }
  100% { opacity: 0.55; }
}

/* ---------- 头像 ---------- */
.alice-portrait {
  position: relative;
  isolation: isolate;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--cake-pink);
  box-shadow: 0 0 20px rgba(255, 143, 171, 0.5);
  margin: 0 auto 1rem;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease-out);
}
/* 呼吸柔光：伪元素 opacity/scale 动画（GPU 合成），不再每帧重绘 box-shadow */
.alice-portrait::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  z-index: -1;
  background: radial-gradient(circle, rgba(169, 220, 242, 0.55), rgba(255, 143, 171, 0.4) 55%, transparent 75%);
  opacity: 0.5;
  animation: avatarGlow 2.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes avatarGlow {
  0%   { opacity: 0.35; transform: scale(0.94); }
  100% { opacity: 0.85; transform: scale(1.08); }
}
.alice-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  backface-visibility: hidden;
}
.alice-portrait:hover {
  transform: scale(1.08) rotate(5deg);
}

/* ---------- 资料条目 ---------- */
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
  padding: 10px 15px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  cursor: default;
  opacity: 0;
  transform: translateY(12px);
  will-change: transform, opacity;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out),
    background 0.3s ease, border-radius 0.3s ease;
}
.profile-row.reveal {
  opacity: 1;
  transform: translateY(0);
}
.profile-row:hover {
  background: rgba(255, 143, 171, 0.1);
  border-radius: 8px;
  transform: translateX(5px);
  transition-duration: 0.3s;
}
.profile-label {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--cake-text);
}
.profile-value {
  color: #ffc2d9;
  font-weight: bold;
  text-align: right;
  word-break: break-word;
}

/* ---------- 照片墙 ---------- */
.photo-frame {
  border-radius: 18px;
  border: 2px solid var(--cake-border);
  overflow: hidden;
  cursor: pointer;
  background: #2a1a3a;
  position: relative;
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition: transform 0.25s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s,
    opacity 0.55s var(--ease-out);
}
.photo-frame.reveal {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.photo-frame:hover {
  border-color: var(--cake-blue);
  box-shadow: 0 0 18px rgba(169, 220, 242, 0.3);
}
.photo-frame:hover img {
  transform: scale(1.04);
}

/* ---------- 日记卡片 ---------- */
.diary-card {
  background: var(--cake-card-bg);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--cake-border);
  cursor: default;
  opacity: 0;
  transform: translateY(16px);
  will-change: transform, opacity;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out),
    border-color 0.3s ease, box-shadow 0.3s ease;
}
.diary-card.reveal {
  opacity: 1;
  transform: translateY(0);
}
.diary-card:hover {
  border-color: var(--cake-blue);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(169, 220, 242, 0.35);
  transform: translateY(-5px);
  transition-duration: 0.3s;
}
.diary-date {
  color: var(--cake-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* ---------- 私密信息 ---------- */
.secret-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 25px;
  padding: 25px;
  border: 1px solid var(--cake-border);
}

/* 隐藏的私密内容：用黑色方块盖住，悬停时方块变 10% 透明露出文字 */
.secret-hidden {
  position: relative;
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  cursor: help;
}
.secret-hidden::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 4px;
  z-index: 1;
  opacity: 1;
  will-change: opacity;
  transition: opacity 0.25s ease;
}
.secret-hidden:hover::after {
  opacity: 0.1;
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  background: rgba(169, 220, 242, 0.4);
  border: 1px solid var(--cake-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: rgba(255, 143, 171, 0.6);
  transform: translateY(-3px) scale(1.1);
}

/* ---------- 点击涟漪 ---------- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
  transform: scale(0);
  animation: rippleAnim 0.55s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  0%   { transform: scale(0); opacity: 0.45; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- 鼠标跟随光晕（JS rAF 平滑跟随） ---------- */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 143, 171, 0.12), rgba(169, 220, 242, 0.1) 40%, transparent 70%);
  pointer-events: none;
  z-index: 5;
  will-change: transform;
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--cake-pink), var(--cake-blue));
  box-shadow: 0 0 10px rgba(255, 143, 171, 0.6);
  z-index: 400;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ---------- 私密按钮呼吸光晕（伪元素 opacity 动画，GPU 合成） ---------- */
.secret-nav-btn::after {
  content: '';
  position: absolute;
  inset: -6px -14px;
  z-index: -1;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(255, 143, 171, 0.45), transparent 70%);
  opacity: 0;
  animation: secretBreath 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes secretBreath {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.7; }
}

/* ---------- 回到顶部：自然缓动 + 悬浮发光 ---------- */
.back-to-top {
  transition: transform 0.35s var(--ease-out), background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 10px 24px rgba(255, 143, 171, 0.5);
}

/* ---------- 移动端 ---------- */
@media (max-width: 800px) {
  /* 推式导航：展开时整个容器向右平移，露出左侧导航栏（无遮罩） */
  .app-container {
    position: relative;
    flex-direction: row;
    align-items: flex-start;
    padding: 10px;
    min-height: 100vh;
    /* 禁用 pageIn 入场动画：避免关闭 nav-open 时动画接管 transform 导致瞬间归位 */
    animation: none;
    /* 更自然的缓动：轻盈启动、优雅缓慢收尾，无回弹 */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .app-container.nav-open {
    /* 平移量 = 侧边栏宽度(250px)，使侧边栏正好贴住屏幕左边缘，无缝隙 */
    transform: translateX(250px);
    animation: none;
  }
  /* 侧边栏：绝对定位在容器左侧，默认藏在屏幕外 */
  .sidebar-nav {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 5;
    background: rgba(30, 20, 50, 0.95);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 0 25px 25px 0;
    border: none;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    /* 随容器右移被顶出；-100% 保证展开后正好露在屏幕左侧 */
    transform: translateX(-100%);
    opacity: 0;
    /* 关闭时 opacity 与容器同步缓慢淡出(0.6s)，展开时覆盖为稍快淡入 */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  }
  .app-container.nav-open .sidebar-nav {
    opacity: 1;
    /* 展开时淡入稍快于容器，避免拖沓 */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }
  /* 侧边栏内部元素：默认隐藏，展开时逐个交错滑入 */
  .sidebar-nav .alice-portrait,
  .sidebar-nav .nav-modules .nav-btn,
  .sidebar-nav .secret-nav-btn {
    opacity: 0;
    transform: translateX(-18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  /* 关闭时：按与展开相反的次序逆序交错淡出，收合更自然 */
  .sidebar-nav .secret-nav-btn { transition-delay: 0.03s; }
  .sidebar-nav .nav-modules .nav-btn:nth-child(3) { transition-delay: 0.11s; }
  .sidebar-nav .nav-modules .nav-btn:nth-child(2) { transition-delay: 0.19s; }
  .sidebar-nav .nav-modules .nav-btn:nth-child(1) { transition-delay: 0.27s; }
  .sidebar-nav .alice-portrait { transition-delay: 0.35s; }
  .app-container.nav-open .sidebar-nav .alice-portrait {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.05s;
  }
  .app-container.nav-open .sidebar-nav .nav-modules .nav-btn:nth-child(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.13s;
  }
  .app-container.nav-open .sidebar-nav .nav-modules .nav-btn:nth-child(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.21s;
  }
  .app-container.nav-open .sidebar-nav .nav-modules .nav-btn:nth-child(3) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.29s;
  }
  .app-container.nav-open .sidebar-nav .secret-nav-btn {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.37s;
  }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content-area {
    flex: 1;
    margin-left: 0;
    margin-top: 60px;
    max-height: none;
    /* 移动端关闭独立滚动：内容撑开页面，由 body 负责滚动。
       若保留 overflow-y:auto + overscroll-behavior:contain，
       触摸/滚轮会被“空滚动容器”拦截，导致整页无法上下滑动。 */
    overflow-y: visible;
    overscroll-behavior: auto;
    padding: 20px;
    border-radius: 25px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
  }
  /* 内容区被推开时轻微内缩 + 柔和投影，产生景深感 */
  .app-container.nav-open .content-area {
    transform: scale(0.95);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }
  .module-title { font-size: 1.6rem; }
  .photo-frame { min-height: 100px; }
  .back-to-top { right: 10px; bottom: 10px; }
}

/* ---------- 交错入场延迟（--i 由 JS 注入） ---------- */
.profile-row.reveal { transition-delay: calc(var(--i, 0) * 60ms); }
.photo-frame.reveal { transition-delay: calc(var(--i, 0) * 55ms); }
.diary-card.reveal  { transition-delay: calc(var(--i, 0) * 80ms); }
.profile-row:hover,
.photo-frame:hover,
.diary-card:hover {
  transition-delay: 0ms;
}

/* ---------- 照片大图 Lightbox ---------- */
.photo-lightbox .modal-content {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 143, 171, 0.4);
  animation: lightboxIn 0.4s var(--ease-spring) both;
}
@keyframes lightboxIn {
  0%   { opacity: 0; transform: scale(0.86) translateY(24px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.photo-lightbox img {
  width: 100%;
  display: block;
  border-radius: 20px;
}
.photo-lightbox .lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(26, 20, 45, 0.6);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.photo-lightbox .lightbox-close:hover {
  background: rgba(255, 143, 171, 0.85);
  box-shadow: 0 0 14px rgba(255, 143, 171, 0.6);
  transform: scale(1.1) rotate(90deg);
}

/* ---------- 尊重系统"减少动态效果"设置（无障碍 & 省电） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
