/* ============================================
   Rayna · 暖象牙白 × 墨蓝 · 极简高级感
   ============================================ */

:root {
  --ivory: #F7F2E9;
  --paper: #FDFAF3;
  --ink: #1B3A5C;
  --ink-soft: #33567E;
  --mist: #8CA3C0;
  --gold: #C2A06B;
  --hairline: rgba(27, 58, 92, 0.14);
  --shadow: 0 1px 2px rgba(27, 58, 92, 0.04), 0 8px 28px rgba(27, 58, 92, 0.07);
  --serif: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ---------- 夜信纸 ---------- */
body.dark {
  --ivory: #101F31;
  --paper: #1B3A5C;
  --ink: #F1EAD9;
  --ink-soft: #D8CDB6;
  --mist: #7E93AF;
  --hairline: rgba(241, 234, 217, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.3);
}
body {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}
.modal-paper, .entry-card, .anni-card, .me-card, .partner-card, .envelope, .bottombar, .letter-hint, .msg-bubble, .btn-ink, .login-user-btn, .photo-item, .wish-check {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}

/* 全局圆角 */
.login-wrap, .entry-card, .daily-music, .daily-music-history, .letter-hint,
.modal-paper, .search-results, .search-result, .back-to-latest, .chat-bar,
.quote-bar, .img-preview-thumb, .msg-img, .anni-card, .digest-card, .envelope,
.photo-item, .wish-item, .me-card, .partner-card, .poke-toast, .poster-img,
.login-user-btn, .reaction-chip, .reaction-picker, .panel-head, .wish-check,
.date-calendar {
  border-radius: var(--radius);
}
.lightbox-img { border-radius: var(--radius); }
.btn-ink, .btn-outline, .load-more-btn, .theme-btn {
  border-radius: 999px;
}
input, textarea, select, #login-view input {
  border-radius: var(--radius-sm);
}
.bottombar {
  border-radius: var(--radius) var(--radius) 0 0;
}
.msg-bubble {
  border-radius: 18px;
}
.msg-row.mine .msg-bubble {
  border-bottom-right-radius: 4px;
}
.msg-row.theirs .msg-bubble {
  border-bottom-left-radius: 4px;
}
.theme-btn { font-size: 16px; padding: 6px; line-height: 1; opacity: .75; }
.theme-btn:hover { opacity: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
body.dark .msg-row.mine .msg-bubble { background: #E9E1CD; color: #16293E; }
body.dark .btn-ink { background: #E9E1CD; color: #16293E; }
body.dark .btn-ink:hover { background: #F7F2E9; }
body.dark .login-user-btn.active { background: #E9E1CD; color: #16293E; border-color: #E9E1CD; }
body.dark .wish-item.done .wish-check { background: #E9E1CD; border-color: #E9E1CD; color: #16293E; }
body.dark .modal { background: rgba(5, 12, 20, 0.5); }
body.dark .modal-paper { box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5); }
body.dark .check-row input { accent-color: #E9E1CD; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
html, body {
  height: 100%;
  /* body 完全不滚动：页面滚动统一收进 #login-view / #app-view。
     iOS standalone 下 body 橡皮筋与内层滚动是两套手感，锁死 body 后只剩一种。 */
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 统一移动端点击高亮为品牌淡金色，替换系统默认蓝色闪烁 */
  -webkit-tap-highlight-color: rgba(194, 160, 107, .18);
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:active:not(:disabled) { transition: none; }
input, textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: transparent; border: none; outline: none;
  border-bottom: 1px solid var(--hairline);
  padding: 10px 2px; transition: border-color .3s;
}
input:focus, textarea:focus { border-bottom-color: var(--ink); }
textarea { resize: vertical; line-height: 1.8; }
::placeholder { color: var(--mist); }

/* ---------- 按钮 ---------- */
.btn-ink {
  background: var(--ink); color: var(--paper);
  padding: 12px 30px; letter-spacing: .15em; font-size: 14px;
  transition: background .3s, transform .2s;
}
.btn-ink:hover { background: var(--ink-soft); }
.btn-ink:active { transform: scale(.98); }
.btn-outline {
  border: 1px solid var(--hairline); color: var(--ink);
  padding: 8px 20px; font-size: 13px; letter-spacing: .1em;
  transition: all .3s;
}
.btn-outline:hover { border-color: var(--ink); background: var(--paper); }
.btn-outline:active { transform: scale(.97); opacity: .85; }
.btn-text {
  color: var(--mist); font-size: 13px; letter-spacing: .08em; padding: 8px 4px;
  transition: color .3s, opacity .15s;
}
.btn-text:hover { color: var(--ink); }
.btn-text:active { opacity: .6; }

/* ---------- 登录 ---------- */
#login-view {
  height: 100%; display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  padding: 24px;
}
.login-wrap {
  width: 340px; text-align: center;
  margin: auto;  /* 双轴居中且内容超高时可正常滚动（flex 居中 + overflow 会裁掉顶部） */
  animation: rise .8s ease both;
}
.login-eyebrow {
  font-size: 11px; letter-spacing: .4em; color: var(--gold); margin-bottom: 18px;
}
.login-wordmark {
  font-family: var(--serif); font-weight: 500; font-size: 44px;
  letter-spacing: .06em; color: var(--ink);
}
.login-rule {
  width: 42px; height: 1px; background: var(--gold); margin: 22px auto 30px;
}
.login-users { display: flex; gap: 12px; justify-content: center; margin-bottom: 22px; }
.login-user-btn {
  flex: 1; padding: 13px 0; font-family: var(--serif); font-size: 17px;
  letter-spacing: .1em; color: var(--mist);
  border: 1px solid var(--hairline); background: var(--paper);
  transition: all .3s;
}
.login-user-btn.active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
#login-view input { width: 100%; text-align: center; letter-spacing: .2em; margin-bottom: 20px; }
#login-btn { width: 100%; }
.login-error { color: #A4606C; font-size: 13px; margin-top: 14px; min-height: 20px; }

.notify-banner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 28px;
  background: var(--paper); border-bottom: 1px solid var(--hairline);
  font-size: 13px; color: var(--ink-soft);
}
.notify-banner span { flex: 1; }
.notify-banner .btn-ink { padding: 6px 18px; font-size: 12px; }
.notify-banner .btn-text { color: var(--mist); font-size: 16px; padding: 4px; }

/* ---------- 框架 ---------- */
#app-view {
  height: 100%; display: flex; flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  scroll-behavior: smooth;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; width: 100%; margin: 0 auto;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--hairline);
}
.wordmark { font-family: var(--serif); font-size: 22px; letter-spacing: .08em; }
.topnav { display: flex; gap: 26px; }
.nav-item {
  font-size: 14px; letter-spacing: .12em; color: var(--mist);
  padding: 4px 0; border-bottom: 1px solid transparent; transition: all .3s;
}
.nav-item:hover { color: var(--ink); }
.nav-item:active { opacity: .7; transition: opacity .1s; }
.nav-item.active { color: var(--ink); border-bottom-color: var(--gold); }

.page {
  flex: 1; width: 100%; max-width: 960px; margin: 0 auto;
  padding: 40px 28px 80px;
}
.panel { animation: fade .5s ease both; }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.panel-title {
  font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: .08em;
}
.panel-sub { color: var(--mist); font-size: 13px; margin-bottom: 26px; }

/* ---------- 序章 ---------- */
.hero { text-align: center; padding: 48px 0 40px; }
.hero-names {
  font-family: var(--serif); font-size: 20px; letter-spacing: .18em; color: var(--ink-soft);
}
.hero-names .amp { color: var(--gold); font-style: italic; margin: 0 6px; }
.hero-eyebrow { margin-top: 44px; font-size: 13px; letter-spacing: .3em; color: var(--mist); }
.hero-days {
  font-family: var(--serif); color: var(--ink);
  display: flex; align-items: baseline; justify-content: center; gap: 14px;
}
#days-num { font-size: 118px; line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-days-unit { font-size: 22px; letter-spacing: .2em; color: var(--ink-soft); }
.hero-since { margin-top: 6px; font-size: 13px; letter-spacing: .22em; color: var(--mist); }
.hero-rule { width: 42px; height: 1px; background: var(--gold); margin: 34px auto; }
.hero-greeting { font-family: var(--serif); font-size: 17px; letter-spacing: .12em; color: var(--ink-soft); }
.hero-presence { margin-top: 12px; font-size: 12px; letter-spacing: .14em; color: var(--mist); }
.hero-presence .on { color: var(--gold); }
.hero-status {
  margin-top: 8px; font-size: 13px; letter-spacing: .1em; color: var(--ink-soft);
  cursor: pointer; transition: color .3s;
}
.hero-status:hover { color: var(--ink); }
.hero-status.empty { color: var(--mist); font-size: 12px; }
.status-edit {
  margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.status-edit input { width: 240px; text-align: center; font-size: 13px; padding: 6px 2px; }

.letter-hint {
  max-width: 420px; margin: 0 auto 40px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 20px; background: var(--paper); box-shadow: var(--shadow);
  font-size: 14px; color: var(--ink-soft); letter-spacing: .06em;
  animation: rise .6s ease both;
}
.letter-hint-seal {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); flex: none;
}

.entry-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px;
  max-width: 880px; margin: 0 auto;
}
.entry-card {
  background: var(--paper); box-shadow: var(--shadow);
  padding: 26px 22px 24px; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .35s ease, box-shadow .35s ease;
}
.entry-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(27,58,92,.05), 0 16px 40px rgba(27,58,92,.1); }
.daily-music-list {
  display: flex; flex-direction: row; gap: 16px;
  max-width: 880px; margin: 0 auto;
}
.daily-music {
  flex: 1 1 0; min-width: 0;
  background: var(--paper); box-shadow: var(--shadow);
  padding: 22px 24px;
}
.daily-music-list:empty { display: none; }
.daily-music-empty {
  max-width: 880px; margin: 28px auto 0;
  text-align: center; font-size: 14px; color: var(--mist); letter-spacing: .05em;
}
@media (max-width: 640px) {
  .daily-music-list { flex-direction: column; }
  .daily-music { max-width: none; }
}
.daily-music-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.daily-music-label {
  font-family: var(--serif); font-size: 13px; letter-spacing: .2em; color: var(--gold);
}
.daily-music-link {
  font-size: 16px; color: var(--ink); letter-spacing: .05em;
  text-decoration: none; word-break: break-all;
}
.daily-music-link:hover { color: var(--ink-soft); }
.daily-music-note {
  font-size: 13px; color: var(--ink-soft); margin-top: 6px; font-style: italic;
}
.daily-music-by {
  font-size: 12px; color: var(--mist); letter-spacing: .05em;
}
.daily-music-actions {
  display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap;
}
.daily-music-history {
  max-width: 880px; margin: 28px auto 0;
  background: var(--paper); box-shadow: var(--shadow);
  padding: 22px 24px;
}
.daily-music-history-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.dm-history-controls { display: flex; align-items: center; gap: 10px; }
.dm-history-controls input {
  width: 150px; font-size: 13px; padding: 6px 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
}
.dm-history-controls input:focus { border-color: var(--ink); }
.daily-music-history-list { display: flex; flex-direction: column; gap: 16px; }
.daily-music-history-item {
  border-top: 1px solid var(--hairline); padding-top: 14px;
}
.daily-music-history-item:first-child { border-top: none; padding-top: 0; }
.dm-history-date {
  font-size: 12px; color: var(--mist); letter-spacing: .1em; margin-bottom: 4px;
}
.dm-history-title {
  font-size: 15px; color: var(--ink); letter-spacing: .05em;
  text-decoration: none; word-break: break-all;
}
.dm-history-title:hover { color: var(--ink-soft); }
.dm-history-note {
  font-size: 12px; color: var(--ink-soft); margin-top: 4px; font-style: italic;
}
.dm-history-empty {
  font-size: 13px; color: var(--mist); font-style: italic; margin: 0;
}
.entry-num {
  font-family: var(--serif); font-size: 13px; letter-spacing: .2em; color: var(--gold);
}
.entry-title { font-family: var(--serif); font-size: 19px; letter-spacing: .1em; color: var(--ink); }
.entry-desc { font-size: 12px; color: var(--mist); letter-spacing: .05em; }

/* ---------- 聊天 ---------- */
.chat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.chat-presence { font-size: 12px; letter-spacing: .14em; color: var(--mist); }
.chat-presence .on { color: var(--gold); }
.chat-list {
  height: calc(100vh - 320px); height: calc(100dvh - 320px);
  min-height: 300px;
  overflow-y: auto; padding: 8px 2px;
  display: flex; flex-direction: column; gap: 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.msg-day {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .2em; color: var(--mist);
  margin: 14px 0 2px;
}
.msg-day::before, .msg-day::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.msg-poke {
  text-align: center; font-size: 12px; color: var(--mist);
  letter-spacing: .08em; padding: 6px 0; margin: 4px 0;
  animation: fade .3s ease both;
}
  display: block; margin: 6px auto 10px; padding: 6px 18px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .15em;
  color: var(--mist); background: none; border: 1px solid var(--hairline); border-radius: 999px;
  cursor: pointer;
}
.load-more-btn:hover { color: var(--ink); border-color: var(--mist); }
.load-more-btn:disabled { opacity: .6; cursor: default; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-body { max-width: 68%; }
.msg-bubble {
  padding: 11px 16px; font-size: 15px; line-height: 1.7;
  word-break: break-word; white-space: pre-wrap;
}
.msg-row.mine .msg-bubble { background: var(--ink); color: var(--paper); }
.msg-row.theirs .msg-bubble { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.msg-time { font-size: 11px; color: var(--mist); margin-top: 5px; letter-spacing: .08em; }
.msg-row.mine .msg-time { text-align: right; }
.msg-read { font-size: 10px; color: var(--mist); margin-top: 2px; letter-spacing: .1em; }
.msg-row.mine .msg-read { text-align: right; }
.typing-hint { font-size: 12px; color: var(--mist); letter-spacing: .1em; padding: 6px 2px; }
.chat-bar { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.chat-bar textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 148px;
  overflow-y: auto;
  line-height: 1.7;
}
.chat-bar textarea:focus { border-bottom-color: var(--ink); }
.chat-bar textarea::placeholder { color: var(--mist); }

/* ---------- 聊天搜索 ---------- */
.chat-head-right { display: flex; align-items: center; gap: 14px; }
.search-toggle {
  font-size: 20px; color: var(--mist); line-height: 1; padding: 4px;
  transition: color .3s;
}
.search-toggle:hover { color: var(--ink); }
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.search-bar input { flex: 1; }
.search-results {
  max-height: 40vh; overflow-y: auto; margin-bottom: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--paper); box-shadow: var(--shadow);
}
.search-result {
  display: block; width: 100%; text-align: left;
  padding: 12px 18px; border-bottom: 1px solid var(--hairline);
  transition: background .2s;
}
.search-result:hover { background: rgba(194, 160, 107, .08); }
.search-result:active { background: rgba(194, 160, 107, .16); transition: background .1s; }
.search-result .sr-meta { font-size: 11px; color: var(--mist); letter-spacing: .1em; margin-bottom: 3px; }
.search-result .sr-text { font-size: 14px; color: var(--ink); line-height: 1.5; }
.search-result mark { background: rgba(194, 160, 107, .35); color: inherit; padding: 0 1px; }
.sr-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--mist); }

