:root {
  --bg: #faf5f0;
  --card: #ffffff;
  --primary: #ff8fab;
  --primary-dark: #e56b8d;
  --accent: #ffe0e8;
  --text: #3c3744;
  --muted: #9a93a0;
  --border: #f0e7e0;
  --danger: #e05252;
  --shadow: 0 2px 12px rgba(140, 110, 90, 0.08);
  --shadow-lg: 0 10px 30px rgba(140, 110, 90, 0.16);
  --radius: 16px;
  --header-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #fdf2f8 0%, #faf5f0 45%, #eef6fd 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

body.modal-open { overflow: hidden; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ===== 顶部 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 245, 240, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 24px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }

/* 顶部导航（桌面） */
.top-nav { display: none; gap: 4px; }
.top-nav .nav-item {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.top-nav .nav-item.active { background: var(--accent); color: var(--primary-dark); font-weight: 600; }

/* 宝宝选择条 */
.child-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 10px;
  max-width: 920px;
  margin: 0 auto;
  scrollbar-width: none;
}
.child-bar::-webkit-scrollbar { display: none; }

.child-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
}
.child-chip.active { border-color: var(--primary); background: var(--accent); color: var(--primary-dark); font-weight: 600; }

.chip-avatar-all {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
}

/* ===== 头像 ===== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--accent);
}
.avatar-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.avatar-sm { width: 26px; height: 26px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; font-size: 19px; }
.avatar-lg { width: 64px; height: 64px; font-size: 28px; }

/* ===== 主区域 ===== */
.app-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* ===== 时间轴 ===== */
.timeline { display: flex; flex-direction: column; gap: 16px; }

.record-card { padding: 16px; }

.record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.record-title { font-size: 17px; font-weight: 700; }
.record-actions { display: flex; gap: 2px; flex: 0 0 auto; }

.icon-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--muted);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  font-size: 13px;
  color: var(--muted);
}
.record-date { color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
}
.chip-stage { background: #eef4ff; color: #4a7fd0; }
.chip-age { background: #fff2e6; color: #d9813a; }
.chip-child { background: var(--accent); color: var(--primary-dark); }

.record-desc { margin: 8px 0 0; color: #6b6470; font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ===== 媒体网格 ===== */
.media-grid {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.media-grid.count-1 { grid-template-columns: 1fr; }
.media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.media-grid.count-3,
.media-grid.count-4 { grid-template-columns: repeat(3, 1fr); }

.media-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f3ece6;
  cursor: pointer;
  aspect-ratio: 1;
}
.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-grid.count-1 .media-tile { aspect-ratio: 16 / 10; }

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  pointer-events: none;
}

/* 超出 9 张时的 +N 蒙层（盖在第 9 张上，点击展开剩余图片） */
.media-more {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(30, 26, 32, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}
.media-more-txt {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  opacity: 0.85;
}

/* 展开后的“收起”块 */
.media-collapse-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3ece6;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
}
.media-collapse-tile:hover { color: var(--primary-dark); }

/* 实况图角标 */
.live-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 1px;
  pointer-events: none;
}

/* 阶段快选标签 */
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.stage-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.stage-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 加载更多时禁用入场动画，避免内容区白闪 */
.no-enter .record-card,
.no-enter .gallery-item { animation: none !important; }

/* ===== 首屏骨架屏 ===== */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.sk-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.sk-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #f0e7e0 25%, #faf4ee 50%, #f0e7e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
.sk-img {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0e7e0 25%, #faf4ee 50%, #f0e7e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ===== 时光轴月份分组胶囊 ===== */
.timeline-month {
  position: relative;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary-dark);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: var(--shadow);
}
.timeline-month::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8fab, #ffa36c);
  box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.18);
}

