/* ==========================================================
   我们的空间 · Our Space
   柔美 / 日出玫瑰 / 薰衣草 · 移动端优先 · 视觉重做
   ========================================================== */

:root {
  /* 调色板 */
  --bg: #fcf4f6;
  --bg-2: #f7ecf0;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-2: #fdf6f9;

  --rose: #f2789e;          /* 主玫瑰 */
  --rose-deep: #e85c8e;     /* 深玫瑰：按钮/激活/柔底上的文字 */
  --rose-soft: #fde6ef;     /* 柔粉填充：pill / 标签 */
  --lavender: #b9a7e8;
  --lav-deep: #8f78d6;
  --lav-soft: #ece6fa;
  --peach: #fcded0;

  /* 兼容旧变量名（历史组件仍引用） */
  --accent: var(--rose);
  --accent-soft: var(--rose-soft);
  --accent-deep: var(--rose-deep);

  --text: #3a2b31;
  --text-soft: #9b8b93;
  --text-faint: #c6b9c0;
  --line: #f2e6ec;
  --card-border: rgba(226, 135, 154, 0.10);
  --card-highlight: rgba(255, 255, 255, 0.7);

  --shadow: 0 2px 8px rgba(226, 135, 154, 0.06), 0 16px 34px rgba(200, 120, 150, 0.12);
  --shadow-soft: 0 1px 3px rgba(226, 135, 154, 0.05), 0 8px 22px rgba(200, 120, 150, 0.09);
  --shadow-rose: 0 8px 22px rgba(232, 92, 142, 0.30);

  --grad-sunset: linear-gradient(168deg, #fce3d0 0%, #fbc6d8 40%, #ecccf0 74%, #dccff2 100%);
  --grad-lav: linear-gradient(165deg, #cabff2 0%, #b3a1e6 52%, #d9caf1 100%);
  --grad-rose: linear-gradient(135deg, #f58aae 0%, #e85c8e 100%);

  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 30px;
  --nav-h: 64px;
  --maxw: 480px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro SC",
          "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17131b;
    --bg-2: #1d1824;
    --bg-elevated: #221c2b;
    --card: #221c2b;
    --card-2: #251e30;

    --rose: #f18bab;
    --rose-deep: #f6a6c1;
    --rose-soft: #3a2530;
    --lavender: #b9a7e8;
    --lav-deep: #b9a7e8;
    --lav-soft: #2c2440;
    --peach: #3a2b30;

    --text: #f1eaf0;
    --text-soft: #ab9fb0;
    --text-faint: #766a7c;
    --line: #2e2637;
    --card-border: rgba(255, 255, 255, 0.06);
    --card-highlight: rgba(255, 255, 255, 0.05);

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 16px 36px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.25), 0 8px 22px rgba(0, 0, 0, 0.34);
    --shadow-rose: 0 8px 22px rgba(0, 0, 0, 0.4);

    --grad-sunset: linear-gradient(168deg, #3c2836 0%, #34243a 46%, #2a2440 100%);
    --grad-lav: linear-gradient(165deg, #322a4a 0%, #2a2440 55%, #2e2740 100%);
  }
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; }
img { display: block; max-width: 100%; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  padding: 16px; border-radius: var(--radius); font-size: 16px; font-weight: 600;
  color: #fff; background: var(--grad-rose);
  box-shadow: var(--shadow-rose);
  transition: transform .15s ease, opacity .2s, box-shadow .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; }
.btn-text { color: var(--text-soft); font-size: 15px; padding: 8px; }

/* ==========================================================
   登录
   ========================================================== */
.auth-screen {
  min-height: 100dvh; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 24px) 28px calc(var(--safe-bottom) + 24px);
  background:
    radial-gradient(120% 76% at 50% -8%, #fbd0de 0%, transparent 55%),
    radial-gradient(90% 60% at 88% 8%, var(--lav-soft) 0%, transparent 46%),
    var(--bg);
}
.auth-inner { width: 100%; max-width: 360px; text-align: center; animation: fade-up .6s ease; }
.auth-logo {
  width: 88px; height: 88px; margin: 0 auto 18px; object-fit: cover;
  border-radius: 26px; box-shadow: 0 14px 34px rgba(232, 92, 142, 0.34);
}
.auth-brand { margin-bottom: 34px; }
.auth-brand h1 { font-size: 27px; font-weight: 700; margin: 0; letter-spacing: .5px; }
.auth-sub { color: var(--text-soft); margin: 8px 0 0; font-size: 15px; }

.auth-days {
  position: absolute; top: calc(var(--safe-top) + 14px); left: 50%;
  transform: translateX(-50%); z-index: 20;
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 9px 20px; border-radius: 999px;
  background: #17131b; border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap; animation: island-pop .55s cubic-bezier(.34, 1.56, .64, 1) both;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .35s ease;
}
.auth-days::after {
  content: ""; position: absolute; inset: -1px; border-radius: 999px;
  border: 2px solid var(--rose); opacity: 0; pointer-events: none;
}
.auth-days.knocked::after { animation: island-ripple .62s ease-out; }
.auth-days-label { font-size: 13px; color: rgba(255, 255, 255, 0.62); }
.auth-days-num {
  display: inline-block; font-size: 20px; font-weight: 700; line-height: 1;
  color: var(--rose); font-variant-numeric: tabular-nums;
}
.auth-days-num.beat { animation: heartbeat .9s cubic-bezier(.36, .07, .19, .97) both; }
.auth-days-unit { font-size: 13px; color: rgba(255, 255, 255, 0.62); }
@keyframes island-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.7); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.auth-days.pressing { animation: island-charge .48s cubic-bezier(.33, 0, .35, 1) forwards; }
@keyframes island-charge {
  0% { transform: translateX(-50%) scale(1);
    box-shadow: 0 8px 26px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 0 color-mix(in srgb, var(--rose) 0%, transparent); }
  100% { transform: translateX(-50%) scale(.92);
    box-shadow: 0 5px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06), 0 0 24px 4px color-mix(in srgb, var(--rose) 60%, transparent); }
}
.auth-days.knocked { animation: island-knock .6s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes island-knock {
  0% { transform: translateX(-50%) scale(.92); }
  35% { transform: translateX(-50%) scale(1.12); }
  62% { transform: translateX(-50%) scale(.98); }
  100% { transform: translateX(-50%) scale(1); }
}
@keyframes island-ripple { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes heartbeat { 0% { transform: scale(1); } 12% { transform: scale(1.5); } 24% { transform: scale(1); } 38% { transform: scale(1.34); } 52% { transform: scale(1); } 100% { transform: scale(1); } }

.auth-knock {
  position: absolute; top: calc(var(--safe-top) + 62px); left: 50%;
  transform: translateX(-50%) translateY(-4px); z-index: 19;
  font-size: 11px; letter-spacing: .5px; color: var(--text-faint);
  white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity .5s ease, transform .5s ease;
}
.auth-knock.show { opacity: .85; transform: translateX(-50%) translateY(0); }

.auth-users { display: flex; flex-direction: column; gap: 12px; }
.auth-users::before {
  content: "选择你的身份"; display: block; text-align: left;
  font-size: 12px; letter-spacing: .5px; color: var(--text-faint); margin: 0 4px 2px;
}
.auth-user-btn {
  width: 100%; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-soft); color: var(--text);
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--card-border);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.auth-user-btn:hover { border-color: color-mix(in srgb, var(--rose) 26%, transparent); }
.auth-user-btn:active { transform: scale(.98); box-shadow: var(--shadow); }
.auth-avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  background: var(--rose-soft); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 14%, transparent);
}
.auth-user-name { flex: 1; text-align: left; font-size: 17px; font-weight: 600; }
.auth-user-go { flex: none; font-size: 22px; line-height: 1; color: var(--text-faint); transition: transform .2s ease, color .2s ease; }
.auth-user-btn:hover .auth-user-go { color: var(--rose-deep); transform: translateX(3px); }
.auth-password { display: flex; flex-direction: column; gap: 14px; }
.auth-password input {
  padding: 16px 18px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); color: var(--text); text-align: center; outline: none;
  box-shadow: var(--shadow-soft);
}
.auth-password input:focus { border-color: var(--rose); }
.auth-error { color: var(--rose-deep); font-size: 14px; min-height: 20px; margin-top: 14px; }

