* {
  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);
}

/* 弹窗里的实况播放:与静图同框铺满(cover),消除"小窗口放视频"的观感 */
.modal-live-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  background: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none; /* 华为浏览器需显式禁用原生视频手势 */
}
.modal-live-video.show { opacity: 1; }
/* 视频封面 + 播放键(点击才加载播放器,不自动播放) */
.video-cover {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  max-width: 85vw; min-width: 200px; min-height: 200px;
}
.video-cover img {
  display: block; max-width: 85vw; max-height: 75vh;
  border-radius: 8px;
}
.video-play-btn {
  position: absolute; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0 0 0 5px; /* 三角形视觉居中 */
  -webkit-tap-highlight-color: transparent;
}
.video-play-btn:active { transform: scale(0.92); }
/* 实况徽章:左上角角标,点击切换播放/停止 */
.live-badge {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border: none; border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff; font-family: inherit;
  font-size: 12px; letter-spacing: 1px;
  cursor: pointer; backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.25s ease;
}
.live-badge:active { transform: scale(0.96); }
.live-badge i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ffd60a;
  animation: livePulse 1.3s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 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;
  -webkit-touch-callout: none; /* 长按重播用,iOS 别弹"存储图像"菜单 */
  -webkit-user-select: none;
  user-select: none;
}
.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-date-input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dark);
  border: 1px solid var(--pink-300);
  border-radius: 8px;
  padding: 3px 8px;
  background: var(--pink-50);
  outline: none;
  max-width: 210px;
}
.modal-date-input:focus { border-color: var(--pink-500); box-shadow: 0 0 0 3px rgba(255, 93, 143, .15); }
.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); }
/* 版本号:页脚角落里弱化显示,不打扰观感 */
.site-footer .version-tag {
  font-size: 11px;
  letter-spacing: 0;
  opacity: 0.45;
}

/* 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; }
}

/* ====== P0: 相册/厨房 双模式切换 ====== */

/* header 内 logo 和模式切换胶囊的 row 布局 */
.logo-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.logo-row .logo { margin: 0; font-size: 28px; }
@media (max-width: 600px) {
  .logo-row .logo { font-size: 24px; }
  .logo-row { gap: 10px; }
}