/* ===== 音乐悬浮小球（婚礼请柬风格） ===== */
.music-ball {
  position: fixed;
  right: 14px;
  top: calc(var(--header-h) + 12px);
  z-index: 55;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8fab, #ff9d7a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 143, 171, 0.45);
  cursor: pointer;
  touch-action: manipulation;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.music-ball[hidden] { display: none; }
.music-ball .music-icon { font-size: 18px; display: block; }
.music-ball.playing .music-icon { animation: spin 3.2s linear infinite; }
.music-ball:not(.playing) { filter: grayscale(0.65); opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }
body.body-public .music-ball { top: 18px; }

/* ===== 返回顶部 ===== */
.to-top {
  position: fixed;
  right: 14px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 35;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.to-top[hidden] { display: none; }
body.body-public .to-top { display: none; }
@media (min-width: 768px) {
  .to-top { bottom: 30px; }
}

/* 宝宝卡片淡粉渐变底，更有温度 */
.child-card { background: linear-gradient(160deg, #ffffff 55%, #fff4f8); }

/* ===== 相册 ===== */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3ece6;
  cursor: pointer;
}
.gallery-item img,
.gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 表单 ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-title { margin: 0; font-size: 19px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); }

.field input[type="text"],
.field input[type="date"],
.field select,
.field textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent); }
.field textarea { resize: vertical; }

.field input[type="file"] { font-size: 14px; }

.radio-row { display: flex; gap: 16px; }
.radio-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-danger-ghost { background: #fdecec; color: var(--danger); }
.btn-block { width: 100%; }

/* 预览 */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.preview-grid .preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3ece6;
}
.preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove-file {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

/* 编辑弹窗：标记移除的媒体（保存时才真正删除，再点可恢复） */
.edit-media.removed img,
.edit-media.removed video { opacity: 0.3; }
.edit-media.removed::after {
  content: '保存时移除';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.edit-media-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* 进度条 */
.progress { margin-top: 4px; height: 8px; border-radius: 999px; background: var(--accent); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s; }

/* ===== 宝宝资料页 ===== */
.profile-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.child-card { display: flex; flex-direction: column; gap: 12px; }
.child-card-main { display: flex; gap: 14px; align-items: center; }
.child-info { min-width: 0; }
.child-name { font-size: 17px; font-weight: 700; }
.child-nick { color: var(--muted); font-weight: 400; font-size: 14px; }
.child-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #6b6470; margin-top: 3px; }
.child-meta.muted { color: var(--muted); }
.child-actions { display: flex; gap: 8px; }
.child-actions .btn { flex: 1; }

.add-child-btn { margin-top: 4px; }

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ===== 底部导航（移动端） ===== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(140, 110, 90, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .nav-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  color: var(--muted);
}
.bottom-nav .nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav .nav-item.active { color: var(--primary-dark); font-weight: 600; }

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 10, 12, 0.94);
  display: flex;
  flex-direction: column;
}
.lightbox[hidden] { display: none; }

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
}
.lightbox-top .icon-btn { color: #fff; font-size: 20px; }

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 4px;
}
.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

.lightbox-caption {
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  color: #e8e2e8;
  font-size: 14px;
  text-align: center;
  white-space: pre-wrap;
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(30, 22, 26, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay[hidden] { display: none; }

.modal {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: calc(var(--header-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(40, 34, 40, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}
.toast[hidden] { display: none; }
.toast-error { background: rgba(224, 82, 82, 0.95); }

/* ===== 桌面端 ===== */
@media (min-width: 768px) {
  body { padding-bottom: 40px; }
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .app-main { padding: 24px; }

  .media-grid.count-1 { grid-template-columns: repeat(2, 1fr); }
  .media-grid.count-1 .media-tile { aspect-ratio: 16 / 10; }
  .media-grid.count-2 { grid-template-columns: repeat(2, 1fr); }
  .media-grid.count-3,
  .media-grid.count-4 { grid-template-columns: repeat(4, 1fr); }

  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .preview-grid { grid-template-columns: repeat(4, 1fr); }

  .modal-overlay { align-items: center; padding: 20px; }
  .modal {
    width: 460px;
    max-width: 92vw;
    border-radius: 20px;
    padding: 24px;
  }
}

/* ===== 公开 / 登录模式 ===== */
body.body-public { padding-bottom: 0; }
body.body-public .app-header,
body.body-public .bottom-nav { display: none; }
body.body-public .app-main { max-width: none; padding: 0; }

.auth-screen {
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 20px;
  font-size: 14px;
}
.auth-link {
  display: block;
  margin: 16px auto 0;
  border: none;
  background: none;
  color: var(--primary-dark);
  font-size: 14px;
}

/* ===== 页脚备案信息 ===== */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  color: var(--muted);
}
.app-footer a {
  color: inherit;
  text-decoration: none;
}
.app-footer a:hover { color: var(--primary-dark); }

/* ===== 公开分享页 ===== */
.public-wrap { max-width: 920px; margin: 0 auto; padding: 16px; }
.public-head { margin-bottom: 4px; }
.public-title { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.public-meta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ===== 分享 ===== */
.share-note { color: var(--muted); font-size: 14px; margin: 0; }
.share-code {
  font-size: 30px;
  letter-spacing: 5px;
  font-weight: 800;
  text-align: center;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 14px 8px;
  border-radius: 12px;
}
.share-link {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
  margin-top: 10px;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--muted); margin: 6px 0 10px; }
.section-gap { margin-top: 28px; }
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-empty { color: var(--muted); font-size: 14px; }
.share-card { display: flex; flex-direction: column; gap: 10px; }
.share-card-main { display: flex; flex-direction: column; gap: 4px; }
.share-code-sm { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--primary-dark); }
.share-card-meta { color: var(--muted); font-size: 13px; }
.share-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-card-actions .btn { flex: 1; min-width: 90px; }

.account-card { display: flex; flex-direction: column; gap: 12px; }
.account-row { display: flex; justify-content: space-between; align-items: center; }

/* ===== 相册分组 ===== */
.gallery-age { margin-bottom: 22px; }
.gallery-age-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 6px 0 14px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}
.gallery-month { margin-bottom: 18px; }
.gallery-month-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
}

/* ==================================================
   视觉增强（炫酷化）
   ================================================== */

/* --- 通用入场动画 --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* --- 渐变背景上的毛玻璃顶栏 --- */
.app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(253, 242, 248, 0.62));
}