/* ==========================================================
   App 布局
   ========================================================== */
.app {
  min-height: 100dvh;
  background:
    radial-gradient(140% 42% at 50% 0%, color-mix(in srgb, var(--rose-soft) 60%, transparent) 0%, transparent 52%),
    var(--bg);
}
.view {
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 18px calc(var(--nav-h) + var(--safe-bottom) + 26px);
  animation: fade-in .35s ease;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  display: flex; max-width: var(--maxw); margin: 0 auto;
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-faint); font-size: 11px; font-weight: 500;
  transition: color .2s, transform .12s;
}
.tab-icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: fill .2s; }
.tab.active { color: var(--rose); }
.tab.active .tab-icon { fill: color-mix(in srgb, var(--rose) 16%, transparent); }
.tab:active { transform: scale(.9); }

/* ---------- 通用卡片 & 文本 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow-soft);
}
.section-title {
  display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text);
  letter-spacing: .2px; margin: 26px 4px 12px; font-weight: 700;
}
.section-title::before {
  content: ""; flex: none; width: 4px; height: 15px; border-radius: 3px;
  background: var(--grad-rose);
}
.section-title .st-more { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--text-faint); }
.muted { color: var(--text-soft); }
.center { text-align: center; }

/* ==========================================================
   首页
   ========================================================== */
