/* ==================================================================
   两个人的小屋 · 样式
   ================================================================== */

:root {
  --bg-1: #fff5f7;
  --bg-2: #ffe8f0;
  --bg-3: #f3ecff;
  --card: #ffffff;
  --ink: #3a2c31;
  --ink-soft: #6d5b61;
  --muted: #a5949a;
  --line: #f3e3e8;
  --primary: #ff6b8b;
  --primary-dark: #ea4d72;
  --primary-soft: #ffe4ea;
  --accent: #ffb3c6;
  --mint: #7ed8a6;
  --shadow: 0 10px 28px rgba(255, 107, 139, 0.13);
  --shadow-sm: 0 4px 14px rgba(255, 107, 139, 0.10);
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
/* 视觉隐藏但保留可交互性：用于 file input，确保 .click() / showPicker() 有效 */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
/* 文件输入专用：移到屏幕外但保持可点击，兼容性最好 */
.offscreen-input {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 模态输入框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.modal-box {
  width: 86%; max-width: 320px;
  background: #fff; border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal-title { font-size: 15px; font-weight: 600; color: #444; margin-bottom: 12px; text-align: center; }
.modal-input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #e0d8e8; border-radius: 12px;
  padding: 10px 12px; font-size: 14px;
  background: #faf7ff; outline: none;
}
.modal-input:focus { border-color: #d28cd2; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------------------------- 通用按钮 ---------------------------- */
.btn {
  display: inline-block;
  border-radius: 14px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.96); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), #ff8fa8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 107, 139, .32);
}
.btn.primary:active { box-shadow: 0 4px 10px rgba(255, 107, 139, .28); }
.btn.ghost {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.btn.tiny { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }

.text-input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fffdfe;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 179, 198, .25);
}
.text-input.area { min-height: 84px; resize: vertical; line-height: 1.55; }

/* ============================ 加入房间 ============================ */
.join {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + var(--safe-b));
  background: linear-gradient(165deg, #fff0f4 0%, #ffe4ee 50%, #f0e9ff 100%);
  z-index: 50;
}
.join-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border-radius: 26px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: riseIn .5s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.join-logo {
  width: 56px; height: 56px; margin: 0 auto 10px;
  display: grid; place-items: center;
  font-size: 26px; color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff9fbb);
  box-shadow: 0 8px 20px rgba(255, 107, 139, .4);
  animation: beat 2.4s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.1); }
  24% { transform: scale(1); }
  36% { transform: scale(1.06); }
}
.join-card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: .5px; }
.join-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 179, 198, .22); }
.join-actions { display: flex; gap: 10px; margin-top: 18px; }
.join-actions .btn { flex: 1; }
.join-error { color: var(--primary-dark); font-size: 13px; min-height: 18px; margin: 12px 0 0; }
.join-tip { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.6; }

/* ============================== 主界面 ============================== */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(8px + var(--safe-t)) 14px calc(96px + var(--safe-b));
  min-height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
}
.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  letter-spacing: 1.4px;
  font-size: 13.5px;
  color: var(--primary-dark);
}
.room-chip .copy-hint { font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d8ccd0;
  box-shadow: 0 0 0 0 rgba(126, 216, 166, .6);
}
.dot.on {
  background: var(--mint);
  animation: dotPulse 2s ease-out infinite;
}
@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 216, 166, .55); }
  100% { box-shadow: 0 0 0 8px rgba(126, 216, 166, 0); }
}
.name-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 7px 12px;
  box-shadow: var(--shadow-sm); font-weight: 600; font-size: 13.5px;
}
.name-chip .edit { color: var(--muted); font-size: 12px; }