/* --- 品牌 Logo 摇摆 --- */
.brand-icon {
  display: inline-block;
  animation: sway 3.5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(9deg); }
}

/* --- 卡片悬浮微动效 --- */
.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* --- 时光轴：渐变轴线 + 发光节点 --- */
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff8fab, #7ec3f0);
  opacity: 0.45;
}
.record-card {
  position: relative;
  animation: fadeUp 0.55s cubic-bezier(0.22, 0.9, 0.35, 1) backwards;
}
.record-card::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8fab, #ffa36c);
  box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.18), 0 0 10px rgba(255, 143, 171, 0.55);
}
.timeline .record-card:nth-child(1) { animation-delay: 0.03s; }
.timeline .record-card:nth-child(2) { animation-delay: 0.08s; }
.timeline .record-card:nth-child(3) { animation-delay: 0.13s; }
.timeline .record-card:nth-child(4) { animation-delay: 0.18s; }
.timeline .record-card:nth-child(5) { animation-delay: 0.23s; }
.timeline .record-card:nth-child(6) { animation-delay: 0.28s; }
.timeline .record-card:nth-child(7) { animation-delay: 0.33s; }
.timeline .record-card:nth-child(8) { animation-delay: 0.38s; }
.timeline .record-card:nth-child(9) { animation-delay: 0.43s; }
.timeline .record-card:nth-child(10) { animation-delay: 0.48s; }

/* --- 媒体缩略图：绝对定位锁定在容器内，修复移动端视频溢出 --- */
.media-tile img,
.media-tile video,
.gallery-item img,
.gallery-item video,
.preview-item img,
.preview-item video {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.media-tile:hover img,
.media-tile:hover video,
.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.06);
}

/* --- 相册格子错落入场 --- */
.gallery-item {
  animation: fadeUp 0.5s ease backwards;
}
.gallery-grid .gallery-item:nth-child(1) { animation-delay: 0.02s; }
.gallery-grid .gallery-item:nth-child(2) { animation-delay: 0.06s; }
.gallery-grid .gallery-item:nth-child(3) { animation-delay: 0.1s; }
.gallery-grid .gallery-item:nth-child(4) { animation-delay: 0.14s; }
.gallery-grid .gallery-item:nth-child(5) { animation-delay: 0.18s; }
.gallery-grid .gallery-item:nth-child(6) { animation-delay: 0.22s; }
.gallery-grid .gallery-item:nth-child(7) { animation-delay: 0.26s; }
.gallery-grid .gallery-item:nth-child(8) { animation-delay: 0.3s; }
.gallery-grid .gallery-item:nth-child(9) { animation-delay: 0.34s; }

