/* =========================================================
   YIER. chat — 照着 iMessage 的感觉做
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-2: #f2f2f7;
  --text: #000000;
  --text-2: #8a8a8e;
  --text-3: #b4b4b9;
  --sep: rgba(60, 60, 67, 0.18);
  --blue: #0b7dff;
  --blue-press: #0a6ad6;
  --bubble: #e9e9eb;
  --bubble-text: #000;
  --red: #ff3b30;
  --green: #34c759;
  --nav: rgba(249, 249, 249, 0.82);
  --hover: rgba(0, 0, 0, 0.04);
  --press: rgba(0, 0, 0, 0.08);
  --select: #0b7dff;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
  --dim: rgba(0, 0, 0, 0.32);
  --orange: #e8682e;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);          /* iOS 推入、弹出 */
  --spring: cubic-bezier(0.2, 1.2, 0.35, 1);       /* 带一点回弹 */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --vv-h: 100dvh;
  --vv-top: 0px;
  --fs: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --text: #ffffff;
    --text-2: #8d8d93;
    --text-3: #5a5a5f;
    --sep: rgba(84, 84, 88, 0.6);
    --blue: #0a84ff;
    --blue-press: #3d9bff;
    --bubble: #26252a;
    --bubble-text: #fff;
    --red: #ff453a;
    --green: #30d158;
    --nav: rgba(22, 22, 24, 0.78);
    --hover: rgba(255, 255, 255, 0.06);
    --press: rgba(255, 255, 255, 0.12);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    --dim: rgba(0, 0, 0, 0.55);
  }
}
@media (max-width: 767px) {
  :root { --fs: 17px; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs)/1.32 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

/* ---------- 头像 ---------- */
.avatar {
  position: relative; flex-shrink: 0;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 20px; letter-spacing: 0;
  background: linear-gradient(180deg, var(--a1, #a5abb8), var(--a2, #858994));
  user-select: none;
}
.avatar.group { border-radius: 30%; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.xs { width: 30px; height: 30px; font-size: 13px; }
.avatar.md { width: 40px; height: 40px; font-size: 16px; }
.avatar.lg { width: 84px; height: 84px; font-size: 34px; }
.avatar .dot {
  position: absolute; right: 0; bottom: 0;
  width: 26%; height: 26%; min-width: 9px; min-height: 9px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- 布局 ---------- */
.app {
  position: fixed; left: 0; right: 0;
  top: var(--vv-top); height: var(--vv-h);
  display: grid; grid-template-columns: 340px 1fr;
  overflow: hidden;
}
.pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.list-pane { border-right: 0.5px solid var(--sep); z-index: 1; }
.chat-pane { z-index: 2; }

/* 毛玻璃导航栏 */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  padding-top: env(safe-area-inset-top);
  min-height: calc(52px + env(safe-area-inset-top));
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s;
}
.nav.edge { border-bottom-color: var(--sep); }
.nav-btn {
  min-width: 44px; height: 44px; border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  color: var(--blue);
  transition: opacity 0.15s;
}
.nav-btn:active { opacity: 0.4; }
.nav-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-weight: 600; font-size: 17px; opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.list-pane.scrolled .nav-title { opacity: 1; }

/* ---------- 列表 ---------- */
.list-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-top: calc(52px + env(safe-area-inset-top));
  padding-bottom: env(safe-area-inset-bottom);
}
.large-title { padding: 0 16px 6px; }
.large-title h1 { margin: 2px 0 0; font-size: 34px; font-weight: 700; letter-spacing: 0.3px; }
.conn-line {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 13px; margin-top: 2px;
  animation: fade-in 0.3s;
}
.room-list { list-style: none; margin: 0; padding: 0 0 20px; }
.room {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 0 22px; cursor: pointer; user-select: none;
  transition: background 0.15s;
}
.room:active { background: var(--press); }
@media (hover: hover) { .room:hover { background: var(--hover); } }
.room.active { background: var(--select); color: #fff; }
.room.active .room-time, .room.active .room-preview, .room.active .chev { color: rgba(255, 255, 255, 0.82); }
.room .udot {
  position: absolute; left: 7px; top: 50%;
  width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--blue);
  transform: scale(0); transition: transform 0.3s var(--spring);
}
.room.unread .udot { transform: scale(1); animation: pop 0.4s var(--spring); }
.room.active .udot { background: #fff; }
.room-main {
  flex: 1; min-width: 0; padding: 10px 14px 10px 0;
  border-bottom: 0.5px solid var(--sep);
}
.room:last-child .room-main { border-bottom-color: transparent; }
.room-top { display: flex; align-items: baseline; gap: 6px; }
.room-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-time { font-size: 15px; color: var(--text-2); flex-shrink: 0; }
.chev { color: var(--text-3); flex-shrink: 0; margin-left: 2px; align-self: center; }
.room-preview {
  color: var(--text-2); font-size: 15px; line-height: 1.3; margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; word-break: break-all;
}
.room-preview.typing { color: var(--blue); }
.room.active .room-preview.typing { color: #fff; }
.room.enter { animation: room-in 0.45s var(--ease); }
.room-empty { white-space: pre-line; padding: 50px 30px; color: var(--text-2); text-align: center; font-size: 15px; line-height: 1.6; }

/* ---------- 聊天窗口 ---------- */
.empty-chat {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  color: var(--text-3); font-size: 15px; padding: 20px; text-align: center;
}
.empty-chat p { margin: 0; color: var(--text-2); }
.chat { position: absolute; inset: 0; }

.chat-nav { min-height: calc(64px + env(safe-area-inset-top)); align-items: center; }
.chat-nav .back { justify-content: flex-start; padding-left: 6px; min-width: 64px; visibility: hidden; }
.back-count {
  font-size: 17px; margin-left: 4px; min-width: 0;
}
.back-count:not(:empty) {
  background: var(--blue); color: #fff; border-radius: 11px; font-size: 14px; font-weight: 600;
  padding: 1px 7px; animation: pop 0.3s var(--spring);
}
.ghost-slot { min-width: 64px; visibility: hidden; }
.chat-id {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 10px; border-radius: 10px; min-width: 0; max-width: 60%;
  transition: opacity 0.15s;
}
.chat-id:active { opacity: 0.5; }
.chat-avatar .avatar { width: 38px; height: 38px; font-size: 16px; }
.chat-name {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: 12px; color: var(--text);
}
.chat-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-name svg { color: var(--text-3); flex-shrink: 0; }
.chat-status { font-size: 10.5px; color: var(--text-2); line-height: 1.1; min-height: 11px; transition: color 0.2s; }
.chat-status.on { color: var(--green); }

.messages {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding-top: var(--head-h, 72px);
  padding-bottom: var(--comp-h, 60px);
  -webkit-overflow-scrolling: touch;
}
.msgs-inner { display: flex; flex-direction: column; padding: 8px 0 6px; min-height: 100%; justify-content: flex-end; }

/* 顶部：加载 / 聊天开头 */
.top-note { align-self: center; padding: 18px 20px 8px; text-align: center; color: var(--text-2); font-size: 12px; }
.top-note .avatar { margin: 0 auto 8px; }
.top-note b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 2px; }

.time-head {
  align-self: center; margin: 14px 0 6px; color: var(--text-2);
  font-size: 11.5px; font-weight: 400; text-align: center;
}
.time-head b { font-weight: 600; }
.sys {
  align-self: center; max-width: 80%; text-align: center;
  margin: 10px 0 6px; color: var(--text-2); font-size: 11.5px; line-height: 1.4;
}

.row { position: relative; display: flex; align-items: flex-end; padding: 0 14px; margin-top: 2px; }
.row.first { margin-top: 8px; }
.row.after-head { margin-top: 2px; }
.row.mine { justify-content: flex-end; }
.row .av { position: relative; z-index: 1; width: 28px; margin-right: 8px; flex-shrink: 0; align-self: flex-end; } /* 压在气泡尾巴的遮罩上面 */
.row .av .avatar { visibility: hidden; }
.row.tail .av .avatar { visibility: visible; }
.bwrap { display: flex; flex-direction: column; max-width: min(74%, 540px); min-width: 0; }
.row.mine .bwrap { align-items: flex-end; }
.row.group-theirs .bwrap { max-width: min(70%, 520px); }
.sender { font-size: 11.5px; color: var(--text-2); margin: 0 0 2px 12px; display: none; }
.row.first .sender { display: block; }

.bubble {
  position: relative;
  padding: 7px 13px 8px;
  border-radius: 18px;
  background: var(--bubble); color: var(--bubble-text);
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  line-height: 1.3;
  user-select: text; -webkit-user-select: text;
  -webkit-touch-callout: default;
}
.row.mine .bubble { background: var(--blue); color: #fff; }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* 气泡尾巴（经典两层伪元素做法） */
.row.tail .bubble:not(.jumbo)::before,
.row.tail .bubble:not(.jumbo)::after {
  content: ""; position: absolute; bottom: 0; height: 20px;
}
.row.tail.mine .bubble:not(.jumbo)::before {
  right: -7px; width: 20px; background: var(--blue);
  border-bottom-left-radius: 16px 14px;
}
.row.tail.mine .bubble:not(.jumbo)::after {
  right: -26px; width: 26px; background: var(--bg);
  border-bottom-left-radius: 10px;
}
.row.tail:not(.mine) .bubble:not(.jumbo)::before {
  left: -7px; width: 20px; background: var(--bubble);
  border-bottom-right-radius: 16px 14px;
}
.row.tail:not(.mine) .bubble:not(.jumbo)::after {
  left: -26px; width: 26px; background: var(--bg);
  border-bottom-right-radius: 10px;
}

/* 纯表情：大号、无气泡 */
.bubble.jumbo { background: none !important; padding: 0 2px; font-size: 46px; line-height: 1.15; }

/* 发送失败 */
.fail-ico {
  width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  margin-left: 8px; flex-shrink: 0; cursor: pointer; align-self: center;
  animation: pop 0.35s var(--spring);
}
.status {
  align-self: flex-end; padding: 2px 18px 0; font-size: 11.5px; color: var(--text-2);
  animation: fade-in 0.3s ease-out;
}
.status b { font-weight: 600; }
.status.fail { color: var(--red); cursor: pointer; }
.status.sending { animation: fade-in 0.3s ease-out 0.9s both; }

/* 左滑看时间 */
.stamp {
  position: absolute; right: 0; bottom: 8px;
  padding: 0 14px 0 6px; font-size: 11.5px; color: var(--text-2); white-space: nowrap;
  transform: translateX(calc(100% - var(--r, 0px)));
  pointer-events: none;
}
.row.mine .bwrap, .row.mine .fail-ico { transform: translateX(calc(-1 * var(--r, 0px))); }
.msgs-inner.settle .stamp,
.msgs-inner.settle .row.mine .bwrap,
.msgs-inner.settle .row.mine .fail-ico { transition: transform 0.35s var(--ease); }

/* 正在输入 */
.typing-bubble {
  position: relative; display: flex; gap: 4px; align-items: center;
  padding: 12px 14px; border-radius: 20px; background: var(--bubble);
}
.typing-bubble::before, .typing-bubble::after {
  content: ""; position: absolute; border-radius: 50%; background: var(--bubble);
}
.typing-bubble::before { width: 12px; height: 12px; left: -2px; bottom: -2px; }
.typing-bubble::after { width: 6px; height: 6px; left: -7px; bottom: -7px; }
.typing-bubble i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-2);
  animation: typing 1.3s infinite ease-in-out;
}
.typing-bubble i:nth-child(2) { animation-delay: 0.18s; }
.typing-bubble i:nth-child(3) { animation-delay: 0.36s; }
.row.typing-row { margin-top: 10px; margin-bottom: 4px; padding-left: 22px; }
.row.typing-row.leave { animation: shrink-out 0.22s ease-in forwards; }

/* 进场动画 */
.row.send-in .bwrap { animation: send-in 0.5s var(--spring); transform-origin: 100% 100%; }
.row.recv-in .bwrap, .row.typing-row.recv-in .typing-bubble { animation: recv-in 0.45s var(--spring); transform-origin: 0 100%; }
.row.recv-in .av .avatar { animation: fade-in 0.4s; }
.sys.recv-in, .time-head.recv-in { animation: fade-in 0.4s; }

/* 新消息提示 */
.jump {
  position: absolute; left: 50%; bottom: calc(var(--comp-h, 60px) + 10px); z-index: 6;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 18px;
  background: var(--nav); color: var(--blue); font-size: 14px; font-weight: 600;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
  animation: jump-in 0.35s var(--spring);
}

/* ---------- 输入栏 ---------- */
.composer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 7px 12px;
  padding-bottom: calc(7px + env(safe-area-inset-bottom));
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.field {
  position: relative; display: flex; align-items: flex-end;
  border: 1px solid var(--sep); border-radius: 19px; background: var(--bg);
  min-height: 36px;
  transition: border-color 0.2s;
}
.field textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  padding: 7px 44px 7px 14px; max-height: 150px; line-height: 1.3;
  font-size: var(--fs);   /* 至少 16px，iOS 才不会一点输入框就放大页面 */
}
.field textarea::placeholder { color: var(--text-3); }
.send {
  position: absolute; right: 3px; bottom: 3px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  transform: scale(1); transition: transform 0.28s var(--spring), opacity 0.2s, background 0.15s;
}
.send:active { background: var(--blue-press); }
.send:disabled { transform: scale(0.4); opacity: 0; pointer-events: none; }

/* ---------- 面板（新聊天、群信息……） ---------- */
.sheet-back, .asheet-back {
  position: fixed; inset: 0; z-index: 40; background: var(--dim);
  animation: fade-in 0.3s;
}
.sheet-back.out, .asheet-back.out { animation: fade-out 0.25s forwards; }
.sheet {
  position: fixed; z-index: 41; left: 50%; top: 50%;
  width: min(440px, calc(100% - 32px)); max-height: min(680px, 86vh);
  transform: translate(-50%, -50%);
  background: var(--bg-2); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-pop 0.32s var(--ease);
}
.sheet.out { animation: sheet-pop-out 0.2s ease-in forwards; }
.grabber { display: none; }
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 14px 10px; flex-shrink: 0;
}
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-btn { color: var(--blue); font-size: 17px; justify-self: start; padding: 4px 2px; }
.sheet-btn.strong { font-weight: 600; justify-self: end; }
.sheet-btn:disabled { color: var(--text-3); cursor: default; }
.sheet-btn:active:not(:disabled) { opacity: 0.4; }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px;
  background: var(--press); border-radius: 9px; margin: 0 0 14px; position: relative;
}
.seg button { position: relative; z-index: 1; padding: 6px; font-size: 14px; font-weight: 500; border-radius: 7px; }
.seg .thumb {
  position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 3px);
  border-radius: 7px; background: var(--bg); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s var(--ease);
}
.seg[data-i="1"] .thumb { transform: translateX(calc(100% + 2px)); }
@media (prefers-color-scheme: dark) { .seg .thumb { background: #636366; } }

.group-box { background: var(--bg); border-radius: 11px; overflow: hidden; margin-bottom: 18px; }
.group-label { font-size: 13px; color: var(--text-2); margin: 0 0 6px 16px; text-transform: uppercase; }
.cell {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 16px; min-height: 48px; text-align: left; position: relative;
}
.cell + .cell::before {
  content: ""; position: absolute; top: 0; right: 0; left: 56px; border-top: 0.5px solid var(--sep);
}
.cell.plain + .cell.plain::before { left: 16px; }
button.cell:active, .cell.tap:active { background: var(--press); }
.cell .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .sub { font-size: 13px; color: var(--text-2); }
.cell.blue { color: var(--blue); }
.cell.red { color: var(--red); }
.check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text-3); flex-shrink: 0;
  display: grid; place-items: center; transition: background 0.2s, border-color 0.2s;
}
.check svg { transform: scale(0); transition: transform 0.25s var(--spring); }
.cell.on .check { background: var(--blue); border-color: var(--blue); }
.cell.on .check svg { transform: scale(1); }
.text-input {
  width: 100%; border: 0; outline: none; background: var(--bg);
  border-radius: 11px; padding: 12px 16px; margin-bottom: 18px; font-size: var(--fs);
}
.profile { text-align: center; padding: 6px 0 18px; }
.profile .avatar { margin: 0 auto 10px; }
.profile h3 { margin: 0; font-size: 22px; font-weight: 600; }
.profile p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.profile p.on { color: var(--green); }
.foot-note { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: -8px 16px 18px; }