/* 模式切换胶囊(仿 iOS style) */
.mode-switch {
  position: relative;
  width: 96px; height: 34px;
  border-radius: 17px;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
  padding: 0; overflow: hidden;
  transition: background .25s ease;
  flex-shrink: 0;
}
.mode-switch .ms-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 42px; height: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  box-shadow: 0 2px 8px rgba(255, 93, 143, .4);
  transition: left .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 2;
}
.mode-switch .ms-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 14px; line-height: 1;
  z-index: 1;
  transition: color .25s ease, opacity .25s ease;
}
.mode-switch .ms-icon-album { left: 10px; color: var(--text-mute); opacity: .5; }
.mode-switch .ms-icon-kitchen { right: 10px; color: #fff; opacity: 1; }
/* 厨房模式:thumb 滑到右边 */
body.kitchen-mode .mode-switch .ms-thumb { left: 51px; }
body.kitchen-mode .mode-switch .ms-icon-album { color: #fff; opacity: 1; }
body.kitchen-mode .mode-switch .ms-icon-kitchen { color: var(--text-mute); opacity: .5; }

/* ====== 纯 CSS 模式切换:body class 驱动 ====== */

/* 相册模式(默认):厨房 tab 隐藏;相册 tab/工具栏/上传区/地图/相册显示 */
.kitchen-tabs { display: none; }

/* 厨房模式:相册 tab/工具栏/上传区/地图隐藏;厨房 tab + 购物车显示
   注意:#gallery 在厨房模式也保留显示——menu.js 要用它渲染菜品网格/冰箱列表/购物车清单 */
body.kitchen-mode .album-tabs { display: none !important; }
body.kitchen-mode .album-stats { display: none !important; }
body.kitchen-mode .album-actions { display: none !important; }
body.kitchen-mode .upload-area { display: none !important; }
body.kitchen-mode .progress-wrap { display: none !important; }
body.kitchen-mode #mapSection { display: none !important; }
body.kitchen-mode .kitchen-tabs { display: flex !important; justify-content: center; }
body.kitchen-mode #musicToggle { display: none !important; } /* 厨房模式隐藏 BGM 按钮 */
body.kitchen-mode .love-days { display: none !important; }
/* 关键:厨房模式下 gallery 恢复普通文档流(dish-header 和 dish-grid 要垂直排列,
   不能被相册的 grid 布局当成两个横向 grid item) */
body.kitchen-mode #gallery { display: block !important; }

/* FAB 和抽屉 DOM 始终存在,用 JS 控制 visible/hidden 更可靠
   (CSS 选择器覆盖不了浏览器 UA 对 [hidden] 的 !important) */

/* 厨房 tab 视觉复用 .filter-tabs,但 tab 本身不显示 emoji 前缀造成拥挤(已经在 HTML 里写好了) */
.kitchen-tabs .tab { padding: 8px 14px; }

/* ====== 购物车悬浮 FAB ====== */
.cart-fab {
  position: fixed;
  right: 18px; bottom: 100px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff; font-size: 26px;
  box-shadow: 0 6px 20px rgba(255, 93, 143, .5);
  display: none; align-items: center; justify-content: center;
  z-index: 99;
  transition: transform .2s ease, box-shadow .2s ease;
}
body.kitchen-mode .cart-fab { display: flex; }
.cart-fab:active { transform: scale(.92); }
.cart-fab:hover { box-shadow: 0 8px 28px rgba(255, 93, 143, .65); transform: translateY(-2px); }
.cart-fab .cart-fab-icon { line-height: 1; }
.cart-fab .cart-fab-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  background: #fff; color: var(--pink-600);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--pink-600);
  animation: cartBadgePop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cartBadgePop {
  0% { transform: scale(.6); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.cart-fab .cart-fab-icon.cart-bump {
  animation: cartBump .4s ease;
}
@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4) rotate(-8deg); }
  80% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1); }
}

