:root {
  --bg: #fbf3ee;
  --bg-deep: #f6e7de;
  --paper: #fffdfb;
  --paper-soft: rgba(255, 253, 251, 0.72);
  --ink: #443431;
  --ink-mid: #6f5a55;
  --ink-soft: #9d8681;
  --rose: #d98b8b;
  --rose-deep: #c06b6b;
  --rose-wash: rgba(217, 139, 139, 0.10);
  --blue: #8ba7b0;
  --line: rgba(160, 110, 105, 0.14);
  --line-strong: rgba(160, 110, 105, 0.24);
  --shadow-sm: 0 1px 2px rgba(150, 100, 95, 0.05), 0 4px 14px rgba(150, 100, 95, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1618;
    --bg-deep: #241a1d;
    --paper: #2a1f22;
    --paper-soft: rgba(42, 31, 34, 0.78);
    --ink: #f1e4e0;
    --ink-mid: #c2aca7;
    --ink-soft: #8d7874;
    --rose: #d99898;
    --rose-deep: #e8ada9;
    --rose-wash: rgba(217, 152, 152, 0.12);
    --line: rgba(232, 173, 169, 0.13);
    --line-strong: rgba(232, 173, 169, 0.22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(0, 0, 0, 0.2);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-y;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: var(--rose-deep);
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform .15s ease, background .2s ease, opacity .2s;
}
button:hover { background: var(--rose); }
button:active { transform: scale(.975); }
button:disabled { opacity: .5; cursor: default; }

.icon-btn {
  background: transparent;
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.icon-btn:hover { background: var(--rose-wash); color: var(--rose-deep); }

input, textarea {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
}
textarea { resize: none; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); }

/* ============ 登录 ============ */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--bg-deep), transparent 65%),
    var(--bg);
}
.login-inner { width: min(360px, 100%); text-align: center; }
.seal {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border: 1px solid var(--line);
  animation: beat 2.6s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.1); }
  24% { transform: scale(1); }
  36% { transform: scale(1.05); }
}
.login-inner h1 {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 3px;
  margin: 0 0 6px;
}
.login-inner .sub {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 1px;
  margin: 0 0 34px;
}
.login-inner form { display: grid; gap: 14px; }
.login-inner input {
  text-align: center;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  letter-spacing: 4px;
  font-size: 15px;
}
.login-inner input:focus { border-color: var(--rose); }
.login-inner button { padding: 13px; font-size: 15px; letter-spacing: 2px; }
.err { color: #c0565f; font-size: 13px; min-height: 20px; margin: 0; }
.foot { color: var(--ink-soft); font-size: 12px; margin-top: 34px; letter-spacing: 1px; }

/* ============ 抬头 ============ */
.app {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  padding: max(18px, env(safe-area-inset-top)) 22px 12px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--bg-deep) 0%, var(--bg) 78%);
}
.hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 139, 139, 0.22), transparent 68%);
  pointer-events: none;
}
.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 12px; letter-spacing: 4px; color: var(--ink-soft); }
.hero-actions { display: flex; align-items: center; gap: 8px; }