/* 日期日历 */
.date-calendar {
  max-width: 880px; margin: 10px auto 20px;
  background: var(--paper); box-shadow: var(--shadow);
  padding: 18px 22px;
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-header span { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
.cal-nav { font-size: 20px; padding: 4px 12px; color: var(--mist); }
.cal-nav:hover { color: var(--ink); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.cal-weekdays span { text-align: center; font-size: 12px; color: var(--mist); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  aspect-ratio: 1; border: 1px solid transparent;
  background: transparent; color: var(--ink); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.cal-day:hover { background: rgba(194, 160, 107, .12); }
.cal-day.today { border-color: var(--gold); }
.cal-day.has-msg { color: var(--ink); font-weight: 600; background: rgba(194, 160, 107, .15); }
.cal-day.has-msg:hover { background: rgba(194, 160, 107, .28); }
.date-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--mist); }
.back-to-latest {
  align-self: center; margin-bottom: 8px; font-size: 12px; letter-spacing: .1em;
  color: var(--gold); padding: 6px 14px; border: 1px solid var(--hairline);
  background: var(--paper);
}
.msg-row.flash .msg-bubble { animation: flashGold 2s ease; }
@keyframes flashGold {
  0%, 60% { box-shadow: 0 0 0 2px var(--gold); }
  100% { box-shadow: none; }
}

/* ---------- 引用 ---------- */
.quote-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: 13px; color: var(--ink-soft);
}
.quote-bar-line { width: 3px; height: 20px; background: var(--gold); flex: none; }
.quote-bar-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-cancel { color: var(--mist); font-size: 13px; padding: 4px; }
.quote-cancel:hover { color: var(--ink); }
.img-preview-thumb { height: 48px; max-width: 72px; object-fit: cover; border-radius: 2px; flex: none; }
.msg-quote {
  border-left: 3px solid var(--gold); padding: 4px 10px; margin-bottom: 6px;
  font-size: 12px; line-height: 1.5; cursor: pointer;
  opacity: .8; transition: opacity .2s;
}
.msg-quote:hover { opacity: 1; }
.msg-quote .q-who { letter-spacing: .1em; color: var(--gold); font-size: 11px; }
.msg-quote .q-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
}
.msg-row.mine .msg-quote .q-text { color: rgba(253, 250, 243, .85); }
body.dark .msg-row.mine .msg-quote .q-text { color: rgba(22, 41, 62, .85); }
.msg-row.theirs .msg-quote .q-text { color: var(--ink-soft); }
.quote-btn {
  position: absolute; top: -8px; font-size: 13px; line-height: 1;
  color: var(--mist); background: var(--paper); box-shadow: var(--shadow);
  padding: 4px 7px; opacity: 0; transition: opacity .2s; z-index: 2;
}
.msg-row.mine .quote-btn { left: -34px; }
.msg-row.theirs .quote-btn { right: -34px; }
.msg-row.mine .react-btn { left: -64px; }
.msg-row.theirs .react-btn { right: -64px; }
.msg-row:hover .quote-btn, .msg-row.show-quote .quote-btn { opacity: 1; }
.msg-body { position: relative; }

