/* 朝暮 · 样式
   暖色调 + 大圆角，尽量接近原生 App 的手感
   布局要点：整页不滚动，只有 .view 内部滚动 —— 这样键盘弹起时不会被顶上去 */

:root {
  --bg: #fbf4ef;
  --bg-soft: #fff8f3;
  --card: #ffffff;
  --ink: #322b27;
  --ink-2: #6f635c;
  --ink-3: #a79a91;
  --coral: #ef6a55;
  --coral-2: #f79a7f;
  --coral-soft: #ffeae3;
  --line: #f1e4db;
  --green: #4f9d76;
  --shadow: 0 10px 30px rgba(160, 120, 100, 0.10);
  --radius: 22px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --vvh: 100dvh;
  --vvt: 0px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  /* 关掉双击缩放，但保留点击 */
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { position: relative; }

button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }

.hidden { display: none !important; }

/* ---------- 登录 / 注册 ---------- */

.auth {
  height: var(--vvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 46px) 22px calc(var(--safe-b) + 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(900px 420px at 50% -10%, #ffe6dc 0%, rgba(255, 230, 220, 0) 70%),
    var(--bg);
}

.auth-logo {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 8px;
  padding-left: 8px;
  background: linear-gradient(135deg, var(--coral) 10%, #d95d8a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  margin: 12px 0 22px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}

.auth-card { width: 100%; max-width: 420px; padding: 18px 20px 22px; }

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--bg-soft);
  border-radius: 14px;
}
.auth-tab {
  flex: 1;
  height: 40px;
  border-radius: 11px;
  font-size: 14px;
  color: var(--ink-2);
  transition: all .15s;
}
.auth-tab.on {
  background: #fff;
  color: var(--coral);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(200, 150, 130, .14);
}

.auth-note {
  margin: 14px 2px 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------- 通用 ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 2px 8px;
  letter-spacing: 0.4px;
}

.input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  outline: none;
  /* iOS 上当输入框字号 <16px 会自动放大页面，这里必须 16px */
  font-size: 16px;
  transition: border-color .15s;
  appearance: none;
}
.input:focus { border-color: var(--coral-2); background: #fff; }

.code-input {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-weight: 600;
  text-align: center;
}

.btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--coral-2), var(--coral));
  box-shadow: 0 8px 20px rgba(239, 106, 85, .28);
}
.btn.ghost { color: var(--ink-2); margin-top: 10px; font-size: 15px; }
.btn.small {
  width: auto;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: 12px;
  background: var(--coral-soft);
  color: var(--coral);
}
.btn[disabled] { opacity: .55; }

/* ---------- 应用骨架 ---------- */

.app {
  position: relative;
  width: 100%;
  height: var(--vvh);
  overflow: hidden;
}

.view {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 620px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--tab-h) + var(--safe-b) + 26px);
}

.page-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 6px 2px 2px;
}
.page-sub { margin: 6px 2px 18px; color: var(--ink-3); font-size: 13px; }

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255, 250, 247, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.tab {
  position: relative;
  flex: 1;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-3);
  transition: color .15s;
}
.tab.on { color: var(--coral); }
.tab svg { width: 22px; height: 22px; }

/* 未读小红点 */
.tab.has-new::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  margin-left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255, 250, 247, .95);
}

/* 键盘弹起时：隐藏底部栏和悬浮按钮，让输入区贴着键盘 */
html.kb .tabbar { display: none; }
html.kb .fab { display: none; }
html.kb .composer { bottom: 0; }
html.kb .view { padding-bottom: 96px; }
/* 把整个骨架对齐到视觉视口：否则 iOS 弹键盘会把整页往上推走一大截，
   这里只让出键盘那一块，页面顶部仍停在原位 */
html.kb .app { top: var(--vvt); }
/* 键盘态底栏已隐藏，聊天页不用再按 tab-h 留白；
   只留输入栏的高度，内容就不会被整块顶上去 */
html.kb .view.has-composer { padding-bottom: 74px; }
/* 键盘弹起时不弹任何横幅/提示：它们会贴着键盘冒出来，正好压在输入框上方 */
html.kb .banner,
html.kb .toast { display: none !important; }

/* ---------- 今天 ---------- */