/* ====== 购物车侧滑抽屉 ====== */
.cart-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 998;
  animation: fadeIn .2s ease;
}
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  background: #fff;
  z-index: 999;
  box-shadow: -8px 0 28px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0e6ea;
}
.cart-drawer-header h3 { margin: 0; font-size: 17px; color: var(--text); }
.cart-drawer-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; cursor: pointer; background: #f5f0f2; color: var(--text-mute);
  font-size: 14px; line-height: 1;
  transition: background .2s ease;
}
.cart-drawer-close:hover { background: #ffe7ef; color: var(--pink-600); }
.cart-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
}
.cart-empty-hint {
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
  padding: 40px 0;
  line-height: 1.8;
}
.cart-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0e6ea;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cart-btn {
  flex: 1 1 100px;
  padding: 10px 14px;
  border: none; border-radius: 22px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cart-btn:active { transform: scale(.96); }
.cart-btn-primary {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  color: #fff;
  box-shadow: 0 3px 12px rgba(255,93,143,.4);
}
.cart-btn-secondary {
  background: #f5f0f2;
  color: var(--text);
}
.cart-btn-secondary:hover { background: #ffe7ef; }
.cart-btn-danger {
  background: transparent;
  color: #c75a5a;
  border: 1px solid #ffd6d6;
  flex: 0 0 auto;
}
.cart-btn-danger:hover { background: #fff0f0; }

/* 购物车抽屉里的食材清单(Phase 3 渲染,先预留样式) */
.cart-ingredient-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #f4e4ea;
  font-size: 14px;
}
.cart-ingredient-row:last-child { border-bottom: none; }
.cart-ingredient-row .ci-name { flex: 1; color: var(--text); }
.cart-ingredient-row .ci-status {
  font-size: 12px; padding: 2px 10px; border-radius: 10px;
  flex-shrink: 0;
}
.cart-ingredient-row.in-cart .ci-status { background: #ffe7ef; color: var(--pink-600); }
.cart-ingredient-row.need-buy .ci-status { background: #fff1f1; color: #d64545; }
.cart-ingredient-row.in-fridge .ci-status { background: #e8f5e9; color: #3e8e41; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* 移动端抽屉适配 */
@media (max-width: 600px) {
  .cart-fab { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .cart-drawer { width: 100%; }
}

/* ====== P1/P2/P3/P4: 厨房模式全量 UI 优化 ====== */

/* ---- dish-header（正常文档流,grid 上方,sticky 吸顶） ---- */
.dish-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 14px;
  margin-bottom: 14px;
  position: sticky; top: 10px; z-index: 20;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,250,252,.9));
  backdrop-filter: blur(8px);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(255,120,160,.1);
}
.dish-new-btn {
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  color: #fff; border: none; border-radius: 22px;
  padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 14px rgba(255,93,143,.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dish-new-btn:hover { box-shadow: 0 5px 18px rgba(255,93,143,.55); }
.dish-new-btn:active { transform: scale(.96); }
.dish-count { font-size: 13px; color: var(--text-mute); }

/* ---- dish-card 网格（参考相册 card 风格:图片占满 + 名字叠底部） ---- */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.dish-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.dish-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,93,143,.2);
}
.dish-card img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  background: #fff5f8;
  transition: transform .35s ease;
}
.dish-card:hover img { transform: scale(1.05); }
.dish-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #fff1f5 0%, #ffe0ea 60%, #ffd0de 100%);
  position: relative;
}
.dish-card-placeholder::after {
  content: "♥"; position: absolute; top: 6px; right: 8px;
  font-size: 11px; color: #ff9cb8; opacity: .6;
}
/* 菜品名叠在图片底部渐变条上(和相册照片角标风格一致) */
.dish-card-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
  color: #fff;
  pointer-events: none;
}
.dish-card-info h3 { margin: 0; font-size: 13px; color: #fff; font-weight: 600; letter-spacing: .3px; }
.dish-card-info p { display: none; } /* 食材列表放角落或省略,保持卡片干净 */

.dish-card-cart {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(4px);
  font-size: 15px; line-height: 1;
  color: var(--pink-500);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .18s ease, background .18s ease;
  z-index: 2;
}
.dish-card-cart:hover { transform: scale(1.15); }
.dish-card-cart.in-cart { background: linear-gradient(135deg, #ff7aa8, #ff5d8f); color: #fff; box-shadow: 0 3px 12px rgba(255,93,143,.45); }

.dish-card-del {
  position: absolute; bottom: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity .18s ease, background .18s ease;
  z-index: 2;
}
.dish-card:hover .dish-card-del { opacity: 1; }
.dish-card-del:hover { background: rgba(0,0,0,.65); }

/* 菜品弹窗 */
.dish-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,10,20,.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.dish-modal {
  width: min(460px, 92vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 22px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(100,30,60,.28);
  animation: modalIn .28s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.dish-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #fde3ec;
}
.dish-modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.dish-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; cursor: pointer; background: #f8eef2; color: var(--text-mute);
  font-size: 14px;
  transition: background .18s ease;
}
.dish-modal-close:hover { background: #ffe1ec; color: var(--pink-600); }

.dish-modal-body {
  flex: 1; overflow-y: auto;
  padding: 16px 22px;
}
.dish-modal-body img {
  max-width: 100%; max-height: 260px;
  border-radius: 14px; object-fit: contain;
  background: #fafafa;
}
.dish-detail-modal .dish-modal-body img {
  width: 100%; max-height: 300px;
}

.dish-upload-area { margin-bottom: 14px; }
.dish-upload-preview {
  width: 100%; height: 180px;
  border: 2px dashed #f2c0cf; border-radius: 14px;
  background: #fff8fb;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: background .15s ease, border-color .15s ease;
}
.dish-upload-preview:hover { background: #fff0f6; border-color: #ff9cb8; }
.dish-upload-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.dish-upload-hint {
  text-align: center; color: #c88; font-size: 14px; line-height: 1.8;
}
.dish-upload-hint span { color: #bbb; font-size: 12px; }

.dish-form-field { margin-bottom: 14px; }
.dish-form-field label {
  display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; font-weight: 600;
}
.dish-form-field input[type="text"] {
  width: 100%; padding: 11px 14px;
  border: 1px solid #eed6de; border-radius: 10px;
  font-family: inherit; font-size: 14px;
  box-sizing: border-box;
  background: #fffbfc;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dish-form-field input[type="text"]:focus {
  outline: none; border-color: var(--pink-500);
  box-shadow: 0 0 0 3px rgba(255,93,143,.15);
}

.dish-ingredients { display: flex; flex-direction: column; gap: 8px; }
.dish-ing-row { display: flex; gap: 6px; align-items: center; }
.dish-ing-input {
  flex: 1; padding: 9px 12px;
  border: 1px solid #eed6de; border-radius: 10px;
  font-family: inherit; font-size: 14px;
  background: #fffbfc;
  transition: border-color .15s ease;
}
.dish-ing-input:focus { outline: none; border-color: var(--pink-500); }
.dish-ing-del {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; cursor: pointer;
  background: #ffecec; color: #d66;
  font-size: 14px; line-height: 1;
  flex-shrink: 0;
}
.dish-ing-del:hover { background: #ffdada; }

.dish-modal-footer {
  display: flex; gap: 10px;
  padding: 14px 22px; border-top: 1px solid #fde3ec;
}
.dish-modal-btn {
  flex: 1; padding: 10px;
  border: none; border-radius: 22px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dish-modal-btn:active { transform: scale(.96); }
.dish-submit {
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  color: #fff;
  box-shadow: 0 3px 14px rgba(255,93,143,.45);
}
.dish-submit:disabled { opacity: .6; cursor: not-allowed; }
.dish-cancel {
  background: #f8eef2;
  color: var(--text);
}
.dish-cancel:hover { background: #ffe1ec; }
#dishDetailDel {
  background: transparent; border: 1px solid #ffd6d6; color: #c75a5a;
  flex: 0 0 auto; padding: 10px 14px;
}
#dishDetailDel:hover { background: #fff0f0; }

/* ====== P2: 冰箱列表（卡片化 header + 搜索输入框 + 食材 chip） ====== */
.kitchen-section-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(255,120,160,.08), 0 0 0 1px rgba(255,220,235,.4);
  margin-bottom: 16px;
}
.kitchen-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.kitchen-section-title .kst-left {
  font-size: 15px; font-weight: 700; color: var(--text-dark);
}
.kitchen-section-title .kst-left::before {
  content: ""; display: inline-block; width: 4px; height: 15px;
  background: linear-gradient(180deg, #ff7aa8, #ff5d8f);
  border-radius: 3px; margin-right: 8px; vertical-align: middle;
}
.kitchen-section-title .kst-count { font-size: 12px; color: #b799a5; }

.fridge-search-wrap {
  position: relative; margin-bottom: 0;
}
.fridge-search-wrap input {
  width: 100%; padding: 11px 14px 11px 36px;
  border: 1px solid #eed6de; border-radius: 24px;
  font-family: inherit; font-size: 14px;
  box-sizing: border-box;
  background: #fffbfc;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fridge-search-wrap::before {
  content: "🧊"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; pointer-events: none; opacity: .7;
}
.fridge-search-wrap input:focus {
  outline: none; border-color: var(--pink-500);
  box-shadow: 0 0 0 3px rgba(255,93,143,.15);
}
.fridge-suggest {
  position: absolute; top: 50px; left: 0; right: 0;
  background: #fff; border: 1px solid #f4e4ea; border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  z-index: 10;
  max-height: 220px; overflow-y: auto;
}
.fridge-suggest > div {
  padding: 10px 14px; font-size: 14px; cursor: pointer;
  border-bottom: 1px solid #faf0f4;
  display: flex; align-items: center; gap: 8px;
}
.fridge-suggest > div::before { content: "＋"; color: var(--pink-500); font-size: 12px; font-weight: 700; }
.fridge-suggest > div:last-child { border-bottom: none; }
.fridge-suggest > div:hover { background: #fff5f8; color: var(--pink-600); }

.fridge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fridge-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 14px;
  background: linear-gradient(135deg, #fff1f5, #ffe3ec);
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(255,93,143,.15);
  animation: chipIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes chipIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fridge-name { font-weight: 500; color: var(--text-dark); }
.fridge-del {
  width: 20px; height: 20px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.8); color: #d64545;
  font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.fridge-del:hover { background: #ffdada; }

.fridge-add-btn {
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  color: #fff; border: none; border-radius: 22px;
  padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 12px rgba(255,93,143,.4);
}

/* ====== P3: 购物车 tab（做菜计划 + 统计 + 食材清单） ====== */
.cart-plan-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(255,120,160,.08), 0 0 0 1px rgba(255,220,235,.4);
  margin-bottom: 14px;
}
.cart-plan-dishes {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.cart-plan-dishes .cpd-chip {
  background: linear-gradient(135deg, #fff5f8, #ffe3ec);
  border-radius: 18px; padding: 5px 12px; font-size: 13px;
  color: var(--text-dark); font-weight: 500;
  box-shadow: 0 1px 3px rgba(255,93,143,.15);
}
.cart-stats {
  display: flex; gap: 8px; font-size: 12px;
}
.cart-stats .cs-cell {
  flex: 1; text-align: center; padding: 10px 6px;
  border-radius: 12px;
}
.cs-cell.best { background: #e8f5e9; color: #2e7d32; }
.cs-cell.warn { background: #fff1f1; color: #c62828; }
.cs-cell.info { background: #fff5f8; color: #a55; }
.cs-cell b { display: block; font-size: 18px; margin-top: 2px; }

.cart-ingredient-list { display: flex; flex-direction: column; gap: 4px; }
.cart-ingredient-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(255,120,160,.06);
  font-size: 14px;
  transition: transform .12s ease;
}
.cart-ingredient-row:hover { transform: translateX(2px); }
.cart-ingredient-row .ci-name { flex: 1; color: var(--text-dark); font-weight: 500; }
.cart-ingredient-row .ci-source { font-size: 11px; color: #b799a5; flex-shrink: 0; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-ingredient-row .ci-status {
  font-size: 11px; padding: 3px 10px; border-radius: 10px;
  flex-shrink: 0; font-weight: 600;
}
.cart-ingredient-row.in-fridge .ci-status { background: #e8f5e9; color: #2e7d32; }
.cart-ingredient-row.need-buy .ci-status { background: #ffebee; color: #c62828; }
.cart-ingredient-row.in-fridge::before { content: "✅"; font-size: 13px; }
.cart-ingredient-row.need-buy::before { content: "🛒"; font-size: 13px; }

/* 购物车抽屉内食材行的精简版（无边框无 hover，紧凑） */
.cart-drawer-body .cart-ingredient-row {
  padding: 8px 0; box-shadow: none; border-radius: 0;
  border-bottom: 1px dashed #fde3ec;
}
.cart-drawer-body .cart-ingredient-row:last-child { border-bottom: none; }
.cart-drawer-body .cart-ingredient-row:hover { transform: none; }

/* 厨房模式下统一空状态 */
body.kitchen-mode .empty-state {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(255,120,160,.08), 0 0 0 1px rgba(255,220,235,.4);
  padding: 40px 24px;
  text-align: center;
  animation: none;
}
body.kitchen-mode .empty-state .empty-icon {
  font-size: 64px; margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(255,93,143,.25));
}
body.kitchen-mode .empty-state p {
  color: #a87c8c; font-size: 14px; line-height: 1.7;
  letter-spacing: .5px;
}
body.kitchen-mode .empty-state p br { display: block; content: ""; margin-bottom: 4px; }

/* ====== 今天吃啥:推荐卡样式 ====== */
.rec-section { margin-bottom: 22px; }
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.rec-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,93,143,.18);
}
.rec-card.rec-card-perfect {
  box-shadow: 0 0 0 2px #ff7aa8, 0 4px 14px rgba(255,93,143,.22);
}
.rec-card-media {
  aspect-ratio: 1/1;
  position: relative;
  background: #fff5f8;
  overflow: hidden;
}
.rec-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.rec-card:hover .rec-card-media img { transform: scale(1.05); }
.rec-card-body {
  padding: 10px 12px 12px;
}
.rec-card-name {
  font-size: 14px; font-weight: 600; color: var(--text-dark);
  margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-match-bar {
  height: 5px; background: #f5eef2; border-radius: 3px;
  overflow: hidden; margin-bottom: 4px;
}
.rec-match-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}
.rec-match-fill.perfect { background: linear-gradient(90deg, #66bb6a, #43a047); }
.rec-match-fill.high { background: linear-gradient(90deg, #ffa726, #fb8c00); }
.rec-match-fill.mid { background: linear-gradient(90deg, #ef5350, #e53935); }
.rec-match-fill.low { background: #ccc; }
.rec-match-fill.no-ing { background: #eee; }
.rec-match-text {
  font-size: 11px; color: #a08;
  display: flex; justify-content: space-between;
}

/* 随机抽一道大卡片 */
.rec-random-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #fff5f8 0%, #ffe0ea 100%);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 24px;
  cursor: pointer;
  box-shadow: 0 3px 16px rgba(255,93,143,.18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rec-random-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255,93,143,.28);
}
.rec-random-card:active { transform: scale(.99); }
.rec-random-left { flex: 1; min-width: 0; }
.rec-random-label {
  font-size: 12px; color: #c07089; font-weight: 600;
  margin-bottom: 6px; letter-spacing: .5px;
}
.rec-random-name {
  font-size: 22px; font-weight: 700; color: var(--pink-600);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-random-hint {
  font-size: 11px; color: #b799a5;
}
.rec-random-media {
  width: 88px; height: 88px; flex-shrink: 0;
  border-radius: 14px; overflow: hidden;
  background: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(255,93,143,.25);
  transition: transform .18s ease;
}
.rec-random-media:hover { transform: scale(1.05); }
.rec-random-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rec-no-fridge {
  background: #fff5f8; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px;
  font-size: 13px; color: #a07088;
  text-align: center;
}

@media (max-width: 600px) {
  .dish-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .dish-card-info h3 { font-size: 12px; }
  .dish-new-btn { padding: 8px 16px; font-size: 13px; }
  .fridge-search-wrap input { padding: 10px 14px 10px 36px; font-size: 13px; }
  .dish-modal { width: 96vw; border-radius: 18px; }
  .kitchen-section-card { padding: 14px; margin-bottom: 12px; }
  .cart-stats .cs-cell b { font-size: 16px; }
}

/* ====== 菜品分类 ====== */
/* 网格上方筛选条 */
.dish-cat-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.cat-filter-chip {
  border: none; cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #fff; color: #b799a5;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: all .15s ease;
}
.cat-filter-chip:hover { color: #ff5d8f; }
.cat-filter-chip.on {
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,93,143,.3);
}
/* 卡片上的分类小标签 */
.dish-card-cat {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  color: #ff5d8f; background: #ffe3ec;
  padding: 1px 7px; border-radius: 999px;
  margin-bottom: 3px;
  letter-spacing: .5px;
}
/* 弹窗里的分类选择 chips */
.dish-cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dish-cat-chips .cat-chip {
  border: 1.5px solid #ffd0de; background: #fff;
  color: #b799a5; cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: all .15s ease;
}
.dish-cat-chips .cat-chip.on {
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(255,93,143,.3);
}
/* 详情弹窗标题里的分类 */
.detail-cat {
  display: inline-block; vertical-align: 2px;
  font-size: 11px; font-weight: 600;
  color: #ff5d8f; background: #ffe3ec;
  padding: 2px 8px; border-radius: 999px;
  margin-left: 6px;
}
/* 详情弹窗三按钮防挤 */
.dish-modal-footer { flex-wrap: wrap; }

/* ====== 照片配文 ====== */
.modal-caption { margin: 8px 0 2px; text-align: center; }
.modal-caption .cap-text {
  border: none; background: #fff5f8; cursor: pointer;
  font-size: 14px; color: #8a5a6e; font-style: normal;
  padding: 6px 14px; border-radius: 10px;
  max-width: 100%; line-height: 1.5;
  transition: background .15s ease;
  word-break: break-all;
}
.modal-caption .cap-text:hover { background: #ffe3ec; }
.modal-caption .cap-add {
  border: 1.5px dashed #ffc8d7; background: transparent; cursor: pointer;
  font-size: 12px; color: #c99aab;
  padding: 5px 14px; border-radius: 999px;
  transition: all .15s ease;
}
.modal-caption .cap-add:hover { border-color: #ff7aa8; color: #ff5d8f; }
.cap-edit-row {
  display: flex; gap: 8px; align-items: center;
  max-width: 100%;
}
.cap-edit-row input {
  flex: 1; min-width: 0;
  border: 1.5px solid #ffc8d7; border-radius: 10px;
  padding: 8px 12px; font-size: 14px;
  color: var(--text-dark, #4a2c3a);
  outline: none;
  background: #fff;
}
.cap-edit-row input:focus { border-color: #ff7aa8; }
.cap-edit-row .cap-save {
  border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #ff7aa8, #ff5d8f);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 10px;
  transition: opacity .15s ease;
}
.cap-edit-row .cap-save:hover { opacity: .88; }

/* ====== 情书 · 拟真信纸(点开阅读) ====== */
.letter-scroll {
  width: min(94vw, 720px);
  max-height: 78vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 120, 140, .4) transparent;
  border-radius: 8px;
}
.letter-paper {
  position: relative;
  /* 浪漫信纸:腮红粉渐变底 + 淡粉横格线(与行高 46px 对齐) + 中央淡淡的心形水印 */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 86C22 62 6 44 6 28 6 14 16 6 28 6c10 0 18 6 22 15C54 12 62 6 72 6c12 0 22 8 22 22 0 16-16 34-44 58z' fill='%23e0708c' fill-opacity='0.07'/%3E%3C/svg%3E") no-repeat center 42% / 240px,
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 45px,
      rgba(199, 120, 140, 0.15) 45px,
      rgba(199, 120, 140, 0.15) 46px
    ),
    linear-gradient(165deg, #fffaf7 0%, #fdf0ea 50%, #fbe4e0 100%);
  border: 1px solid rgba(199, 120, 140, 0.3);
  border-radius: 6px;
  padding: 56px 38px 64px;
  box-shadow:
    0 1px 2px rgba(120, 60, 70, 0.18),
    0 8px 24px rgba(120, 60, 70, 0.22),
    0 24px 60px rgba(50, 20, 35, 0.28);
  /* 正文用马善政手写体:行楷韵味但更清晰易读 */
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  color: #4f3340;
}
/* 纸张做旧斑纹 + 腮红粉晕 */
.letter-paper::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(ellipse 300px 200px at 88% 6%, rgba(255, 170, 190, .16), transparent 70%),
    radial-gradient(ellipse 280px 220px at 6% 94%, rgba(255, 170, 190, .14), transparent 70%),
    radial-gradient(ellipse 300px 180px at 85% 8%, rgba(210, 180, 140, .10), transparent 70%),
    radial-gradient(ellipse 260px 200px at 10% 92%, rgba(210, 180, 140, .08), transparent 70%);
}
/* 内框细线:信纸的双层边框感 */
.letter-paper::after {
  content: "";
  position: absolute; inset: 12px;
  border: 1px solid rgba(199, 120, 140, 0.26);
  border-radius: 4px;
  pointer-events: none;
}
/* 四角小爱心点缀(JS 注入的 span) */
.letter-corner {
  position: absolute;
  font-family: sans-serif; /* 符号用系统字体,避免手写字体缺字形 */
  font-size: 13px;
  color: rgba(214, 110, 140, 0.4);
  pointer-events: none;
  z-index: 1;
}
.letter-corner::after {
  content: "❤";
  position: absolute;
  top: 11px; left: 11px;
  font-size: 8px;
  opacity: 0.75;
}
.letter-corner.c-tl { top: 18px; left: 20px; }
.letter-corner.c-tr { top: 18px; right: 20px; }
.letter-corner.c-bl { bottom: 18px; left: 20px; }
.letter-corner.c-br { bottom: 18px; right: 20px; }
/* 火漆印(骑在信纸顶边) */
.letter-seal {
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: rgba(255, 255, 255, .92);
  background: radial-gradient(circle at 35% 30%, #e0606e, #b8323f 60%, #8f2430);
  /* 火漆不规则边缘 */
  border-radius: 47% 53% 51% 49% / 52% 48% 52% 48%;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, .35),
    inset 0 -3px 6px rgba(0, 0, 0, .3),
    0 3px 8px rgba(90, 20, 30, .4);
}
.letter-title {
  text-align: center;
  font-family: "Zhi Mang Xing", "Ma Shan Zheng", cursive; /* 标题保留飘逸行书 */
  font-size: 32px;
  letter-spacing: 2px;
  color: #a43d56;
  margin-bottom: 28px;
}
.letter-body {
  font-size: 24px;
  line-height: 46px; /* 对齐信纸横格线 */
  letter-spacing: 1px;
  white-space: pre-wrap; /* 保留换行 */
  word-break: break-word;
}
.letter-sign {
  margin-top: 40px;
  text-align: right;
  font-size: 20px;
  color: #b0758a;
}
@media (max-width: 600px) {
  .letter-scroll { width: 92vw; max-height: 74vh; }
  .letter-paper { padding: 48px 24px 56px; }
  .letter-title { font-size: 27px; }
  .letter-body { font-size: 22px; }
}

/* ====== 信栏目 · 微信聊天样式列表(乐女士左/粉,阳先生右/蓝) ====== */
#gallery.chat-mode {
  display: block;
  max-width: 760px;
  margin: 0 auto;
}
/* 日期分隔:居中时间条 */
.chat-time {
  text-align: center;
  font-size: 12px;
  color: #b0758a;
  margin: 20px 0 12px;
  letter-spacing: 1px;
}
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 4px;
  cursor: pointer;
}
.chat-row.right { flex-direction: row-reverse; }
/* 圆形字头像:乐=粉,阳=蓝 */
.chat-avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-size: 24px;
  color: #fff;
  user-select: none;
}
.chat-avatar.le {
  background: linear-gradient(135deg, #ff9ebb, #ff5d8f);
  box-shadow: 0 3px 10px rgba(255, 93, 143, .45);
}
.chat-avatar.yang {
  background: linear-gradient(135deg, #7db8ff, #4a8fe8);
  box-shadow: 0 3px 10px rgba(74, 143, 232, .45);
}
/* 气泡 */
.chat-bubble {
  position: relative;
  max-width: 78%;
  padding: 12px 16px 13px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(120, 60, 70, .12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.chat-row:hover .chat-bubble {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(120, 60, 70, .2);
}
.chat-bubble.le {
  background: #ffffff;
  border: 1px solid rgba(255, 158, 187, .35);
  border-top-left-radius: 4px; /* 靠头像角收窄,模拟微信气泡尾巴 */
}
.chat-bubble.yang {
  background: linear-gradient(165deg, #eaf3ff, #dceaff);
  border: 1px solid rgba(125, 184, 255, .4);
  border-top-right-radius: 4px;
}
.chat-title {
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", cursive;
  font-size: 18px;
  letter-spacing: 1px;
}
.chat-bubble.le .chat-title { color: #c93870; }
.chat-bubble.yang .chat-title { color: #3a6fc0; }
/* 内容摘要:最多两行 */
.chat-snippet {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
/* 多选模式下的选中态 */
.chat-row.sel-on .chat-bubble {
  outline: 2px solid var(--pink-500);
  outline-offset: 2px;
}
/* 「谁留的」标签(信息栏,双击/长按切换) */
.from-tag {
  display: inline-block;
  align-self: flex-start;
  margin: -2px 0 8px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, #e3f0ff, #d2e5ff);
  color: #3a6fc0;
  border: 1px solid rgba(125, 184, 255, .5);
}
.from-tag.le {
  background: linear-gradient(135deg, #ffe3ec, #ffd0de);
  color: #c93870;
  border-color: rgba(255, 158, 187, .5);
}
@media (max-width: 600px) {
  #gallery.chat-mode { max-width: 100%; }
  .chat-avatar { width: 40px; height: 40px; font-size: 21px; }
  .chat-bubble { max-width: 82%; }
  .chat-title { font-size: 17px; }
}

