/* ================= 设计系统：浪漫粉紫 ================= */
:root {
  --bg: #fff6f9;
  --bg-2: #ffeef4;
  --card: #ffffff;
  --ink: #4a2b3a;
  --ink-2: #a3768a;
  --ink-3: #c9a3b3;
  --pink: #ff7ea2;
  --pink-deep: #f2578f;
  --pink-soft: #ffd6e3;
  --purple: #c9a7ff;
  --lavender: #e6d9ff;
  --grad-hero: linear-gradient(135deg, #ff9db8 0%, #f77fae 45%, #c9a7ff 100%);
  --grad-btn: linear-gradient(135deg, #ff8fab, #f2578f);
  --grad-text: linear-gradient(135deg, #f2578f, #a86ef0);
  --danger: #f0566e;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(244, 114, 152, 0.14);
  --shadow-sm: 0 4px 14px rgba(244, 114, 152, 0.12);
  --tabbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(600px 300px at 110% -40px, rgba(201, 167, 255, 0.25), transparent 60%),
    radial-gradient(500px 260px at -20% 30%, rgba(255, 158, 184, 0.22), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); outline: none; }
img { display: block; }
a { color: var(--pink-deep); text-decoration: none; }

/* ================= 页面容器 ================= */
.page { padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); animation: pageIn .32s ease both; }
.page.no-tab { padding-bottom: 32px; }
.page-full { padding: 0; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 14px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.page-title small { display: block; font-size: 12px; color: var(--ink-2); font-weight: 500; margin-top: 2px; letter-spacing: 2px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--ink-2);
  transition: transform .15s ease;
}
.icon-btn:active { transform: scale(.9); }

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.card-title .sub { font-size: 12px; color: var(--ink-2); font-weight: 400; margin-left: auto; }

/* 首页主卡 */
.hero-card {
  background: var(--grad-hero); color: #fff; border-radius: 26px; padding: 26px 22px 22px;
  box-shadow: 0 16px 40px rgba(242, 87, 143, 0.35); position: relative; overflow: hidden; text-align: center;
}
.hero-card::before, .hero-card::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.hero-card::before { width: 180px; height: 180px; top: -70px; right: -50px; }
.hero-card::after { width: 120px; height: 120px; bottom: -50px; left: -36px; }
.hero-days { font-size: 60px; font-weight: 800; line-height: 1.1; letter-spacing: 1px; text-shadow: 0 4px 18px rgba(0,0,0,.14); font-variant-numeric: tabular-nums; }
.hero-days small { font-size: 18px; font-weight: 600; margin-left: 4px; }
.hero-label { font-size: 13px; opacity: .92; letter-spacing: 5px; margin-bottom: 4px; }
.hero-names { margin-top: 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hero-names .heart { animation: beat 1.6s ease-in-out infinite; display: inline-block; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.28); } 24% { transform: scale(1); } 36% { transform: scale(1.18); } 48% { transform: scale(1); } }
.hero-milestone { margin-top: 14px; background: rgba(255,255,255,.2); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; backdrop-filter: blur(4px); }
.hero-milestone .bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin-top: 6px; overflow: hidden; }
.hero-milestone .bar i { display: block; height: 100%; border-radius: 3px; background: #fff; animation: growBar 1.2s ease both; }
@keyframes growBar { from { width: 0 !important; } }

/* 想你按钮 */
.miss-card { display: flex; align-items: center; gap: 12px; }
.miss-btn {
  flex: 1; padding: 14px; border-radius: 16px; background: var(--grad-btn); color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: 2px; box-shadow: 0 10px 24px rgba(242, 87, 143, 0.35);
  transition: transform .15s ease;
}
.miss-btn:active { transform: scale(.96); }
.miss-mini { width: 52px; height: 52px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); font-size: 22px; display: flex; align-items: center; justify-content: center; }
.miss-banner {
  margin-bottom: 14px; padding: 13px 16px; border-radius: 16px; font-weight: 700; color: #fff; text-align: center;
  background: linear-gradient(120deg, #f2578f, #a86ef0); box-shadow: 0 10px 26px rgba(200, 90, 190, 0.35);
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1) both; font-size: 15px;
}
@keyframes popIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

