/* ============================================================
   情侣共同纪念档案 · 全局样式
   设计基调：低饱和度暖色系（米白 + 浅粉 + 淡紫），护眼温柔
   所有切换/点击均带 0.3s 平滑过渡动效
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #faf6f1;              /* 米白底色 */
  --bg-soft: #f4ece3;         /* 米白柔和底色 */
  --card: #fffdfa;            /* 卡片 */
  --pink: #e8b4b8;            /* 浅粉 */
  --pink-deep: #d98c92;       /* 深粉 */
  --pink-soft: #f7e3e4;       /* 粉底色 */
  --purple: #b9a7d6;          /* 淡紫 */
  --purple-deep: #9a84c2;     /* 深紫 */
  --purple-soft: #eae3f4;     /* 紫底色 */
  --ink: #5c5148;             /* 暖灰主文字 */
  --ink-soft: #8d827a;        /* 次要文字 */
  --ink-light: #b3a89f;       /* 弱化文字 */
  --line: #ecdfd2;            /* 分割线 */
  --danger: #d98192;          /* 危险/警示 */
  --ok: #9db98a;              /* 成功 */
  --font-title: "华文行楷","STXingkai","楷体","KaiTi","Zhi Mang Xing",cursive;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(92, 81, 72, .09);
  --shadow-soft: 0 3px 14px rgba(92, 81, 72, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --tabbar-h: 64px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% 0%, #f7e9e6 0%, transparent 55%),
    radial-gradient(120% 60% at 0% 100%, #eae4f3 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }
a { color: var(--purple-deep); }

/* 全局 0.3s 过渡 */
button, .btn, .tab, .card, input, textarea, .mood-chip, .note-item, .letter-card, .anni-card {
  transition: all .3s var(--ease);
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  letter-spacing: 1px; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  color: #fff; box-shadow: 0 8px 20px rgba(185, 167, 214, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(185, 167, 214, .5); transform: translateY(-1px); }

.btn-ghost { background: var(--card); color: var(--purple-deep); border: 1.5px solid var(--purple); }
.btn-ghost:hover { background: var(--purple-soft); }

.btn-danger { background: linear-gradient(135deg, #eda3ad, var(--danger)); color: #fff; }
.btn-danger-ghost { background: var(--card); color: var(--danger); border: 1.5px solid var(--danger); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { display: flex; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(185, 167, 214, .18);
}

/* ---------- Toast 轻提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px);
  transform: translateX(-50%) translateY(16px);
  background: rgba(60, 52, 46, .92); color: #fff; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; z-index: 999;
  opacity: 0; pointer-events: none;
  transition: all .3s var(--ease);
  max-width: 82%; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 加载遮罩 ---------- */
#loading {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(250, 246, 241, .75); backdrop-filter: blur(4px);
}
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--pink-soft); border-top-color: var(--purple);
  animation: spin 0.8s linear infinite;
}
.loading-text { color: var(--ink-soft); font-size: 14px; letter-spacing: 2px; }

/* ---------- 通用弹窗 ---------- */
#modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(70, 60, 52, .4); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: maskIn .3s var(--ease);
}
#modal-box {
  width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(92, 81, 72, .18);
  animation: sheetUp .35s var(--ease);
}
#modal-title { font-family: var(--font-title); font-size: 24px; text-align: center; margin-bottom: 14px; color: var(--ink); }
#modal-body { font-size: 15px; color: var(--ink); }
#modal-actions { display: flex; gap: 12px; margin-top: 18px; }
#modal-actions .btn { flex: 1; }

/* ---------- 认证页 ---------- */
.auth-view {
  min-height: 100vh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 24px 18px;
}
.auth-deco { position: absolute; inset: 0; pointer-events: none; }
.auth-deco::before, .auth-deco::after {
  content: "❦"; position: absolute; font-size: 90px; opacity: .16; color: var(--purple);
  animation: floatUp 9s ease-in-out infinite;
}
.auth-deco::before { top: 8%; left: 8%; }
.auth-deco::after { bottom: 12%; right: 10%; animation-delay: 3s; color: var(--pink); }

.auth-card {
  position: relative; width: 100%; max-width: 400px;
  background: rgba(255, 253, 250, .82); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 26px; padding: 30px 26px 26px;
  box-shadow: var(--shadow); animation: fadeSlide .5s var(--ease);
}
.auth-logo {
  width: 66px; height: 66px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(135deg, #f6d6d8, #dcccef);
  box-shadow: 0 8px 22px rgba(217, 140, 146, .35);
  animation: heartbeat 2.4s ease-in-out infinite;
}
.auth-title { font-family: var(--font-title); text-align: center; font-size: 26px; letter-spacing: 3px; color: var(--ink); }
.auth-sub { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 4px 0 20px; letter-spacing: 2px; }

.auth-tabs { display: flex; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 10px 0; font-size: 15px; color: var(--ink-soft);
  position: relative; letter-spacing: 4px;
}
.auth-tab.active { color: var(--purple-deep); font-weight: 700; }
.auth-tab.active::after {
  content: ""; position: absolute; left: 50%; bottom: -1.5px; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
}
.remember-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin: 2px 0 16px; cursor: pointer; }
.remember-line input { accent-color: var(--purple-deep); width: 16px; height: 16px; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(250, 246, 241, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(236, 223, 210, .7);
  display: flex; align-items: center; justify-content: space-between;
}
#topbar-love { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-size: 20px; }
#topbar-love .topbar-heart { font-size: 16px; animation: heartbeat 2s ease-in-out infinite; display: inline-block; color: var(--pink-deep); }
#topbar-days { font-size: 12px; color: var(--purple-deep); background: var(--purple-soft); padding: 4px 12px; border-radius: 999px; }

/* ---------- 提示横幅 ---------- */
#banner { margin: 10px 14px 0; }
.banner {
  border-radius: 14px; padding: 12px 14px; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--pink-soft); color: var(--pink-deep);
  box-shadow: var(--shadow-soft); animation: fadeSlide .4s var(--ease);
}
.banner.warn { background: #fdf0e0; color: #b98a4e; }
.banner.info { background: var(--purple-soft); color: var(--purple-deep); }
.banner .banner-text { flex: 1; }
.banner .btn { flex-shrink: 0; }

/* ---------- 底部导航 ---------- */
#tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 60;
  display: flex; justify-content: space-around;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 250, .92); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(236, 223, 210, .8);
}
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 20px; color: var(--ink-light); padding: 4px 0; border-radius: 12px; }
.tab-dot {
  position: absolute; top: 0; right: 14%; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px;
  font-style: normal; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}