.presence {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0 4px;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  animation: riseIn .38s cubic-bezier(.2, .9, .3, 1) both;
}
.card-title {
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: '';
  width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.foot-note { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; margin: 14px 0; }

/* ---------------------------- 心情 ---------------------------- */
.mood-top { margin-bottom: 14px; }
.mood-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow);
}
.pair-one { flex: 1; text-align: center; min-width: 0; }
.pair-avatar {
  font-size: 36px;
  line-height: 1;
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.5); }
  to { opacity: 1; transform: scale(1); }
}
.pair-avatar.partner { font-size: 34px; }
.pair-name {
  font-size: 12.5px; font-weight: 700; margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pair-label { font-size: 11.5px; color: var(--muted); }
.pair-link { position: relative; width: 26px; }
.pair-link::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1.5px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.pair-link .pulse {
  position: relative;
  font-size: 14px; color: var(--primary);
  animation: beat 2s ease-in-out infinite;
  display: inline-block;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.mood-opt {
  border-radius: 14px;
  padding: 10px 4px 8px;
  background: #fffafb;
  border: 1.5px solid var(--line);
  text-align: center;
  transition: transform .14s ease, border-color .2s, background .2s;
}
.mood-opt em { display: block; font-size: 22px; font-style: normal; line-height: 1.2; }
.mood-opt span { display: block; font-size: 10.5px; color: var(--ink-soft); margin-top: 2px; }
.mood-opt:active { transform: scale(.94); }
.mood-opt.sel {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(255, 107, 139, .2);
}
.mood-opt.sel em { animation: popIn .35s cubic-bezier(.2, 1.5, .4, 1) both; }
/* 自定义心情表情（上传的图片） */
.mood-opt.custom { position: relative; }
.mood-opt.custom em { display: flex; align-items: center; justify-content: center; }
.emoji-img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.emoji-del {
  position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 9px; line-height: 16px;
  padding: 0; text-align: center; font-weight: 700;
  box-shadow: 0 2px 5px rgba(255,107,139,.4);
  opacity: 0; transition: opacity .15s;
}
.mood-opt.custom:hover .emoji-del,
.mood-opt.custom:active .emoji-del { opacity: 1; }
.mood-upload { margin-bottom: 12px; }
/* label 包裹 file input：点击 label 原生触发文件选择器，兼容性最好 */
.file-label { display: inline-block; cursor: pointer; }
.file-label input[type="file"] { display: none; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }

.ta-mood-box { text-align: center; }
.ta-mood-emoji { font-size: 44px; animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.ta-mood-emoji .emoji-img,
.pair-avatar .emoji-img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.ta-mood-label { font-weight: 700; margin-top: 4px; }

/* 心情日历 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head .card-title { margin: 0; flex: 1; text-align: center; }
.cal-nav {
  width: 30px; height: 30px; border-radius: 50%;
  background: #f5eef8; color: #b07cc4; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.cal-nav:hover { background: #ecd9f0; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; color: #b07cc4;
  margin-bottom: 6px;
}
.cal-weekdays span { padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #faf7ff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 11px; color: #999;
  position: relative;
  padding: 2px;
}
.cal-cell.other-month { background: transparent; color: #ddd; }
.cal-cell.today { background: #f0e0f0; font-weight: 700; color: #b07cc4; }
.cal-cell .cal-day { font-size: 10px; opacity: .6; }
.cal-cell .cal-moods { display: flex; gap: 2px; margin-top: 2px; }
.cal-cell .cal-mood { font-size: 13px; line-height: 1; }
.cal-cell .cal-mood .emoji-img { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; }
.cal-legend { display: flex; justify-content: center; gap: 16px; margin-top: 10px; font-size: 11px; color: #999; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.legend-dot.me { background: #ffb3c7; }
.legend-dot.ta { background: #b3d9ff; }

.ta-mood-note {
  margin: 10px auto 0; max-width: 300px;
  background: #fffafb; border-radius: 14px; padding: 10px 14px;
  color: var(--ink-soft); font-size: 13.5px; border: 1px dashed var(--accent);
}
.ta-mood-time { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------------------------- 清单 ---------------------------- */
.progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.progress-text { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.progress-bar { height: 9px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.progress-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #ffa4bd);
  transition: width .5s cubic-bezier(.2, .9, .3, 1);
}

.add-row { margin-bottom: 12px; }
.kind-toggle {
  display: inline-flex;
  background: #fdf2f5;
  border-radius: 12px;
  padding: 3px;
  margin: 10px 0;
}
.kind-toggle button {
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  transition: background .2s, color .2s;
}
.kind-toggle button.on { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-sm); }

.items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 12px;
  border-radius: 15px;
  background: #fffafb;
  border: 1.5px solid var(--line);
  animation: riseIn .3s ease both;
  transition: background .25s, border-color .25s, opacity .25s;
}
.item.done { background: #f7fffa; border-color: #d5f0e0; }
.check {
  flex: 0 0 auto;
  width: 23px; height: 23px; border-radius: 50%;
  border: 2px solid var(--accent);
  display: grid; place-items: center;
  margin-top: 1px;
  transition: background .2s, border-color .2s, transform .2s;
}
.check svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3.4; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .28s ease .05s; }
.item.done .check { background: var(--mint); border-color: var(--mint); }
.item.done .check svg { stroke-dashoffset: 0; }
.item:active .check { transform: scale(.9); }
.item-main { flex: 1; min-width: 0; }
.item-text { font-size: 14.5px; font-weight: 600; word-break: break-word; }
.item.done .item-text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 6px; padding: 1px 6px; font-size: 10.5px; font-weight: 700;
}
.tag.grey { background: #f1edee; color: var(--muted); }
.del {
  color: #d9ccd1; font-size: 17px; padding: 0 2px; line-height: 1;
  align-self: center;
}
.del:active { color: var(--primary); }

/* ---------------------------- 便签 ---------------------------- */
.note-compose { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent;
  transition: transform .16s, border-color .16s;
  position: relative;
}
.swatch.sel { border-color: var(--ink-soft); transform: scale(1.14); }

/* ---------- 便签写作区：画笔 + 画布 ---------- */
.draw-area {
  margin-top: 12px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fffafb;
  padding: 10px;
}
.draw-tools {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.draw-colors {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.brush-color {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid transparent;
  transition: transform .14s, border-color .14s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.brush-color.sel { border-color: var(--ink-soft); transform: scale(1.15); }
.brush-color.erase { box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08); }
.draw-sizes { display: flex; gap: 6px; }
.brush-size {
  width: 32px; height: 32px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--line);
  display: grid; place-items: center;
  transition: border-color .14s, background .14s;
}
.brush-size i { display: block; border-radius: 50%; background: var(--ink-soft); }
.brush-size.sel { border-color: var(--primary); background: var(--primary-soft); }
.brush-size.sel i { background: var(--primary-dark); }
.note-canvas {
  display: block;
  width: 100%; height: 160px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: crosshair;
}

.wall { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; padding: 4px 2px 8px; }
.sticky {
  position: relative;
  border-radius: 4px 4px 10px 10px;
  padding: 18px 12px 10px;
  box-shadow: 0 8px 20px rgba(120, 90, 100, .22), 0 2px 6px rgba(120, 90, 100, .12);
  word-break: break-word;
  overflow: hidden;
}
/* 纸张纹理：叠加细微的渐变和噪点感 */
.sticky::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 35%),
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(0,0,0,.025) 23px, rgba(0,0,0,.025) 24px);
  pointer-events: none;
  border-radius: inherit;
}
/* 顶部胶带 */
.sticky::after {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 52px; height: 18px;
  background: rgba(255, 255, 255, .55);
  border-left: 1px dashed rgba(255,255,255,.6);
  border-right: 1px dashed rgba(255,255,255,.6);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  backdrop-filter: blur(2px);
}
/* 入场动画：从上方飘落并贴到墙上 */
@keyframes stickIn {
  0% { opacity: 0; transform: translateY(-40px) rotate(0deg) scale(.85); }
  60% { opacity: 1; transform: translateY(6px) rotate(var(--rot, 0deg)) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)) scale(1); }
}
.sticky { animation: stickIn .5s cubic-bezier(.2, .9, .3, 1.2) both; }

