* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink-50: #fff5f8;
  --pink-100: #ffe3ec;
  --pink-200: #ffc2d4;
  --pink-300: #ff9ebb;
  --pink-500: #ff5d8f;
  --pink-600: #e63b73;
  --rose-700: #c93870;
  --text-dark: #4a2233;
  --text-mute: #8a6275;
  --white: #ffffff;
  --shadow: 0 8px 30px rgba(255, 93, 143, 0.18);
  --shadow-lg: 0 20px 60px rgba(255, 93, 143, 0.28);
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Microsoft YaHei UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #fff5f8 0%, #ffe3ec 40%, #ffd0de 100%);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 飘落爱心 + 乐/楽字 */
.floating-hearts {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.heart-float {
  position: absolute; bottom: -40px;
  color: var(--pink-300); opacity: 0.5;
  font-size: 20px;
  animation: floatUp linear infinite;
  user-select: none;
}
.heart-float.char-le {
  color: #ff8a3d;
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 200, 100, 0.4);
}
.heart-float.char-raku {
  color: #6dbf9c;
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(120, 220, 170, 0.4);
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* 绵羊 + 向日葵:与爱心/乐字同源的飘浮上升效果(边升边轻摇 + 呼吸式缩放) */
.sheep {
  position: fixed;
  bottom: 6px;
  font-size: 38px;
  --o: 0.95;
  animation: floatCute linear infinite;
  user-select: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.sheep-1 { left: 9%;  animation-duration: 30s; animation-delay: -4s; }
.sheep-2 { left: 62%; font-size: 28px; --o: 0.8; animation-duration: 38s; animation-delay: -14s; }
.sheep-3 { left: 34%; font-size: 24px; --o: 0.55; animation-duration: 46s; animation-delay: -26s; }

.sunflower {
  position: fixed;
  bottom: 10px;
  font-size: 52px;
  --o: 0.9;
  animation: floatCute linear infinite;
  animation-duration: 28s;
  animation-delay: -2s;
  user-select: none;
  filter: drop-shadow(0 6px 8px rgba(255, 180, 0, 0.35));
  z-index: 0;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
}
.sunflower.left  { left: 5%; }
.sunflower.right { left: 80%; }
.sunflower-2 { font-size: 36px; --o: 0.7; animation-duration: 26s; animation-delay: -9s; }
.sunflower.left.sunflower-3 { left: 43%; }
.sunflower-3 { font-size: 30px; --o: 0.5; animation-duration: 34s; animation-delay: -19s; }
/* 装饰图标(矢量)随 font-size 缩放,便于沿用上面的尺寸与动画 */
.sheep svg, .sunflower svg { display: block; width: 1em; height: 1em; }

/* 边上升边左右轻摇、呼吸式缩放,升到顶部淡出后循环 */
@keyframes floatCute {
  0%   { transform: translate3d(0, 0, 0) rotate(-8deg) scale(0.86); opacity: 0; }
  12%  { opacity: var(--o); }
  30%  { transform: translate3d(15px, -30vh, 0) rotate(7deg) scale(1); }
  55%  { transform: translate3d(-17px, -58vh, 0) rotate(-7deg) scale(1.07); }
  80%  { transform: translate3d(13px, -86vh, 0) rotate(7deg) scale(1); opacity: var(--o); }
  92%  { opacity: 0; }
  100% { transform: translate3d(0, -112vh, 0) rotate(-8deg) scale(0.86); opacity: 0; }
}

/* Header */
.site-header {
  position: relative; z-index: 2;
  padding: 48px 20px 32px;
  text-align: center;
}
.header-inner { display: inline-block; }
.logo {
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-size: 52px; font-weight: 400;
  color: var(--pink-600);
  letter-spacing: 4px;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
}
.logo .heart {
  display: inline-block; color: var(--pink-500);
  animation: beat 1.5s ease-in-out infinite;
  margin-right: 6px;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}
.subtitle {
  margin-top: 10px; color: var(--text-mute);
  font-size: 18px; letter-spacing: 2px;
}
/* 在一起天数(纪念日计数) */
.love-days {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  font-size: 14px;
  color: var(--pink-600);
  letter-spacing: 1px;
}
.love-days .heart {
  display: inline-block; color: var(--pink-500);
  animation: beat 1.5s ease-in-out infinite;
}

/* 状态栏 */
.status-bar {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-mute);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #bbb;
  transition: background 0.3s ease;
}
.status-dot.online { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.status-dot.offline { background: #e57373; }
.status-dot.connecting { background: #ffb74d; animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-bar .sep { opacity: 0.5; }
.logout-link {
  color: var(--text-mute);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-mute);
}
.logout-link:hover { color: var(--pink-600); }

/* Container */
.container {
  position: relative; z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Upload */
.upload-area {
  border: 2px dashed var(--pink-300);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--pink-500);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
/* 可爱桃心(眼睛+笑脸+腮红,替代原 💛) */
.upload-icon {
  position: relative;
  width: 64px; height: 58px;
  margin: 0 auto;
  animation: beat 2s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(255, 93, 143, 0.35));
}
.upload-icon::before,
.upload-icon::after {
  content: "";
  position: absolute;
  top: 0;
  width: 32px; height: 52px;
  background: linear-gradient(180deg, #ff9ebb 0%, #ff5d8f 100%);
  border-radius: 32px 32px 0 0;
}
.upload-icon::before {
  left: 32px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
.upload-icon::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
.kh-eye {
  position: absolute;
  top: 44%;
  width: 6px; height: 9px;
  background: #7a2440;
  border-radius: 50%;
  z-index: 2;
}
.kh-eye.kh-l { left: 29%; }
.kh-eye.kh-r { right: 29%; }
.kh-mouth {
  position: absolute;
  top: 56%; left: 50%;
  width: 10px; height: 6px;
  transform: translateX(-50%);
  border: 2px solid #7a2440;
  border-top: none;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}
.kh-blush {
  position: absolute;
  top: 50%;
  width: 12px; height: 6px;
  background: rgba(255, 160, 200, 0.85);
  border-radius: 50%;
  filter: blur(1px);
  z-index: 2;
}
.kh-blush.kh-l { left: 8%; }
.kh-blush.kh-r { right: 8%; }
.upload-title {
  font-size: 22px; color: var(--text-dark);
  margin: 12px 0 6px;
  letter-spacing: 1px;
}
.upload-hint {
  color: var(--text-mute); font-size: 14px;
  margin-bottom: 18px;
}
.btn-upload {
  display: inline-block;
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  border: none; border-radius: 30px;
  font-family: inherit; font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 93, 143, 0.4);
  transition: all 0.2s ease;
}
.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 93, 143, 0.55);
}
.btn-upload:active { transform: translateY(0); }

/* Progress */
.progress-wrap {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.progress-bar {
  height: 8px;
  background: var(--pink-100);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink-500), var(--pink-600));
  border-radius: 4px;
  transition: width 0.2s ease;
}
.progress-text {
  margin-top: 8px; font-size: 13px;
  color: var(--text-mute); text-align: center;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 18px;
  flex-wrap: wrap; gap: 12px;
}
.filter-tabs {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px; border-radius: 30px;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto;
  padding: 8px 18px;
  border: none; background: transparent;
  color: var(--text-mute);
  font-family: inherit; font-size: 14px;
  border-radius: 25px; cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}
/* 五个栏目统一的手绘风图标:同款线宽/圆角/尺寸 */
.tab svg {
  width: 17px; height: 17px; flex: 0 0 auto;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.tab.active {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 93, 143, 0.35);
}
.stats {
  color: var(--text-mute); font-size: 14px;
  letter-spacing: 1px;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}
.empty-icon {
  font-size: 64px; margin-bottom: 16px; opacity: 0.6;
}
.empty-state p { font-size: 16px; letter-spacing: 1px; }

/* 按拍摄日的分组标题(横跨整行) */
.date-sep {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 2px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-mute);
}
.date-sep::before {
  content: "";
  width: 9px; height: 9px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pink-500);
  box-shadow: 0 0 0 4px var(--pink-100);
}
.date-sep::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right, var(--pink-200), rgba(255, 194, 212, 0));
}