/* 心情 */
.mood-row { display: flex; gap: 10px; }
.mood-chip {
  flex: 1; background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 12px; text-align: center;
  transition: transform .15s ease;
}
.mood-chip:active { transform: scale(.95); }
.mood-chip .who { font-size: 12px; color: var(--ink-2); }
.mood-chip .m-emoji { font-size: 32px; line-height: 1.3; }
.mood-chip .m-emoji.placeholder { color: var(--ink-3); font-size: 20px; }
.mood-chip .hint { font-size: 11px; color: var(--ink-3); }

/* 今日份甜蜜 */
.sweet-card { display: flex; gap: 14px; align-items: center; }
.sweet-thumb { width: 74px; height: 74px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--pink-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.sweet-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sweet-info { flex: 1; min-width: 0; }
.sweet-text { font-size: 14px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sweet-date { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* 即将到来的纪念日 */
.chip-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.event-chip {
  flex-shrink: 0; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.event-chip .e-emoji { font-size: 20px; }
.event-chip b { display: block; font-size: 13px; }
.event-chip .e-days { color: var(--pink-deep); font-size: 12px; font-weight: 700; }
.event-chip.today { background: var(--grad-btn); color: #fff; }
.event-chip.today .e-days { color: #fff; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 13px 4px; text-align: center;
  transition: transform .15s ease;
}
.quick-item:active { transform: scale(.93); }
.quick-item .q-icon { font-size: 24px; }
.quick-item .q-label { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ================= 底部导航 ================= */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 60;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 158, 184, 0.18);
  display: flex; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--ink-3); font-size: 10.5px; border-radius: 12px; transition: color .2s; }
.tab .t-icon { font-size: 21px; line-height: 1.2; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.tab.active { color: var(--pink-deep); font-weight: 700; }
.tab.active .t-icon { transform: translateY(-2px) scale(1.12); }
.tab.tab-heart { position: relative; }
.tab.tab-heart .t-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--grad-btn); color: #fff; font-size: 25px;
  display: flex; align-items: center; justify-content: center; margin-top: -26px;
  box-shadow: 0 10px 22px rgba(242, 87, 143, 0.45); border: 3px solid #fff;
  animation: heartFloat 3.2s ease-in-out infinite;
}
@keyframes heartFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tabbar.hidden { display: none; }

/* ================= 表单 ================= */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid #ffd9e5; background: #fff;
  transition: border-color .2s;
}
.input:focus { border-color: var(--pink); }
textarea.input { resize: none; min-height: 90px; line-height: 1.6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: 999px; background: var(--grad-btn); color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing: 1px; box-shadow: 0 8px 20px rgba(242, 87, 143, 0.3);
  transition: transform .15s ease, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; }
.btn.full { width: 100%; padding: 14px; }
.btn.ghost { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow-sm); }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn.danger { background: linear-gradient(135deg, #ff7d8e, #f0566e); }

/* ================= 底部弹层 ================= */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(74, 43, 58, 0.45); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 480px; background: #fff; border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto;
  animation: slideUp .32s cubic-bezier(.2, 1, .3, 1) both;
}
@keyframes slideUp { from { transform: translateY(60%); } }
.sheet .grabber { width: 40px; height: 4.5px; border-radius: 3px; background: #f0cfdd; margin: 4px auto 14px; }
.sheet h3 { font-size: 17px; margin-bottom: 16px; text-align: center; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* ================= 弹窗/提示 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(74, 43, 58, 0.5); z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 30px; animation: fadeIn .2s ease both;
}
.modal { background: #fff; border-radius: 22px; padding: 24px; width: 100%; max-width: 320px; text-align: center; animation: popIn .3s cubic-bezier(.2, 1.4, .4, 1) both; }
.modal h4 { font-size: 16px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--ink-2); margin-bottom: 18px; }
.modal .row { display: flex; gap: 10px; }
.modal .row .btn { flex: 1; padding: 10px; }

.toast-wrap { position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; pointer-events: none; }
.toast {
  background: rgba(74, 43, 58, 0.9); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); animation: toastIn .3s ease both; max-width: 86vw;
  display: flex; align-items: center; gap: 6px;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.9); } }