/* 便签颜色：更多选择 + 更仿真的纸色 */
.sticky.c-pink   { background: #ffd9e4; }
.sticky.c-yellow { background: #fff1b8; }
.sticky.c-mint   { background: #c9efd6; }
.sticky.c-blue   { background: #cfe4ff; }
.sticky.c-purple { background: #e4d8ff; }
.sticky.c-orange { background: #ffd9b0; }
.sticky.c-green  { background: #c5ecd2; }
.sticky.c-red    { background: #ffc9c9; }
.sticky.c-cream  { background: #fdf6e3; }

.sticky-text {
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
  position: relative; z-index: 1;
  color: #4a3540;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
/* 绘画画布区 */
.sticky-canvas {
  position: relative; z-index: 1;
  width: 100%; height: 70px;
  margin-top: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,.18);
  touch-action: none;
  cursor: default;
  pointer-events: none; /* 默认不拦截，方便滚动 */
}
.sticky-canvas.drawing {
  background: rgba(255,255,255,.32);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6);
  cursor: crosshair;
  pointer-events: auto;
}
.sticky-canvas.readonly { cursor: default; pointer-events: none; }
/* 绘画工具栏 */
.sticky-tools {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px;
  position: relative; z-index: 2;
}
.sticky-tools .tool-btn {
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 6px;
  font-size: 12px;
  padding: 3px 7px;
  color: #5a4550;
  cursor: pointer;
  transition: background .15s;
}
.sticky-tools .tool-btn:hover { background: rgba(255,255,255,.75); }
.sticky-tools .tool-btn.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sticky-tools .spacer { flex: 1; }

.sticky-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 10.5px; color: rgba(58, 44, 49, .55);
  position: relative; z-index: 1;
}
.sticky .del { color: rgba(58, 44, 49, .32); font-size: 15px; }
.sticky .new {
  position: absolute; top: -6px; right: -4px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(255, 107, 139, .45);
  animation: beat 1.8s ease-in-out infinite;
  z-index: 3;
}
.sticky.mine { outline: 2px dashed rgba(255,255,255,.5); outline-offset: -4px; }

/* ---------------------------- 想你 ---------------------------- */
.miss-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 20px;
}
.miss-btn {
  width: 168px; height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9db4, var(--primary) 60%, #e63d66);
  box-shadow: 0 16px 40px rgba(255, 107, 139, .42), inset 0 -6px 18px rgba(0, 0, 0, .08);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  transition: transform .16s ease;
  position: relative;
}
.miss-btn::after {
  content: ''; position: absolute; inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 139, .45);
  animation: ripple 2.6s ease-out infinite;
}
@keyframes ripple {
  0% { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.18); opacity: 0; }
}
.miss-btn:active { transform: scale(.93); }
.miss-heart { font-size: 44px; animation: beat 1.8s ease-in-out infinite; }
.miss-text { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.miss-hint { color: var(--muted); font-size: 12.5px; margin-top: 16px; }

.stat-row { display: flex; }
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--primary-dark); }
.stat span { font-size: 11.5px; color: var(--muted); }

.timeline { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.tl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  animation: riseIn .3s ease both;
}
.tl-item:last-child { border-bottom: none; }
.tl-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  background: var(--primary-soft); flex: 0 0 auto;
}
.tl-item.back .tl-icon { background: #e9f6ff; }
.tl-main { flex: 1; min-width: 0; }
.tl-who { font-weight: 600; }
.tl-time { font-size: 11px; color: var(--muted); }

/* ---------------------------- 底部导航 ---------------------------- */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b));
  width: min(452px, calc(100% - 20px));
  display: flex;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
  border-radius: 22px;
  padding: 7px 6px;
  box-shadow: 0 10px 30px rgba(180, 120, 140, .22);
  z-index: 20;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 10.5px;
  position: relative;
  transition: color .2s, background .25s;
}
.tab svg { width: 21px; height: 21px; }
.tab.on { color: var(--primary-dark); background: var(--primary-soft); }
.tab:active { transform: scale(.95); }
.tab .badge {
  position: absolute; top: 3px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  display: grid; place-items: center; padding: 0 4px;
  box-shadow: 0 3px 8px rgba(255, 107, 139, .5);
  animation: beat 1.8s ease-in-out infinite;
}