.home-hero {
  position: relative; overflow: hidden;
  margin: calc(-1 * (var(--safe-top) + 20px)) -18px 0;
  padding: calc(var(--safe-top) + 18px) 20px 58px;
  background: var(--grad-sunset);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 78% 6%, rgba(255,255,255,.55) 0%, transparent 60%),
    radial-gradient(50% 34% at 16% 4%, rgba(255,255,255,.35) 0%, transparent 60%);
}
.home-hero > * { position: relative; }
.home-header { display: flex; align-items: center; justify-content: space-between; }
.hh-brand { font-size: 13px; font-weight: 600; letter-spacing: .5px; color: color-mix(in srgb, var(--text) 66%, transparent); }
.hh-avatar-btn { padding: 0; line-height: 0; border-radius: 50%; flex: none; }
.hh-avatar-btn:active { transform: scale(.94); }
.hh-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--rose-deep);
  box-shadow: 0 3px 10px rgba(180,90,120,.22), 0 0 0 2px rgba(255,255,255,.55);
}
.hh-avatar:active { transform: scale(.94); }
.home-greeting { margin-top: 20px; }
.home-greeting h2 {
  font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -.5px;
  color: #5a3a46;
}
.home-greeting .hg-heart { color: var(--rose); -webkit-text-fill-color: var(--rose); }
.home-greeting .hg-sub { margin-top: 6px; font-size: 15px; color: #8a6472; font-weight: 500; }

/* 玻璃「在一起 N 天」卡 */
.days-glass {
  position: relative; z-index: 2; margin: -40px 2px 4px;
  display: flex; align-items: center; gap: 15px;
  padding: 16px 16px 16px 15px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 62%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 34px rgba(200, 110, 140, 0.20), inset 0 1px 0 rgba(255,255,255,.6);
}
.dg-icon {
  flex: none; width: 54px; height: 54px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, #ffffff 0%, #fff4f8 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(200, 110, 140, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.9);
}
.dg-icon img { width: 48px; height: 48px; object-fit: contain; animation: heartpulse 2.4s ease-in-out infinite; }
@keyframes heartpulse { 0%,100% { transform: scale(1); } 15% { transform: scale(1.16); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
.dg-main { flex: 1; min-width: 0; }
.dg-label { font-size: 13px; color: var(--text-soft); }
.dg-value { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; }
.dg-num {
  font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -1px;
  background: var(--grad-rose); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dg-unit { font-size: 14px; color: var(--text-soft); font-weight: 600; }
.dg-pill {
  flex: none; align-self: center; padding: 9px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff; background: var(--grad-rose);
  box-shadow: var(--shadow-rose); display: inline-flex; align-items: center; gap: 5px;
  transition: transform .15s ease;
}
.dg-pill:active { transform: scale(.94); }

/* 快速入口 */
.quick-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.qe-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-border); min-width: 0;
  box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow-soft);
  text-align: left; transition: transform .15s ease, box-shadow .2s ease;
}
.qe-card:active { transform: scale(.97); box-shadow: var(--shadow); }
.qe-card.mine { background: linear-gradient(150deg, #fff, var(--rose-soft)); }
.qe-card.partner { background: linear-gradient(150deg, #fff, var(--lav-soft)); }
.qe-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: var(--rose-soft);
  display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--rose-deep); }
.qe-text { min-width: 0; }
.qe-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qe-sub { font-size: 12px; color: var(--text-soft); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 状态卡片 */
.status-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.status-emoji { font-size: 30px; }
.status-name { font-size: 14px; color: var(--text-soft); }
.status-label { font-size: 19px; font-weight: 700; }
.status-content { color: var(--text); margin: 10px 0 2px; font-size: 15px; }
.status-content.empty { color: var(--text-faint); }

.reaction-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.reaction-btn {
  padding: 9px 15px; border-radius: 999px; background: var(--bg-2);
  border: 1px solid var(--card-border); font-size: 14px; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px; transition: transform .12s, background .2s;
}
.reaction-btn:active { transform: scale(.93); background: var(--rose-soft); }
.reaction-received {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--rose-soft); font-size: 14px; color: var(--rose-deep);
  display: flex; align-items: center; gap: 8px;
}

/* 心情选择器 */
.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.mood-item {
  padding: 14px 6px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1.5px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-soft); transition: all .18s;
}
.mood-item .m-emoji { font-size: 26px; }
.mood-item.selected { border-color: var(--rose); background: var(--rose-soft); color: var(--rose-deep); }
.mood-item:active { transform: scale(.95); }

/* 纪念日提醒卡 */
.anniv-remind { display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; }
.anniv-remind::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 100% 50%, var(--rose-soft) 0%, transparent 60%);
  opacity: .8; pointer-events: none;
}
.anniv-remind > * { position: relative; }
.anniv-remind .a-left { flex: 1; min-width: 0; }
.anniv-remind .a-left .a-label { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anniv-remind .a-left .a-date { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.anniv-remind .a-days { text-align: right; flex-shrink: 0; }
.anniv-remind .a-days .a-num { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; }
.anniv-remind .a-days b {
  font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -1px;
  background: var(--grad-rose); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.anniv-remind .a-days .a-num i { font-style: normal; font-size: 14px; font-weight: 600; color: var(--text-soft); }
.anniv-remind.is-today .a-days b { font-size: 26px; }

/* ==========================================================
   表单通用
   ========================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin: 0 4px 7px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); outline: none;
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--rose); }
.field input[type="checkbox"] { width: auto; accent-color: var(--rose); }
/* iOS 原生日期控件会变高、字号变大、居中，这里归一化到和其它输入框一致 */
.field input[type="date"] {
  -webkit-appearance: none; appearance: none;
  font: inherit; text-align: left; min-height: 52px;
}
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; }
.lunar-hint { margin: 7px 4px 0; font-size: 12.5px; color: var(--rose-deep); letter-spacing: .3px; min-height: 16px; transition: opacity .2s; }
.lunar-hint:empty { display: none; }
.row-between { display: flex; align-items: center; justify-content: space-between; }

/* 页面标题栏 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 16px; }
.page-head h2 { font-size: 27px; font-weight: 800; margin: 0; letter-spacing: -.5px; }
.page-head .ph-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--grad-rose);
  box-shadow: var(--shadow-rose); display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; transition: transform .15s, box-shadow .2s; flex: none;
}
.icon-btn:active { transform: scale(.9); }

/* ==========================================================
   留言（动态流）
   ========================================================== */
.notes-filter { display: flex; gap: 22px; margin: 0 4px 16px; border-bottom: 1px solid var(--line); }
.nf-tab {
  position: relative; padding: 6px 2px 12px; font-size: 15px; color: var(--text-soft);
  font-weight: 600; transition: color .2s;
}
.nf-tab.active { color: var(--rose-deep); }
.nf-tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--grad-rose);
}