.anniv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(150, 100, 95, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.anniv-heart { font-size: 11px; color: var(--rose); animation: beat 2.6s ease-in-out infinite; }
.anniv-body { display: inline-flex; align-items: baseline; gap: 2px; }
.anniv-days {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .5px;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.anniv-unit { font-size: 10px; color: var(--ink-soft); letter-spacing: .5px; }
.anniv-sub {
  position: relative;
  margin-top: 9px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .5px;
  opacity: .9;
  display: flex;
  align-items: center;
  gap: 7px;
}
.anniv-sub::before { content: ""; width: 16px; height: 1px; background: var(--line-strong); flex: 0 0 auto; }

.hero-date {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 12px;
}
.hero-day {
  font-size: 52px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.hero-meta { display: flex; flex-direction: column; line-height: 1.4; }
.hero-meta > span:first-child { font-size: 15px; color: var(--ink-mid); letter-spacing: 1px; }
.hero-weekday { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
.hero-together {
  position: relative;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .5px;
}
.hero-together b { color: var(--rose-deep); font-weight: 500; }

.wrap { display: grid; gap: 14px; padding: 0 14px; }

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}
.panel-hint { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }

/* ============ 一只猫脸（区切换） ============ */
.catnav {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}
.catface {
  position: relative;
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 50%;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.catface:hover { background: transparent; }
.catface:active { transform: scale(.94); }

.catface-halo {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 139, 139, 0.16) 0%, transparent 68%);
  pointer-events: none;
}

.cat-svg {
  position: relative;
  display: block;
  width: 196px;
  height: 184px;
  overflow: visible;
  --c-line: #6f5551;
  --c-fill: #fffdfb;
  --c-fill-2: #ffe6e0;
  animation: catBreath 4.2s ease-in-out infinite;
  transform-origin: 60px 105px;
}
@media (prefers-color-scheme: dark) {
  .cat-svg { --c-line: #e6b9b4; --c-fill: #3a2b2f; --c-fill-2: #52353a; }
}

.c-face { fill: var(--c-fill); stroke: var(--c-line); stroke-width: 2.8; }
.c-ear { fill: var(--c-fill); stroke: var(--c-line); stroke-width: 2.8; stroke-linejoin: round; }
.c-ear-in { fill: var(--c-fill-2); }

.c-eye { fill: #4a3330; }
@media (prefers-color-scheme: dark) { .c-eye { fill: #f3dcd7; } }
.c-spark { fill: #fff; animation: sparkle 3.6s ease-in-out infinite; }
.c-spark-sm { fill: rgba(255, 255, 255, .75); }

.c-happy-eye, .c-mouth, .c-whisker {
  fill: none;
  stroke: var(--c-line);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.c-nose { fill: #e08d94; }
.c-blush { fill: rgba(224, 141, 148, .38); }

@keyframes catBreath {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.018) translateY(-2px); }
}
.c-eyes { animation: catBlink 5.6s infinite; transform-origin: 60px 62px; }
@keyframes catBlink {
  0%, 90%, 96%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(.06); }
}
@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

.c-happy-eye { opacity: 0; transition: opacity .25s; }
.catnav[data-zone="memory"] .c-eyes { opacity: 0; }
.catnav[data-zone="memory"] .c-happy-eye { opacity: 1; }
.catnav[data-zone="memory"] .cat-svg { animation: catDoze 5s ease-in-out infinite; }
@keyframes catDoze {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  45% { transform: rotate(-2.4deg) translateY(2px); }
  65% { transform: rotate(-2.8deg) translateY(3px); }
}

.catnav[data-zone="qa"] .cat-svg { animation: catTilt 3.6s ease-in-out infinite; }
@keyframes catTilt {
  0%, 100% { transform: rotate(-3deg) translateY(-1px); }
  50% { transform: rotate(3deg) translateY(-1px); }
}

.cat-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.4;
}
#cat-name { font-size: 15px; letter-spacing: 3px; color: var(--rose-deep); font-weight: 500; }
.cat-tip { font-size: 10px; letter-spacing: 1.5px; color: var(--ink-soft); opacity: .75; }

.cat-dot {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ============ 心情 ============ */
.mood-pair { display: flex; align-items: stretch; gap: 14px; }
.mood-slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
}
.mood-divider { width: 1px; background: var(--line); margin: 4px 0; }
.slot-label {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-emoji { font-size: 30px; line-height: 1.35; }
.slot-note {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  word-break: break-word;
  line-height: 1.5;
  min-height: 18px;
}

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 14px 0 10px;
  justify-content: center;
}
.picker button {
  flex: 0 0 auto;
  width: calc((100% - 18px) / 10);
  min-width: 0;
  font-size: 19px;
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 0;
  border-radius: 10px;
  line-height: 1;
  filter: grayscale(0.55);
  opacity: .72;
  transition: all .18s ease;
}
.picker button:hover { opacity: 1; transform: translateY(-1px); }
.picker button.on {
  border-color: var(--rose);
  background: var(--rose-wash);
  filter: none;
  opacity: 1;
  transform: translateY(-1px);
}
.mood-note {
  text-align: center;
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
}

/* ============ 写作框 ============ */
.composer {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 14px;
}
.composer textarea { min-height: 56px; font-size: 15px; line-height: 1.7; }
.composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.attach {
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.attach:hover { background: var(--rose-wash); color: var(--rose-deep); }
.composer-hint { font-size: 12px; color: var(--ink-soft); }
.composer-bar button { margin-left: auto; padding: 8px 22px; font-size: 14px; }

.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-preview:empty { display: none; }
.upload-preview .thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ 今天 ============ */
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 0;
}
.today-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}
.tabs { display: flex; gap: 2px; }
.tab {
  background: transparent;
  color: var(--ink-soft);
  padding: 4px 12px;
  font-size: 12px;
  letter-spacing: 1px;
  border-radius: 999px;
}
.tab.active { color: var(--rose-deep); background: var(--rose-wash); }

.timeline { display: grid; gap: 10px; }

.item {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 15px 17px;
  animation: rise .3s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.item-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  background: var(--rose);
  flex: 0 0 auto;
}
.avatar.her { background: var(--blue); }
.item-head .who { color: var(--ink-mid); font-size: 13px; }
.item-head .time { margin-left: auto; font-size: 11px; }

.edited {
  font-size: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
  line-height: 1.6;
}
.item-head .del + .del { margin-left: 4px; }

.item-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.75;
}
.item-body.mood-line { display: flex; align-items: baseline; gap: 8px; }
.item-body.mood-line .big { font-size: 22px; }
.item-body.mood-line .txt { font-size: 14px; color: var(--ink-mid); }

.item-photo img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  cursor: zoom-in;
  margin-top: 2px;
}
.caption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }

.empty { text-align: center; padding: 44px 0 36px; color: var(--ink-soft); }
.empty-heart { display: block; font-size: 20px; color: var(--rose); opacity: .5; margin-bottom: 10px; }
.empty p { margin: 0 0 2px; font-size: 14px; }
.empty-sub { font-size: 12px; opacity: .8; }

/* ============ 评论 ============ */
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.comment-toggle {
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  padding: 3px 0;
  letter-spacing: .5px;
}
.comment-toggle:hover { color: var(--rose-deep); background: transparent; }
.comment-body { margin-top: 6px; display: grid; gap: 10px; }
.comment { padding-left: 10px; border-left: 1px solid var(--line); }
.comment.reply { border-left-color: var(--rose-wash); }
.comment-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-soft);
}
.comment-who { color: var(--ink-mid); font-size: 12px; }
.comment-who.me { color: var(--rose-deep); }
.comment-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 1px;
  line-height: 1.65;
}
.comment-acts { display: flex; gap: 12px; margin-top: 2px; }
button.link {
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  padding: 0;
  letter-spacing: .5px;
}
button.link:hover { color: var(--rose-deep); background: transparent; }
button.link.danger:hover { color: #c0565f; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }
.comment-form textarea {
  font-size: 15px;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
}
.comment-form textarea:focus { border-color: var(--rose); }
.comment-form button { flex: 0 0 auto; padding: 7px 18px; font-size: 13px; }
.comment-none { font-size: 12px; color: var(--ink-soft); opacity: .8; }
.reply-form { margin-top: 6px; }

/* ============ 编辑 ============ */
.edit-box { margin-top: 12px; }
.edit-box textarea {
  font-size: 15px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rose);
  background: transparent;
  margin-bottom: 10px;
}
.row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
button.small { padding: 7px 18px; font-size: 13px; }
button.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); }
button.ghost:hover { background: var(--rose-wash); color: var(--rose-deep); }