.hero {
  padding: 26px 22px 24px;
  border-radius: var(--radius);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(140deg, #ffe2d8 0%, #ffd0d8 55%, #ffe9df 100%);
  box-shadow: 0 14px 34px rgba(230, 140, 130, .20);
}
.hero-eyebrow { font-size: 12px; color: #b06a5c; letter-spacing: 2px; }
.hero-days { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.hero-num { font-size: 52px; font-weight: 700; line-height: 1; color: #7a3b30; letter-spacing: -1px; }
.hero-unit { font-size: 14px; color: #9a5a4d; }
.hero-note { margin-top: 12px; font-size: 13px; color: #94584c; }

.section { margin-top: 18px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 4px 10px;
}
.section-title { font-size: 13px; color: var(--ink-3); letter-spacing: 1.5px; }

.q-card, .task-card { padding: 20px; }
.q-text { font-size: 17px; line-height: 1.6; font-weight: 500; margin: 6px 0 14px; }
.q-answers { display: flex; flex-direction: column; gap: 10px; }
.ans {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ans .who { font-size: 11px; color: var(--coral); margin-bottom: 5px; letter-spacing: .5px; }
.ans.empty { color: var(--ink-3); font-style: normal; }
.q-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-bottom: 12px; }

.task-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.task-title { font-size: 16px; line-height: 1.5; font-weight: 500; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  background: var(--coral-soft); color: var(--coral);
}
.badge.ok { background: #e8f4ec; color: var(--green); }

/* ---------- 列表 / 卡片 ---------- */

.list { display: flex; flex-direction: column; gap: 12px; }

.entry { padding: 16px 18px; }
.entry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--coral-2), #e77fa4);
  flex: 0 0 auto;
}
.avatar.me { background: linear-gradient(135deg, #f2a10f, #ef6a55); }
.entry-name {
  font-size: 13px; font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 日记时间：可点击，在「N 小时前」和「2026/11/10 11:23:45」之间切换 */
.entry-time {
  font-size: 11px; color: var(--ink-3); margin-left: auto;
  flex: 0 0 auto; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  padding: 3px 6px; margin-right: -6px; border-radius: 8px;
  transition: color .18s ease, background .18s ease;
}
.entry-time:hover { color: var(--coral-2); }
.entry-time:active { background: var(--coral-soft); }
.entry-time[data-mode="abs"] { color: var(--ink-2); }
.entry-text { font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.entry-del { font-size: 12px; color: var(--ink-3); margin-top: 10px; padding: 6px 0; }

.img-grid { display: grid; gap: 6px; margin-top: 10px; }
.img-grid.n1 { grid-template-columns: 1fr; }
.img-grid.n2 { grid-template-columns: 1fr 1fr; }
.img-grid.n3 { grid-template-columns: repeat(3, 1fr); }
.img-grid img {
  width: 100%; display: block; border-radius: 12px; object-fit: cover;
  background: var(--bg-soft); aspect-ratio: 1 / 1;
}
.img-grid.n1 img { aspect-ratio: 4 / 3; border-radius: 16px; }

.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-cell { position: relative; }
.album-cell img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 12px; background: var(--bg-soft); display: block;
}
.album-del {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; display: grid; place-items: center;
}

/* ---------- 悄悄话 ---------- */

.whisper-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

/* 聊天主题：奶油黄背景 + 淡淡的心形水印（挂在整个内容区上） */
.view.chat-mode {
  background-color: #f6f1dc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Ctext x='16' y='48' font-size='32' fill='%23eee6c6'%3E%E2%99%A1%3C/text%3E%3Ctext x='86' y='112' font-size='25' fill='%23efe8cb'%3E%E2%99%A1%3C/text%3E%3C/svg%3E");
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 96px);
}

/* 时间线：相邻消息间隔超过 5 分钟才出现一条 */
.chat-day {
  text-align: center;
  font-size: 11px;
  color: #b6ad8f;
  margin: 8px 0 2px;
}

/* 一条消息 = 头像 + 气泡（+ 自己的已读标记），头像顶部对齐 */
.w-row { display: flex; align-items: flex-start; gap: 8px; }
.w-row.mine { flex-direction: row-reverse; }
.w-row .avatar {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  font-size: 15px;
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.bubble {
  max-width: 66%;
  padding: 10px 13px;
  border-radius: 14px;
  /* 靠近头像那一侧的下角收紧，做出对话「尾巴」 */
  border-bottom-left-radius: 4px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(160, 130, 80, .08);
}
.bubble.mine {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, #a7ee6d, #8fdd55);
  color: #21330f;
}
.msg-state {
  flex: 0 0 auto;
  align-self: center;
  font-size: 11px;
  color: #b6ad8f;
}

.composer {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  margin: 0 auto;
  max-width: 620px; /* 和 .view 的内容宽度对齐 */
  padding: 10px 14px;
  display: flex; gap: 8px;
  /* 跟聊天背景同色，输入框像浮在上面的一条胶囊 */
  background: rgba(246, 241, 220, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(200, 185, 140, .35);
  z-index: 20;
  /* 键盘弹起时平滑贴上去，不要「跳一下」 */
  transition: bottom .18s ease-out;
}
.composer input {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  border: 1px solid rgba(200, 185, 140, .35);
  background: #fff;
  padding: 0 16px;
  outline: none;
  font-size: 16px;
}
.composer button {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #a7ee6d, #8fdd55);
  color: #3c4d1f; display: grid; place-items: center;
  flex: 0 0 auto;
}
.composer button svg { width: 20px; height: 20px; }

/* 输入栏两侧的小圆钮：图片 / 表情 */
.composer-side {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(200, 185, 140, .35);
  color: #9a9070;
  display: grid; place-items: center;
  flex: 0 0 auto;
  font-size: 20px;
}
.composer-side svg { width: 20px; height: 20px; }

/* 表情面板 = 「表情键盘」：贴在屏幕最底部，输入栏浮在它上面（和微信一致）。
   它和 .composer 同级挂在 .app 上，不放在输入栏内部，避免输入框被挤到面板下面。 */
.emoji-panel {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 620px;
  height: 250px;
  background: #f4f2ec;
  border-top: 1px solid rgba(200, 185, 140, .35);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-content: start;
  gap: 2px;
  padding: 10px 6px calc(10px + var(--safe-b));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 19;
}
.emoji-panel.hidden { display: none; }
.emoji-item {
  background: none; border: 0;
  font-size: 26px; line-height: 1;
  padding: 9px 0;
  border-radius: 10px;
}
.emoji-item:active { background: #e8e3cf; }

/* 表情键盘打开时：底栏让位，输入栏抬到面板上方，聊天内容多让出面板的高度 */
html.emoji-open .tabbar { display: none; }
html.emoji-open .composer { bottom: 250px; }
html.emoji-open .view {
  /* 面板 250 + 输入栏约 62 + 一点间隙；底栏此时已隐藏，不再叠加 tab-h */
  padding-bottom: calc(var(--safe-b) + 250px + 90px);
}

/* 「↓ N 条新消息」浮标：回看历史时来了新消息，点了才跳到底 */
.new-msg-pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-b) + 72px);
  border: 0;
  border-radius: 16px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #a7ee6d, #8fdd55);
  color: #21330f;
  box-shadow: 0 6px 20px rgba(100, 140, 40, .35);
  z-index: 22;
}
.new-msg-pill.hidden { display: none; }
html.kb .new-msg-pill,
html.emoji-open .new-msg-pill { display: none; }

/* 待发送图片的小卡片 */
.chat-attach {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 34px rgba(90, 70, 30, .18);
  z-index: 25;
}
.chat-attach.hidden { display: none; }
.chat-attach img {
  width: 68px; height: 68px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.chat-attach .rm {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(60, 50, 30, .82);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

/* 聊天图片气泡：图片 + 可选文字 */
.bubble-img {
  display: block;
  max-width: min(200px, 58vw);
  max-height: 260px;
  border-radius: 10px;
}
.bubble .bubble-text { margin-top: 6px; }
.bubble.imgonly {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.bubble.imgonly.mine { background: transparent; }

/* 悄悄话页：滚动区底部多留出「输入框高度 + 间隙」，
   不然最后一句永远压在输入框后面（键盘态沿用 html.kb .view 的 96px） */
.view.has-composer {
  /* 输入栏高 63px，再留 11px 间隙：最后一句正好贴在输入栏上方 */
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 74px);
}

/* ---------- 我们 ---------- */

.profile-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
}
.profile-name { font-size: 16px; font-weight: 600; }
.profile-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.info-row:first-child { border-top: 0; }
.info-row .k { color: var(--ink-2); }
.info-row .v { color: var(--ink); font-weight: 500; }
.info-row .v.code { letter-spacing: 3px; color: var(--coral); }

/* ---------- 悬浮按钮 ---------- */

.fab {
  position: absolute;
  right: 20px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 20px);
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--coral-2), var(--coral));
  color: #fff;
  box-shadow: 0 12px 26px rgba(239, 106, 85, .38);
  z-index: 25;
}
.fab svg { width: 24px; height: 24px; }

/* ---------- 弹层 ---------- */

.sheet {
  position: fixed;
  left: 0; right: 0;
  top: var(--vvt);
  height: var(--vvh);
  z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding-top: var(--safe-t);
  animation: sheet-in .22s ease;
}
@keyframes sheet-in { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-title { font-size: 15px; font-weight: 600; }
.sheet-cancel { color: var(--ink-2); font-size: 15px; padding: 6px 4px; }
.sheet-done {
  color: #fff; background: var(--coral); font-size: 14px;
  padding: 9px 18px; border-radius: 999px;
}
.sheet-body { flex: 1; padding: 16px; overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet-text {
  width: 100%; min-height: 170px; border: 0; outline: none; resize: none;
  background: transparent; font-size: 16px; line-height: 1.75;
}
.sheet-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.sheet-images .thumb { position: relative; }
.sheet-images img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 10px; display: block;
}
.sheet-images .rm {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; display: grid; place-items: center;
}
.pick-photo {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-size: 15px; padding: 12px 2px;
}
.pick-photo .plus {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--coral-soft); color: var(--coral); font-size: 17px;
}

/* ---------- toast / 通知横幅 / 大图 ---------- */

.toast {
  position: fixed; left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 34px);
  transform: translate(-50%, 12px);
  max-width: 82vw;
  padding: 10px 16px; border-radius: 14px;
  background: rgba(50, 43, 39, .92); color: #fff;
  font-size: 13px; line-height: 1.5; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 80;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.banner {
  position: fixed;
  left: 12px; right: 12px;
  top: calc(var(--safe-t) + 10px);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 30px rgba(150, 110, 95, .22);
  z-index: 85;
  transform: translateY(-140%);
  /* 只靠位移藏不住：iOS 键盘弹起后视觉视口上移，藏在布局视口外的横幅会「冒」进屏幕。
     加 visibility + opacity，隐藏时彻底不绘制。 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease,
    visibility .28s;
}
.banner.on {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.banner-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--coral-soft); color: var(--coral); font-size: 16px;
}
.banner-body { flex: 1; min-width: 0; }
.banner-title { font-size: 14px; font-weight: 600; }
.banner-text { font-size: 12.5px; color: var(--ink-2); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-close { color: var(--ink-3); font-size: 18px; padding: 4px 6px; }

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: #000; display: grid; place-items: center;
}
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }

.emptystate {
  text-align: center; color: var(--ink-3); font-size: 13px;
  line-height: 1.9; padding: 46px 20px;
}
.emptystate .big { font-size: 30px; display: block; margin-bottom: 10px; }

@media (min-width: 720px) {
  .view { padding-top: 40px; }
  .tabbar { max-width: 620px; margin: 0 auto; border-radius: 18px 18px 0 0; }
  .composer { max-width: 620px; margin: 0 auto; }
}

/* ---------- 页面头部（大标题 + 右上角操作） ---------- */

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}
.page-title-xl {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.15;
}
.hero-actions { display: flex; gap: 8px; }
.pill {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--coral);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.pill svg { width: 19px; height: 19px; }
.pill:active { transform: scale(.94); }

/* ---------- 筛选 chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(190, 140, 120, .07);
}
.chip.on {
  background: linear-gradient(135deg, var(--coral-2), var(--coral));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.custom-range input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 16px;
  color: var(--ink);
}

/* ---------- 日记卡片流 ---------- */

.month-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 4px 10px;
  color: var(--ink);
}
.month-head b { font-size: 16px; font-weight: 700; }
.month-head span { font-size: 12px; color: var(--ink-3); }

.j-group { display: flex; flex-direction: column; gap: 14px; }
.j-item { display: flex; gap: 10px; }
.j-rail { flex: 0 0 36px; display: flex; justify-content: center; }
.j-rail .avatar { width: 34px; height: 34px; font-size: 14px; }
.j-item .entry { flex: 1; min-width: 0; padding: 14px 16px; }
.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-3);
}
.foot-meta svg { stroke: var(--ink-3); }

/* ---------- 纪念日 ---------- */

.anniv-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 22px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(480px 180px at 100% 0%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, #ff8a70 0%, #ff5f7e 60%, #fb6b93 100%);
  box-shadow: 0 16px 36px rgba(250, 110, 120, .38);
}
.anniv-hero.solo { padding: 26px 22px; }
.hero-cap { font-size: 13px; opacity: .92; letter-spacing: 1px; }
.hero-days {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}
.hero-days span { font-size: 15px; font-weight: 500; margin-left: 6px; opacity: .95; }
.hero-next { margin-top: 10px; font-size: 12px; opacity: .92; }
.ring { width: 92px; height: 92px; flex: 0 0 auto; }

.anniv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.anniv-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.anniv-emoji {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--coral-soft);
  flex: 0 0 auto;
}
.anniv-info { flex: 1; min-width: 0; }
.anniv-title { font-size: 15px; font-weight: 600; }
.anniv-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.anniv-right { text-align: right; flex: 0 0 auto; }
.anniv-right b {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--coral);
  line-height: 1.1;
}
.anniv-right span { font-size: 11px; color: var(--ink-3); }
.anniv-right.done b { color: var(--green); }
.anniv-right.done .ok { font-size: 14px; font-weight: 700; color: var(--green); }
.anniv-right.done .when { display: block; margin-top: 2px; }
.anniv-del {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
}
.anniv-add {
  width: 100%;
  height: 54px;
  margin-top: 14px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.anniv-add .plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 15px;
}