/* 操作菜单（iOS action sheet） */
.asheet {
  position: fixed; z-index: 51; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(420px, calc(100% - 16px));
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  animation: up-in 0.38s var(--ease);
}
.asheet.out { animation: up-out 0.25s ease-in forwards; }
.asheet-back { z-index: 50; }
.asheet-group, .asheet-cancel {
  background: var(--nav); border-radius: 14px; overflow: hidden;
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
}
@media (prefers-color-scheme: light) { .asheet-group, .asheet-cancel { background: rgba(255, 255, 255, 0.92); } }
.asheet-title { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.asheet-btn {
  display: block; width: 100%; padding: 16px; font-size: 19px; color: var(--blue); text-align: center;
  border-top: 0.5px solid var(--sep);
}
.asheet-group > :first-child { border-top: 0; }
.asheet-btn.danger { color: var(--red); }
.asheet-btn:active, .asheet-cancel:active { background: var(--press); }
.asheet-cancel {
  display: block; width: 100%; margin-top: 8px; padding: 16px; font-size: 19px; font-weight: 600; color: var(--blue);
}

/* ---------- 其他 ---------- */
.gate, .loading {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
}
.gate-card { max-width: 320px; animation: fade-up 0.5s var(--ease); }
.gate-icon {
  width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center;
  background: linear-gradient(180deg, #5fb0ff, var(--blue)); color: #fff;
  box-shadow: 0 8px 24px rgba(11, 125, 255, 0.3);
}
.brand { font-weight: 700; font-size: 24px; letter-spacing: 0.3px; }
.brand span { color: var(--orange); }
.gate p { margin: 10px 0; line-height: 1.6; }
.muted { color: var(--text-2); }
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 60;
  transform: translateX(-50%);
  background: var(--nav); color: var(--text);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  padding: 10px 18px; border-radius: 22px; font-size: 14px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); text-align: center;
  animation: toast-in 0.4s var(--spring);
}
.toast.out { animation: toast-out 0.25s ease-in forwards; }