.card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--pink-100);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}
.card img, .card video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(74, 34, 51, 0.85) 0%, transparent 50%);
  opacity: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  transition: opacity 0.25s ease;
}
.card:hover .card-overlay { opacity: 1; }
.card-name {
  color: var(--white); font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-date { color: rgba(255, 255, 255, 0.75); font-size: 11px; }
.card-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0, 0, 0, 0.55); color: var(--white);
  font-size: 11px; padding: 3px 10px;
  border-radius: 12px; letter-spacing: 1px;
}
/* 动图角标:粉色渐变,和普通照片角标区分 */
.card-badge.gif {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 93, 143, 0.45);
}
/* 手机实况照片角标:蓝色,和 GIF 区分 */
.card-badge.live {
  background: linear-gradient(135deg, #5ac8fa, #0a84ff);
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.45);
}

/* 弹窗里的实况播放:静图之上叠视频,加载完淡入 */
.modal-live-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  background: transparent;
}
.modal-live-video.show { opacity: 1; }
.live-toggle {
  position: absolute; right: 12px; bottom: 12px; z-index: 5;
  padding: 6px 13px;
  border: none; border-radius: 16px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff; font-family: inherit;
  font-size: 12px; letter-spacing: 1px;
  cursor: pointer; backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}
.live-toggle:active { transform: scale(0.96); }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex;
  align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(40, 15, 25, 0.92);
  backdrop-filter: blur(10px);
}
.modal-content {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--white);
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.modal-media {
  background: #000;
  max-width: 85vw; max-height: 75vh;
  display: flex;
  align-items: center; justify-content: center;
  position: relative;
  margin: 0 auto; /* 信息栏比媒体盒宽时居中,两侧均衡不露单边白边 */
  overflow: hidden; /* 放大后的图片裁剪在媒体盒内,不盖住信息栏 */
}
.modal-media img, .modal-media video {
  max-width: 100%; max-height: 75vh;
  display: block;
}
/* 缩放容器:铺满已定尺寸的媒体盒,双指/双击放大时整体变换 */
.zoom-wrap {
  position: relative;
  width: 100%; height: 100%;
  transform-origin: 0 0;
  touch-action: none; /* 捏合/拖拽交给我们,浏览器别抢手势 */
  cursor: zoom-in;
}
.zoom-wrap.zoomed { cursor: zoom-out; }
.zoom-wrap img.modal-full {
  width: 100%; height: 100%;
  object-fit: contain; /* 媒体盒已按原图宽高比定尺寸,contain 即精确铺满 */
}
/* 渐进式加载:缩略图先铺底(网格已缓存,模糊遮丑),原图加载完淡入 */
.modal-media img.modal-thumb {
  position: absolute; inset: 0; margin: auto;
  width: 100%; height: 100%; object-fit: cover; /* 铺满已定尺寸的媒体盒 */
  filter: blur(10px); transform: scale(1.04);
}
.modal-media img.modal-full {
  opacity: 0; transition: opacity .25s ease;
}
.modal-media img.modal-full.loaded { opacity: 1; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white); font-size: 26px;
  cursor: pointer; z-index: 5;
  display: flex;
  align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.modal-close:hover { background: var(--pink-600); }