/* ---------- 添加纪念日的弹层 ---------- */

.emoji-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.emoji-row::-webkit-scrollbar { display: none; }
.emoji-cell {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 22px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
}
.emoji-cell.on {
  background: var(--coral-soft);
  border-color: var(--coral-2);
}
.seg {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: 14px;
}
.seg-btn {
  flex: 1;
  height: 40px;
  border-radius: 11px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.seg-btn.on {
  background: #fff;
  color: var(--coral);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(200, 150, 130, .14);
}

/* ---------- 「我们」页：点头像换头像 ---------- */

.avatar-edit {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 0;
  background: transparent;
}
.avatar-edit .avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
}
.avatar-cam {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(150, 120, 90, .28);
}

/* ============================================================
   视觉增强层：更丰富的色彩层次、柔和渐变、微动效
   只做加法，不改原有布局数值，避免影响聊天页键盘/滚动
   ============================================================ */

:root {
  --lav: #9a7ad6;
  --lav-soft: #f1eaff;
  --blue: #5b83c4;
  --blue-soft: #e8f1ff;
  --shadow-2: 0 14px 36px rgba(160, 120, 100, .14), 0 2px 8px rgba(160, 120, 100, .06);
}

/* 背景：三团很淡的暖色光晕，不随内容滚动 */
body {
  background:
    radial-gradient(880px 400px at 6% -8%, #ffe4d6 0%, rgba(255, 228, 214, 0) 62%),
    radial-gradient(760px 420px at 102% 4%, #fff0d5 0%, rgba(255, 240, 213, 0) 58%),
    radial-gradient(720px 460px at 48% 108%, #ffe6ed 0%, rgba(255, 230, 237, 0) 60%),
    var(--bg);
}

/* 每次切页内容轻微上浮淡入；聊天页不参与（避免影响气泡定位） */
@keyframes zm-rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}
.view:not(.chat-mode) > * { animation: zm-rise .3s cubic-bezier(.2, .8, .25, 1) both; }
.view:not(.chat-mode) > *:nth-child(2) { animation-delay: .035s; }
.view:not(.chat-mode) > *:nth-child(3) { animation-delay: .07s; }
.view:not(.chat-mode) > *:nth-child(4) { animation-delay: .1s; }

.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: rgba(190, 150, 130, .26); border-radius: 6px; }

/* 卡片：更立体的层次 */
.card {
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-2);
}
.hero {
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(224, 132, 122, .26);
}
.hero::after {
  content: '♥';
  position: absolute;
  right: -6px; bottom: -62px;
  font-size: 168px;
  line-height: 1;
  color: rgba(255, 255, 255, .34);
  transform: rotate(-14deg);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-2);
}
.section-title::before {
  content: '';
  width: 4px; height: 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--coral-2), var(--coral));
}

