:root {
  --bg: #F7F1E8;
  --bg-2: #F1E8DA;
  --surface: #FFFCF7;
  --surface-2: #FBF4EA;
  --ink: #4A3B30;
  --ink-soft: #93836F;
  --ink-faint: #BAA88F;
  --line: #E8DBCA;
  --accent: #D2703F;
  --accent-2: #E4916A;
  --rose: #DC8B83;
  --sage: #8CA27E;
  --gold: #CEA441;
  --shadow: 0 2px 8px rgba(112, 84, 54, .05), 0 12px 32px rgba(112, 84, 54, .07);
  --radius: 20px;
  --serif: Georgia, "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(226, 168, 140, .20), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(190, 200, 165, .20), transparent 40%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .01em; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea { font-family: inherit; font-size: inherit; }

.screen { min-height: 100vh; }
.screen-center { display: flex; align-items: center; justify-content: center; padding: 24px; }
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 34px 28px 28px;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-heart { font-size: 34px; display: block; margin-bottom: 6px; }
.auth-brand h1 { font-family: var(--serif); font-size: 26px; }
.auth-brand p { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 4px;
  border-radius: 11px;
  font-size: 13px;
  transition: .2s;
}
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(112,84,54,.10); }

.pane { display: none; flex-direction: column; gap: 14px; }
.pane.is-active { display: flex; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--ink-soft); padding-left: 4px; }
.field input {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 13px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
  transition: .18s;
  width: 100%;
}
.field input:focus { border-color: var(--accent-2); background: var(--surface); box-shadow: 0 0 0 3px rgba(226,145,106,.14); }

.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 18px;
  background: var(--accent);
  color: #FFF8F0;
  font-size: 14px;
  transition: .18s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { box-shadow: 0 6px 18px rgba(210,112,63,.24); }
.btn-small { padding: 7px 14px; font-size: 13px; border-radius: 11px; }
.btn-quiet { background: var(--bg-2); color: var(--ink-soft); }
.btn-quiet:hover { background: #EADFCB; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.btn-link {
  background: none; border: 0; color: var(--ink-soft);
  font-size: 12.5px; text-align: center; padding: 2px; text-decoration: underline;
  text-underline-offset: 3px;
}
.hint { font-size: 12px; color: var(--ink-faint); text-align: center; line-height: 1.5; }
.auth-msg {
  font-size: 13px; padding: 10px 12px; border-radius: 11px; margin-bottom: 4px;
  background: #FBE3DC; color: #A2472C;
}
.auth-msg.is-ok { background: #E6EFE0; color: #4E6B40; }

/* ---------- 等待加入 ---------- */
.wait-card {
  max-width: 380px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 38px 28px 26px; display: flex; flex-direction: column; gap: 12px;
}
.wait-icon { font-size: 40px; }
.wait-card h2 { font-family: var(--serif); font-size: 21px; }
.wait-card p { color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.wait-email { font-size: 12.5px; color: var(--ink-faint); word-break: break-all; }
.wait-uid-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 10px 8px 12px;
}
.wait-uid-box code {
  flex: 1; min-width: 0; font-size: 12px; color: var(--ink-soft);
  word-break: break-all; user-select: all;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 241, 232, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 219, 202, .6);
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
}
.brand { font-family: var(--serif); font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people { display: flex; align-items: center; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--surface); font-size: 15px;
  margin-left: -8px; box-shadow: 0 1px 4px rgba(112,84,54,.14);
}
.avatar:first-child { margin-left: 0; }
.avatar.is-me { border-color: var(--accent-2); }
.icon-btn {
  border: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 50%; width: 34px; height: 34px; font-size: 15px; line-height: 1;
  display: grid; place-items: center; transition: .18s;
}
.icon-btn:hover { background: var(--surface-2); }

