/* ══════════════════════════════════════════════════════
   yphone · 样式
   莫兰迪浅色系：低饱和、灰调、柔光。
   手机本体是 #phone，桌面端居中成一块屏，手机屏上自动铺满。
   所有颜色都走 :root 变量 —— 换色只改这一块。
   ══════════════════════════════════════════════════════ */
:root {
  --paper: #faf8f5;          /* App 内容底：暖白纸 */
  --paper-2: #f1ede7;        /* 次级底 */
  --fg: #4b463f;             /* 主文字：暖炭灰 */
  --fg-dim: #9a9289;         /* 次要文字 */
  --line: rgba(75, 70, 63, .1);
  --panel: rgba(255, 255, 255, .78);
  --accent: #7d9c94;         /* 鼠尾草绿 */
  --accent-ink: #5d7a72;
  --accent-soft: rgba(125, 156, 148, .14);
  --danger: #c4756b;
  --shadow-s: 0 2px 8px rgba(96, 88, 78, .08);
  --shadow-m: 0 8px 22px rgba(96, 88, 78, .12);
  --nav-h: 52px;
  --sb-h: 36px;
  --radius: 46px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
}

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

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font);
  background: #e9e5de;
  color: var(--fg);
  user-select: none;
}

/* ── 舞台：桌面端居中 ── */
#stage {
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 22% 12%, #f5f2ec 0%, transparent 55%),
    radial-gradient(circle at 78% 88%, #dfe3e0 0%, transparent 60%),
    linear-gradient(160deg, #eae6e0, #d8d4cd);
}

#phone {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: 100dvh;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 0 0 11px #e3ded7, 0 0 0 13px #cfc9c0,
    0 42px 80px rgba(90, 82, 72, .34);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* 手机屏上：去掉机身、铺满 */
@media (max-width: 520px), (max-height: 880px) {
  #phone {
    width: 100%; height: 100dvh; max-height: none;
    border-radius: 0; box-shadow: none;
  }
}

/* ══ 状态栏 ══ */
#statusbar {
  flex: 0 0 var(--sb-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .2px;
  color: #4b463f;
  position: relative; z-index: 30;
  pointer-events: none;
}
#sb-notch {
  position: absolute; left: 50%; top: -1px; transform: translateX(-50%);
  width: 104px; height: 29px; background: #2b2b2e; border-radius: 18px;
  box-shadow: inset 0 -1px 2px rgba(255,255,255,.08);
}
#sb-right { display: flex; align-items: center; gap: 5px; }
.sb-batt-icon {
  position: relative; width: 24px; height: 12px;
  border: 1.4px solid currentColor; border-radius: 3.5px; opacity: .55;
  padding: 1.5px;
}
.sb-batt-icon::after {
  content: ''; position: absolute; right: -3.5px; top: 3.5px;
  width: 1.6px; height: 4px; background: currentColor; border-radius: 0 1px 1px 0;
}
#sb-batt-fill { display: block; height: 100%; width: 100%; background: currentColor; border-radius: 1.5px; transition: width .6s; }

/* ══ 桌面 ══ */
#home {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  display: flex; flex-direction: column;
  padding-top: var(--sb-h);
  transition: transform .32s cubic-bezier(.22,1,.36,1), filter .32s, opacity .32s;
  z-index: 10;
}
#home.pushed { transform: scale(.945); filter: brightness(.94) saturate(.85); opacity: .92; }

#pages {
  flex: 1;
  display: flex;
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.page {
  flex: 0 0 100%;
  padding: 14px 20px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
  gap: 22px 8px;
  align-content: start;
}