.modal-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.45);
  color: var(--white); font-size: 32px;
  cursor: pointer; z-index: 5;
  display: flex;
  align-items: center; justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}
.modal-nav.prev { left: 14px; }
.modal-nav.next { right: 14px; }
.modal-nav:hover { background: var(--pink-600); }
.modal-info {
  padding: 18px 24px;
  display: flex; flex-direction: column;
  gap: 4px; background: var(--white);
  /* 限宽:窄屏下按钮行的固有宽度可能超过媒体盒上限 85vw,
     会把白卡撑得比图片区宽,右侧露出白边 */
  max-width: 85vw; min-width: 0;
}
.modal-name {
  font-size: 17px; color: var(--text-dark);
  font-weight: bold; word-break: break-all;
}
.modal-date { font-size: 13px; color: var(--text-mute); margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; }
.btn-action {
  flex: 1; padding: 10px 16px;
  text-align: center; border: none;
  border-radius: 25px;
  font-family: inherit; font-size: 14px;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: 1px;
  /* 允许收缩到内容宽度以下,窄屏不撑破信息栏 */
  min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.btn-action.download {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 93, 143, 0.35);
}
.btn-action.download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 93, 143, 0.5);
}
.btn-action.delete {
  background: var(--pink-100); color: var(--rose-700);
}
.btn-action.delete:hover { background: var(--pink-200); }

