:root {
  --bg: #121212;
  --rail: #1b1b1b;
  --panel: #202020;
  --line: rgba(255, 255, 255, 0.07);
  --ink: #e6e6e6;
  --soft: #8b8b8b;
  --green: #2fb55a;
  --bubble-her: #2b2b2b;
  --bubble-me: #2fb55a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; height: 100vh; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 14px/1.6 "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  user-select: none;
}

/* 左侧栏 */
.rail {
  width: 76px; background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0;
  gap: 6px;
}
.me { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; font-size: 15px; font-weight: 600;
  background: linear-gradient(160deg, #3a7bd5, #1f4b8a); color: #fff;
}
.avatar.sm { width: 34px; height: 34px; border-radius: 7px; font-size: 13px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-name { font-size: 11px; color: var(--soft); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; flex: 1; }
.tab {
  width: 56px; padding: 9px 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--soft); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit;
}
.tab .ic { font-size: 18px; }
.tab .tx { font-size: 11px; }
.tab:hover { background: rgba(255,255,255,.05); }
.tab.active { background: rgba(47,181,90,.16); color: var(--green); }
.rail-foot { font-size: 10.5px; color: var(--soft); text-align: center; padding: 0 6px; }

/* 主区 */
.main { flex: 1; display: flex; min-width: 0; }
.view { display: none; flex: 1; flex-direction: column; min-width: 0; }
.view.active { display: flex; }

.chat-head {
  display: flex; align-items: center; gap: 11px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.chat-who .nm { font-weight: 600; }
.chat-who .st { font-size: 11.5px; color: var(--soft); }

.log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg .av {
  width: 32px; height: 32px; border-radius: 7px; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; background: #333; color: #fff;
}
.msg .av img { width: 100%; height: 100%; object-fit: cover; }
.bubble {
  max-width: min(560px, 70%);
  padding: 9px 12px; border-radius: 6px;
  background: var(--bubble-her); white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--line);
}
.msg.me .bubble { background: var(--bubble-me); color: #06220f; border-color: transparent; }
.bubble img.photo, .bubble video { max-width: 100%; border-radius: 6px; display: block; }
.bubble img.sticker { width: 132px; height: 132px; object-fit: contain; background: transparent; }
.bubble .fname { font-size: 12.5px; }
.bubble .fsize { font-size: 11px; opacity: .7; }
.bubble a { color: inherit; }

.time-sep { align-self: center; font-size: 11px; color: var(--soft); margin: 6px 0; }

.typing { display: flex; gap: 9px; align-items: center; color: var(--soft); font-size: 12px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--soft); animation: b 1.2s infinite; }
.dot:nth-child(3) { animation-delay: .15s; } .dot:nth-child(4) { animation-delay: .3s; }
@keyframes b { 0%,60%,100% { transform: translateY(0); opacity: .4 } 30% { transform: translateY(-3px); opacity: 1 } }

/* 输入区 */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px 14px;
  border-top: 1px solid var(--line); background: var(--panel); position: relative;
}
.tools { display: flex; gap: 2px; padding-bottom: 6px; }
.tool { border: 0; background: transparent; font-size: 19px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.tool:hover { background: rgba(255,255,255,.08); }
textarea {
  flex: 1; resize: none; min-height: 38px; max-height: 150px; padding: 9px 11px;
  border-radius: 7px; border: 1px solid var(--line); background: #171717; color: var(--ink);
  font: inherit; outline: none;
}
textarea:focus { border-color: rgba(47,181,90,.5); }
.send {
  padding: 8px 18px; border-radius: 7px; border: 0; background: var(--green); color: #06220f;
  font: inherit; font-weight: 600; cursor: pointer; margin-bottom: 1px;
}
.send:disabled { opacity: .5; cursor: default; }

.sticker-pop {
  position: absolute; left: 14px; bottom: 62px; width: 340px; max-height: 260px; overflow-y: auto;
  background: #1a1a1a; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  display: none; grid-template-columns: repeat(4, 1fr); gap: 8px; z-index: 20;
}
.sticker-pop.on { display: block; }
/* 表情浮层：带标题栏和关闭按钮 */
.sticker-pop .sp-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 2px 8px;
  background: #1a1a1a;
  font-size: 12.5px; color: var(--soft);
}
.sticker-pop .sp-close {
  border: 0; background: rgba(255,255,255,.08); color: #ddd;
  width: 24px; height: 24px; border-radius: 50%; font-size: 15px; line-height: 1;
  cursor: pointer;
}
.sticker-pop .sp-close:hover { background: rgba(255,80,80,.25); color: #fff; }
.sticker-pop .sp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sticker-pop img { width: 100%; aspect-ratio: 1; object-fit: contain; cursor: pointer; border-radius: 6px; background: #222; }

/* 面板 */
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.ghost { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.06); }

.moments { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.moment { padding: 12px 14px; background: #1b1b1b; border: 1px solid var(--line); border-radius: 10px; }
.moment .meta { font-size: 11.5px; color: var(--soft); margin-bottom: 5px; }
.moment .body { white-space: pre-wrap; }
.moment .pics { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.moment .pics img { width: 108px; height: 108px; object-fit: cover; border-radius: 6px; }

.sticker-grid {
  flex: 1; overflow-y: auto; padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;      /* 关键：不要拉伸行高，否则格子会变成细长条 */
  gap: 10px;
}
.sticker-grid .cell {
  position: relative;
  aspect-ratio: 1;                 /* 正方形，像微信表情面板 */
  background: #1b1b1b;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}
.sticker-grid .cell:hover { border-color: rgba(47,181,90,.5); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.sticker-grid .del {
  position: absolute; right: 3px; top: 3px;
  background: rgba(0,0,0,.65); border: 0; color: #ddd;
  border-radius: 50%; width: 19px; height: 19px; line-height: 1;
  font-size: 13px; cursor: pointer; opacity: 0;
  transition: opacity .15s;
}
.sticker-grid .cell:hover .del { opacity: 1; }
@media (hover: none) { .sticker-grid .del { opacity: .95; } }

.settings { padding: 20px; display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.srow label { color: var(--soft); }
.srow input { flex: 1; max-width: 280px; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line); background: #171717; color: var(--ink); font: inherit; }
.hint { color: var(--soft); font-size: 12px; }

.mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; z-index: 40; }
.mask.on { display: block; }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, 90vw); background: #1c1c1c; border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; display: none; z-index: 41;
}
.modal.on { display: block; }
.modal h3 { margin: 0 0 10px; font-size: 14px; }
.modal textarea { width: 100%; min-height: 88px; }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 朋友圈：头像 + 名字 */
.moment .m-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.moment .m-av {
  width: 36px; height: 36px; border-radius: 7px; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; background: #333; color: #fff; font-size: 13px;
}
.moment .m-av img { width: 100%; height: 100%; object-fit: cover; }
.moment .m-name { font-weight: 600; font-size: 13.5px; }
.moment .meta { font-size: 11px; color: var(--soft); }

/* 朋友圈互动 */
.moment .m-likes { margin-top: 8px; font-size: 12.5px; color: #9ad; }
.moment .m-comments { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.moment .m-comment { font-size: 12.5px; color: #cfcfcf; }
.moment .m-comment b { color: var(--green); font-weight: 600; }
.moment .m-actions { display: flex; gap: 8px; margin-top: 10px; }
.moment .m-like, .moment .m-cc {
  border: 1px solid var(--line); background: transparent; color: var(--soft);
  border-radius: 6px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.moment .m-like:hover, .moment .m-cc:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.moment .m-ccbox { margin-top: 8px; }
.moment .m-input {
  width: 100%; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #171717; color: var(--ink); font: inherit;
}

/* ── 手机：底部标签栏（像微信） ── */
@media (max-width: 760px) {
  body {
    flex-direction: column;
    height: 100dvh;
  }

  /* 侧栏变底栏 */
  .rail {
    order: 2;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--line);
    background: #1b1b1b;
  }

  /* 底栏里不重复显示头像 */
  .rail .me { display: none; }
  .rail-foot { display: none; }

  .tabs {
    flex-direction: row;
    flex: 1;
    gap: 0;
    justify-content: space-around;
    align-items: stretch;
  }

  .tab {
    width: auto;
    flex: 1;
    padding: 7px 0 6px;
    border-radius: 0;
    gap: 1px;
    justify-content: center;
  }
  .tab .ic { font-size: 21px; line-height: 1.1; }
  .tab .tx { font-size: 10.5px; }
  .tab.active { background: transparent; color: var(--green); }
  .tab.active .ic { transform: translateY(-1px); }

  /* 主区占满 */
  .main { order: 1; flex: 1; min-height: 0; }
  .view { min-height: 0; }

  /* 聊天头更紧凑 */
  .chat-head { padding: 9px 14px; }
  .panel-head { padding: 11px 14px; }

  .log { padding: 12px; gap: 10px; }
  .bubble { max-width: 78%; font-size: 15px; }
  .bubble img.sticker { width: 110px; height: 110px; }

  /* 输入区：窄屏不能挤成一团 */
  .composer { padding: 7px 8px 8px; gap: 6px; align-items: center; }
  .tools { padding-bottom: 0; gap: 0; }
  .tool { font-size: 20px; padding: 2px 3px; }
  textarea {
    font-size: 16px;              /* 避免安卓聚焦时放大 */
    min-height: 38px; max-height: 96px;
    padding: 8px 10px;
    overflow-y: auto;
    line-height: 1.4;
  }
  .send { padding: 8px 14px; }
  .sticker-pop { left: 8px; right: 8px; width: auto; bottom: 58px; }

  /* 设置页更宽松 */
  .settings { padding: 14px; }
  .srow input { max-width: none; flex: 1; }

  .moments { padding: 12px; }
  .moment .pics img { width: 88px; height: 88px; }

  .sticker-grid { padding: 10px; grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .sticker-grid .cell { padding: 4px; }
}
.moment .m-del {
  border: 1px solid var(--line); background: transparent; color: #a55;
  border-radius: 6px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.moment .m-del:hover { background: rgba(255,80,80,.15); color: #f88; }
/* ── 插件 ── */
.plugin-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; }
.plugin-card { border: 1px solid rgba(255,255,255,.10); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.03); }
.plugin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.plugin-state { font-size: 12px; opacity: .65; margin-top: 8px; }
.plugin-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plugin-topics .chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(120,180,255,.14); }
.plugin-watch { display: flex; gap: 8px; margin-top: 10px; }
.plugin-watch .plugin-link { flex: 1; min-width: 0; }
.plugin-actions { margin-top: 8px; }
.plugin-out { font-size: 12px; opacity: .8; margin-top: 8px; white-space: pre-wrap; }

/* ═══════════ v1.27：圆润 / 抽屉 / 动画 / 引用 ❐══════════ */
:root {
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 6px 20px rgba(0, 0, 0, .28);
}

/* 更圆 */
.avatar { border-radius: 12px; }
.avatar.sm { border-radius: 10px; }
.bubble { border-radius: 18px; padding: 10px 14px; }
.msg.me .bubble { border-radius: 18px 6px 18px 18px; }
.msg:not(.me) .bubble { border-radius: 6px 18px 18px 18px; }
.chat-head { border-radius: 0; }
.panel-head { border-radius: 0; }
.srow input, .modal, .sticker-pop, .modal textarea { border-radius: var(--radius-md); }
.srow input { border-radius: var(--radius-sm); }
.ghost { border-radius: 999px; }
.send { border-radius: 999px; }
.tab { border-radius: 14px; }
.moment, .plugin-card, .sticker-grid .cell { border-radius: var(--radius-lg); }
.bubble img.photo, .bubble video { border-radius: 12px; }
textarea { border-radius: 16px; }
.composer { background: rgba(28, 28, 28, .92); backdrop-filter: blur(12px); }
.chat-head { background: rgba(32, 32, 32, .92); backdrop-filter: blur(12px); }

/* 页面切换动画 */
.view.active { animation: viewIn .26s cubic-bezier(.22, .8, .24, 1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: none; }
}
.msg { animation: msgIn .18s ease-out; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* 汉堡按钮 */
.menu-btn {
  display: none; position: fixed; left: 12px; top: calc(9px + env(safe-area-inset-top)); z-index: 52;
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(36, 36, 36, .92); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  backdrop-filter: blur(10px);
}
.menu-btn span { display: block; width: 16px; height: 1.6px; background: var(--ink); border-radius: 2px; }
.menu-btn:active { transform: scale(.95); }
.drawer-mask { display: none; }

/* 引用栏 */
.composer { flex-wrap: wrap; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.quote-bar {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06);
  border-left: 3px solid var(--green);
}
.quote-bar[hidden] { display: none; }
.quote-bar .quote-text {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quote-bar .quote-x { border: 0; background: transparent; color: var(--soft); cursor: pointer; font-size: 14px; }

/* 气泡里的引用块 */
.bubble .quoted {
  display: block; margin-bottom: 6px; padding: 5px 9px; border-radius: 10px;
  background: rgba(0, 0, 0, .18); font-size: 12.5px; opacity: .85;
  border-left: 2px solid rgba(255, 255, 255, .35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg.me .bubble .quoted { background: rgba(0, 0, 0, .14); border-left-color: rgba(0, 0, 0, .35); }

/* 撤回 */
.msg.recalled .bubble {
  background: transparent; border: 1px dashed var(--line); color: var(--soft);
  font-size: 12.5px; font-style: italic;
}

/* 长按动作面板 */
.act-sheet {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 62;
  display: flex; flex-direction: column; min-width: 200px;
  background: #232323; border: 1px solid var(--line); border-radius: 18px;
  padding: 6px; box-shadow: var(--shadow-1);
  animation: sheetIn .18s ease-out;
}
.act-sheet[hidden] { display: none; }
.act-sheet button {
  border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px;
  padding: 12px 16px; border-radius: 12px; cursor: pointer; text-align: center;
}
.act-sheet button:hover { background: rgba(255, 255, 255, .07); }
.act-sheet button.muted { color: var(--soft); }
@keyframes sheetIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 聊天背景 */
.log.bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 插件卡在窄屏也别溢出 */
.plugin-card { overflow-wrap: anywhere; }
.plugin-head { gap: 10px; flex-wrap: wrap; }
.plugin-head .ghost { flex: 0 0 auto; }
.plugin-watch { flex-wrap: wrap; }
.plugin-watch .plugin-link { min-width: 120px; }
.plugin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 手机：抽屉式导航（v1.27 取代底部标签栏） ── */
@media (max-width: 760px) {
  body { flex-direction: row; }
  .main { order: 0; flex: 1; min-height: 0; }
  .rail {
    order: 0;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    width: 236px; height: 100dvh; max-height: 100dvh;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 20px 12px calc(14px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line); border-top: 0;
    background: #1b1b1b;
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    overflow-y: auto;
  }
  body.drawer-open .rail { transform: translateX(0); }
  .rail .me { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0 4px 18px; }
  .rail .me-name { max-width: 130px; text-align: left; font-size: 13px; }
  .rail-foot { display: block; margin-top: auto; padding: 10px 6px 0; text-align: left; }
  .tabs {
    flex-direction: column; width: 100%; height: auto; flex: 0 0 auto;
    align-items: stretch; justify-content: flex-start; gap: 6px;
  }
  .tab {
    width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: 14px;
  }
  .tab .ic { font-size: 19px; }
  .tab .tx { font-size: 14px; }
  .tab.active { background: rgba(47, 181, 90, .16); }
  .menu-btn { display: flex; }
  .drawer-mask { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  body.drawer-open .drawer-mask { display: block; }
  body.drawer-open { overflow: hidden; }

  /* 给汉堡按钮让位 */
  .chat-head, .panel-head { padding-left: 58px; }
  .composer-row { gap: 6px; }
  .settings { padding-bottom: 28px; }
}
.plugin-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ghost.danger { color: #e08a8a; border-color: rgba(224, 138, 138, .35); }
.ghost.danger:hover { background: rgba(224, 138, 138, .12); }
/* 插件输入框跟主题一致（别用浏览器默认的白底） */
.plugin-link, .srow input, .modal input {
  background: #171717; color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; font: inherit; outline: none;
}
.plugin-link:focus, .srow input:focus { border-color: rgba(47, 181, 90, .5); }
.plugin-watch .plugin-link { flex: 1 1 140px; min-width: 0; }
/* 设置页要能自己滚（手机上内容一多就被切掉） */
.settings {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.view { min-height: 0; }
@media (max-width: 760px) {
  .settings { max-width: none; padding: 16px 14px calc(28px + env(safe-area-inset-bottom)); }
  .plugin-card { margin-bottom: 4px; }
}
/* 手机上点按钮不要出现那层蓝底（tap highlight / 长按选中） */
* { -webkit-tap-highlight-color: transparent; }
button, .tab, .tool, .ghost, .send, .act-sheet button, .msg, .bubble, .cell {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.msg .bubble, .msg .av, .msg .quoted {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
button:focus, button:active, .ghost:focus, .ghost:active {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
/* 戳一戳 */
.msg-poke {
  align-self: center; font-size: 12px; color: var(--soft);
  padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .05);
  margin: 2px 0;
}
.avatar.poke { animation: pokeShake .55s cubic-bezier(.36, .07, .19, .97); }
@keyframes pokeShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-4px) rotate(-6deg); }
  30% { transform: translateX(4px) rotate(6deg); }
  45% { transform: translateX(-3px) rotate(-4deg); }
  60% { transform: translateX(3px) rotate(4deg); }
  80% { transform: translateX(-1px) rotate(-2deg); }
}
#herAvatar { cursor: pointer; }
/* 戳一戳提示在背景图上也要看得清 */
.msg-poke {
  background: rgba(0, 0, 0, .55);
  color: #e8e8e8;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .08);
}
/* 日记 */
.diary {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.diary-item {
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px;
  background: rgba(255, 255, 255, .03);
}
.diary-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.diary-date { font-size: 12.5px; color: var(--green); font-weight: 600; }
.diary-where { font-size: 11.5px; color: var(--soft); }
.diary-text { font-size: 14.5px; line-height: 1.85; white-space: normal; }
@media (max-width: 760px) {
  .diary { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
  .diary-item { border-radius: 16px; padding: 12px 14px; }
  .diary-text { font-size: 15px; line-height: 1.9; }
}

.voice{width:240px;max-width:70vw;} .msg.her .voice{margin:2px 0;}


/* 消息通知按钮 */
.push-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  opacity: .75;
}
.push-btn:hover { opacity: 1; background: rgba(127, 127, 127, .12); }

/* 语音气泡（像 QQ） */
.voice-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  max-width: 240px;
  padding: 4px 2px;
  cursor: pointer;
  user-select: none;
}
.voice-bubble .vb-play {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(120, 160, 255, .28);
  color: inherit;
  font-size: 11px;
  line-height: 26px;
  text-align: center;
  padding: 0;
  flex: 0 0 auto;
}
.voice-bubble .vb-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}
.voice-bubble .vb-bars i {
  width: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: .55;
}
.voice-bubble .vb-bars i:nth-child(1) { height: 6px; }
.voice-bubble .vb-bars i:nth-child(2) { height: 12px; }
.voice-bubble .vb-bars i:nth-child(3) { height: 8px; }
.voice-bubble .vb-bars i:nth-child(4) { height: 16px; }
.voice-bubble .vb-bars i:nth-child(5) { height: 10px; }
.voice-bubble .vb-bars i:nth-child(6) { height: 14px; }
.voice-bubble .vb-bars i:nth-child(7) { height: 7px; }
.voice-bubble .vb-bars i:nth-child(8) { height: 11px; }
.voice-bubble .vb-dur {
  font-size: 12px;
  opacity: .75;
  margin-left: auto;
}
.voice-bubble.playing .vb-bars i { animation: vbWave .9s ease-in-out infinite; opacity: .9; }
.voice-bubble.playing .vb-bars i:nth-child(2n) { animation-delay: .15s; }
.voice-bubble.playing .vb-bars i:nth-child(3n) { animation-delay: .3s; }
@keyframes vbWave {
  0%, 100% { transform: scaleY(.6); }
  50% { transform: scaleY(1.25); }
}
.voice-bubble audio { display: none; }