/* 桌面挂件：磨砂玻璃 */
.widget {
  grid-column: 1 / -1;
  padding: 16px 20px 18px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 26px;
  color: #4b463f;
  box-shadow: var(--shadow-s);
}
.widget-time { font-size: 46px; font-weight: 300; letter-spacing: -1.5px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.widget-date { font-size: 13px; opacity: .62; margin-top: 3px; }

/* 图标：莫兰迪色块 + 深灰线性图标 */
.icon {
  background: none; border: 0; padding: 0; color: var(--fg);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; font-family: inherit;
  transition: transform .12s;
}
.icon:active { transform: scale(.88); }
.icon-art {
  width: 60px; height: 60px; border-radius: 19px;
  display: grid; place-items: center;
  color: #46423c;                                   /* 图标笔画：暖炭灰，压在粉彩色块上 */
  box-shadow:
    0 6px 14px rgba(96, 88, 78, .18),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}
.icon-art svg { opacity: .82; }
.icon.small .icon-art { width: 56px; height: 56px; border-radius: 18px; }
.icon-name {
  font-size: 11.5px; letter-spacing: .2px; color: #4b463f; font-weight: 500;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .8);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon.dragging { opacity: .35; }
.icon.ghost { opacity: .95; transform: scale(1.14); transition: transform .1s; }

#dots { display: flex; justify-content: center; gap: 7px; padding: 8px 0; }
#dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(75, 70, 63, .3);
  box-shadow: 0 1px 3px rgba(255, 255, 255, .75);   /* 浅壁纸上不这样压一压就看不见 */
  transition: background .2s, width .2s;
}
#dots i.on { background: rgba(75, 70, 63, .68); width: 16px; }

#dock {
  margin: 0 12px 26px;
  padding: 13px 10px;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 32px;
  box-shadow: var(--shadow-s);
}

/* 底部小白条 */
#homebar {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; border-radius: 3px;
  background: rgba(75, 70, 63, .45);
  z-index: 40; pointer-events: none;
}

/* 深色壁纸时整体翻成白字（默认是浅色壁纸 → 深字） */
#phone.dark-wall { --fg: #f3f1ee; --fg-dim: rgba(255,255,255,.7); --line: rgba(255,255,255,.14); --panel: rgba(38,36,34,.72); color: var(--fg); }
#phone.dark-wall #statusbar { color: #fff; }
#phone.dark-wall .icon { color: #fff; }
#phone.dark-wall .icon-art { color: #fff; }
#phone.dark-wall .icon-art svg { opacity: .95; }
#phone.dark-wall .icon-name { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
#phone.dark-wall .widget { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.16); color: #fff; }
#phone.dark-wall #dock { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.14); }
#phone.dark-wall #dots i { background: rgba(255,255,255,.3); }
#phone.dark-wall #dots i.on { background: rgba(255,255,255,.9); }
#phone.dark-wall #homebar { background: rgba(255,255,255,.85); }
#phone.dark-wall #lock-time, #phone.dark-wall #lock-date, #phone.dark-wall #lock-hint { color: #fff; }
#phone.dark-wall .pk { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.16); }

/* ══ App 视图栈 ══ */
#stack { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.app-view {
  position: absolute; inset: 0;
  background: var(--paper);
  display: flex; flex-direction: column;
  pointer-events: auto;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  padding-top: var(--sb-h);
  will-change: transform;
}
.app-view.in { transform: translateX(0); }