.note {
  background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow-soft);
  animation: fade-up .4s ease;
}
.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar-sm {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--rose-soft); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--rose-deep);
}
.note-meta { min-width: 0; }
.note-meta .n-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.note-meta .n-time { font-size: 12px; color: var(--text-faint); margin-top: 1px; }
.author-tag {
  font-size: 11px; font-weight: 600; padding: 1.5px 8px; border-radius: 999px; line-height: 1.5;
  color: var(--rose-deep); background: var(--rose-soft);
}
.author-tag.partner { color: var(--lav-deep); background: var(--lav-soft); }
.play-count {
  margin-left: auto; flex: none; align-self: flex-start;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 11.5px; letter-spacing: .2px;
  color: var(--text-soft); background: var(--bg-2); border: 1px solid var(--card-border);
}
.note-body { font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.note-img { margin-top: 12px; border-radius: var(--radius-sm); overflow: hidden; }
.note-img img { width: 100%; object-fit: cover; }
.note-actions { display: flex; align-items: center; gap: 20px; margin-top: 14px; color: var(--text-soft); font-size: 14px; }
.note-act { display: inline-flex; align-items: center; gap: 6px; transition: transform .12s; }
.note-act:active { transform: scale(.9); }
.note-act.liked { color: var(--rose-deep); }
.note-act.danger { color: var(--text-faint); margin-left: auto; }
.replies { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 13px; }
.reply { font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.reply .r-text { line-height: 1.6; word-break: break-word; }
.reply .r-name { color: var(--rose-deep); font-weight: 700; }
.reply .r-arrow { color: var(--text-faint); font-weight: 400; margin: 0 4px; }
.reply .r-sep { color: var(--text-faint); }
.reply .r-foot { display: flex; align-items: center; gap: 12px; }
.reply .r-time { color: var(--text-faint); font-size: 11px; }
.reply .r-reply { padding: 6px 10px 6px 2px; margin: -6px 0; font-size: 12px; color: var(--text-soft); background: transparent; transition: color .18s ease; }
.reply .r-reply:hover, .reply .r-reply:active { color: var(--rose-deep); }
.reply-box { margin-top: 12px; }
.reply-box .reply-row { display: flex; gap: 8px; }
.reply-box .reply-to {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px;
  padding: 4px 6px 4px 11px; border-radius: 999px; font-size: 12px;
  color: var(--rose-deep); background: var(--rose-soft);
}
.reply-box .reply-to-x {
  width: 17px; height: 17px; border-radius: 50%; font-size: 10px; line-height: 1; color: #fff;
  background: color-mix(in srgb, var(--rose) 72%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.reply-box input { flex: 1; padding: 11px 15px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); outline: none; }
.reply-box input:focus { border-color: color-mix(in srgb, var(--rose) 42%, transparent); }
.reply-box button[data-sendreply] { padding: 0 18px; border-radius: 999px; background: var(--grad-rose); color: #fff; font-size: 14px; font-weight: 600; }

/* ---------- 空态（柔和插画） ---------- */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-faint); }
.empty-illus {
  position: relative; width: 128px; height: 128px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
}
.empty-illus::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, var(--rose-soft) 0%, var(--lav-soft) 62%, transparent 74%);
}
.empty-illus .ei-emoji { position: relative; font-size: 56px; filter: drop-shadow(0 8px 14px rgba(200,110,140,.24)); }
.empty-illus .ei-spark { position: absolute; font-size: 16px; opacity: .8; }
.empty-illus .ei-spark.s1 { top: 8px; right: 20px; }
.empty-illus .ei-spark.s2 { bottom: 16px; left: 16px; font-size: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 6px; }
.empty-sub { font-size: 13.5px; color: var(--text-soft); margin-top: 5px; }
.empty-state .btn-primary { display: inline-block; width: auto; padding: 13px 30px; margin-top: 20px; }
.empty-state .e-emoji { font-size: 42px; margin-bottom: 12px; opacity: .7; }