/* Footer */
.site-footer {
  position: relative; z-index: 2;
  text-align: center;
  padding: 30px 20px;
  color: var(--text-mute); font-size: 14px;
  letter-spacing: 2px;
}
.site-footer .heart { color: var(--pink-500); }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center; justify-content: center;
  padding: 20px;
  position: relative; z-index: 2;
}
.login-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px 32px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 360px;
  width: 100%;
}
.login-card .logo { font-size: 38px; margin-bottom: 8px; }
.login-card .subtitle { margin-bottom: 28px; }
.login-input {
  width: 100%;
  padding: 12px 18px;
  border: 2px solid var(--pink-200);
  border-radius: 25px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  transition: border-color 0.2s ease;
  margin-bottom: 14px;
}
.login-input:focus { border-color: var(--pink-500); }
.login-error {
  color: var(--rose-700);
  font-size: 13px;
  margin: -6px 0 12px;
  min-height: 18px;
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  border: none;
  border-radius: 25px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 93, 143, 0.4);
  transition: all 0.2s ease;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 93, 143, 0.55);
}

/* Responsive */
@media (max-width: 600px) {
  .logo { font-size: 38px; }
  .subtitle { font-size: 15px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .upload-area { padding: 32px 16px; }
  .upload-title { font-size: 18px; }
  .toolbar { justify-content: center; }
  .modal-nav { width: 40px; height: 40px; font-size: 24px; }
}

/* ====== 地图栏目 ====== */
.map-section {
  position: relative;
  height: 64vh;
  min-height: 380px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #eef3ee;
}
#map { width: 100%; height: 100%; background: #eef3ee; }
.leaflet-container { font-family: inherit; }

/* 无定位提示 */
.map-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; color: var(--text-mute);
  background: rgba(255, 245, 248, 0.9);
  z-index: 500;
  padding: 20px;
  line-height: 1.9;
}
.map-empty-icon { font-size: 52px; margin-bottom: 10px; }
/* 防止 display:flex 覆盖 hidden 属性导致空提示永远显示 */
.map-empty[hidden] { display: none; }

/* 照片缩略图标记 */
.photo-marker {
  background: none; border: none;
}
.photo-marker img {
  width: 54px; height: 54px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: block;
  background: var(--pink-100);
}
.photo-marker img:hover { transform: scale(1.08); }

/* 弹窗里的地址信息 */
.modal-addr {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.6;
  word-break: break-all;
}