/* 表情回应 */
.msg-reactions { display: flex; gap: 4px; margin-top: 3px; }
.msg-row.mine .msg-reactions { justify-content: flex-end; }
.reaction-chip {
  font-size: 13px; line-height: 1; padding: 3px 8px;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px;
  box-shadow: var(--shadow); cursor: pointer;
}
.reaction-chip.mine { border-color: var(--gold, #c9a86a); background: color-mix(in srgb, var(--gold, #c9a86a) 14%, var(--paper)); }
.reaction-picker {
  position: absolute; top: -40px; z-index: 3;
  display: flex; gap: 2px; padding: 4px 6px;
  background: var(--paper); border-radius: 999px; box-shadow: var(--shadow);
}
.msg-row.mine .reaction-picker { right: 0; }
.msg-row.theirs .reaction-picker { left: 0; }
.reaction-picker button { font-size: 18px; padding: 2px 5px; background: none; border: none; cursor: pointer; }
.reaction-picker button:hover { transform: scale(1.2); }

/* ---------- 聊天图片 ---------- */
.chat-photo-btn {
  font-size: 22px; color: var(--mist); line-height: 1; padding: 4px 8px;
  transition: color .3s;
}
.chat-photo-btn:hover { color: var(--ink); }
#voice-btn svg { display: block; width: 24px; height: 24px; }
.attach-wrap { position: relative; }
.attach-popup {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 8px; background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.14); display: flex; flex-direction: column;
  gap: 2px; padding: 6px; min-width: 110px; z-index: 200;
}
.attach-item {
  display: block; width: 100%; padding: 10px 14px; border: none; border-radius: 8px;
  background: none; font-size: 14px; cursor: pointer; text-align: left;
  transition: background .2s; white-space: nowrap;
}
.attach-item:hover { background: var(--mist); }
@media (prefers-color-scheme: dark) {
  .attach-popup { background: #2a2a2c; box-shadow: 0 4px 24px rgba(0,0,0,.4); }
  .attach-item:hover { background: #3a3a3c; }
}
.msg-img {
  max-width: 240px; max-height: 320px; display: block; cursor: zoom-in;
  border-radius: 2px;
}
.msg-row.mine .msg-bubble:has(.msg-img) { background: none; padding: 0; box-shadow: none; }
.msg-row.theirs .msg-bubble:has(.msg-img) { background: none; padding: 0; box-shadow: none; }
.msg-row.mine .msg-bubble:has(.file-attachment) { background: none; padding: 0; box-shadow: none; }
.msg-row.theirs .msg-bubble:has(.file-attachment) { background: none; padding: 0; box-shadow: none; }
.msg-img { box-shadow: var(--shadow); }

/* ---------- 文件附件 ---------- */
.file-attachment {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.04); text-decoration: none;
  color: inherit; max-width: 260px;
}
body.dark .file-attachment { background: rgba(255,255,255,.06); }
.file-attachment:hover { background: rgba(0,0,0,.08); }
body.dark .file-attachment:hover { background: rgba(255,255,255,.1); }
.file-icon { font-size: 28px; flex: none; line-height: 1; }
.file-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-name {
  font-size: 13px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.file-size { font-size: 11px; color: var(--mist); }

/* ---------- 语音消息 ---------- */
.voice-player {
  display: flex; align-items: center; gap: 10px;
  min-width: 140px; max-width: 240px;
}
.voice-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  flex: none; cursor: pointer; position: relative;
  transition: background .3s;
}
.voice-play-btn:hover { background: var(--ink); }
.voice-play-btn.playing { background: var(--gold); }

/* 播放三角（CSS 三角形，不用 emoji，避免平台差异） */
.voice-play-btn::after {
  content: "";
  display: block;
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
.voice-play-btn.playing::after {
  width: 3px; height: 14px;
  border: none; border-radius: 1px;
  background: #fff;
  box-shadow: 6px 0 0 #fff;
  margin-left: -3px;
}

.voice-wave {
  flex: 1; height: 32px;
  display: flex; align-items: center; gap: 2px;
}
.voice-wave-bar {
  flex: 1; min-width: 2px; border-radius: 2px;
  background: var(--ink-soft); opacity: .5;
  animation: voiceWave 1.2s ease-in-out infinite paused;
}
.voice-wave.playing .voice-wave-bar { animation-play-state: running; }
.voice-wave-bar:nth-child(odd) { animation-delay: 0s; }
.voice-wave-bar:nth-child(even) { animation-delay: .15s; }

@keyframes voiceWave {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

.voice-duration { font-size: 11px; color: var(--mist); letter-spacing: .06em; flex: none; }

/* 自己发的语音：浅色控件 */
.msg-row.mine .voice-play-btn { background: var(--paper); }
.msg-row.mine .voice-play-btn::after { border-color: transparent transparent transparent var(--ink); }
.msg-row.mine .voice-play-btn.playing::after { background: var(--ink); box-shadow: 6px 0 0 var(--ink); }
.msg-row.mine .voice-play-btn:hover { background: rgba(253, 250, 243, .8); }
.msg-row.mine .voice-play-btn.playing { background: var(--gold); }
.msg-row.mine .voice-play-btn.playing::after { background: #fff; box-shadow: 6px 0 0 #fff; }
.msg-row.mine .voice-wave-bar { background: var(--paper); }
.msg-row.mine .voice-duration { color: rgba(253, 250, 243, .7); }

/* 语音气泡保留背景 */
.msg-row.mine .msg-bubble:has(.voice-player) { background: var(--ink); padding: 11px 16px; }
.msg-row.theirs .msg-bubble:has(.voice-player) { background: var(--paper); padding: 11px 16px; }

/* 录音指示条 */
.voice-recording {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; margin-bottom: 6px;
  background: var(--paper); border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-size: 13px; color: var(--ink-soft); letter-spacing: .06em;
  animation: fade .3s ease both;
}
.voice-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #E05A5A; flex: none;
  animation: pulse 1s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.75); }
}
.voice-hint { font-size: 11px; color: var(--mist); margin-left: auto; }
.voice-timer { font-variant-numeric: tabular-nums; }
.voice-send-btn, .voice-cancel-btn { padding: 6px 14px; font-size: 13px; }
.voice-cancel-btn { color: #E05A5A; border-color: #E05A5A; }

.wall-row {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-soft);
}
.wall-row .dot-gold { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.wall-act {
  font-size: 12px; color: var(--gold); border-bottom: 1px solid var(--gold);
  padding: 1px 2px; letter-spacing: .08em;
}
.wall-act.dim { color: var(--mist); border-bottom-color: var(--mist); }
.wall-done { font-size: 11px; color: var(--mist); letter-spacing: .08em; margin-top: 6px; }
.lightbox.view-only .lightbox-actions { display: none; }
.lightbox.view-only .lightbox-comments { display: none; }

/* 照片评论 */
.lightbox-comments {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 20px 14px; max-height: 32vh;
  background: linear-gradient(transparent, rgba(18, 32, 48, .85) 24%);
}
.comment-list {
  overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.comment-item { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: rgba(253,250,243,.9); }
.comment-who { font-size: 12px; color: rgba(253,250,243,.55); flex-shrink: 0; letter-spacing: .1em; }
.comment-text { word-break: break-word; }
.comment-del { margin-left: auto; color: rgba(253,250,243,.4); font-size: 12px; flex-shrink: 0; }
.comment-del:hover { color: #E8B4BC; }
.comment-input-row { display: flex; gap: 10px; }
#comment-input {
  flex: 1; background: rgba(253,250,243,.12); border: none; border-radius: 999px;
  padding: 8px 16px; color: #FDFAF3; font-size: 14px; outline: none;
}
#comment-input::placeholder { color: rgba(253,250,243,.4); }
.comment-send { color: rgba(253,250,243,.75); font-size: 14px; letter-spacing: .1em; padding: 0 6px; }
.comment-send:hover { color: #fff; }
@media (max-width: 768px) {
  .lightbox-comments { padding: 10px 14px 12px; max-height: 38vh; }
}

/* 年度回顾海报 */
.panel-head-btns { display: flex; gap: 10px; }
.poster-paper { max-width: 420px; }
.poster-img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); display: block; }
.poster-download { display: inline-block; text-decoration: none; }

/* ---------- 时光信 ---------- */
.letter-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.envelope {
  background: var(--paper); box-shadow: var(--shadow);
  padding: 26px 24px; position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .35s ease, box-shadow .2s ease;
  width: 100%;
}
.envelope:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27,58,92,.15); }
.envelope:active { transform: translateY(-1px); transition: transform .1s ease; }
.envelope-seal {
  position: absolute; top: 22px; right: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); opacity: .85;
}
.envelope.opened .envelope-seal { background: transparent; border: 1px solid var(--hairline); }
.envelope-title { font-family: var(--serif); font-size: 19px; letter-spacing: .08em; color: var(--ink); padding-right: 30px; }
.envelope-meta { font-size: 12px; color: var(--mist); letter-spacing: .1em; }
.envelope-status { font-size: 13px; letter-spacing: .08em; }
.envelope-status.locked { color: var(--mist); }
.envelope-status.ready { color: var(--gold); }
.empty-hint {
  text-align: center; color: var(--mist); font-size: 14px; padding: 48px 0;
  letter-spacing: .1em; grid-column: 1 / -1;
}