.nav {
  flex: 0 0 var(--nav-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 245, .82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.nav-btn {
  background: none; border: 0; color: var(--accent-ink);
  font: inherit; font-size: 15px; padding: 8px 10px;
  cursor: pointer; border-radius: 10px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 1px;
}
.nav-btn:active { background: var(--accent-soft); }
.nav-btn.back { font-weight: 500; }
/* 「＋」「清空」这种纯文字按钮：15px 的全角＋看起来又小又灰 */
.nav-btn.plus { font-size: 22px; line-height: 1; font-weight: 400; padding: 4px 12px; }
.nav-btn .chev { display: inline-flex; margin-left: -3px; }
.nav-btn.ghost { opacity: 0; pointer-events: none; }

/* ══ 通用组件 ══ */
.list { flex: 1; overflow-y: auto; padding: 8px 0 40px; }
.group-title { font-size: 12px; color: var(--fg-dim); padding: 18px 20px 6px; letter-spacing: .6px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.row:active { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; }
.row-sub { font-size: 13px; color: var(--fg-dim); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { font-size: 12px; color: var(--fg-dim); flex: 0 0 auto; }
.empty { text-align: center; color: var(--fg-dim); font-size: 14px; padding: 40px 30px; line-height: 1.8; }
.empty.big { white-space: pre-line; padding-top: 80px; }
.pad { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
/* .pad 直接挂在 .app-view 下时（角色编辑页、备忘录编辑页）必须自己能滚。
   .app-view 是 flex 列容器，flex 项默认 min-height:auto —— 内容一高于屏幕，
   它宁可溢出也不缩，于是被 #phone 的 overflow:hidden 裁掉，
   底部的「保存 / 删除角色」按钮整个消失，用户看到的就是「没有保存选项」。 */
.app-view > .pad {
  flex: 1; min-height: 0; overflow-y: auto;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.btn {
  border: 0; border-radius: 14px; padding: 13px;
  font: inherit; font-size: 15px; font-weight: 500;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(125, 156, 148, .3);
}
.btn:active { opacity: .85; transform: translateY(1px); }
.btn.ghost { background: rgba(75, 70, 63, .07); color: var(--fg); box-shadow: none; }
.btn.danger { background: rgba(196, 117, 107, .14); color: var(--danger); box-shadow: none; }

.field {
  width: 100%; border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 15px; font: inherit; font-size: 15px;
  background: #fff; color: var(--fg);
  outline: none; user-select: text;
  box-shadow: inset 0 1px 2px rgba(96, 88, 78, .04);
}
.field::placeholder { color: #b6aea4; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.area { min-height: 200px; resize: none; line-height: 1.7; }
.field.area.sm { min-height: 88px; }
/* 注意：这里不能叫 .sm —— .field.area.sm 和 .field.sm 会同时命中 textarea，
   把开场白那个框也压成 110px 宽（踩过一次）。 */
.field.tiny { width: 112px; text-align: center; font-size: 22px; padding: 8px 10px; }
select.field { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-dim) 50%), linear-gradient(135deg, var(--fg-dim) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field-wrap { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fg-dim); }
.hide { display: none; }
.hint { font-size: 12.5px; color: var(--fg-dim); line-height: 1.7; }

/* 角色头像：通讯录/微信列表/编辑页共用一个 */
.avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 15px;
  display: grid; place-items: center; font-size: 23px; line-height: 1;
  box-shadow: var(--shadow-s);
}
.row .avatar { margin-right: 12px; }

/* 建角色时的 emoji / 配色选择器 */
.emoji-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.emoji, .swatch {
  width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line);
  background: #fff; font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  transition: transform .15s, border-color .15s;
}
.emoji:active, .swatch:active { transform: scale(.92); }
.emoji.on, .swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch.on::after { content: '✓'; font-size: 15px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* 通讯录行尾的「发消息」 */
.row-go {
  flex: 0 0 auto; border: none; cursor: pointer; font: inherit; font-size: 13px;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 10px; padding: 7px 11px;
}

/* 分段控件 */
.seg {
  margin: 14px 20px 0; padding: 3px;
  display: flex; background: rgba(75, 70, 63, .07); border-radius: 12px;
}
.seg button {
  flex: 1; border: 0; background: none; color: var(--fg-dim);
  font: inherit; font-size: 14px; padding: 8px; border-radius: 10px; cursor: pointer;
  transition: background .18s, color .18s;
}
.seg button.on { background: #fff; color: var(--fg); font-weight: 600; box-shadow: var(--shadow-s); }

/* 壁纸选择 */
.walls { display: flex; gap: 10px; padding: 8px 20px 4px; overflow-x: auto; }
.wall {
  flex: 0 0 62px; height: 100px; border-radius: 15px; cursor: pointer;
  border: 2.5px solid transparent; transition: border-color .15s, transform .15s;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-s);
}
.wall:active { transform: scale(.94); }
.wall.on { border-color: var(--accent); }

/* 聊天 */
.chat-list { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 74%; padding: 11px 15px; border-radius: 19px;
  font-size: 15px; line-height: 1.55; word-break: break-word;
  animation: pop .22s cubic-bezier(.22,1,.36,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 3px 10px rgba(125,156,148,.28); }
.bubble.ta { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-s); }
.bubble.typing { color: var(--fg-dim); letter-spacing: 2px; }
.chat-bar {
  display: flex; gap: 8px; padding: 10px 12px 22px;
  border-top: 1px solid var(--line);
  background: rgba(250, 248, 245, .9);
  backdrop-filter: blur(18px);
}
.chat-input {
  flex: 1; border: 1px solid var(--line); border-radius: 20px;
  padding: 11px 16px; font: inherit; font-size: 15px;
  background: #fff; color: var(--fg); outline: none;
  user-select: text;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  border: 0; border-radius: 20px; padding: 0 18px;
  background: var(--accent); color: #fff; font: inherit; font-size: 15px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(125,156,148,.3);
}

/* 时钟 / 计算器 */
.clock-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.big-clock { font-size: 62px; font-weight: 200; letter-spacing: -2.5px; font-variant-numeric: tabular-nums; color: var(--fg); }
.clock-date { font-size: 15px; color: var(--fg-dim); margin-top: -14px; }

.calc-out {
  flex: 0 0 auto; padding: 28px 26px; text-align: right;
  font-size: 46px; font-weight: 300; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--fg);
}
.calc-pad {
  flex: 1; padding: 0 12px 26px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.ck {
  border: 0; border-radius: 20px; background: #fff;
  color: var(--fg); font: inherit; font-size: 24px; cursor: pointer;
  box-shadow: var(--shadow-s);
  transition: transform .1s;
}
.ck:active { transform: scale(.95); }
.ck.op { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.ck.eq { background: var(--accent); color: #fff; grid-column: span 2; box-shadow: 0 4px 12px rgba(125,156,148,.32); }

/* ══ 锁屏 ══ */
#lock {
  position: absolute; inset: 0; z-index: 60;
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 110px;
  transition: opacity .28s, transform .28s;
  color: #4b463f;
}
#lock::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 40%);
}
#lock > * { position: relative; z-index: 1; }
#lock-time { font-size: 80px; font-weight: 200; letter-spacing: -3px; text-shadow: 0 2px 18px rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
#lock-date { font-size: 17px; opacity: .68; margin-top: 2px; }
#lock-hint { margin-top: auto; margin-bottom: 46px; font-size: 14px; opacity: .6; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .28; } }
#lock.shake { animation: shake .4s; }
@keyframes shake {
  25% { transform: translateX(-9px); } 50% { transform: translateX(9px); } 75% { transform: translateX(-5px); }
}

/* 密码键盘 */
#lock-pad { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 60px; }
.pad-dots { font-size: 19px; letter-spacing: 13px; height: 22px; }
.pad-grid { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px; }
.pk {
  width: 74px; height: 74px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .5); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #4b463f; font: inherit; font-size: 27px; cursor: pointer;
  box-shadow: var(--shadow-s);
}
.pk:active { background: rgba(255, 255, 255, .85); }

/* ══ 弹窗 ══ */
.mask {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(75, 70, 63, .32);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 34px;
  animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } }
.confirm {
  width: 100%; max-width: 280px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(24px);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(90, 82, 72, .3);
}
.confirm-text { padding: 22px 20px; font-size: 15px; text-align: center; line-height: 1.6; }
.confirm-actions { display: flex; border-top: 1px solid var(--line); }
.confirm-actions .btn { flex: 1; border-radius: 0; background: none; padding: 15px; font-weight: 600; color: var(--accent-ink); box-shadow: none; }
.confirm-actions .btn.danger { color: var(--danger); }
.confirm-actions .btn.ghost { color: var(--fg-dim); }
.confirm-actions .btn + .btn { border-left: 1px solid var(--line); }

/* 细滚动条，别破坏浅色气质 */
.list::-webkit-scrollbar, .chat-list::-webkit-scrollbar, .walls::-webkit-scrollbar { width: 6px; height: 6px; }
.list::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb, .walls::-webkit-scrollbar-thumb {
  background: rgba(75, 70, 63, .16); border-radius: 3px;
}

/* ══════════════════════════════════════════════════════
   聊天页：左边「＋」功能面板、右边会变身的发送键
   ══════════════════════════════════════════════════════ */
.chat-plus {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--fg-dim);
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.chat-plus:active { background: rgba(125, 156, 148, .12); }
/* 有欠着的回复时变高亮 —— 这时候它才是主角 */
.chat-send.urge {
  background: linear-gradient(150deg, #8fae9f, #6d8c84);
  animation: urgePulse 1.6s ease-in-out infinite;
}
@keyframes urgePulse { 50% { box-shadow: 0 3px 16px rgba(125, 156, 148, .55); } }
.chat-send.off { background: rgba(75, 70, 63, .13); color: rgba(75, 70, 63, .4); box-shadow: none; }

/* 图片 / 贴纸气泡：白框，别让图片顶着那个墨绿 */
.bubble.media { padding: 5px; background: #fff; border: 1px solid var(--line); }
.bubble.media .bubble-pic { display: block; max-width: 200px; max-height: 240px; border-radius: 15px; }
.bubble-sticker { font-size: 50px; line-height: 1.15; padding: 4px 8px; }

/* 转账卡片。必须把 .bubble.me 的白字压回来 —— 否则金额是白字白底，直接看不见 */
.bubble.transfer {
  display: flex; align-items: center; gap: 11px; color: var(--fg);
  background: #fff; border: 1px solid var(--line); padding: 11px 15px;
  box-shadow: var(--shadow-s);
}
.tr-ico {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; color: #fff;
  background: linear-gradient(150deg, #e6b183, #cf8b57);
}
.tr-amt { font-size: 16px; font-weight: 600; }
.tr-tip { font-size: 12px; color: var(--fg-dim); margin-top: 2px; }

/* ── 底部功能面板 ── */
.sheet-mask { align-items: end; justify-items: stretch; padding: 0; }
.sheet {
  width: 100%; background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 6px 0 calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 34px rgba(90, 82, 72, .26);
  animation: sheetUp .24s cubic-bezier(.22, 1, .36, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  border: 0; background: none; font: inherit; font-size: 15px; color: var(--fg);
  padding: 14px 22px; cursor: pointer; text-align: left;
}
.sheet-item:active { background: rgba(75, 70, 63, .05); }
.sheet-item.off { opacity: .38; }
.si-icon { flex: none; width: 26px; text-align: center; font-size: 19px; color: var(--accent-ink); }
.si-hint { margin-left: auto; font-size: 13px; color: var(--fg-dim); }

.sticker-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 22px 10px; border-bottom: 1px solid var(--line);
}
.sticker {
  width: 46px; height: 46px; border-radius: 15px; font-size: 25px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.sticker:active { background: rgba(125, 156, 148, .14); }

/* 一闪而过的提示 */
.toast {
  position: absolute; left: 50%; bottom: 104px; z-index: 90;
  transform: translateX(-50%); max-width: 78%;
  background: rgba(62, 58, 52, .9); color: #fff;
  font-size: 13px; line-height: 1.5; text-align: center;
  padding: 9px 15px; border-radius: 16px; pointer-events: none;
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ══ 聊天设置页（左上加的齿轮进这里） ══ */
.who { display: flex; align-items: center; gap: 12px; padding: 2px 0 4px; }
.who-name { font-size: 17px; font-weight: 600; }

/* 记忆卡片。正文必须能换行 —— .row-sub 是单行省略号，套上去等于只看得见前半句 */
.mem {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 12px;
}
.mem-text {
  flex: 1; min-width: 0; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.mem-del {
  flex: none; border: 0; background: none; cursor: pointer;
  color: var(--fg-dim); font: inherit; font-size: 19px; line-height: 1; padding: 0 2px;
}
.mem-del:active { color: var(--danger); }

/* ══ 日历 ══ */
.cal-wrap { gap: 14px; }
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.cal-nav {
  flex: none; width: 38px; height: 38px; border-radius: 13px;
  border: 1px solid var(--line); background: #fff; color: var(--accent-ink);
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.cal-nav:active { background: var(--accent-soft); }

.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  padding-bottom: 2px; font-size: 12px; color: var(--fg-dim); text-align: center;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; font-size: 15px;
  background: #fff; border: 1px solid var(--line);
}
.cal-cell.blank { background: none; border-color: transparent; cursor: default; }
.cal-cell:not(.blank):active { background: var(--accent-soft); }
.cal-cell.today { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.cal-dot {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-ink);
}
.cal-cell.today .cal-dot { background: #fff; }
.cal-today { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.cal-today .group-title { padding: 0 2px 2px; }
.cal-today .row-title.done { text-decoration: line-through; opacity: .45; }
.nav-btn.plus { font-size: 21px; line-height: 1; }