/* ====== 精选 ====== */
/* 卡片左上角星标按钮 */
.card-star {
  position: absolute; top: 8px; left: 8px;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 19px; line-height: 34px;
  text-align: center; padding: 0;
  cursor: pointer; z-index: 3;
  transition: all 0.2s ease;
}
.card-star:hover { background: rgba(0, 0, 0, 0.68); transform: scale(1.12); }
.card-star.on {
  background: linear-gradient(135deg, #ffd45e, #f5a623);
  box-shadow: 0 3px 10px rgba(245, 166, 35, 0.55);
}
/* 精选卡片金色描边 */
.card.is-featured {
  box-shadow: 0 0 0 3px #ffd45e, var(--shadow);
}
/* 弹窗里的精选按钮 */
.btn-action.star {
  background: var(--pink-100);
  color: var(--rose-700);
}
.btn-action.star:hover { background: var(--pink-200); }
.btn-action.star.on {
  background: linear-gradient(135deg, #ffd45e, #f5a623);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

/* ====== 单文件上传进度列表 ====== */
.progress-list {
  margin-top: 10px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-list:empty { display: none; }
.prog-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-mute);
  background: rgba(255, 245, 248, 0.8);
  border-radius: 8px;
  padding: 4px 10px;
}
.prog-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: left;
}
.prog-state { flex: 0 0 auto; }
.prog-state.ok { color: #4caf50; }
.prog-state.err { color: #e57373; }
.prog-state.skip { color: #ffb74d; }

/* ====== 懒加载哨兵 ====== */
.gallery-sentinel {
  grid-column: 1 / -1;
  height: 2px;
}

/* ====== 月份快速跳转 ====== */
.month-nav {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 70vh;
  overflow-y: auto;
}
.month-btn {
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-mute);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 93, 143, 0.15);
  transition: all 0.2s ease;
  writing-mode: vertical-rl;
}
.month-btn:hover {
  background: var(--pink-500);
  color: #fff;
  transform: scale(1.06);
}
@media (max-width: 640px) {
  .month-nav { right: 4px; }
  .month-btn { font-size: 11px; padding: 5px 6px; }
}

/* ====== 回收站 ====== */
.trash-link {
  border: none;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-mute);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.trash-link:hover { background: var(--pink-100); color: var(--pink-600); }
/* 多选开关激活态 */
.trash-link.active {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 93, 143, 0.35);
}
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.trash-content {
  max-width: 560px;
  width: 92vw;
  text-align: left;
  padding: 26px 22px 22px;
}
.trash-title {
  font-size: 20px;
  color: var(--text-dark);
  letter-spacing: 1px;
}
.trash-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-mute);
}
.trash-list {
  margin-top: 14px;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trash-empty {
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
  padding: 30px 0;
}
.trash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--pink-50);
  border-radius: 12px;
  padding: 8px 12px;
}
.trash-icon { font-size: 22px; flex: 0 0 auto; }
.trash-meta { flex: 1 1 auto; min-width: 0; }
.trash-name {
  font-size: 14px;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-date { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.trash-btn {
  border: none;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.2s ease;
}
.trash-btn.restore {
  background: var(--pink-100);
  color: var(--rose-700);
}
.trash-btn.restore:hover { background: var(--pink-200); }
.trash-btn.danger {
  background: #fde8e8;
  color: #d05454;
}
.trash-btn.danger:hover { background: #f9d2d2; }
.trash-btn:disabled { opacity: 0.5; cursor: default; }

/* 背景音乐开关(右下角浮动圆钮) */
.music-toggle {
  position: fixed; right: 16px; bottom: 24px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--white);
  box-shadow: 0 6px 18px rgba(255, 93, 143, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.music-toggle:hover { transform: scale(1.1); }
.music-toggle svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--pink-500);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.2s ease;
}
/* 关闭状态:灰色音符 + 斜杠 */
.music-toggle.off svg { stroke: #b9aeb3; }
.music-toggle .music-slash {
  position: absolute; width: 30px; height: 2.5px;
  background: #b9aeb3; border-radius: 2px;
  transform: rotate(-45deg);
  transition: opacity 0.2s ease;
}
.music-toggle:not(.off) .music-slash { opacity: 0; }
/* 播放状态:右上角跳动的声波小竖条 */
.music-toggle .music-wave {
  position: absolute; top: 5px; right: 6px;
  display: none; align-items: flex-end; gap: 1.5px; height: 10px;
}
.music-toggle.playing .music-wave { display: flex; }
.music-wave i {
  width: 2.5px; border-radius: 2px;
  background: var(--pink-500);
  animation: musicWave 0.9s ease-in-out infinite;
}
.music-wave i:nth-child(1) { height: 5px; animation-delay: 0s; }
.music-wave i:nth-child(2) { height: 9px; animation-delay: 0.25s; }
.music-wave i:nth-child(3) { height: 6px; animation-delay: 0.5s; }
@keyframes musicWave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}
.music-toggle.playing {
  box-shadow: 0 6px 20px rgba(255, 93, 143, 0.55);
}

/* ====== 多选模式 ====== */
/* 卡片右上角勾选圈:仅多选模式显示 */
.card-check {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.35);
  color: transparent;
  font-size: 15px; line-height: 22px; text-align: center;
  z-index: 4;
  transition: all 0.2s ease;
  display: none;
}
.gallery.select-mode .card-check { display: block; }
.card-check.on {
  background: var(--pink-500);
  border-color: #fff;
  color: #fff;
}
/* 多选模式下隐藏星标与类型徽标,避免和勾选圈重叠/误触 */
.gallery.select-mode .card-star,
.gallery.select-mode .card-badge { display: none; }
/* 已选卡片:粉色蒙层 + 描边 */
.card.sel-on::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 3px solid var(--pink-500);
  background: rgba(255, 93, 143, 0.26);
  pointer-events: none;
  z-index: 2;
}