.tab span { font-size: 11px; letter-spacing: 1px; }
.tab.active { color: var(--purple-deep); transform: translateY(-2px); }
.tab.active span { color: var(--pink-deep); font-weight: 600; }
.tab:active { transform: scale(.92); }

/* ---------- 页面骨架 ---------- */
.app-view { max-width: 520px; margin: 0 auto; min-height: 100vh; }
#pages { padding: 12px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); }
.page { animation: fadeSlide .35s var(--ease); }

/* ============================================================
   首页 · 相爱正计时
   ============================================================ */
#page-home { position: relative; }

/* 粒子浮动层 */
#particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
#particles span {
  position: absolute; bottom: -30px; font-size: 16px; opacity: 0;
  animation: particleRise linear infinite; will-change: transform, opacity;
}

.home-count-card {
  position: relative; z-index: 1; text-align: center;
  background: linear-gradient(160deg, rgba(255,253,250,.9), rgba(247,227,228,.55) 60%, rgba(234,227,244,.6));
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px; padding: 30px 16px 26px; margin-top: 6px;
  box-shadow: var(--shadow); overflow: hidden;
}
.home-count-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 40% at 50% 0%, rgba(255,255,255,.65), transparent 70%);
}
.home-title { font-family: var(--font-title); font-size: 22px; letter-spacing: 4px; color: var(--pink-deep); margin-bottom: 4px; }
.home-since { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }

/* 倒计时数字 */
.count-grid { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.count-cell { min-width: 64px; }
.count-num {
  font-size: 34px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
  background: rgba(255,255,255,.75); border-radius: 14px; padding: 10px 8px;
  box-shadow: var(--shadow-soft); display: inline-block; min-width: 58px;
}
.count-num.pop { animation: digitPop .5s var(--ease); }
.count-unit { font-size: 12px; color: var(--ink-soft); margin-top: 6px; letter-spacing: 3px; }

.home-days-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--purple-deep); background: rgba(255,255,255,.8);
  border-radius: 999px; padding: 7px 18px; margin-bottom: 16px; box-shadow: var(--shadow-soft);
}
.home-edit {
  font-size: 12px; color: var(--purple-deep); text-decoration: underline; cursor: pointer;
}

/* 快捷入口 */
.home-quick { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.quick-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 16px; text-align: left; box-shadow: var(--shadow-soft);
}
.quick-card:active { transform: scale(.96); }
.quick-card .quick-emoji { font-size: 26px; }
.quick-card .quick-name { font-family: var(--font-title); font-size: 18px; margin: 4px 0 2px; }
.quick-card .quick-desc { font-size: 12px; color: var(--ink-light); }

/* 未绑定引导卡 */
.unbound-card {
  position: relative; z-index: 1; text-align: center; padding: 34px 20px;
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow); margin-top: 16px;
}
.unbound-card .big-emoji { font-size: 44px; display: block; margin-bottom: 10px; animation: heartbeat 2s infinite; }
.unbound-card h3 { font-family: var(--font-title); font-size: 20px; letter-spacing: 2px; margin-bottom: 6px; }
.unbound-card p { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; }
.invite-code-box {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--purple-soft); border-radius: 14px; padding: 14px; margin-bottom: 18px;
}
.invite-code-box .code { font-size: 24px; font-weight: 800; letter-spacing: 6px; color: var(--purple-deep); font-variant-numeric: tabular-nums; }
.invite-code-box .btn { font-size: 12px; }

/* ============================================================
   日记页
   ============================================================ */
.seg-tabs { display: flex; gap: 6px; background: rgba(255,253,250,.85); padding: 5px; border-radius: 999px; box-shadow: var(--shadow-soft); margin-bottom: 14px; }
.seg-tab { flex: 1; padding: 8px 0; border-radius: 999px; font-size: 14px; color: var(--ink-soft); }
.seg-tab.active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(185,167,214,.4); }

.page-head { font-family: var(--font-title); font-size: 22px; letter-spacing: 3px; margin: 4px 0 12px; color: var(--ink); }