.spinner {
  display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--text-3); border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.spinner.big { width: 26px; height: 26px; border-width: 2.5px; }

/* ---------- 手机：两页叠起来，推入推出 ---------- */
@media (max-width: 767px) {
  .app { display: block; }
  .pane { position: absolute; inset: 0; will-change: transform; transition: transform 0.45s var(--ease); }
  .list-pane { border-right: 0; }
  .list-pane::after {
    content: ""; position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none;
    transition: opacity 0.45s var(--ease); z-index: 10;
  }
  .chat-pane { transform: translateX(100%); box-shadow: none; transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease); }
  .app[data-view="chat"] .chat-pane, .app.dragging .chat-pane { transform: translateX(0); box-shadow: -1px 0 0 var(--sep), -12px 0 30px rgba(0, 0, 0, 0.08); }
  .app[data-view="chat"] .list-pane { transform: translateX(-28%); }
  .app[data-view="chat"] .list-pane::after { opacity: 0.1; }
  .app.dragging .pane, .app.dragging .list-pane::after, .app.no-anim .pane, .app.no-anim .list-pane::after { transition: none; }
  .chat-nav .back { visibility: visible; }
  .room.active { background: transparent; color: inherit; }
  .room.active .room-time, .room.active .room-preview { color: var(--text-2); }
  .room.active .chev { color: var(--text-3); }
  .room.active .udot { background: var(--blue); }
  .empty-chat { display: none; }
  .bwrap { max-width: 78%; }

  /* 面板从底下滑上来 */
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%;
    max-height: calc(var(--vv-h) - 44px - env(safe-area-inset-top));
    transform: none; border-radius: 12px 12px 0 0;
    animation: up-in 0.45s var(--ease);
  }
  .sheet.out { animation: up-out 0.3s ease-in forwards; }
  .grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--text-3); margin: 6px auto 0; opacity: 0.6; }
  .sheet-head { padding-top: 6px; }
}

/* ---------- 关键帧 ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { transform: scale(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes send-in {
  0% { transform: translateY(28px) scale(0.88); opacity: 0.2; }
  60% { opacity: 1; }
}
@keyframes recv-in {
  0% { transform: scale(0.5); opacity: 0; }
  40% { opacity: 1; }
}
@keyframes shrink-out { to { transform: scale(0.5); opacity: 0; transform-origin: 0 100%; } }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
@keyframes room-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes jump-in { from { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } }
@keyframes sheet-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); } }
@keyframes sheet-pop-out { to { opacity: 0; transform: translate(-50%, -50%) scale(0.97); } }
@keyframes up-in { from { transform: translate(var(--tx, 0), 100%); } }
@keyframes up-out { to { transform: translate(var(--tx, 0), 100%); } }
.asheet { --tx: -50%; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}