.page-title-xl {
  background: linear-gradient(115deg, #d9503f 5%, #ef6a55 52%, #efa33f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pill {
  border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 6px 18px rgba(190, 140, 120, .16);
  transition: transform .16s, box-shadow .16s;
}
.pill:active { transform: scale(.9); }

.btn.primary { box-shadow: 0 10px 24px rgba(239, 106, 85, .32); }
.btn:active { transform: scale(.97); }

.chip { transition: transform .15s, box-shadow .15s, background .15s; }
.chip:active { transform: scale(.94); }
.chip.on { box-shadow: 0 6px 16px rgba(239, 106, 85, .3); }

/* 类型筛选：淡紫，和时间筛选区分开 */
.chips-kind { padding-top: 0; padding-bottom: 12px; }
.chips-kind .chip {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, .72);
}
.chips-kind .chip.on {
  background: linear-gradient(135deg, #a98be6, #8062cf);
  box-shadow: 0 6px 16px rgba(128, 98, 207, .3);
  border-color: transparent;
}

.tabbar { box-shadow: 0 -8px 28px rgba(160, 120, 100, .12); }
.tab svg { transition: transform .22s cubic-bezier(.2, 1.5, .4, 1); }
.tab.on svg { transform: translateY(-2px) scale(1.12); }
.tab.on::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--coral-2), var(--coral));
}