/* ==========================================================
   回忆时间轴
   ========================================================== */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--rose) 0%, var(--lavender) 100%); opacity: .4;
}
.tl-year { font-size: 22px; font-weight: 800; color: var(--text); margin: 8px 0 18px -34px; padding-left: 34px; }
.tl-item { position: relative; margin-bottom: 20px; animation: fade-up .4s ease; }
.tl-dot {
  position: absolute; left: -34px; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--rose); display: flex; align-items: center; justify-content: center;
  font-size: 11px; box-shadow: var(--shadow-soft); z-index: 1;
}
.tl-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--card-border); box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow-soft);
}
.tl-top { display: flex; align-items: flex-start; gap: 10px; }
.tl-top .tl-headings { flex: 1; min-width: 0; }
.tl-date { display: inline-block; font-size: 12px; color: var(--rose-deep); font-weight: 600;
  background: var(--rose-soft); padding: 2px 9px; border-radius: 999px; }
.tl-title { font-size: 17px; font-weight: 700; margin: 7px 0 0; }
.tl-ago { flex: none; font-size: 12px; font-weight: 600; color: var(--lav-deep); background: var(--lav-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tl-loc { font-size: 13px; color: var(--text-soft); margin: 7px 0 0; word-break: break-word; }
.tl-content { font-size: 14px; color: var(--text-soft); line-height: 1.7; white-space: pre-wrap; word-break: break-word; margin-top: 8px; }
.tl-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.tl-images.n1 { grid-template-columns: 1fr; }
.tl-images.n2, .tl-images.n4 { grid-template-columns: repeat(2, 1fr); }
.tl-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.tl-images.n1 img { aspect-ratio: 4/3; }
.tl-foot { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-faint); }
.tl-foot button { color: var(--text-faint); }
.tl-foot button:active { color: var(--rose-deep); }

/* ==========================================================
   我们
   ========================================================== */
.us-hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 30px 20px 26px; border-radius: var(--radius); margin-bottom: 18px;
  background: var(--grad-lav);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 14px 34px rgba(150, 120, 200, 0.22), inset 0 1px 0 rgba(255,255,255,.4);
}
.us-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 40% at 84% 12%, rgba(255,255,255,.6) 0%, transparent 62%);
}
.us-hero > * { position: relative; }
.us-pair { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 14px; }
.us-person { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.us-avatar {
  width: 78px; height: 78px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--lav-deep);
  box-shadow: 0 6px 18px rgba(120,90,170,.28), 0 0 0 3px rgba(255,255,255,.5);
}
.us-person span { font-size: 14px; font-weight: 600; color: #4b3a63; }
.us-heart { display: flex; align-items: center; justify-content: center; animation: heartpulse 2.4s ease-in-out infinite; }
.us-heart svg { width: 30px; height: 30px; fill: #fff; filter: drop-shadow(0 3px 7px rgba(150,90,140,.4)); }
.us-days { color: #4b3a63; font-size: 14px; font-weight: 500; }
.us-days b { color: #3a2b52; font-size: 18px; font-weight: 800; }

.list-group { background: var(--card); border-radius: var(--radius); box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow-soft); border: 1px solid var(--card-border); overflow: hidden; margin-bottom: 16px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.list-item:last-child { border-bottom: none; }
.list-item .li-left { display: flex; align-items: center; gap: 12px; }
.list-item .li-sub { font-size: 12px; color: var(--text-faint); }
.list-item.tappable:active { background: var(--bg-2); }
.li-arrow { color: var(--text-faint); }
.li-danger { color: var(--rose-deep); }
.anniv-days-badge { font-size: 13px; color: var(--rose-deep); font-weight: 600; }

/* ==========================================================
   弹层 Modal
   ========================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(40, 28, 36, 0.42);
  backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease;
}
.modal {
  width: 100%; max-width: var(--maxw); background: var(--bg-elevated);
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(var(--safe-bottom) + 22px);
  max-height: 90dvh; overflow-y: auto; animation: slide-up .3s cubic-bezier(.2,.8,.2,1);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 19px; font-weight: 700; margin: 0; }
.modal-close { font-size: 22px; color: var(--text-faint); width: 32px; height: 32px; }
.modal .btn-primary { width: 100%; margin-top: 6px; }

/* 图片选择预览 */
.img-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.img-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.img-add {
  aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-faint); font-size: 12px;
}
.img-add .plus { font-size: 26px; line-height: 1; }

/* 图片查看器 */
.viewer { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; animation: fade-in .2s; }
.viewer img { max-width: 100%; max-height: 92dvh; object-fit: contain; }

/* ---------- 语音 / 视频 附件 ---------- */
.note-media { margin-top: 12px; }
.note-media video { width: 100%; max-height: 60dvh; border-radius: var(--radius-sm); background: #000; }
.tl-videos { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.tl-videos video { width: 100%; max-height: 50dvh; border-radius: 12px; background: #000; }
.tl-audios { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

/* 自定义语音条 */
.voice {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--rose-soft), color-mix(in srgb, var(--lav-soft) 70%, var(--card)));
  border: 1px solid color-mix(in srgb, var(--rose) 16%, transparent); box-shadow: var(--shadow-soft);
}
.voice-play {
  flex: none; width: 40px; height: 40px; border: none; border-radius: 50%; cursor: pointer;
  position: relative; background: var(--grad-rose);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--rose) 45%, transparent);
  transition: transform .15s ease;
}
.voice-play:active { transform: scale(.92); }
.voice-play::before, .voice-play::after { content: ''; position: absolute; top: 50%; left: 50%; }
.voice-play::before { width: 0; height: 0; border-left: 12px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; transform: translate(-30%, -50%); }
.voice-play::after { display: none; }
.voice.playing .voice-play::before { width: 4px; height: 14px; border: none; background: #fff; border-radius: 1.5px; transform: translate(-160%, -50%); }
.voice.playing .voice-play::after { display: block; width: 4px; height: 14px; background: #fff; border-radius: 1.5px; transform: translate(60%, -50%); }
.voice-wave { position: relative; flex: 1; height: 30px; cursor: pointer; min-width: 0; }
.voice-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2.5px; }
.voice-bars span { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--rose) 30%, var(--text-faint)); }
.voice-fill { position: absolute; inset: 0; clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); transition: clip-path .1s linear; }
.voice-fill .voice-bars span { background: var(--rose-deep); }
.voice-time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--rose-deep); min-width: 30px; text-align: right; }