/* ---------- 纪念日 ---------- */
.anni-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.anni-card {
  background: var(--paper); box-shadow: var(--shadow);
  padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.anni-name { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; }
.anni-date { font-size: 12px; color: var(--mist); margin-top: 4px; letter-spacing: .1em; }
.anni-count { text-align: right; flex: none; }
.anni-count .num { font-family: var(--serif); font-size: 30px; color: var(--ink); line-height: 1.1; }
.anni-count .label { font-size: 11px; color: var(--mist); letter-spacing: .12em; }
.anni-del { color: var(--mist); font-size: 13px; padding: 6px; align-self: flex-start; }
.anni-del:hover { color: #A4606C; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 28px; margin-top: 10px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--hairline);
}
.tl-item { position: relative; padding: 0 0 30px 8px; animation: fade .5s ease both; }
.tl-item::before {
  content: ""; position: absolute; left: -27px; top: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
}
.tl-item.major::before { width: 11px; height: 11px; left: -29px; top: 7px; background: var(--ink); }
.tl-date { font-size: 12px; letter-spacing: .16em; color: var(--mist); }
.tl-text { font-family: var(--serif); font-size: 17px; letter-spacing: .05em; color: var(--ink); margin-top: 3px; }
.tl-note { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.tl-del { color: var(--mist); font-size: 12px; margin-left: 10px; }
.tl-del:hover { color: #A4606C; }

/* ---------- 照片 ---------- */
.photo-grid { columns: 3 220px; column-gap: 16px; }
.photo-item {
  break-inside: avoid; margin-bottom: 16px; background: var(--paper);
  padding: 8px 8px 10px; box-shadow: var(--shadow); cursor: zoom-in;
  transition: transform .35s ease;
}
.photo-item:hover { transform: translateY(-3px); }
.photo-item:active { transform: translateY(-1px) scale(.99); transition: transform .1s ease; }
.photo-item img { width: 100%; display: block; }
.photo-fallback {
  width: 100%; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 34px; opacity: 0.28;
}
.photo-cap { font-size: 12px; color: var(--mist); padding: 8px 4px 0; letter-spacing: .05em; }

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 15px; letter-spacing: 0;
  overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 84px; height: 84px; font-size: 32px; }
.avatar.hero-av { width: 40px; height: 40px; font-size: 17px; box-shadow: var(--shadow); }

.msg-row .avatar { align-self: flex-end; margin-bottom: 2px; }
.msg-row.mine .avatar { margin-left: 10px; order: 2; }
.msg-row.theirs .avatar { margin-right: 10px; }
.hero-names { display: flex; align-items: center; justify-content: center; gap: 16px; }

/* ---------- 我的 ---------- */
.me-card {
  display: flex; gap: 36px; align-items: flex-start;
  background: var(--paper); box-shadow: var(--shadow); padding: 32px;
}
.me-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.me-fields { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.me-row { display: flex; align-items: center; gap: 12px; }
.me-row input { flex: 1; }
.me-hint { font-size: 12px; color: var(--gold); min-height: 18px; letter-spacing: .06em; }
.partner-card {
  display: flex; gap: 20px; align-items: center;
  background: var(--paper); box-shadow: var(--shadow); padding: 24px 32px;
}
.partner-name { font-family: var(--serif); font-size: 20px; letter-spacing: .08em; }
.partner-sub { font-size: 12px; color: var(--mist); letter-spacing: .1em; margin-top: 4px; }

/* ---------- 心愿单 ---------- */
.wish-input-row { display: flex; gap: 14px; align-items: center; margin-bottom: 30px; }
.wish-input-row input { flex: 1; }
.wish-list { display: flex; flex-direction: column; }
.wish-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 2px; border-bottom: 1px solid var(--hairline);
  animation: fade .4s ease both;
}
.wish-check {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1px solid var(--mist); transition: all .3s;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--paper);
}
.wish-check:active { transform: scale(.9); transition: transform .1s; }
.wish-item.done .wish-check { background: var(--ink); border-color: var(--ink); }
.wish-text { flex: 1; font-size: 15px; letter-spacing: .03em; transition: color .3s; word-break: break-word; overflow-wrap: anywhere; }
.wish-item.done .wish-text { color: var(--mist); text-decoration: line-through; text-decoration-color: var(--hairline); }
.wish-meta { font-size: 11px; color: var(--mist); letter-spacing: .1em; flex: none; }
.wish-del { color: var(--mist); font-size: 13px; padding: 4px; }
.wish-del:hover { color: #A4606C; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(27, 58, 92, 0.28);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .3s ease both;
}
.modal-paper {
  background: var(--paper); width: 400px; max-width: 100%;
  padding: 36px 34px; box-shadow: 0 24px 64px rgba(27, 58, 92, 0.2);
  display: flex; flex-direction: column; gap: 16px;
  animation: rise .4s ease both;
  max-height: 88vh; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-title { font-family: var(--serif); font-size: 22px; letter-spacing: .1em; font-weight: 600; }
.field-label { font-size: 12px; letter-spacing: .14em; color: var(--mist); margin-bottom: -10px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.check-row input { accent-color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 8px; }
.photo-preview { max-height: 220px; object-fit: contain; border: 1px solid var(--hairline); }

/* 读信 */
.read-paper { width: 460px; padding: 44px 42px; }
.read-from { font-size: 12px; letter-spacing: .2em; color: var(--gold); }
.read-title { font-family: var(--serif); font-size: 24px; letter-spacing: .08em; font-weight: 600; }
.read-rule { width: 34px; height: 1px; background: var(--gold); }
.read-body { font-size: 15px; line-height: 2; color: var(--ink-soft); white-space: pre-wrap; }
.read-date { font-size: 12px; color: var(--mist); letter-spacing: .14em; text-align: right; }

/* ---------- 大图 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(18, 32, 48, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  animation: fade .3s ease both;
}
.lightbox img { max-width: 90vw; max-height: 78vh; animation: rise .4s ease both; }
.lightbox-caption { color: rgba(253, 250, 243, .8); font-size: 14px; letter-spacing: .08em; }
.lightbox-close { position: absolute; top: 22px; right: 26px; color: rgba(253,250,243,.7); font-size: 22px; }
.lightbox-close:hover { color: #fff; }
.lightbox-actions { position: absolute; bottom: 26px; right: 26px; display: flex; gap: 20px; align-items: center; }
/* 有评论区时（照片墙大图），编辑/删除挪到左上，避免与评论重叠 */
.lightbox:not(.view-only) .lightbox-actions { bottom: auto; top: 22px; left: 26px; right: auto; }
.lightbox-action {
  color: rgba(253,250,243,.6); font-size: 13px; letter-spacing: .1em;
  border-bottom: 1px solid transparent; transition: all .3s;
}
.lightbox-action:hover { color: #fff; border-bottom-color: #fff; }
.lightbox-delete {
  color: rgba(253,250,243,.6); font-size: 13px; letter-spacing: .1em;
  border-bottom: 1px solid transparent; transition: all .3s;
}
.lightbox-delete:hover { color: #E8B4BC; border-bottom-color: #E8B4BC; }

/* ---------- 底部导航（移动端） ---------- */
.bottombar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--paper); border-top: 1px solid var(--hairline);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.bnav-item {
  flex: 1; font-size: 12px; letter-spacing: .1em; color: var(--mist);
  padding: 4px 0; transition: color .3s, opacity .15s;
}
.bnav-item:active { opacity: .6; transition: opacity .1s; }
.bnav-item.active { color: var(--ink); }

/* ---------- 戳一下 ---------- */
.poke-btn {
  margin-top: 14px; font-size: 12px; letter-spacing: .16em; color: var(--mist);
  border-bottom: 1px solid transparent; padding: 4px 2px; transition: all .3s;
}
.poke-btn:hover { color: var(--gold); border-bottom-color: var(--gold); }
.poke-btn:active { transform: scale(.94); transition: transform .1s; }
.poke-btn:disabled { color: var(--gold); opacity: .7; }
.poke-toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  z-index: 50; background: var(--paper); box-shadow: var(--shadow);
  padding: 12px 28px; font-family: var(--serif); font-size: 15px; letter-spacing: .1em;
  color: var(--ink); animation: pokeIn .5s ease both;
}
@keyframes pokeIn {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}
.poke-toast.bye { animation: pokeOut .5s ease both; }
@keyframes pokeOut {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}
.hero-names.wiggle { animation: wiggle .6s ease; }
@keyframes wiggle {
  0%, 100% { transform: none; }
  25% { transform: rotate(-1.2deg) scale(1.02); }
  75% { transform: rotate(1.2deg) scale(1.02); }
}

/* ---------- 每周回顾 ---------- */
.digest-card {
  margin-top: 28px; background: var(--paper); box-shadow: var(--shadow);
  padding: 28px 32px; text-align: center;
}
.digest-eyebrow { font-size: 11px; letter-spacing: .4em; color: var(--gold); margin-bottom: 14px; }
.digest-content {
  font-family: var(--serif); font-size: 16px; line-height: 2; letter-spacing: .05em;
  color: var(--ink-soft); max-width: 560px; margin: 0 auto 10px; white-space: pre-wrap;
}

/* ---------- 信件照片 ---------- */
.letter-photo-row { display: flex; align-items: center; gap: 12px; }
.letter-photo-preview { max-height: 72px; border: 1px solid var(--hairline); }
.read-photo { max-width: 100%; border: 1px solid var(--hairline); }
.envelope-has-photo { font-size: 11px; color: var(--gold); letter-spacing: .1em; }

/* ---------- 相框入口 ---------- */
.frame-link-wrap { text-align: center; margin-top: 36px; }
.frame-link {
  font-size: 12px; letter-spacing: .16em; color: var(--mist); text-decoration: none;
  border-bottom: 1px solid transparent; transition: all .3s;
}
.frame-link:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 动效 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--hairline); }

/* ---------- 响应式 ---------- */
/* Pad（761–1024px）：桌面框架，内容放宽 */
@media (max-width: 1024px) and (min-width: 761px) {
  .page { padding: 32px 24px 72px; }
  .me-card { padding: 26px; gap: 28px; }
  .topnav { gap: 18px; }
}

/* 手机 */
@media (max-width: 760px) {
  .topnav { display: none; }
  .bottombar { display: flex; }
  .topbar { padding: 14px 18px 12px; }
  .page { padding: 24px 16px 110px; }
  /* 序章页额外底部留白，避免最后一张卡片被 bottombar 遮挡 */
  #tab-home .page { padding-bottom: 130px; }
  .entry-grid { gap: 12px; }
  .entry-card { padding: 18px 16px 16px; }
  .hero { padding: 32px 0 28px; }
  .hero-eyebrow { margin-top: 30px; }
  #days-num { font-size: 84px; }
  .chat-list { height: calc(100vh - 290px); height: calc(100dvh - 290px); }
  .msg-body { max-width: 82%; }
  .msg-img { max-width: 200px; }
  .photo-grid { columns: 2 150px; column-gap: 12px; }
  .bnav-item { font-size: 11px; letter-spacing: .04em; }
  .voice-play-btn, #voice-btn { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
  /* 我的页：头像与表单上下排，输入不溢出 */
  .me-card { flex-direction: column; align-items: center; padding: 26px 20px; gap: 20px; }
  .me-fields { width: 100%; }
  .me-row { flex-wrap: nowrap; }
  .me-row .btn-text { flex: none; padding: 8px 6px; }
  .partner-card { padding: 20px; gap: 16px; }
  /* 弹窗占满宽度 */
  .modal { padding: 16px; align-items: flex-end; }
  .modal-paper { width: 100%; padding: 26px 22px; border-radius: 0; }
  .read-paper { width: 100%; padding: 32px 26px; }
  /* 信封卡片标题不被火漆点挡住 */
  .envelope { padding: 20px; }
  /* 回顾卡片 */
  .digest-card { padding: 22px 20px; }
}

/* 超小屏（≤360px） */
@media (max-width: 360px) {
  #days-num { font-size: 72px; }
  .entry-grid { grid-template-columns: 1fr 1fr; }
  .entry-title { font-size: 16px; }
  .bnav-item { font-size: 10px; }
}

/* ---------- 地图打卡 ---------- */
.map-box {
  height: min(58vh, 520px);
  min-height: 320px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--paper);
}
/* 高德容器里字体会被默认样式带跑，收一收 */
.map-box .amap-container { font-family: var(--sans); }