/* 底部多选操作栏 */
.select-bar {
  position: fixed;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  max-width: calc(100vw - 24px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(255, 93, 143, 0.35);
  animation: selectBarIn 0.25s ease;
}
.select-bar[hidden] { display: none; }
@keyframes selectBarIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sel-count {
  font-size: 13px; color: var(--text-mute);
  letter-spacing: 1px; white-space: nowrap;
  padding: 0 4px;
}
.sel-btn {
  border: none; font-family: inherit;
  font-size: 13px; padding: 8px 16px;
  border-radius: 20px; cursor: pointer;
  background: var(--pink-100); color: var(--rose-700);
  transition: all 0.2s ease; white-space: nowrap;
}
.sel-btn:hover { background: var(--pink-200); }
.sel-btn.danger { background: #fde8e8; color: #d05454; }
.sel-btn.danger:hover { background: #f9d2d2; }
.sel-btn.primary {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 93, 143, 0.35);
}
.sel-btn.primary:hover { transform: translateY(-2px); }
.sel-btn.cancel { background: #f0e9ec; color: var(--text-mute); }
.sel-btn.cancel:hover { background: #e6dde1; }
.sel-btn:disabled {
  opacity: 0.45; cursor: default; transform: none;
  box-shadow: none;
}
/* 多选模式下,底部操作栏上移避开背景音乐圆钮 */
@media (max-width: 600px) {
  .select-bar { bottom: 10px; gap: 6px; padding: 8px 10px; }
  .sel-btn { font-size: 12px; padding: 7px 12px; }
  .sel-count { width: 100%; text-align: center; }
}

/* ====== 开场电影(登录后自动播放的浪漫序章) ====== */
.intro-modal {
  position: fixed; inset: 0; z-index: 95;
  background: radial-gradient(ellipse at 50% 38%, #31142a 0%, #180810 72%);
  overflow: hidden;
  transition: opacity 0.8s ease;
}
.intro-modal[hidden] { display: none; }
.intro-modal.fadeout { opacity: 0; pointer-events: none; }
.intro-hearts { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* 片头标题卡 */
.intro-title, .intro-endcard {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  opacity: 0; transition: opacity 0.7s ease;
  pointer-events: none;
}
.intro-title.show, .intro-endcard.show { opacity: 1; }
.intro-title h1 {
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-size: 58px; font-weight: 400;
  color: #ffd9e6; letter-spacing: 8px;
  text-shadow: 0 0 24px rgba(255, 93, 143, 0.75), 0 4px 40px rgba(255, 93, 143, 0.5);
  animation: titleBreathe 2.4s ease-in-out infinite;
}
@keyframes titleBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.intro-title .heart {
  display: inline-block; margin-right: 10px;
  color: var(--pink-500);
  animation: beat 1.5s ease-in-out infinite;
}
.intro-title p {
  margin-top: 16px; font-size: 16px;
  letter-spacing: 4px; color: rgba(255, 255, 255, 0.78);
}
.intro-endcard .heart {
  font-size: 46px; color: var(--pink-500);
  animation: beat 1.5s ease-in-out infinite;
}
.intro-endcard p {
  margin-top: 14px; font-size: 18px; letter-spacing: 5px;
  color: rgba(255, 233, 240, 0.9);
  text-shadow: 0 0 18px rgba(255, 93, 143, 0.6);
}

/* 照片层通用:整层只做淡入淡出,动作交给内部元素 */
.intro-item {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.8s ease;
  pointer-events: none;
}
.intro-item.enter { opacity: 1; }
.intro-item.exit { opacity: 0; }

/* 登场样式一:拍立得卡片,带着随机倾斜浮上来轻轻摇晃 */
.intro-item .polaroid {
  background: #fff;
  padding: 14px 14px 14px;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  max-width: min(78vw, 520px);
  animation:
    polaroidIn 0.9s cubic-bezier(0.2, 0.8, 0.25, 1) both,
    polaroidFloat 5s ease-in-out 0.9s infinite;
}
.polaroid img {
  max-width: 100%; max-height: 54vh;
  display: block; border-radius: 2px; margin: 0 auto;
}
.polaroid .p-cap {
  margin-top: 12px; text-align: center;
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-size: 19px; color: #a06b82; letter-spacing: 2px;
}
@keyframes polaroidIn {
  from { transform: translateY(70px) rotate(var(--r, -3deg)) scale(0.85); opacity: 0; }
  to   { transform: translateY(0) rotate(var(--r, -3deg)) scale(1); opacity: 1; }
}
@keyframes polaroidFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, -3deg)); }
  50%      { transform: translateY(-12px) rotate(var(--r2, 2deg)); }
}

/* 登场样式二:全屏电影感——同一张照片两层叠加:
   底层放大模糊做氛围(慢推近),上层完整 contain 主图,任何比例都不裁切 */
.intro-item.full .f-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.5);
  transform: scale(1.25);
  animation: introKbBg 5.6s ease-out forwards;
}
@keyframes introKbBg {
  from { transform: scale(1.25); }
  to   { transform: scale(1.4); }
}
.intro-item.full .f-main {
  position: relative; z-index: 1;
  max-width: 100vw; max-height: 100vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 44px rgba(0, 0, 0, 0.55));
}
.intro-item.full .f-cap {
  position: absolute; left: 16px; right: 16px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 2;
  text-align: center; font-size: 15px; letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* 登场样式三:粉色光晕圆角卡,从柔焦中清晰浮现;盒子随照片比例缩放,完整不裁切 */
.intro-item .glow {
  width: fit-content;
  max-width: min(82vw, 560px);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 20px 80px rgba(255, 93, 143, 0.45);
  animation: glowIn 1s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.glow img {
  display: block;
  max-width: 100%; max-height: 60vh;
}
@keyframes glowIn {
  from { transform: scale(0.72); opacity: 0; filter: blur(8px); }
  to   { transform: scale(1); opacity: 1; filter: blur(0); }
}

/* 跳过 / 音乐提示 */
.intro-skip, .intro-sound {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 5;
  padding: 8px 16px; border-radius: 20px;
  font-family: inherit; font-size: 13px; letter-spacing: 1px;
  cursor: pointer; backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}
.intro-skip {
  right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}
.intro-skip:hover { background: rgba(255, 255, 255, 0.26); }
.intro-sound {
  left: 18px;
  border: none;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 93, 143, 0.5);
  animation: soundPulse 1.6s ease-in-out infinite;
}
@keyframes soundPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 底部进度点 */
.intro-progress {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 5;
}
.intro-progress i {
  width: 18px; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.4s ease;
}
.intro-progress i.on { background: var(--pink-300); }

@media (max-width: 600px) {
  .intro-title h1 { font-size: 38px; letter-spacing: 5px; }
  .intro-title p { font-size: 14px; letter-spacing: 3px; }
  .intro-endcard p { font-size: 16px; letter-spacing: 4px; }
  /* 拍立得与光晕卡在窄屏放大占比,竖屏照片更饱满 */
  .intro-item .polaroid { max-width: 86vw; padding: 10px 10px 10px; }
  .polaroid img { max-height: 58vh; }
  .polaroid .p-cap { font-size: 17px; margin-top: 10px; }
  .intro-item .glow { max-width: 88vw; border-radius: 18px; }
  .glow img { max-height: 62vh; }
  .intro-item.full .f-cap { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); font-size: 13px; letter-spacing: 2px; }
  /* 触控目标加大,进度点加粗 */
  .intro-skip, .intro-sound { padding: 10px 18px; font-size: 14px; }
  .intro-progress i { width: 22px; height: 4px; }
}
@media (max-width: 360px) {
  .intro-title h1 { font-size: 32px; letter-spacing: 4px; }
}