/* ================= 随手记 ================= */
.note-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--pink-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.note-head .n-name { font-weight: 700; font-size: 14.5px; }
.note-head .n-time { font-size: 12px; color: var(--ink-3); }
.note-text { font-size: 15px; line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.note-text.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.note-more { color: var(--pink-deep); font-size: 13px; margin-top: 4px; cursor: pointer; }
.note-media { display: grid; gap: 5px; margin-top: 10px; border-radius: 14px; overflow: hidden; }
.note-media.g1 { grid-template-columns: 1fr; }
.note-media.g2 { grid-template-columns: 1fr 1fr; }
.note-media.g3 { grid-template-columns: repeat(3, 1fr); }
.nm { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-2); aspect-ratio: 1; cursor: pointer; }
.note-media.g1 .nm { aspect-ratio: auto; max-height: 380px; }
.note-media.g1 .nm img, .note-media.g1 .nm video { max-height: 380px; margin: 0 auto; }
.nm img, .nm video { width: 100%; height: 100%; object-fit: cover; }
.nm .video-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(30, 10, 30, 0.25); color: #fff; font-size: 13px; gap: 4px;
}
.nm .video-badge::before { content: '▶'; font-size: 15px; }
.note-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.like-btn { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 13px; padding: 4px 8px; border-radius: 999px; transition: transform .15s; }
.like-btn:active { transform: scale(1.15); }
.like-btn.liked { color: var(--pink-deep); font-weight: 700; }
.note-del { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.note-empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.note-empty .big { font-size: 46px; margin-bottom: 12px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); z-index: 50;
  width: 54px; height: 54px; border-radius: 50%; background: var(--grad-btn); color: #fff; font-size: 26px;
  box-shadow: 0 12px 26px rgba(242, 87, 143, 0.45); display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.fab:active { transform: scale(.9) rotate(90deg); }

/* 编写随手记 */
.compose-textarea { width: 100%; min-height: 110px; border: none; font-size: 16px; line-height: 1.7; resize: none; }
.compose-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.cm-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.cm-item img { width: 100%; height: 100%; object-fit: cover; }
.cm-item .cm-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.cm-item .cm-progress {
  position: absolute; inset: 0; background: rgba(255, 255, 255, 0.72); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--pink-deep);
}
.cm-add {
  aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed #ffb8cd; color: var(--pink); font-size: 24px;
  display: flex; align-items: center; justify-content: center; background: #fff8fa;
}
.cm-add:active { background: var(--pink-soft); }
.compose-tools { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.compose-tools .tool {
  padding: 8px 14px; border-radius: 999px; background: var(--bg-2); font-size: 13.5px; color: var(--ink-2);
  display: flex; gap: 5px; align-items: center;
}
.compose-tools .btn { margin-left: auto; }

/* ================= 详情弹层 ================= */
.detail-media { border-radius: 0; }
.detail-media .nm { aspect-ratio: auto; border-radius: 0; }
.detail-media .nm img, .detail-media .nm video { max-height: 72vh; width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; background: #000; }
.sheet.no-pad { padding: 0 0 calc(16px + env(safe-area-inset-bottom)); }
.sheet .detail-head { padding: 12px 18px 8px; display: flex; align-items: center; gap: 10px; }

/* ================= 心动空间（3D） ================= */
.heart-page {
  position: fixed; inset: 0; z-index: 40; max-width: 480px; margin: 0 auto; overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 108%, rgba(242, 87, 143, 0.32), transparent 60%),
    radial-gradient(70% 50% at 80% -10%, rgba(168, 110, 240, 0.28), transparent 60%),
    radial-gradient(120% 100% at 50% 0%, #451648 0%, #2b0f36 48%, #190a24 100%);
  color: #fff; animation: fadeIn .4s ease both;
}
.heart-top { position: relative; z-index: 5; padding: calc(16px + env(safe-area-inset-top)) 18px 0; display: flex; align-items: center; }
.heart-back { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.heart-title { flex: 1; text-align: center; }
.heart-title h2 { font-size: 17px; font-weight: 700; letter-spacing: 3px; }
.heart-title p { font-size: 11px; color: rgba(255, 255, 255, 0.55); letter-spacing: 2px; margin-top: 1px; }
.heart-controls { position: relative; z-index: 5; display: flex; gap: 7px; padding: 14px 18px 0; align-items: center; flex-wrap: wrap; }
.h-chip {
  padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.65);
  font-size: 12.5px; border: 1px solid rgba(255, 255, 255, 0.14); transition: all .2s;
}
.h-chip.on { background: rgba(255, 255, 255, 0.92); color: #f2578f; font-weight: 700; }
.h-chip.refresh { margin-left: auto; }
.heart-stage-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  perspective: 1050px; touch-action: none; cursor: grab;
}
.heart-stage { position: relative; transform-style: preserve-3d; }
.hcard {
  position: absolute; top: 0; left: 0; border-radius: 13px; overflow: hidden;
  transform-origin: center; will-change: transform, opacity;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); border: 1.5px solid rgba(255, 255, 255, 0.25);
  user-select: none; -webkit-user-drag: none;
}
.hcard img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.hcard .hc-ph {
  width: 100%; height: 100%; background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.hcard .hc-text {
  width: 100%; height: 100%; padding: 8px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; line-height: 1.45; color: #fff; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.hcard .hc-play {
  position: absolute; right: 5px; bottom: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 8px; display: flex; align-items: center; justify-content: center;
}
.heart-hint {
  position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  font-size: 11.5px; color: rgba(255, 255, 255, 0.5); letter-spacing: 2px; z-index: 5; pointer-events: none;
}
.heart-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px; text-align: center; }
.heart-empty .big { font-size: 60px; animation: beat 2s ease-in-out infinite; }
.heart-empty p { color: rgba(255,255,255,.75); font-size: 14.5px; }

/* 星星与光斑 */
.star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .9; transform: scale(1.15); } }
.orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; animation: orbFloat 9s ease-in-out infinite; }
@keyframes orbFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(24px, -20px) scale(1.12); } }