.map-pin { position: relative; cursor: pointer; filter: drop-shadow(0 2px 4px rgba(27,58,92,.3)); }
.map-pin-icon { font-size: 26px; line-height: 1; display: block; }
.map-pin-count {
  position: absolute; top: -7px; right: -10px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--gold); color: var(--ivory);
  font-size: 11px; line-height: 17px; text-align: center;
  border-radius: 999px; font-family: var(--sans);
}

/* 图钉点开的地方卡片（高德自定义 InfoWindow） */
.place-card {
  width: 250px; max-height: 300px; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
  font-family: var(--sans);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pc-name { font-weight: 600; font-size: 15px; }
.pc-count { font-size: 11px; color: var(--gold); white-space: nowrap; letter-spacing: .06em; }
.pc-visit { padding: 8px 0; border-top: 1px dashed var(--hairline); }
.pc-visit:first-child { border-top: none; padding-top: 0; }
.pc-date { font-size: 12px; color: var(--mist); display: flex; justify-content: space-between; align-items: center; }
.pc-del { background: none; border: none; color: var(--mist); cursor: pointer; font-size: 12px; padding: 0 2px; }
.pc-del:hover { color: #B3573F; }
.pc-note { font-size: 13px; margin-top: 3px; line-height: 1.6; }
.pc-photo { max-width: 100%; max-height: 120px; margin-top: 6px; border-radius: var(--radius-sm); cursor: zoom-in; display: block; }

/* 实时位置头像标记 */
.loc-marker { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.loc-marker .avatar { width: 34px; height: 34px; border: 2px solid var(--paper); box-shadow: var(--shadow); }
.loc-label {
  font-size: 10px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 1px 7px; white-space: nowrap; opacity: .92;
}
.loc-stale { opacity: .45; }

/* POI 搜索结果 */
.poi-results { border: 1px solid var(--hairline); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; }
.poi-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 9px 12px; background: none; border: none; text-align: left;
  cursor: pointer; border-top: 1px solid var(--hairline);
}
.poi-item:first-child { border-top: none; }
.poi-item:hover { background: var(--ivory); }
.poi-name { font-size: 14px; color: var(--ink); }
.poi-addr { font-size: 11px; color: var(--mist); }
.poi-empty { padding: 10px 12px; font-size: 12px; color: var(--mist); }

/* 位置共享开关行 */
.loc-share-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.loc-share-label { font-size: 13px; }
.loc-share-hint { margin-top: 6px; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--hairline); border-radius: 999px; transition: .25s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: var(--paper);
  border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--ink-soft); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .4; cursor: not-allowed; }