/* 信纸卡片 */
.diary-list { display: flex; flex-direction: column; gap: 12px; }
.diary-card {
  background:
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(217,140,146,.14) 26px 27px),
    linear-gradient(180deg, #fffcf6, #fdf8ef);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 12px;
  box-shadow: var(--shadow-soft); position: relative;
  animation: fadeSlide .4s var(--ease);
}
.diary-card .diary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.diary-card .mood { font-size: 13px; background: var(--pink-soft); color: var(--pink-deep); padding: 2px 10px; border-radius: 999px; }
.diary-card .diary-author { font-size: 13px; color: var(--purple-deep); font-weight: 600; }
.diary-card .diary-time { font-size: 12px; color: var(--ink-light); margin-left: auto; }
.diary-card .diary-content { font-size: 15px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.diary-card .diary-del { position: absolute; top: 10px; right: 10px; font-size: 12px; color: var(--ink-light); }
.diary-card .diary-del:active { color: var(--danger); }

.empty-tip { text-align: center; color: var(--ink-light); font-size: 14px; padding: 46px 0; }
.empty-tip .empty-emoji { font-size: 40px; display: block; margin-bottom: 8px; }

/* 日记输入条（固定在底部导航上方） */
.diary-composer {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 55;
  padding: 8px 12px; background: rgba(255,253,250,.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(92,81,72,.05);
}
.diary-composer textarea {
  width: 100%; min-height: 58px; max-height: 120px; resize: none;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; outline: none; font-size: 15px; line-height: 1.6;
}
.diary-composer textarea:focus { border-color: var(--purple); }
.mood-row { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.mood-row::-webkit-scrollbar { display: none; }
.mood-chip {
  flex-shrink: 0; font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft); white-space: nowrap;
}
.mood-chip.active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.composer-row { display: flex; gap: 8px; align-items: center; }
.composer-row .btn { flex-shrink: 0; }

/* ============================================================
   玻璃罐页
   ============================================================ */
.jar-stage { display: flex; flex-direction: column; align-items: center; }

/* 拟态玻璃罐 */
.jar-wrap { position: relative; width: 210px; height: 250px; margin: 10px 0 4px; }
.jar-glass {
  position: absolute; inset: 0; border-radius: 34% 34% 46% 46% / 16% 16% 42% 42%;
  background:
    radial-gradient(120% 90% at 30% 12%, rgba(255,255,255,.85) 0%, rgba(255,255,255,.15) 45%, transparent 60%),
    linear-gradient(160deg, rgba(190,225,235,.35), rgba(255,255,255,.12) 40%, rgba(210,190,235,.3));
  border: 2px solid rgba(255,255,255,.75);
  box-shadow: inset 0 6px 18px rgba(255,255,255,.7), 0 10px 30px rgba(92,81,72,.14);
  backdrop-filter: blur(3px);
}
.jar-lid {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 118px; height: 26px; border-radius: 12px;
  background: linear-gradient(180deg, #e9d7d2, #d9bdb6);
  box-shadow: 0 4px 10px rgba(92,81,72,.25);
}
.jar-lid::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple)); border: 2px solid rgba(255,255,255,.7);
}
.jar-glow { position: absolute; top: 0; left: 12%; width: 26%; height: 70%; border-radius: 50%; background: rgba(255,255,255,.5); filter: blur(6px); transform: rotate(12deg); }
.jar-inner { position: absolute; inset: 12% 12% 10%; overflow: hidden; }