/* ================= 相册 ================= */
.album-month { margin-bottom: 18px; }
.album-month h4 { font-size: 14px; color: var(--ink-2); padding: 4px 2px 10px; display: flex; align-items: center; gap: 6px; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 16px; overflow: hidden; }
.album-item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-2); cursor: pointer; }
.album-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.album-item:active img { transform: scale(1.06); }
.album-item .video-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(30,10,30,.22); color: #fff; font-size: 20px; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 150; background: #150a1c; display: flex; flex-direction: column;
  animation: fadeIn .25s ease both;
}
.lb-top { padding: calc(12px + env(safe-area-inset-top)) 16px 8px; color: #fff; display: flex; align-items: center; gap: 12px; z-index: 2; }
.lb-top .lb-close { font-size: 20px; padding: 6px; }
.lb-top .lb-title { font-size: 14px; opacity: .85; }
.lb-count { margin-left: auto; font-size: 13px; opacity: .7; }
.lb-track { flex: 1; display: flex; overflow: hidden; touch-action: pan-y; }
.lb-slide { flex-shrink: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb-slide img, .lb-slide video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-info { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.85); font-size: 13.5px; }
.lb-info .lb-note { margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-info .lb-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .65; }
.lb-info .lb-goto { margin-left: auto; color: #ff9db8; font-size: 12.5px; padding: 6px 12px; border: 1px solid rgba(255,157,184,.4); border-radius: 999px; }

/* ================= 时间轴 ================= */
.tl-filter { display: flex; gap: 8px; margin-bottom: 16px; }
.tl-filter .h-chip { background: #fff; color: var(--ink-2); border-color: #ffd9e5; }
.tl-filter .h-chip.on { background: var(--grad-btn); color: #fff; border-color: transparent; }
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(#ffb8cd, #e6d9ff); border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -23.5px; top: 20px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--pink); box-shadow: 0 0 0 4px rgba(255, 126, 162, 0.15);
}
.tl-item.milestone::before { background: var(--grad-btn); border-color: #fff; }
.tl-date { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; padding-left: 2px; }
.tl-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); padding: 14px; }
.tl-card .tl-text { font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.tl-card .tl-thumb { width: 100%; height: 120px; border-radius: 10px; object-fit: cover; margin-top: 8px; }
.tl-milestone-card {
  background: var(--grad-hero); color: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 10px 26px rgba(242,87,143,.3);
  display: flex; align-items: center; gap: 12px;
}
.tl-milestone-card .m-big { font-size: 30px; font-weight: 800; }
.tl-milestone-card .m-label { font-size: 13px; opacity: .9; }
.tl-milestone-card .m-days { margin-left: auto; font-size: 12px; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 999px; }

/* ================= 小纸条 ================= */
.msg-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.msg-card {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px;
  position: relative; animation: msgIn .35s ease both;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(12px); } }
.msg-card.mine { background: linear-gradient(135deg, #fff5f8, #ffeef6); }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-head .avatar { width: 28px; height: 28px; font-size: 15px; }
.msg-head .m-name { font-size: 13px; font-weight: 700; }
.msg-head .m-time { font-size: 11.5px; color: var(--ink-3); }
.msg-mood { margin-left: auto; font-size: 22px; }
.msg-content { font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg-input-bar {
  position: fixed; bottom: var(--tabbar-h); left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 55;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); border-top: 1px solid rgba(255,158,184,.18);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end;
}
.msg-input-bar textarea {
  flex: 1; border: none; background: var(--bg-2); border-radius: 999px; padding: 10px 16px;
  max-height: 90px; line-height: 1.5; resize: none; font-size: 14.5px;
}
.msg-mood-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-2); font-size: 19px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-send {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad-btn); color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.msg-send:disabled { opacity: .4; }
.mood-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mood-picker .mo { font-size: 26px; padding: 8px 0; border-radius: 12px; text-align: center; }
.mood-picker .mo:active, .mood-picker .mo.on { background: var(--pink-soft); transform: scale(1.1); }

/* ================= 清单 ================= */
.list-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.list-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.list-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.list-head h4 { font-size: 15.5px; }
.list-head .l-del { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.list-progress { height: 5px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-bottom: 12px; }
.list-progress i { display: block; height: 100%; background: var(--grad-btn); border-radius: 3px; transition: width .4s ease; }
.li-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.li-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ffc3d6; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; transition: all .2s;
}
.li-item.done .li-check { background: var(--grad-btn); border-color: transparent; color: #fff; }
.li-content { flex: 1; font-size: 14.5px; }
.li-item.done .li-content { color: var(--ink-3); text-decoration: line-through; }
.li-meta { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.li-del { color: var(--ink-3); font-size: 12px; opacity: 0; padding: 4px; }
.li-item:active .li-del { opacity: 1; }
.li-add { display: flex; gap: 8px; margin-top: 10px; }
.li-add input { flex: 1; border: 1.5px dashed #ffc3d6; border-radius: 999px; padding: 8px 14px; background: transparent; font-size: 13.5px; }

/* ================= 纪念日 ================= */
.anniv-card { display: flex; align-items: center; gap: 14px; }
.anniv-emoji { width: 52px; height: 52px; border-radius: 16px; background: var(--pink-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.anniv-info { flex: 1; min-width: 0; }
.anniv-info b { font-size: 15px; }
.anniv-info .a-date { font-size: 12.5px; color: var(--ink-2); }
.anniv-days {
  text-align: center; flex-shrink: 0; min-width: 64px;
}
.anniv-days .d-num { font-size: 21px; font-weight: 800; color: var(--pink-deep); }
.anniv-days .d-num.past { color: var(--ink-3); font-size: 15px; }
.anniv-days .d-label { font-size: 10.5px; color: var(--ink-3); }
.anniv-card.today .anniv-emoji { animation: beat 1.2s ease-in-out infinite; }
.repeat-tag { font-size: 10px; background: var(--lavender); color: #8d6fd8; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }

/* ================= 设置 ================= */
.setting-row {
  display: flex; align-items: center; gap: 12px; padding: 15px 4px; border-bottom: 1px solid #fff0f5;
}
.setting-row:last-child { border-bottom: none; }
.setting-row .s-icon { font-size: 20px; width: 26px; text-align: center; }
.setting-row .s-label { flex: 1; font-size: 14.5px; }
.setting-row .s-value { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.setting-row .s-arrow { color: var(--ink-3); }

/* ================= 登录/初始化 ================= */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; padding: calc(50px + env(safe-area-inset-top)) 28px 40px;
  position: relative; overflow: hidden;
}
.auth-title { text-align: center; margin-bottom: 34px; animation: pageIn .5s ease both; }
.auth-title .logo { font-size: 58px; animation: beat 2.2s ease-in-out infinite; display: inline-block; }
.auth-title h1 {
  font-size: 26px; font-weight: 800; margin-top: 10px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-title p { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; letter-spacing: 1px; }
.member-pick { display: flex; gap: 14px; margin-bottom: 20px; }
.member-card {
  flex: 1; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 22px 12px; text-align: center;
  border: 2px solid transparent; transition: all .2s ease;
}
.member-card .m-emoji { font-size: 44px; }
.member-card .m-name { font-size: 15px; font-weight: 700; margin-top: 8px; }
.member-card.on { border-color: var(--pink); transform: translateY(-4px); box-shadow: 0 16px 34px rgba(242, 87, 143, 0.25); }
.auth-deco { position: absolute; font-size: 24px; opacity: .5; animation: floatUp 8s linear infinite; }
@keyframes floatUp {
  0% { transform: translateY(20vh) rotate(0); opacity: 0; }
  12% { opacity: .5; }
  88% { opacity: .5; }
  100% { transform: translateY(-110vh) rotate(40deg); opacity: 0; }
}

/* ================= 特效层 ================= */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.fx-heart { position: absolute; font-size: 20px; animation: fxFloat 1.1s ease-out forwards; will-change: transform, opacity; }
@keyframes fxFloat {
  0% { transform: translate(0, 0) scale(.6); opacity: 1; }
  100% { transform: translate(var(--dx, 0), -130px) scale(1.35); opacity: 0; }
}
.fx-rain { position: absolute; top: -40px; font-size: 22px; animation: fxRain linear forwards; }
@keyframes fxRain { to { transform: translateY(110vh) rotate(50deg); opacity: .9; } }

/* 加载更多 / 骨架 */
.load-more { text-align: center; padding: 14px; color: var(--pink-deep); font-size: 13.5px; }
.loading-dots { text-align: center; color: var(--ink-3); padding: 20px; font-size: 13px; }
.skeleton { background: linear-gradient(100deg, #ffeef4 40%, #fff6f9 50%, #ffeef4 60%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* 桌面端微调 */
@media (min-width: 520px) {
  body { background-color: #ffe7ef; }
  #app { box-shadow: 0 0 60px rgba(200, 100, 140, 0.18); background: var(--bg); min-height: 100vh; }
}