/* 留言编辑器：附件选择行 */
.attach-row { display: flex; gap: 10px; margin-top: 4px; }
.attach-tile {
  flex: 1; padding: 14px 6px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-soft); transition: all .18s;
}
.attach-tile span { font-size: 12px; }
.attach-tile:active { transform: scale(.95); }
.attach-tile.recording { border-color: var(--rose-deep); background: var(--rose-soft); color: var(--rose-deep); animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.attach-preview:not(:empty) { margin-top: 14px; }
.attach-item { position: relative; }
.attach-item img { width: 100%; border-radius: var(--radius-sm); }
.attach-item audio { width: 100%; height: 40px; }
.attach-item video { width: 100%; max-height: 50dvh; border-radius: var(--radius-sm); background: #000; }
.attach-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.img-thumb .media-chip { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--rose-soft); }

/* ==========================================================
   Toast / 动画 / 桌面
   ========================================================== */
.toast {
  position: fixed; left: 50%; top: 22%; transform: translateX(-50%) translateY(-10px);
  background: rgba(48, 32, 40, 0.92); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }

@media (min-width: 600px) {
  body { background: #efe7ec; }
  @media (prefers-color-scheme: dark) { body { background: #0e0b12; } }
  .app { max-width: var(--maxw); margin: 0 auto; min-height: 100dvh; box-shadow: 0 0 60px rgba(0,0,0,.14);
    background: radial-gradient(140% 44% at 50% 0%, color-mix(in srgb, var(--rose-soft) 70%, transparent) 0%, transparent 54%), var(--bg);
    position: relative; }
  .tabbar { position: absolute; }
  .auth-screen { min-height: 100dvh; }
}
.loading { text-align: center; padding: 50px; color: var(--text-faint); }
.spinner { width: 28px; height: 28px; margin: 0 auto 14px; border: 2.5px solid var(--line); border-top-color: var(--rose); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