/* 罐内纸条堆 */
.jar-note-stack { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 86%; }
.mini-note {
  width: 22px; height: 14px; border-radius: 3px; opacity: .9;
  background: linear-gradient(135deg, #fff3d6, #fbe0a8);
  box-shadow: 0 1px 3px rgba(92,81,72,.25); animation: noteIn .5s var(--ease) backwards;
}

/* 正在放入的纸条（沉入动画） */
.jar-fly-note {
  position: absolute; z-index: 5; width: 120px; padding: 8px 6px;
  background: linear-gradient(135deg, #fff8e6, #fce9c2); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(92,81,72,.3); text-align: center;
  font-size: 11px; color: #8a7355; line-height: 1.4;
  animation: noteSink .9s var(--ease) forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.jar-count { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 2px 0 12px; }
.jar-count b { color: var(--purple-deep); font-size: 18px; margin: 0 3px; }

.jar-form {
  width: 100%; background: var(--card); border-radius: 18px; padding: 14px;
  box-shadow: var(--shadow-soft); border: 1px solid var(--line);
}
.jar-form textarea {
  width: 100%; min-height: 56px; resize: none; border: none; outline: none;
  background: transparent; font-size: 15px; line-height: 1.6;
}
.jar-form .jar-form-row { display: flex; gap: 8px; margin-top: 6px; }

/* 随机抽取结果 */
.draw-area { width: 100%; margin-top: 14px; }
.draw-note {
  background: linear-gradient(160deg, #fff8e6, #fdeccc);
  border: 1px solid #f0dcb0; border-radius: 14px; padding: 20px 18px;
  box-shadow: var(--shadow); text-align: center;
  animation: noteExpand .6s var(--ease);
}
.draw-note .draw-author { font-size: 13px; color: var(--pink-deep); margin-bottom: 8px; }
.draw-note .draw-content { font-size: 15px; line-height: 1.9; color: #7a654a; white-space: pre-wrap; word-break: break-word; }
.draw-note .draw-time { font-size: 11px; color: var(--ink-light); margin-top: 10px; }

/* 全部纸条列表 */
.jar-list-toggle { display: block; width: 100%; margin-top: 14px; padding: 11px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--purple); color: var(--purple-deep); font-size: 14px; }
.jar-list-toggle:active { transform: scale(.97); }
.note-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.note-item {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-soft);
}
.note-item .note-fold { flex-shrink: 0; width: 26px; height: 18px; border-radius: 3px; background: linear-gradient(135deg, #fff3d6, #fbe0a8); transform: rotate(-6deg); box-shadow: 0 1px 3px rgba(92,81,72,.25); }
.note-item .note-text { flex: 1; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item .note-meta { font-size: 11px; color: var(--ink-light); flex-shrink: 0; }
.note-item .note-del { color: var(--ink-light); font-size: 14px; flex-shrink: 0; }
.note-item .note-del:active { color: var(--danger); }

/* ============================================================
   纪念日页
   ============================================================ */
.anni-list { display: flex; flex-direction: column; gap: 10px; }
.anni-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 12px;
}
.anni-card.soon {
  border-color: var(--pink);
  background: linear-gradient(135deg, #fffdfa, var(--pink-soft));
  box-shadow: 0 6px 20px rgba(217, 140, 146, .22);
}
.anni-card.soon::before {
  content: ""; width: 6px; align-self: stretch; border-radius: 3px;
  background: linear-gradient(180deg, var(--pink), var(--purple));
}
.anni-card .anni-emoji { font-size: 28px; flex-shrink: 0; }
.anni-card .anni-info { flex: 1; min-width: 0; }
.anni-card .anni-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.anni-card .anni-date { font-size: 12px; color: var(--ink-light); margin-top: 2px; }
.anni-card .anni-ops { display: flex; gap: 6px; flex-shrink: 0; }
.anni-badge {
  flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--purple-soft); color: var(--purple-deep);
}
.anni-badge.today { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; animation: heartbeat 2s infinite; }
.anni-badge.past { background: var(--bg-soft); color: var(--ink-soft); }

/* 悬浮添加按钮 */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 55; width: 54px; height: 54px; border-radius: 50%; font-size: 26px;
  color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 10px 24px rgba(185, 167, 214, .45);
  display: flex; align-items: center; justify-content: center;
}
.fab:active { transform: scale(.9); }

/* 表单弹窗内小工具 */
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); margin: 4px 0 12px; cursor: pointer; }
.form-check input { accent-color: var(--purple-deep); width: 17px; height: 17px; }

/* ============================================================
   情书页
   ============================================================ */
.letter-list { display: flex; flex-direction: column; gap: 10px; }
.letter-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 12px;
  text-align: left; width: 100%;
}
.letter-card:active { transform: scale(.97); }
.letter-card.unread { border-left: 4px solid var(--pink-deep); }
.letter-card .env-emoji { font-size: 26px; flex-shrink: 0; }
.letter-card .letter-info { flex: 1; min-width: 0; }
.letter-card .letter-title { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-card .letter-meta { font-size: 12px; color: var(--ink-light); margin-top: 2px; }
.letter-card .letter-meta b { color: var(--purple-deep); font-weight: 600; }
.letter-card .letter-star { font-size: 18px; flex-shrink: 0; color: var(--ink-light); }
.letter-card .letter-star.on { color: #e8b64c; animation: starPop .4s var(--ease); }

/* 情书阅读弹窗：翻页过渡 */
.letter-paper {
  position: relative; min-height: 320px; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(140% 60% at 20% 0%, rgba(244,228,205,.55), transparent 55%),
    repeating-linear-gradient(180deg, transparent 0 28px, rgba(160,130,90,.12) 28px 29px),
    linear-gradient(180deg, #fdf6ea, #f8ecd8);
  border: 1px solid #eeddc0; padding: 26px 22px 30px;
  animation: flipIn .55s var(--ease); transform-origin: left center;
}
.letter-paper::before {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 26px;
  background: linear-gradient(90deg, rgba(160,130,90,.06), transparent);
}
.letter-paper .lp-title { font-family: var(--font-title); font-size: 22px; color: #8a5a44; text-align: center; letter-spacing: 4px; margin-bottom: 16px; }
.letter-paper .lp-content { font-size: 15px; line-height: 2.05; color: #6b5540; white-space: pre-wrap; word-break: break-word; }
.letter-paper .lp-signoff { text-align: right; margin-top: 18px; font-family: var(--font-title); font-size: 17px; color: #a06952; }
.letter-paper .lp-time { text-align: right; font-size: 11px; color: #b3a08b; margin-top: 6px; }

/* ============================================================
   我的页
   ============================================================ */
.me-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 16px; box-shadow: var(--shadow-soft); margin-bottom: 14px;
}
.me-head { display: flex; align-items: center; gap: 14px; }
.me-avatar {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(185, 167, 214, .4);
}
.me-name { font-size: 18px; font-weight: 700; }
.me-sub { font-size: 12px; color: var(--ink-light); margin-top: 2px; }
.me-invite { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--purple-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--purple-deep); }
.me-invite .code { font-weight: 800; letter-spacing: 4px; font-size: 16px; }
.me-invite .btn { margin-left: auto; }

.me-section-title { font-size: 14px; color: var(--ink-soft); margin: 18px 0 8px; padding-left: 4px; letter-spacing: 2px; }
.me-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 4px;
  background: var(--card); border-bottom: 1px solid var(--line); text-align: left;
}
.me-row:last-child { border-bottom: none; }
.me-row:active { background: var(--bg-soft); }
.me-row .row-emoji { font-size: 20px; }
.me-row .row-text { flex: 1; font-size: 15px; }
.me-row .row-sub { font-size: 12px; color: var(--ink-light); }
.me-row .row-arrow { color: var(--ink-light); }

/* 解绑申请面板 */
.unbind-panel { border-radius: 16px; padding: 16px; background: #fdf0f1; border: 1px solid #f3d4d7; margin-top: 10px; animation: fadeSlide .4s var(--ease); }
.unbind-panel h4 { font-size: 15px; color: var(--danger); margin-bottom: 6px; }
.unbind-panel p { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.8; }
.unbind-panel .btn-row { display: flex; gap: 10px; }

/* 通知列表 */
.notify-list { display: flex; flex-direction: column; gap: 8px; }
.notify-item {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-soft);
}
.notify-item .notify-icon { font-size: 20px; }
.notify-item .notify-text { flex: 1; font-size: 14px; line-height: 1.6; }
.notify-item .notify-time { font-size: 11px; color: var(--ink-light); flex-shrink: 0; }
.notify-item.unread { background: linear-gradient(135deg, #fffdfa, var(--pink-soft)); border-color: var(--pink); }

/* 管理员区 */
.admin-panel { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; background: rgba(255,255,255,.5); }
.admin-panel summary { cursor: pointer; font-size: 13px; color: var(--ink-light); text-align: center; }
.admin-panel .field { margin-top: 10px; }

/* ============================================================
   动画关键帧
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.08); } 48% { transform: scale(1); } }
@keyframes digitPop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes floatUp { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
@keyframes particleRise {
  0% { transform: translateY(0) scale(.7) rotate(0deg); opacity: 0; }
  12% { opacity: .55; }
  100% { transform: translateY(-620px) scale(1.15) rotate(26deg); opacity: 0; }
}
@keyframes noteIn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: .9; } }
@keyframes noteSink {
  0% { opacity: 1; transform: translate(-50%, -30px) scale(1) rotate(-2deg); }
  100% { opacity: .25; transform: translate(-50%, 60px) scale(.45) rotate(8deg); }
}
@keyframes noteExpand {
  0% { opacity: 0; transform: scale(.5) rotate(-4deg); }
  60% { transform: scale(1.04) rotate(1.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes flipIn {
  0% { opacity: 0; transform: perspective(900px) rotateY(-80deg); }
  100% { opacity: 1; transform: perspective(900px) rotateY(0deg); }
}
@keyframes starPop { 0% { transform: scale(1); } 50% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ============================================================
   PC 适配：居中显示
   ============================================================ */
@media (min-width: 768px) {
  body { background: #efe8df; }
  .app-view {
    max-width: 480px; margin: 0 auto; min-height: 100vh;
    box-shadow: 0 0 60px rgba(92, 81, 72, .12);
    background: linear-gradient(160deg, var(--bg), #f8f2ea);
  }
  #tabbar { max-width: 480px; }
  .diary-composer { max-width: 480px; }
  #toast { max-width: 420px; }
}