/* ---------------------------- Toast ---------------------------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(96px + var(--safe-b));
  transform: translateX(-50%);
  background: rgba(58, 44, 49, .9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 60;
  animation: toastIn .28s ease both;
  white-space: nowrap;
  max-width: 88vw; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------------------- 想你全屏提醒 ---------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60, 30, 42, .55);
  backdrop-filter: blur(8px);
  padding: 20px;
}
.overlay-card {
  position: relative;
  width: 100%; max-width: 340px;
  background: linear-gradient(170deg, #fff8fa, #ffeef4);
  border-radius: 26px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(90, 30, 50, .35);
  animation: riseIn .4s cubic-bezier(.2, 1.3, .35, 1) both;
}
.overlay-emoji { font-size: 52px; animation: beat 1.6s ease-in-out infinite; }
.overlay-card h2 { font-size: 20px; margin: 8px 0 4px; color: var(--primary-dark); }
.overlay-msg {
  font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 0;
  background: #fff; border-radius: 12px; padding: 9px 12px;
}
.overlay-time { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }
.overlay-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

.hearts { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.heart-float {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  animation: floatUp linear forwards;
  filter: drop-shadow(0 2px 6px rgba(255, 107, 139, .5));
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.1) rotate(24deg); opacity: 0; }
}

/* ---------------------------- 纪念日 ---------------------------- */
.anni-card {
  background: linear-gradient(135deg, #fff6f8, #ffeef4);
  border: 1.5px solid #fce1ea;
}
.anni-row {
  display: flex; align-items: center; gap: 12px;
}
.anni-emoji { font-size: 30px; line-height: 1; }
.anni-main { flex: 1; min-width: 0; }
.anni-big {
  font-size: 30px; font-weight: 800; color: var(--primary-dark);
  line-height: 1.05; letter-spacing: -.5px;
}
.anni-big em { font-style: normal; font-size: 14px; font-weight: 700; margin-left: 3px; color: var(--ink-soft); }
.anni-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* 纪念日按钮 + 日期输入框（用 label 触发，input 视觉隐藏） */
.anni-btn-wrap { position: relative; display: inline-block; }

/* ---------------------------- 相册 ---------------------------- */
.upload-row { text-align: center; }
.upload-row .btn span { margin-right: 4px; font-size: 16px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.photo-cell {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 12px;
  background: #f3e3e8;
  box-shadow: var(--shadow-sm);
  animation: stickIn .35s cubic-bezier(.2,1.2,.35,1) both;
}
.photo-cell img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.photo-cell .ph-new {
  position: absolute; top: 4px; right: 4px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(255, 107, 139, .45);
}
.photo-cell .ph-mine {
  position: absolute; top: 4px; left: 4px;
  background: rgba(255,255,255,.85); color: var(--primary-dark);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
}
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(30, 10, 20, .92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 50px 18px 70px;
  backdrop-filter: blur(6px);
}
.lightbox img {
  max-width: 100%; max-height: 75vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  object-fit: contain;
}
.lb-close, .lb-del {
  position: absolute; top: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 18px; display: grid; place-items: center;
}
.lb-close { right: 14px; }
.lb-del { left: 14px; width: auto; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.lb-meta {
  margin-top: 16px; text-align: center; max-width: 90%;
}
#lbCaption { color: #fff; font-size: 15px; font-weight: 600; word-break: break-word; }
#lbInfo { color: rgba(255,255,255,.7); font-size: 12px; margin-top: 4px; }

/* 桌面端稍作美化 */
@media (min-width: 560px) {
  body { font-size: 15.5px; }
  .wall { grid-template-columns: repeat(3, 1fr); }
}