.content { padding: 18px 18px 108px; display: flex; flex-direction: column; gap: 16px; }
/* 每个页签自己定宽度：首页大屏要占满，其它页维持窄栏 */
.view { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 720px; margin: 0 auto; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.empty-hint { color: var(--ink-faint); font-size: 13.5px; line-height: 1.7; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 30px 20px 26px;
  background: linear-gradient(160deg, #FFFDF9, #FBEEDF);
  border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
}
.hero-eyebrow { color: var(--ink-soft); font-size: 13.5px; letter-spacing: .06em; }
.hero-days { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 2px 0 0; }
.hero-num { font-family: var(--serif); font-size: 62px; line-height: 1.05; color: var(--accent); letter-spacing: -.02em; }
.hero-unit { font-size: 17px; color: var(--ink-soft); }
.hero-caption { color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; }

/* ---------- 倒计时卡片 ---------- */
.next-day { flex-direction: row; align-items: center; gap: 14px; }
.nd-left { flex: 0 0 auto; }
.nd-emoji { font-size: 28px; }
.nd-right { flex: 1; min-width: 0; }
.nd-label { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .05em; }
.nd-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-count { font-family: var(--serif); font-size: 20px; color: var(--accent); flex: 0 0 auto; }

/* ---------- AI ---------- */
.ai-out {
  background: var(--surface-2); border-radius: 14px; padding: 14px 16px;
  font-family: var(--serif); font-size: 14.5px; line-height: 1.85; color: var(--ink);
  white-space: pre-wrap; min-height: 72px;
}

/* ---------- 悄悄话 ---------- */
.note-form { display: flex; flex-direction: column; gap: 10px; }
.note-form textarea {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px;
  padding: 11px 13px; color: var(--ink); outline: none; resize: vertical; font-family: inherit;
}
.note-form textarea:focus { border-color: var(--accent-2); background: var(--surface); }
.note-list { display: flex; flex-direction: column; gap: 9px; }
.note-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border-radius: 14px; padding: 11px 13px;
}
.note-item .ni-emoji { font-size: 17px; line-height: 1.4; }
.note-item .ni-body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.note-item .ni-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.note-del { border: 0; background: none; color: var(--ink-faint); font-size: 15px; padding: 0 2px; }

.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-opt {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 11px; width: 34px; height: 34px; font-size: 16px; line-height: 1;
  display: grid; place-items: center; transition: .16s;
}
.emoji-opt.is-active { border-color: var(--accent-2); background: #FBEEE4; }

/* ---------- 头像：本地图片上传 ---------- */
.avatar-picker { display: flex; align-items: center; gap: 12px; }
.avatar-preview {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  display: grid; place-items: center; font-size: 26px; line-height: 1;
  background: var(--surface-2); border: 1px solid var(--line);
}
.avatar-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-hint { font-size: 11.5px; color: var(--ink-faint); margin: 7px 0 0; }
.avatar.is-img, .moment-avatar.is-img, .avatar-preview.is-img { padding: 0; }
.avatar img, .moment-avatar img, .avatar-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}

/* ---------- 时光轴 ---------- */
.composer textarea {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px;
  padding: 12px 14px; color: var(--ink); outline: none; resize: vertical; font-family: inherit; line-height: 1.7;
}
.composer textarea:focus { border-color: var(--accent-2); background: var(--surface); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; transition: .16s;
}
.chip.is-active { border-color: var(--accent-2); background: #FBEEE4; color: var(--accent); }
.composer-row { display: flex; gap: 8px; }
.composer-row.between { justify-content: space-between; align-items: center; }
.composer-row input[type=text] {
  flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 13px; color: var(--ink); outline: none; min-width: 0;
}
.composer-row input[type=text]:focus { border-color: var(--accent-2); background: var(--surface); }
.date-input {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 12px; color: var(--ink); outline: none; font-size: 13px;
}
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pv {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.pv img, .pv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-rm {
  position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%;
  width: 20px; height: 20px; background: rgba(40,30,20,.55); color: #fff; font-size: 11px; line-height: 1;
}
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.form-actions.space-between { justify-content: space-between; }
.file-btn { display: inline-flex; align-items: center; }
.upload-progress { font-size: 12.5px; color: var(--ink-soft); text-align: right; }

.month-label {
  font-size: 12.5px; color: var(--ink-faint); letter-spacing: .1em;
  padding: 6px 6px 0; font-family: var(--serif);
}
.moment {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 17px 18px; display: flex; flex-direction: column; gap: 10px;
}
.moment-head { display: flex; align-items: center; gap: 9px; }
.moment-avatar {
  font-size: 19px; line-height: 1; width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
}
.moment-who { font-size: 13px; font-weight: 600; }
.moment-when { font-size: 12px; color: var(--ink-faint); margin-left: auto; }
.moment-del { border: 0; background: none; color: var(--ink-faint); font-size: 14px; padding: 0 2px; }
.moment-body { font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.moment-tags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); }
.moment-tags span { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.moment-media { display: grid; gap: 6px; border-radius: 14px; overflow: hidden; }
.moment-media.cols-1 { grid-template-columns: 1fr; }
.moment-media.cols-2 { grid-template-columns: 1fr 1fr; }
.moment-media.cols-3 { grid-template-columns: repeat(3, 1fr); }
.moment-media .mm {
  position: relative; background: var(--bg-2); aspect-ratio: 1; cursor: zoom-in; overflow: hidden;
}
.moment-media.cols-1 .mm { aspect-ratio: 4/3; }
.moment-media .mm img, .moment-media .mm video { width: 100%; height: 100%; object-fit: cover; display: block; }
.moment-media .mm.is-loading::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #EFE5D6 30%, #F8F1E6 50%, #EFE5D6 70%);
  background-size: 220% 100%; animation: shim 1.2s infinite linear;
}
@keyframes shim { to { background-position: -220% 0; } }

/* ---------- 心愿 ---------- */
.progress { height: 7px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .45s ease; }
.pill { font-size: 12.5px; color: var(--ink-soft); background: var(--bg-2); border-radius: 999px; padding: 3px 11px; }
.inline-form { display: flex; gap: 8px; }
.inline-form.vertical { flex-direction: column; gap: 10px; }
.inline-form input[type=text] {
  flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 13px; color: var(--ink); outline: none; min-width: 0;
}
.inline-form input[type=text]:focus { border-color: var(--accent-2); background: var(--surface); }
.wish-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 4px rgba(112,84,54,.05);
  padding: 13px 15px; display: flex; align-items: center; gap: 12px; transition: .25s;
}
.wish-item.is-done { background: var(--surface-2); opacity: .72; }
.wish-check {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1.6px solid var(--ink-faint); background: transparent; color: transparent;
  display: grid; place-items: center; font-size: 12px; transition: .2s;
}
.wish-item.is-done .wish-check { background: var(--sage); border-color: var(--sage); color: #fff; }
.wish-body { flex: 1; min-width: 0; }
.wish-title { font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.wish-item.is-done .wish-title { text-decoration: line-through; color: var(--ink-soft); }
.wish-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 1px; word-break: break-word; }
.wish-del { border: 0; background: none; color: var(--ink-faint); font-size: 15px; padding: 0 2px; }

/* ---------- 纪念日 ---------- */
.day-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 4px rgba(112,84,54,.05);
  padding: 15px 17px; display: flex; align-items: center; gap: 13px;
}
.day-emoji { font-size: 24px; flex: 0 0 auto; }
.day-body { flex: 1; min-width: 0; }
.day-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-meta { font-size: 12.5px; color: var(--ink-faint); }
.day-count { font-family: var(--serif); font-size: 22px; color: var(--accent); flex: 0 0 auto; text-align: right; }
.day-count small { display: block; font-family: inherit; font-size: 11px; color: var(--ink-faint); letter-spacing: .05em; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 2px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 252, 247, .9); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  max-width: 720px; margin: 0 auto; border-radius: 22px 22px 0 0;
}
.tabbar-item {
  flex: 1; border: 0; background: none; color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px; font-size: 11px; border-radius: 14px; transition: .18s;
}
.tabbar-item span { font-size: 18px; line-height: 1.2; filter: grayscale(.5); transition: .18s; }
.tabbar-item.is-active { color: var(--accent); }
.tabbar-item.is-active span { filter: none; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(58, 44, 32, .38); backdrop-filter: blur(3px); }
.modal-body {
  position: relative; width: 100%; max-width: 400px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 13px;
}
.modal-body h2 { font-family: var(--serif); font-size: 19px; }
.viewer-body { position: relative; max-width: 92vw; max-height: 88vh; display: grid; place-items: center; }
.viewer-body img, .viewer-body video { max-width: 92vw; max-height: 88vh; border-radius: 16px; display: block; }
.viewer-mask { background: rgba(28, 20, 14, .88); }
.viewer-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  width: 38px; height: 38px; border-radius: 50%; font-size: 16px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  z-index: 90; background: rgba(58, 44, 32, .93); color: #FFF6EA;
  padding: 10px 20px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(58,44,32,.28); max-width: 84vw; text-align: center;
}