/* --- 渐变文字标题 --- */
.gallery-age-title {
  background: linear-gradient(135deg, #e56b8d, #ffa36c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-left-color: #ff8fab;
}

/* --- 按钮渐变 + 悬浮上移 --- */
.btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.15s, background 0.18s;
}
.btn-primary {
  background: linear-gradient(135deg, #ff8fab, #ff9d7a);
  box-shadow: 0 6px 16px rgba(255, 143, 171, 0.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff8fab, #ff9d7a);
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(255, 143, 171, 0.45);
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* --- 选中态渐变 --- */
.filter-chip.active {
  background: linear-gradient(135deg, #ff8fab, #ffa36c);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.35);
}
.child-chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, #ffd9e2, #ffe9d6);
}
.top-nav .nav-item.active {
  background: linear-gradient(135deg, rgba(255, 143, 171, 0.16), rgba(255, 163, 108, 0.16));
}

/* --- 底部导航激活弹跳 --- */
.bottom-nav .nav-item.active .nav-icon {
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop {
  from { transform: scale(0.55); }
  to { transform: scale(1); }
}

/* --- 上传进度条流光 --- */
.progress-bar {
  background: linear-gradient(90deg, #ff8fab, #ffa36c, #7ec3f0, #ff8fab);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

/* --- 灯箱缩放入场 --- */
.lightbox:not([hidden]) {
  animation: overlayIn 0.2s ease;
}
.lightbox-stage img,
.lightbox-stage video {
  animation: zoomIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* --- 弹窗滑入 --- */
.modal-overlay:not([hidden]) {
  animation: overlayIn 0.25s ease;
}
.modal-overlay:not([hidden]) .modal {
  animation: sheetIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(44px); }
  to { opacity: 1; transform: none; }
}

/* --- Toast 弹性落下 --- */
.toast.show {
  animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- 登录页漂浮光斑 --- */
.auth-screen {
  position: relative;
  overflow: hidden;
}
.auth-screen::before,
.auth-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  pointer-events: none;
}
.auth-screen::before {
  width: 260px;
  height: 260px;
  background: #ffb3c8;
  top: 8%;
  left: 10%;
  animation: drift1 9s ease-in-out infinite;
}
.auth-screen::after {
  width: 320px;
  height: 320px;
  background: #a8ddf7;
  bottom: 8%;
  right: 8%;
  animation: drift2 11s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(34px, -26px); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 30px); }
}
.auth-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.7);
  animation: fadeUp 0.6s cubic-bezier(0.22, 0.9, 0.35, 1);
}

/* --- 分享码呼吸光晕 --- */
.share-code {
  animation: glow 2.4s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 143, 171, 0); }
  50% { box-shadow: 0 0 24px rgba(255, 143, 171, 0.45); }
}

/* --- 空状态图标漂浮 --- */
.empty-icon {
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- 无障碍：减弱动效 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==================================================
   表单与登录页精修
   ================================================== */

/* --- 表单标签 --- */
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #a89fac;
}

/* --- 输入控件统一精修 --- */
.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field select,
.field textarea {
  border: 1.5px solid #ebe3dc;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fdfbf8;
  color: var(--text);
  outline: none;
  width: 100%;
  min-height: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #dcc9d2; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.15);
}
.field textarea { resize: vertical; }

/* --- 下拉框自定义箭头 --- */
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239a93a0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* --- 日期选择器 --- */
.field input[type="date"] { -webkit-appearance: none; appearance: none; }
.field input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.55; }