.avatar { box-shadow: 0 4px 12px rgba(160, 120, 100, .18); }
.emptystate .big { animation: zm-float 3.2s ease-in-out infinite; }
@keyframes zm-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.month-head b { position: relative; padding-left: 14px; }
.month-head b::before {
  content: '';
  position: absolute;
  left: 1px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

/* 聊天气泡：轻投影 + 时间戳小胶囊 */
.bubble { box-shadow: 0 3px 10px rgba(120, 100, 60, .09); }
.bubble.mine { box-shadow: 0 4px 12px rgba(90, 140, 40, .2); }
.chat-day {
  display: table;
  margin: 10px auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
}
.sheet-done {
  background: linear-gradient(135deg, var(--coral-2), var(--coral));
  box-shadow: 0 6px 16px rgba(239, 106, 85, .3);
  font-weight: 600;
}

/* ---------- 日记类型：读书笔记 / 博客 ---------- */

.j-item .entry { position: relative; overflow: hidden; }
.j-item .entry::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f7b48c, #ef6a55);
}
.j-item.kind-reading .entry {
  background: linear-gradient(180deg, #f5f9ff 0%, #fff 42%);
}
.j-item.kind-reading .entry::before { background: linear-gradient(180deg, #9bc1f5, #5b83c4); }
.j-item.kind-blog .entry {
  background: linear-gradient(180deg, #faf6ff 0%, #fff 42%);
}
.j-item.kind-blog .entry::before { background: linear-gradient(180deg, #c6aaf0, #8b68cf); }

.j-kind {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.j-kind.reading { background: var(--blue-soft); color: var(--blue); }
.j-kind.blog { background: var(--lav-soft); color: var(--lav); }
.j-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  margin: 2px 0 6px;
  word-break: break-word;
}
.j-meta { font-size: 12px; color: var(--ink-3); margin: -2px 0 8px; }
.j-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--lav);
  text-decoration: none;
}
.j-link:active { opacity: .65; }

/* 写日记弹层里的类型选择 */
.sheet-kinds {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scrollbar-width: none;
}
.sheet-kinds::-webkit-scrollbar { display: none; }
.sheet-kinds .kind-chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(190, 140, 120, .08);
  transition: transform .15s, box-shadow .15s;
}
.sheet-kinds .kind-chip:active { transform: scale(.95); }
.sheet-kinds .kind-chip.on {
  background: linear-gradient(135deg, var(--coral-2), var(--coral));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(239, 106, 85, .3);
}
.sheet-field { height: 46px; margin-bottom: 10px; }
#sheet-extra { display: flex; flex-direction: column; }

@media (prefers-reduced-motion: reduce) {
  .view:not(.chat-mode) > *,
  .emptystate .big { animation: none; }
  .tab svg, .chip, .pill, .btn { transition: none; }
}