/* ---------- 地图 ---------- */
.map-wrap {
  background: linear-gradient(170deg, #FDF7EE, #F5EBDC);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  overflow: hidden;
}
.china-map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.china-map .prov {
  fill: #EEE4D4;
  stroke: #FFFDF8;
  stroke-width: 1.1;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill .45s ease, opacity .35s ease;
}
.china-map .prov:hover { fill: #E4D6C0; }
.china-map .prov.is-lit {
  fill: url(#litGrad);
  stroke: #FFFCF7;
  stroke-width: 1.3;
}
.china-map .prov.is-lit:hover { filter: brightness(1.05); }
.china-map .prov-dot { fill: #EEE4D4; stroke: #FFFDF8; stroke-width: 1; cursor: pointer; }
.china-map .prov-dot.is-lit { fill: var(--accent); }
.china-map .lit-mark {
  fill: #FFF3E4; stroke: var(--accent); stroke-width: 2.2; opacity: 0;
  transition: opacity .4s ease; pointer-events: none;
}
.china-map .lit-mark.is-on { opacity: 1; }
.china-map .lit-halo {
  fill: var(--accent-2); opacity: 0; transform-box: fill-box; transform-origin: center;
  pointer-events: none;
}
.china-map .lit-halo.is-on { animation: haloPulse 2.6s ease-out infinite; }
@keyframes haloPulse {
  0% { opacity: .42; transform: scale(.55); }
  70% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}
.map-hint { font-size: 12.5px; color: var(--ink-faint); text-align: center; line-height: 1.6; }
.lit-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lit-chip {
  border: 1px solid var(--accent-2); background: #FBF0E6; color: var(--accent);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; transition: .18s;
}
.lit-chip:hover { background: #F7E5D6; }
.prov-select {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 10px 12px; color: var(--ink); outline: none; font-size: 13px;
}
.prov-select:focus { border-color: var(--accent-2); background: var(--surface); }
.city-select { flex: 1; }
.head-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 市级 ---------- */
.city-hint {
  font-size: 12px; color: #8A7357; text-align: center;
  background: rgba(255, 253, 247, .58); border-radius: 12px; padding: 6px 10px;
}
.city-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.city-chip {
  border: 1px solid rgba(74, 59, 48, .16); background: rgba(255, 253, 247, .72);
  color: #7C6046; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; transition: .18s;
}
.city-chip:hover { background: rgba(255, 253, 247, .95); }
.city-chip.is-lit { border-color: var(--accent-2); background: #FBF0E6; color: var(--accent); }
.city-chip.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(210, 112, 63, .18); }

.enter-svg .city-path {
  fill: rgba(255, 252, 244, .30);
  stroke: rgba(120, 92, 62, .38);
  stroke-width: .8;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill .35s ease, stroke .35s ease;
}
.enter-svg .city-path:hover { fill: rgba(255, 240, 220, .72); }
.enter-svg .city-path.is-lit { fill: url(#litGradEnter); stroke: #FFFCF7; stroke-width: 1; }
.enter-svg .city-dot { fill: rgba(120, 92, 62, .38); stroke: #FFFDF8; stroke-width: .6; cursor: pointer; }
.enter-svg .city-dot.is-lit { fill: var(--accent); }

/* ---------- 底部抽屉 ---------- */
/* 在省份/城市详情层之上，点亮城市的抽屉不能被 enter 层盖住 */
#modal-place { z-index: 70; }
.sheet-modal { align-items: flex-end; padding: 0; }
.sheet {
  position: relative; width: 100%; max-width: 460px; margin: 0 auto;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 34px rgba(112,84,54,.16);
  display: flex; flex-direction: column; gap: 10px;
  animation: sheetUp .28s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet h2 { font-family: var(--serif); font-size: 21px; }
.sheet p { color: var(--ink-soft); font-size: 13.5px; }

/* ---------- 进入某个地方 ---------- */
/* 关闭后还有 300ms 淡出，这期间它还是全屏元素，会吞掉底下的点击 */
.enter-modal:not(.is-open) { pointer-events: none; }
.enter-modal { padding: 0; overflow: hidden; }
.enter-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, #F6E3CE, #E8C9A8 60%, #D9B48C);
  opacity: 0; transition: opacity .5s ease;
}
.enter-modal.is-open .enter-bg { opacity: 1; }
.enter-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .96;
  transition: opacity .8s ease .05s;
}
/* 比原来的 .26 高一点：市界是细线，再淡就看不见也点不到了 */
.enter-modal.is-open .enter-svg { opacity: .40; }
.enter-svg .enter-path {
  fill: rgba(255, 252, 244, .90);
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
  filter: drop-shadow(0 10px 26px rgba(150, 92, 44, .28));
}
.enter-panel {
  position: relative; z-index: 2;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; align-items: stretch;
  opacity: 0; transform: translateY(26px);
  transition: opacity .5s ease .18s, transform .6s cubic-bezier(.2,.9,.3,1) .18s;
}
.enter-modal.is-open .enter-panel { opacity: 1; transform: none; }
.enter-head { display: flex; align-items: center; gap: 12px; }
.enter-back {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(74,59,48,.16); background: rgba(255,253,247,.72);
  color: var(--ink); font-size: 17px; line-height: 1;
}
.enter-names { flex: 1; min-width: 0; }
.enter-label { font-size: 11.5px; color: #9A7A57; letter-spacing: .18em; }
.enter-title { font-family: var(--serif); font-size: 27px; color: #4A3B30; }
.enter-album {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
}
.enter-album .ea {
  position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden;
  background: rgba(255,255,255,.45); cursor: zoom-in;
}
.enter-album .ea img, .enter-album .ea video { width: 100%; height: 100%; object-fit: cover; display: block; }
.enter-empty {
  color: #7C6046; font-size: 14px; line-height: 1.8; text-align: center;
  padding: 26px 12px; background: rgba(255,253,247,.52); border-radius: 16px;
  white-space: pre-line;
}
.enter-album .ea-more {
  display: grid; place-items: center; background: rgba(255,255,255,.5);
  color: #7C6046; font-size: 13px;
}
#enter-add { align-self: center; background: rgba(255,253,247,.8); border-color: rgba(74,59,48,.14); color: var(--ink); }

/* ---------- 今天问一句 ---------- */

/* 首页入口条 */
.ask-hook { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; transition: .16s; }
.ask-hook:hover { background: var(--surface-2); }
.ask-hook-emoji { font-size: 22px; line-height: 1; }
.ask-hook-txt { flex: 1; min-width: 0; }
.ask-hook-title { font-size: 14px; font-weight: 600; }
.ask-hook-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-hook-arrow { color: var(--ink-faint); font-size: 18px; }

/* 题面 */
.ask-meta { font-size: 12.5px; color: var(--ink-faint); letter-spacing: .04em; }
.ask-cat { font-size: 12px; color: var(--accent); background: #FBEEE4; border-radius: 999px; padding: 3px 10px; align-self: flex-start; }
.ask-stem { font-family: var(--serif); font-size: 20px; line-height: 1.55; letter-spacing: .01em; }
.ask-hintline { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.ask-body { display: flex; flex-direction: column; gap: 12px; }

/* 状态标签 */
.ask-tag.is-pending { background: #EFE7DA; color: #8A7A63; }
.ask-tag.is-wait { background: #F6E7D6; color: #A9713F; }
.ask-tag.is-ta { background: #F7DFDA; color: #B4553D; }
.ask-tag.is-done { background: #E3EBDC; color: #5C7A4D; }

/* 作答 */
.ask-input {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px;
  padding: 12px 14px; color: var(--ink); outline: none; resize: vertical;
  font-family: inherit; font-size: 14.5px; line-height: 1.7; width: 100%;
}
.ask-input:focus { border-color: var(--accent-2); background: var(--surface); box-shadow: 0 0 0 3px rgba(226,145,106,.14); }
.ask-input::placeholder { color: var(--ink-faint); }
.ask-countline { font-size: 11.5px; color: var(--ink-faint); text-align: right; margin: -6px 2px 0; }

.ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-opt {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
  border-radius: 13px; padding: 10px 15px; font-size: 14px; transition: .16s;
}
.ask-opt:hover { border-color: var(--accent-2); }
.ask-opt.is-on { border-color: var(--accent); background: #FBEEE4; color: var(--accent); font-weight: 600; }

.ask-actions { display: flex; justify-content: flex-end; }
.ask-submit { min-width: 132px; }

/* 答案卡 */
.ask-ans { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; }
.ask-ans.is-mine { background: #FDF6EC; }
.ask-ans-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ask-ans-name { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.ask-ans-time { font-size: 11.5px; color: var(--ink-faint); }
.ask-ans-text { font-size: 14.5px; line-height: 1.75; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.ask-ans.is-locked { background: var(--bg-2); border-style: dashed; }
.ask-ans-locked { font-size: 17px; letter-spacing: .34em; color: var(--ink-faint); margin-top: 6px; }
.ask-ans-lockedtip { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

/* 统计 */
.ask-stats { flex-direction: row; justify-content: space-around; align-items: center; padding: 16px 20px; }
.ask-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ask-stat b { font-family: var(--serif); font-size: 25px; color: var(--accent); line-height: 1.1; }
.ask-stat span { font-size: 12px; color: var(--ink-faint); }

/* 可点卡片上的箭头 */
.card-arrow {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: 19px; line-height: 1; pointer-events: none;
}

/* 问答日记入口 */
.ask-stats { position: relative; cursor: pointer; padding-right: 34px; transition: .16s; }
.ask-stats:hover, .ask-diary-entry:hover { background: var(--surface-2); }
.ask-diary-entry { position: relative; cursor: pointer; padding-right: 34px; transition: .16s; }
.ask-diary-hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }
.ask-diary-peek { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.ask-diary-peek-date { flex: 0 0 auto; font-size: 12px; color: var(--ink-soft); }
.ask-diary-peek-stem {
  flex: 1; min-width: 0; font-family: var(--serif); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 回答日记弹层 ---------- */
.diary-modal { max-width: 440px; padding: 0; gap: 0; overflow: hidden; max-height: 88vh; }
.diary-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 21px 22px 15px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FDF3E8 0%, var(--surface) 100%);
}
.diary-head h2 { font-family: var(--serif); font-size: 19px; }
.diary-head p { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.diary-close { border: 0; background: none; color: var(--ink-faint); font-size: 16px; line-height: 1; padding: 3px 5px; transition: .16s; }
.diary-close:hover { color: var(--ink); }
.diary-scroll { overflow-y: auto; padding: 17px 22px 24px; }

.diary-tl { position: relative; padding-left: 24px; display: flex; flex-direction: column; gap: 14px; }
.diary-tl::before {
  content: ''; position: absolute; left: 5px; top: 14px; bottom: 14px;
  width: 2px; border-radius: 2px; background: var(--line);
}
.diary-node { position: relative; animation: fadeUp .38s ease both; }
.diary-node::before {
  content: ''; position: absolute; left: -24px; top: 16px; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--line); background: var(--surface);
}
.diary-node.is-done::before { border-color: var(--sage); background: var(--sage); }
.diary-node.is-wait::before { border-color: var(--accent-2); background: #F6E7D6; }
.diary-node.is-ta::before { border-color: var(--rose); background: #F7DFDA; }

.diary-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 9px;
}
.diary-card-top { display: flex; align-items: center; gap: 8px; }
.diary-date { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.diary-date.is-today { color: var(--accent); }
.diary-cat { flex: 0 0 auto; font-size: 11px; color: var(--accent); background: #FBEEE4; border-radius: 999px; padding: 2px 9px; }
.diary-stem { font-family: var(--serif); font-size: 16px; line-height: 1.6; }

.diary-ans { border-left: 3px solid var(--line); padding: 5px 0 5px 11px; }
.diary-ans.is-mine { border-left-color: var(--accent-2); }
.diary-ans.is-ta { border-left-color: var(--rose); }
.diary-ans.is-locked { border-left-style: dashed; }
.diary-ans-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.diary-ans-name { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.diary-ans-time { font-size: 11px; color: var(--ink-faint); }
.diary-ans-text { font-size: 14px; line-height: 1.72; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.diary-ans.is-locked .diary-ans-text { color: var(--ink-faint); letter-spacing: .26em; }
.diary-ans-tip { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }

.diary-empty { text-align: center; padding: 34px 12px; color: var(--ink-faint); font-size: 13.5px; line-height: 1.8; }
.diary-empty .de-emoji { display: block; font-size: 30px; margin-bottom: 8px; }

/* ---------- 首页仪表盘 ---------- */

/* 窄屏：单栏。三栏拆成 display:contents，用 order 直接排每张卡 */
.dash { display: flex; flex-direction: column; gap: 16px; }
.dash-col { display: contents; }
.dash-main > .hero { order: 1; }
.dash-main > #ask-hook { order: 2; }
.dash-main > #next-day-card { order: 3; }
.dash-left > .wx-stack { order: 4; }
.dash-main > .ai-card { order: 5; }
.dash-main > .notes-card { order: 6; }
.dash-main > .recent-card { order: 7; }
.dash-left > .cover-card { order: 8; }
.dash-right > .cal-card { order: 9; }
.dash-right > .recipe-card { order: 10; }

/* 大屏：三栏仪表盘
   ⚠️ 三栏必须各自是独立的排版上下文。曾经用 grid + grid-column + row dense 让卡片
   直接落到列上，看着对，其实**行高是三栏共享的** —— 左栏那张高封面照会把整行撑高，
   中栏矮卡片下面就被撑出一大块空白。所以大屏下把 .dash-col 还原成各自的 flex 列。 */
@media (min-width: 1060px) {
  #screen-main.is-wide .topbar-inner { max-width: 1400px; }
  .view[data-view="home"] { max-width: 1400px; }
  .dash { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
  .dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .dash-left { grid-column: 1; }
  .dash-main { grid-column: 2; }
  .dash-right { grid-column: 3; }
  /* 大屏左右两栏可以窄一点：天气卡里有城市名 + 预报，别挤 */
  .dash-left, .dash-right { min-width: 0; }
}

/* ---------- 天气 ---------- */
.wx-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.weather-card { gap: 9px; }
.wc-city { font-size: 12px; color: var(--ink-faint); cursor: pointer; transition: .16s; }
.wc-city:hover { color: var(--accent); }
/* 区县比市名长，别让它把 title 挤下去 */
.wc-city.is-region { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-city-input {
  width: 100%; max-width: 190px; border: 1px solid var(--accent-2); background: var(--surface);
  border-radius: 8px; padding: 2px 7px; font-family: inherit; font-size: 12px;
  color: var(--ink); outline: none;
}
/* 城市候选：跟着卡片长高，不做绝对定位，就不会被卡片裁掉 */
.wc-sug {
  display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 4px; margin: 2px 0 4px;
}
.wc-sug-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  width: 100%; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; text-align: left; padding: 5px 7px; border-radius: 7px; transition: .12s;
}
.wc-sug-item:hover, .wc-sug-item.is-active { background: var(--surface-2); }
.wsi-name { font-size: 13px; color: var(--ink); }
.wsi-up { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.weather-add {
  border-style: dashed; background: transparent; box-shadow: none;
  align-items: center; text-align: center; cursor: pointer; transition: .16s;
  font-size: 12.5px; color: var(--ink-faint); padding: 14px 12px;
}
.weather-add:hover { color: var(--accent); border-color: var(--accent-2); background: var(--surface-2); }
.wc-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wc-temp {
  display: flex; align-items: flex-start; font-family: var(--serif);
  font-size: 40px; line-height: 1; color: var(--accent);
}
.wc-temp b { font-weight: 600; }
.wc-unit { font-size: 17px; margin: 4px 0 0 1px; }
.wc-icon { font-size: 38px; line-height: 1; }
.wc-desc { font-size: 14px; }
.wc-advice { font-size: 12.5px; color: var(--ink-soft); }
.wc-days {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 3px; padding-top: 10px; border-top: 1px solid var(--line);
}
.wc-days:empty { display: none; }
.wc-day { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.wcd-lbl { flex: 0 0 32px; color: var(--ink-faint); }
.wcd-icon { font-size: 14px; }
.wcd-temp { margin-left: auto; color: var(--ink-soft); }

/* ---------- 封面照 ---------- */
.cover-card { padding: 0; overflow: hidden; }
.cover-slot { width: 100%; }
.cover-box { position: relative; width: 100%; aspect-ratio: 3 / 4; background: var(--surface-2); }
.cover-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-box.is-loading::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--surface-2) 30%, #FFF6EA 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: shimmer 1.3s linear infinite;
}
.cover-empty {
  aspect-ratio: 3 / 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; padding: 18px; text-align: center;
  background: linear-gradient(160deg, #FFFDF9, #FBEEDF);
}
.cover-empty .ce-emoji { font-size: 28px; line-height: 1; }
.cover-empty .ce-title { font-size: 13.5px; font-weight: 600; }
.cover-empty .ce-sub { font-size: 12px; color: var(--ink-faint); line-height: 1.6; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---------- 日历 ---------- */
.cal-card { gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h2 { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.cal-nav {
  width: 26px; height: 26px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-soft); border-radius: 9px; font-size: 14px; line-height: 1;
  display: grid; place-items: center; transition: .16s;
}
.cal-nav:hover { border-color: var(--accent-2); color: var(--accent); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week .cw { text-align: center; font-size: 11px; color: var(--ink-faint); padding: 2px 0; }
.cal-blank { aspect-ratio: 1; }
.cal-day {
  aspect-ratio: 1; border: 0; background: none; border-radius: 10px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--ink); font-size: 12.5px; transition: .14s;
}
.cal-day .cd-num { line-height: 1; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.is-sel { background: #FBEEE4; }
.cal-day.is-today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent-2); }
.cd-dots { display: flex; gap: 2px; height: 4px; }
.cdot { display: block; width: 4px; height: 4px; border-radius: 50%; }
.cdot.is-anni { background: var(--gold); }
.cdot.is-ask { background: var(--accent); }
.cdot.is-moment { background: var(--sage); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--ink-faint); }
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.cal-tip {
  font-size: 12px; color: var(--ink-soft); line-height: 1.6;
  background: var(--surface-2); border-radius: 12px; padding: 8px 11px; min-height: 34px;
}

/* 设置里的封面照 */
.cover-picker { display: flex; align-items: center; gap: 12px; }
.cover-preview {
  width: 72px; height: 96px; flex: 0 0 auto; border-radius: 13px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 24px;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- PWA：加到桌面提示 ---------- */
.pwa-hint { flex-direction: row; align-items: flex-start; gap: 12px; background: #FDF3E9; border-color: #EFCFAE; }
.ph-ico { font-size: 24px; line-height: 1.2; }
.ph-txt { flex: 1; min-width: 0; }
.ph-t { font-size: 14px; font-weight: 600; }
.ph-s { font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; margin-top: 3px; }
.ph-x {
  border: 1px solid #EFCFAE; background: #FFF; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; white-space: nowrap; transition: .16s;
}
.ph-x:hover { color: var(--accent); border-color: var(--accent-2); }

/* ---------- 食谱：首页右下角那张卡 ---------- */
.recipe-card { cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(112, 84, 54, .07), 0 18px 40px rgba(112, 84, 54, .10); }
.rc-body { display: flex; flex-direction: column; gap: 9px; min-height: 92px; }
.rc-empty { text-align: center; padding: 6px 0 2px; }
.rc-empty-emoji { display: block; font-size: 28px; opacity: .7; margin-bottom: 4px; }
.rc-empty p { font-size: 13.5px; color: var(--ink-soft); }
.rc-empty-sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.rc-top { display: flex; align-items: flex-start; gap: 10px; }
.rc-emoji { font-size: 26px; line-height: 1.2; }
.rc-txt { min-width: 0; flex: 1; }
.rc-title { font-family: var(--serif); font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sub { font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rc-chip { font-size: 11.5px; color: var(--ink-soft); background: var(--bg-2); border-radius: 999px; padding: 2px 9px; }
.rc-more { font-size: 11.5px; color: var(--ink-faint); }
.rc-open {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: 13px; padding: 9px 14px; font-size: 13px; transition: .2s;
}
.recipe-card:hover .rc-open { background: var(--accent); border-color: var(--accent); color: #FFF6EA; }
.rc-arrow { font-size: 15px; }

/* ---------- 食谱本 ---------- */
.book-modal { padding: 18px; overflow: hidden; }
.book-modal .modal-mask { opacity: 0; transition: opacity .34s ease; }
.book-modal.is-open .modal-mask { opacity: 1; }

.rb-stage {
  position: relative; width: 100%; max-width: 700px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  perspective: 1700px; perspective-origin: 50% 46%;
}
.rb-book {
  position: relative; width: 100%; height: min(520px, 66vh); min-height: 360px;
  transform-style: preserve-3d; transform-origin: 88% 96%;
  border-radius: 6px 18px 18px 6px;
  box-shadow: 0 26px 60px rgba(88, 62, 38, .30);
}
/* 书脊那道折痕：放在 .rb-book 上而不是 .rb-inner 上，
   因为 .rb-inner 是可滚动的，绝对定位的伪元素会跟着内容滚走 */
.rb-book::after {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px;
  transform: translateX(-50%); z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(150, 116, 80, .14) 50%, transparent);
  border-radius: 6px 18px 18px 6px;
}
.book-modal.is-open .rb-book { animation: bookFly .66s cubic-bezier(.2, .86, .26, 1) both; }
/* 从右下角飞到中间：位移做出"从角落过来"，绕右下角旋转做出"甩过来"的手感 */
@keyframes bookFly {
  0% { opacity: 0; transform: translate(30vw, 24vh) rotate(-15deg) scale(.34); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
}

.rb-inner {
  position: absolute; inset: 0; z-index: 2; overflow-y: auto;
  border-radius: 6px 18px 18px 6px;
  background: linear-gradient(90deg, rgba(176, 146, 110, .13) 0 10px, transparent 10px), linear-gradient(160deg, #FFFCF7, #FBF5EC);
  border: 1px solid var(--line);
}

/* 封面：整本盖住，绕左边缘翻开，翻过头就藏起来（不然它会伸到屏幕外面去） */
.rb-leaf {
  position: absolute; inset: 0; z-index: 6;
  transform-style: preserve-3d; transform-origin: left center;
  transform: rotateY(0deg);
}
.rb-face {
  position: absolute; inset: 0; border-radius: 6px 18px 18px 6px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.rb-face-front {
  position: relative; display: grid; place-items: center; color: #FFF6EA;
  background: linear-gradient(148deg, #D9834F 0%, #C26236 48%, #A24C27 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 60px rgba(70, 30, 12, .22);
}
.rb-face-back { transform: rotateY(180deg); background: linear-gradient(90deg, #F1E6D6, #FFFCF7); }
.book-modal.is-open .rb-leaf { animation: leafOpen .82s cubic-bezier(.34, .06, .22, 1) .3s forwards; }
@keyframes leafOpen {
  0% { transform: rotateY(0deg); visibility: visible; }
  99% { transform: rotateY(-170deg); visibility: visible; }
  100% { transform: rotateY(-170deg); visibility: hidden; }
}
.rb-cover-art { text-align: center; padding: 26px; }
.rb-cover-emoji { display: block; font-size: 52px; filter: drop-shadow(0 8px 14px rgba(60, 30, 12, .35)); }
.rb-cover-title { font-family: var(--serif); font-size: 26px; letter-spacing: .1em; margin-top: 12px; }
.rb-cover-sub { font-size: 12.5px; opacity: .82; margin-top: 7px; letter-spacing: .06em; }
.rb-cover-corner {
  position: absolute; right: 16px; bottom: 18px; font-size: 11px;
  letter-spacing: .34em; opacity: .7; writing-mode: vertical-rl;
}

/* 翻页的叶子：内容是当前页的快照，过半时真内容才换 */
.rb-turn {
  position: absolute; inset: 0; z-index: 9;
  transform-style: preserve-3d; transform-origin: left center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  pointer-events: none; overflow: hidden;
  border-radius: 6px 18px 18px 6px;
  background: linear-gradient(90deg, #F4EBDD, #FFFCF7);
  box-shadow: -12px 0 28px rgba(88, 62, 38, .20);
  transition: transform .54s cubic-bezier(.42, .02, .28, 1);
}
.rb-turn.from-right { transform: rotateY(0deg); }
.rb-turn.from-right.go { transform: rotateY(-168deg); }
.rb-turn.from-left { transform: rotateY(-168deg); }
.rb-turn.from-left.go { transform: rotateY(0deg); }

.rb-close {
  position: absolute; top: 18px; right: 18px; z-index: 20;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .16); color: #FFF6EA; font-size: 16px;
}
.rb-tools { position: relative; z-index: 12; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rb-btn {
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 252, 247, .95); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: 13px;
  box-shadow: 0 4px 14px rgba(58, 44, 32, .16); transition: .16s;
}
.rb-btn:hover { background: #fff; transform: translateY(-1px); }
.rb-btn-icon { width: 34px; padding: 7px 0; font-size: 15px; }
.rb-btn-main { background: var(--accent); border-color: var(--accent); color: #FFF6EA; }
.rb-btn-quiet { color: var(--ink-soft); }
.rb-btn-danger { color: #B4544A; }
.rb-pager { font-size: 12.5px; color: rgba(255, 246, 234, .88); min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }

/* 一页内容：宽屏排成左右两栏，像摊开的书 */
.rb-page { padding: 26px 30px 30px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; align-content: start; }
.rb-page-head {
  grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.rb-big-emoji { font-size: 34px; line-height: 1.1; }
.rb-head-txt { min-width: 0; flex: 1; }
.rb-title { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.rb-intro { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; }
.rb-who { font-size: 11px; color: var(--ink-faint); background: var(--bg-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; margin-top: 5px; }
.rb-sec { margin-bottom: 16px; }
.rb-sec h4 { font-size: 12px; color: var(--accent); letter-spacing: .16em; margin: 0 0 7px; font-weight: 600; }
.rb-col-a { grid-column: 1; }
.rb-col-b { grid-column: 2; grid-row: span 2; }
.rb-list { margin: 0; padding: 0; list-style: none; }
.rb-list li { position: relative; padding-left: 15px; font-size: 13.5px; line-height: 1.85; }
.rb-list li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }
.rb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-chip { font-size: 12px; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.rb-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.rb-steps li { counter-increment: s; position: relative; padding-left: 27px; font-size: 13.5px; line-height: 1.85; margin-bottom: 9px; }
.rb-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: var(--accent);
  color: #FFF6EA; font-size: 11px; display: grid; place-items: center;
}
.rb-meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-faint); border-top: 1px dashed var(--line); padding-top: 10px; }
.rb-todo { grid-column: 1 / -1; font-size: 13px; color: var(--ink-faint); }
.rb-blank { display: grid; place-items: center; height: 100%; }
.rb-blank-in { text-align: center; padding: 30px; }
.rb-blank-emoji { display: block; font-size: 44px; opacity: .55; }
.rb-blank-t { font-family: var(--serif); font-size: 18px; margin-top: 10px; }
.rb-blank-s { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

/* 填写表单 */
.rb-form { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 11px; }
.rb-form-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rb-f { display: flex; flex-direction: column; gap: 5px; }
.rb-f > span { font-size: 12px; color: var(--accent); letter-spacing: .14em; font-weight: 600; }
.rb-f input, .rb-f textarea {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 9px 12px; font-family: inherit; font-size: 14px; color: var(--ink);
  outline: none; resize: vertical; line-height: 1.7; width: 100%;
}
.rb-f input:focus, .rb-f textarea:focus { border-color: var(--accent-2); background: #fff; }
.rb-emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-emoji {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px;
  width: 34px; height: 34px; font-size: 17px; line-height: 1; display: grid; place-items: center; transition: .15s;
}
.rb-emoji.is-on { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 2px rgba(210, 112, 63, .16); }

@media (max-width: 760px) {
  .rb-page { grid-template-columns: 1fr; padding: 20px 18px 24px; column-gap: 0; }
  .rb-col-a, .rb-col-b { grid-column: 1; grid-row: auto; }
  .rb-book::after { display: none; }
  .rb-book { height: min(560px, 68vh); }
  .rb-form { padding: 18px 16px 22px; }
}

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card, .moment, .wish-item, .day-item { animation: fadeUp .4s ease both; }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.16); } }
.pulse-heart { font-size: 46px; animation: beat 1.5s ease-in-out infinite; text-align: center; }
.boot-text { color: var(--ink-soft); font-size: 13.5px; text-align: center; margin-top: 10px; }

@media (max-width: 480px) {
  .content { padding: 14px 13px 108px; }
  .card { padding: 17px; border-radius: 18px; }
  .hero-num { font-size: 52px; }
  .auth-card { padding: 28px 20px 22px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