/* --- 文件上传拖放区 --- */
.field input[type="file"] {
  display: block;
  width: 100%;
  font-size: 14px;
  color: var(--muted);
  border: 1.5px dashed #e3c3ce;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 244, 247, 0.8), rgba(255, 252, 250, 0.9));
  padding: 20px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input[type="file"]:hover { border-color: var(--primary); }
.field input[type="file"]::file-selector-button {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  margin: 0 14px 0 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff8fab, #ff9d7a);
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.field input[type="file"]::file-selector-button:active { transform: scale(0.97); }

/* --- 性别分段选择器 --- */
.radio-row { gap: 10px; }
.radio-row label {
  flex: 1;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border: 1.5px solid #ebe3dc;
  border-radius: 14px;
  background: #fdfbf8;
  font-size: 14px;
  color: #7a7280;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.radio-row label:hover { border-color: #dcc9d2; }
.radio-row label:has(input:checked),
.radio-row label.checked {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(255, 143, 171, 0.14), rgba(255, 157, 122, 0.14));
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--primary);
}
.radio-row input { accent-color: var(--primary); }

/* --- 表单标题渐变下划线 --- */
.form-title { font-size: 20px; letter-spacing: 0.3px; }
.form-title::after {
  content: '';
  display: block;
  width: 38px;
  height: 3.5px;
  border-radius: 3px;
  margin-top: 9px;
  background: linear-gradient(90deg, #ff8fab, #ffa36c);
}

/* --- 带图标输入框（登录 / 分享码） --- */
.input-wrap { position: relative; display: block; }
.input-wrap .input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: #b6adb9;
  pointer-events: none;
}
.input-wrap .input-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.field .input-wrap input[type="text"],
.field .input-wrap input[type="password"],
.field .input-wrap input:not([type]) {
  padding-left: 48px;
}
.input-wrap input:focus ~ .input-icon,
.input-wrap:has(input:focus) .input-icon,
.input-wrap.focused .input-icon { color: var(--primary); }

/* --- 登录页高级感 --- */
.auth-card {
  border-radius: 28px;
  padding: 36px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 252, 0.9));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 30px 70px -24px rgba(190, 110, 140, 0.4),
    0 0 0 1px rgba(255, 143, 171, 0.07);
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #ff8fab, #ffa36c, #7ec3f0);
}
.auth-brand {
  font-size: 24px;
  gap: 12px;
  margin-bottom: 2px;
}
.auth-brand .brand-icon {
  width: 52px;
  height: 52px;
  font-size: 26px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e9f9ef, #ffeef3);
  box-shadow: 0 6px 16px rgba(255, 143, 171, 0.25);
}
.auth-sub {
  letter-spacing: 2px;
  font-size: 13px;
  margin: 10px 0 26px;
}
.auth-link {
  margin-top: 20px;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-link:hover { background: rgba(255, 143, 171, 0.08); }

/* --- 加载更多按钮 --- */
.load-more {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.5px;
  border: 1.5px dashed #e3c3ce;
  background: rgba(255, 255, 255, 0.6);
}
.load-more:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
}

/* 媒体加载失败占位 */
.media-tile.media-broken,
.gallery-item.media-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3ece6;
}
.media-broken::after {
  content: '🖼️ 加载失败，点击重试';
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
  text-align: center;
}

/* 懒加载图片：待加载时隐藏（显示底色占位），加载完成淡入，避免快速滚动时内容蹦出 */
.media-tile img[data-src],
.gallery-item img[data-src] { opacity: 0; }
.media-tile img.loaded,
.gallery-item img.loaded {
  opacity: 1;
  transition: opacity 0.35s ease;
}

/* 时间轴 5 张以上：统一 3 列九宫格（放在文件末尾以覆盖桌面端 4 列规则） */
.media-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* --- 灯箱媒体严格约束在舞台内（修复视频浮层超出） --- */
.lightbox-stage img,
.lightbox-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-stage { overflow: hidden; }

/* --- 灯箱手势与滚动锁定 --- */
body.lightbox-open { overflow: hidden; }
.lightbox-stage img,
.lightbox-stage video { touch-action: none; }
.lightbox-nav,
.lightbox .icon-btn { touch-action: manipulation; }
.lightbox.zoomed .lightbox-nav { display: none; }
.lightbox.zoomed .lightbox-stage img,
.lightbox.zoomed .lightbox-stage video { cursor: grab; }

/* 切换方向滑动动画 */
@keyframes slideNext {
  from { opacity: 0.3; transform: translateX(44px); }
  to { opacity: 1; transform: none; }
}
@keyframes slidePrev {
  from { opacity: 0.3; transform: translateX(-44px); }
  to { opacity: 1; transform: none; }
}
.lightbox[data-dir="next"] .lightbox-stage img,
.lightbox[data-dir="next"] .lightbox-stage video { animation: slideNext 0.28s ease; }
.lightbox[data-dir="prev"] .lightbox-stage img,
.lightbox[data-dir="prev"] .lightbox-stage video { animation: slidePrev 0.28s ease; }

/* 灯箱关闭退出动画（缩小淡出，所有关闭方式统一） */
@keyframes lightboxOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes zoomOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}
.lightbox.closing {
  animation: lightboxOut 0.22s ease forwards;
  pointer-events: none;
}
.lightbox.closing .lightbox-stage img,
.lightbox.closing .lightbox-stage video {
  animation: zoomOut 0.22s ease forwards;
}