/* 补标模式：贴底卡片，不遮地图（可以直接点地图选点） */
.modal.checkin-sheet {
  background: none;
  pointer-events: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
}
.modal.checkin-sheet .modal-paper {
  pointer-events: auto;
  width: 380px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 22px 20px;
}
.map-pin-draft { animation: pulse 1.6s ease infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@media (max-width: 640px) {
  .modal.checkin-sheet { justify-content: center; }
  .modal.checkin-sheet .modal-paper { width: 100%; }
}

/* 打卡卡片里的操作按钮 */
.pc-actions { display: inline-flex; gap: 2px; }
.pc-edit { background: none; border: none; color: var(--mist); cursor: pointer; font-size: 12px; padding: 0 2px; }
.pc-edit:hover { color: var(--ink-soft); }

/* ---------- 两人距离 + 见面啦 ---------- */
.map-wrap { position: relative; }
.distance-badge {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 200; padding: 6px 16px;
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: 999px; box-shadow: var(--shadow);
  font-size: 13px; letter-spacing: .08em; color: var(--ink);
  white-space: nowrap;
}
.distance-badge.meet { background: var(--gold); color: var(--ivory); border-color: var(--gold); }
.hero-distance { font-size: 13px; color: var(--gold); letter-spacing: .12em; margin-top: 4px; min-height: 18px; }

.meet-overlay {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(194, 160, 107, 0.22), transparent 62%);
  animation: meetFade 3.8s ease both;
}
.meet-text {
  font-family: var(--serif); font-size: 46px; font-weight: 600;
  letter-spacing: .3em; color: var(--gold); text-indent: .3em;
  animation: meetPop .8s cubic-bezier(.2, 1.4, .4, 1) both;
}
.meet-heart { position: absolute; bottom: -6%; opacity: 0; animation: meetRise linear both; }
@keyframes meetRise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-108vh) scale(1.1); opacity: 0; }
}
@keyframes meetPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes meetFade { 0% { opacity: 0; } 8% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- 记一笔联动（照片 / 位置 / 心愿） ---------- */
.milestone-paper { max-height: 86vh; overflow-y: auto; }
.ms-extra { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ms-extra > .btn-text { padding-left: 0; }
.ms-picker { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ms-loc-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--paper); font-size: 13px; letter-spacing: .04em;
}
.ms-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-photo-wrap { position: relative; display: inline-flex; align-items: flex-start; }
.ms-photo-wrap .tl-del { position: static; margin-left: 6px; }

/* 时间线上的联动件 */
.tl-photo {
  max-height: 140px; max-width: 220px; margin-top: 8px;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  cursor: zoom-in; display: block;
}
.tl-place {
  margin-top: 8px; padding: 3px 12px; font-size: 12px; letter-spacing: .06em;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: none; color: var(--ink-soft); cursor: pointer;
}
.tl-place:hover { color: var(--gold); border-color: var(--gold); }
.tl-wish { margin-top: 8px; font-size: 12.5px; color: var(--gold); letter-spacing: .06em; }
.wish-meta-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.wish-meta-link:hover { color: var(--gold); }

/* ---------- 记一笔多照片 ---------- */
.ms-photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-thumb { position: relative; display: inline-block; }
.ms-thumb img {
  width: 72px; height: 72px; object-fit: cover;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm); display: block;
}
.ms-thumb .tl-del { position: absolute; top: -6px; right: -6px; background: var(--paper); border: 1px solid var(--hairline); border-radius: 50%; }

/* 时间线上一个事件的照片条 */
.tl-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tl-photos img {
  height: 96px; max-width: 160px; object-fit: cover;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  cursor: zoom-in; display: block;
}

/* ---------- 事件详情弹窗 ---------- */
.tl-item.tl-clickable { cursor: pointer; }
.tl-item.tl-clickable:hover .tl-text { color: var(--gold); }
.event-paper { max-height: 86vh; overflow-y: auto; }
.ev-date { font-size: 12px; color: var(--mist, #9aa7b5); letter-spacing: .14em; }
.ev-body { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ev-line { font-size: 14px; color: var(--ink-soft); white-space: pre-wrap; }
.ev-photo-large {
  max-width: 100%; max-height: 40vh; object-fit: contain;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm); cursor: zoom-in;
}

/* 事件详情：心愿原文 / 信件正文 */
.ev-wish-text { font-family: var(--serif); font-size: 17px; color: var(--ink); letter-spacing: .04em; }
.ev-letter-content { max-height: 40vh; overflow-y: auto; line-height: 1.9; }