/* ============ 问答 ============ */
.qa-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 18px 18px;
}
.qa-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.qa-label { font-size: 11px; letter-spacing: 2px; color: var(--ink-soft); }
.qa-tag {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border-radius: 999px;
  padding: 2px 10px;
}
.qa-tag:empty { display: none; }
.qa-question {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: .5px;
}
.qa-meta { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; margin-bottom: 16px; }
.qa-answer textarea {
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  line-height: 1.7;
}
.qa-answer textarea:focus { border-color: var(--rose); }
.qa-answer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.qa-hint { font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.qa-answer-bar button { margin-left: auto; flex: 0 0 auto; }

.qa-bubble { border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.qa-bubble.mine { background: var(--rose-wash); }
.qa-bubble.theirs { background: rgba(139, 167, 176, 0.10); }
.qa-who {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.qa-bubble.mine .qa-who { color: var(--rose-deep); }
.qa-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.qa-locked {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}
.qa-locked p { margin: 0; }
.lock-icon { font-size: 16px; flex: 0 0 auto; }

.qa-history { display: grid; gap: 4px; }
.qa-hist { border-bottom: 1px solid var(--line); padding: 9px 4px; }
.qa-hist:last-child { border-bottom: 0; }
.qa-hist summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.qa-hist summary::-webkit-details-marker { display: none; }
.qa-hist-day {
  flex: 0 0 auto;
  color: var(--rose-deep);
  font-size: 11px;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.qa-hist-q {
  color: var(--ink-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qa-hist-body { padding: 6px 0 2px; }
.qa-none { font-size: 12px; color: var(--ink-soft); padding: 8px 4px; }

/* ============ 记忆漩涡 ============ */
.memory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 4px 0;
}
.memory-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--ink-mid);
}

.seg {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-btn {
  flex: 1 1 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 6px 0;
  border-radius: 999px;
  letter-spacing: 1px;
}
.seg-btn:hover { background: transparent; color: var(--ink-mid); }
.seg-btn.active {
  background: var(--paper);
  color: var(--rose-deep);
  box-shadow: 0 1px 3px rgba(150, 100, 95, 0.10);
}

.memory-list { display: grid; gap: 6px; }
.mem-group-head {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 2px;
  padding: 14px 6px 4px;
}
.mem-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  text-align: left;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .2s;
}
.mem-card:hover {
  background: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(150, 100, 95, 0.10);
}
.mem-card.accent { background: linear-gradient(135deg, var(--paper) 40%, var(--rose-wash) 100%); }
.mem-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mem-title { font-size: 15px; letter-spacing: .5px; }
.mem-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: .3px; }
.mem-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mem-total {
  font-size: 12px;
  color: var(--rose-deep);
  background: var(--rose-wash);
  border-radius: 999px;
  padding: 1px 9px;
  font-variant-numeric: tabular-nums;
}
.mem-arrow { color: var(--ink-soft); font-size: 16px; opacity: .6; }
.mem-loading { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 0; }

/* ============ 抽屉 ============ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 38, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-body {
  position: relative;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  animation: slideUp .3s cubic-bezier(.22, .8, .28, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 16px;
}
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: 1px; }
.sheet-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: .5px; }
.sheet-actions:empty { display: none; }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 12, 13, 0.94);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox img { max-width: 94vw; max-height: 82vh; border-radius: 8px; }
.lb-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 20px;
  padding: 0;
  display: grid;
  place-items: center;
}
#lb-cap {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  margin: 12px 0 0;
  text-align: center;
  max-width: 80vw;
}

/* ============ 底部导航 ============ */
.tabbar-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100px + env(safe-area-inset-bottom));
  background: var(--bg);
  pointer-events: none;
  z-index: 100;
}
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(120, 80, 78, 0.16), 0 1px 3px rgba(120, 80, 78, 0.08);
  z-index: 101;
}
.tabbtn {
  flex: 1 1 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 14px;
  padding: 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  position: relative;
}
.tabbtn:hover { background: transparent; }
.tabbtn.active { color: var(--rose-deep); background: var(--rose-wash); }
.tb-icon { font-size: 15px; line-height: 1.3; }
.tb-label { font-size: 10px; letter-spacing: .5px; }
.tb-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
}

/* ============ toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(110px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: 82vw;
  text-align: center;
}
.toast.on { opacity: .92; transform: translate(-50%, 0); }

@media (max-width: 390px) {
  .hero-day { font-size: 46px; }
  .mood-note { font-size: 13px; }
  .picker button { font-size: 17px; }
  .cat-svg { width: 168px; height: 158px; }
  #cat-name { font-size: 14px; letter-spacing: 2px; }
  .qa-question { font-size: 16px; }
}
