/* 小鲸鱼备用网页通道 · 深色移动优先样式
 * 配色：背景 #0f1218 / 卡片 #171b24 / 主色 #4f7cff
 * 手机优先，桌面居中（max-width 720px）；支持刘海与底部安全区。
 */

:root {
  --bg: #0f1218;
  --panel: #171b24;
  --panel-2: #1b2230;
  --line: #232b3a;
  --ink: #e8edf5;
  --muted: #8b95a7;
  --brand: #4f7cff;
  --brand-strong: #3f6ae8;
  --ok: #33c481;
  --warn: #f0a63c;
  --danger: #ff7373;
  --radius: 16px;
  color-scheme: dark;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 主容器 ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 760px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- 顶部状态栏 ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(15, 18, 24, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand-mark {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #9db6ff;
  background: linear-gradient(160deg, #24325c, #161c2b);
  border: 1px solid #2a3550;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }
.brand-text small { font-size: 11px; color: var(--muted); margin-top: 2px; }

.conn {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.green { background: var(--ok); box-shadow: 0 0 0 3px rgba(51, 196, 129, 0.16); }
.dot.amber { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 166, 60, 0.16); }
.dot.grey { background: #5d6678; }
.dot.pulse { animation: dotPulse 1.2s ease-in-out infinite; }

@keyframes dotPulse { 50% { opacity: 0.35; } }

/* ---------- 提示条 ---------- */
.banner {
  flex: none;
  padding: 8px 16px;
  font-size: 12.5px;
  color: #f4c47e;
  background: rgba(240, 166, 60, 0.1);
  border-bottom: 1px solid rgba(240, 166, 60, 0.22);
}

/* ---------- 消息区 ---------- */
.log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: #2b3346 transparent;
  -webkit-overflow-scrolling: touch;
}

.log::-webkit-scrollbar { width: 6px; }
.log::-webkit-scrollbar-thumb { background: #2b3346; border-radius: 3px; }

.hint {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 16px;
  line-height: 1.7;
}

.row { display: flex; width: 100%; }
.row.owner { justify-content: flex-end; }
.row.system { justify-content: center; }

.wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
  min-width: 0;
}

.row.owner .wrap { align-items: flex-end; }

/* 「主动找你」标记 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  padding: 1px 8px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #f4c47e;
  background: rgba(240, 166, 60, 0.12);
  border: 1px solid rgba(240, 166, 60, 0.3);
  border-radius: 999px;
}
.tag::before { content: "▸"; font-size: 9px; opacity: 0.8; }

.bubble {
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.row.her .bubble {
  background: var(--panel-2);
  color: #dbe3ef;
  border: 1px solid #263042;
  border-bottom-left-radius: 6px;
}

.row.owner .bubble {
  background: linear-gradient(150deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.22);
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding: 0 3px;
  font-size: 11px;
  color: var(--muted);
}
.row.owner .meta { justify-content: flex-end; }

.time { font-variant-numeric: tabular-nums; }
.pending { color: #7c8798; }
.retry {
  padding: 0;
  border: 0;
  background: none;
  color: var(--danger);
  font: inherit;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
}

/* 系统消息（例如通道变更提示） */
.sys {
  max-width: 82%;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

/* 打字气泡 */
.bubble.dots { display: inline-flex; align-items: center; gap: 4px; padding: 13px 14px; }
.bubble.dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #96a3b8;
  animation: typing 1.2s infinite ease-in-out;
}
.bubble.dots span:nth-child(2) { animation-delay: 0.15s; }
.bubble.dots span:nth-child(3) { animation-delay: 0.3s; }
.typing .time { color: var(--muted); }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* 新消息浮标 */
.jump {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #33415e;
  background: rgba(30, 37, 50, 0.96);
  color: #cdd8ea;
  font: inherit;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: jumpIn 0.18s ease-out;
}
.jump:active { transform: translateX(-50%) scale(0.97); }

@keyframes jumpIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 轻提示 */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 8;
  max-width: 86%;
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(46, 26, 30, 0.97);
  border: 1px solid rgba(255, 115, 115, 0.34);
  color: #ffd9d9;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: jumpIn 0.16s ease-out;
}

/* ---------- 输入区 ---------- */
.composer {
  flex: none;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(19, 23, 32, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.typing-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 7px;
  font-size: 12px;
  color: var(--muted);
}

.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: #7f8b9f;
  animation: typing 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

.input-row { display: flex; align-items: flex-end; gap: 8px; }

textarea#input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 13px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* iOS 小于 16px 会放大页面 */
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea#input::placeholder { color: #6c7688; }
textarea#input:focus {
  border-color: rgba(79, 124, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.14);
}

.send {
  flex: none;
  height: 44px;
  min-width: 68px;
  padding: 0 18px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(150deg, var(--brand), var(--brand-strong));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
}
.send:active:not(:disabled) { transform: scale(0.97); }
.send:disabled { opacity: 0.42; cursor: default; }

/* ---------- 解锁卡片 ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(79, 124, 255, 0.2), transparent 62%),
    radial-gradient(700px 400px at 50% 110%, rgba(79, 124, 255, 0.08), transparent 60%),
    var(--bg);
}

.lock-card {
  width: 100%;
  max-width: 340px;
  padding: 28px 22px 22px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid #242c3c;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.lock-card.shake { animation: shake 0.32s; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.lock-logo {
  width: 76px; height: 76px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 22px;
  background: linear-gradient(160deg, #1d2743, #141a26);
  border: 1px solid #2a3554;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lock-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lock-sub {
  margin: 6px 0 20px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.pin {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pin::placeholder { font-size: 14px; letter-spacing: 0.04em; color: #6c7688; font-weight: 400; }
.pin:focus {
  border-color: rgba(79, 124, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.16);
}

#lock-btn {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(150deg, var(--brand), var(--brand-strong));
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
}
#lock-btn:active { transform: scale(0.98); }
#lock-btn:disabled { opacity: 0.55; }

.lock-hint {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--danger);
  line-height: 1.5;
}

.lock-foot {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #6b7486;
}

/* 无障碍 / 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible { outline: 2px solid rgba(79, 124, 255, 0.7); outline-offset: 2px; }

[hidden] { display: none !important; }

/* ===========================================================================
 * 第二阶段（fix117）：媒体消息与互动
 * 只追加，不改上面的基础布局；下面覆盖的少量规则都写了原因。
 * =========================================================================== */

/* ---------- 顶部：头像 + 昵称 + 状态 + 戳一戳 ---------- */
.topbar { gap: 10px; }

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #2a3550;
  background: #141a26;
}

.brand-text { flex: 1 1 auto; }
.topbar { min-height: 56px; }
.brand-text .nick { line-height: 1.35; }
.brand-text .nick {
  font-size: 14.5px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}

.topbar-right { display: flex; align-items: center; gap: 7px; flex: none; }
.topbar-right .conn { padding: 4px 9px; font-size: 11.5px; }

.poke-btn {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.08s;
}
.poke-btn:active { transform: scale(0.92); }

/* ---------- 输入区按钮 ---------- */
.icon-btn {
  width: 40px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.recording {
  background: rgba(255, 115, 115, 0.18);
  border-color: rgba(255, 115, 115, 0.5);
  color: #ffd0d0;
}

.input-row { gap: 6px; }
.input-row textarea#input { min-width: 96px; }

/* ---------- 引用条（输入框中） ---------- */
.quote-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: rgba(79, 124, 255, 0.09);
}
.quote-bar-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.quote-bar-body b { flex: none; font-size: 12px; font-weight: 600; color: #a9c1ff; }
.quote-bar-body span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#quote-cancel { width: 28px; height: 28px; font-size: 12px; border-radius: 9px; }

/* ---------- 待发送附件 ---------- */
.attach-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.attach-strip::-webkit-scrollbar { display: none; }

.attach-chip {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  padding: 6px 26px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 12px;
  color: #c4cee0;
}
.attach-chip img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.attach-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
}

/* ---------- 图片消息 ---------- */
.bubble.media { padding: 6px; }
.bubble.media .caption { padding: 0 4px; }

.media-grid { display: grid; gap: 4px; max-width: 262px; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2, .media-grid.n3, .media-grid.n4 { grid-template-columns: 1fr 1fr; }

.media-img {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0e14;
  line-height: 0;
  cursor: zoom-in;
}
.media-img img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 150px;
  object-fit: cover;
}
.media-grid.n1 .media-img { max-width: 240px; }
.media-grid.n1 .media-img img { max-height: 260px; object-fit: cover; }

/* 表情包：无气泡底，最大 140px */
.row.sticker-row .wrap { max-width: 60%; }
.sticker {
  display: block;
  max-width: 140px;
  max-height: 140px;
  border-radius: 10px;
  cursor: zoom-in;
}

/* ---------- 语音消息 ---------- */
.voice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  max-width: 240px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.row.owner .voice { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.14); }

.voice-play {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11px;
  line-height: 1;
}
.voice-bars { display: flex; align-items: center; gap: 2.5px; height: 18px; flex: 1 1 auto; }
.voice-bars i { width: 2.5px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.voice-bars i:nth-child(1) { height: 5px; }
.voice-bars i:nth-child(2) { height: 10px; }
.voice-bars i:nth-child(3) { height: 15px; }
.voice-bars i:nth-child(4) { height: 8px; }
.voice-bars i:nth-child(5) { height: 13px; }
.voice-bars i:nth-child(6) { height: 6px; }
.voice.playing .voice-bars i { animation: voiceWave 0.9s infinite ease-in-out; }
.voice.playing .voice-bars i:nth-child(2n) { animation-delay: 0.15s; }
.voice.playing .voice-bars i:nth-child(3n) { animation-delay: 0.3s; }
.voice-dur { flex: none; font-size: 12px; opacity: 0.85; font-variant-numeric: tabular-nums; }

@keyframes voiceWave { 50% { transform: scaleY(0.4); } }

/* ---------- 文件消息 ---------- */
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 196px;
  max-width: 272px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  text-decoration: none;
}
.row.owner .file { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.14); }
.file-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 17px;
}
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.file-meta b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { font-size: 11.5px; color: var(--muted); }
.row.owner .file-meta small { color: rgba(255, 255, 255, 0.72); }
.file-dl { flex: none; opacity: 0.7; }

/* ---------- 引用块（消息里） ---------- */
.quote {
  max-width: 100%;
  margin-bottom: 5px;
  padding: 6px 9px;
  border-left: 2px solid rgba(79, 124, 255, 0.65);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.row.owner .quote {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  border-left-color: rgba(255, 255, 255, 0.6);
}
.quote-who { margin-right: 5px; font-weight: 600; color: #a9c1ff; }
.row.owner .quote-who { color: #fff; }
.quote-text { overflow-wrap: anywhere; }

/* ---------- 撤回 ---------- */
/* 注意：.row.owner .bubble 带蓝色渐变、优先级更高，这里必须压过它 */
.row .bubble.revoked,
.row.owner .bubble.revoked,
.row.her .bubble.revoked {
  background: rgba(255, 255, 255, 0.06);
  background-image: none;
  border: 1px dashed var(--line);
  color: var(--muted);
  box-shadow: none;
}

/* ---------- 戳一戳 ---------- */
.row.poke .sys {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c8b6ff;
  background: rgba(140, 110, 255, 0.12);
  border: 1px solid rgba(140, 110, 255, 0.28);
}
.poke-hand { font-size: 12px; }

/* 被戳时整页轻微抖一下 */
body.shake-body .app { animation: bodyShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes bodyShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.caption { margin-top: 7px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-text { color: var(--muted); font-size: 13px; }

/* ---------- 录音浮层 ---------- */
.rec-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
  background: rgba(4, 6, 10, 0.35);
}
.rec-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 26px;
  border-radius: 20px;
  background: rgba(30, 37, 50, 0.97);
  border: 1px solid #33415e;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  color: var(--ink);
}
.rec-card b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rec-card small { font-size: 11.5px; color: var(--muted); }
.rec-wave { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.rec-wave i { width: 3px; border-radius: 2px; background: var(--brand); animation: recWave 0.9s infinite ease-in-out; }
.rec-wave i:nth-child(1) { height: 8px; animation-delay: 0s; }
.rec-wave i:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.rec-wave i:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.rec-wave i:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.rec-wave i:nth-child(5) { height: 20px; animation-delay: 0.4s; }
.rec-wave i:nth-child(6) { height: 10px; animation-delay: 0.5s; }
.rec-wave i:nth-child(7) { height: 14px; animation-delay: 0.6s; }
#rec-cancel { width: 30px; height: 30px; margin-top: 2px; font-size: 12px; border-radius: 10px; }

@keyframes recWave { 50% { transform: scaleY(0.4); } }

/* ---------- 底部弹层（附件 / 长按菜单） ---------- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  align-items: flex-end;
  background: rgba(4, 6, 10, 0.55);
}
.sheet-card {
  width: 100%;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #2a3446;
  border-radius: 20px 20px 0 0;
  background: var(--panel);
  animation: sheetUp 0.18s ease-out;
}
.sheet-title { padding: 6px 8px 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.sheet-item {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.sheet-item:active { transform: scale(0.99); }
.sheet-item.cancel { text-align: center; color: var(--muted); }
.sheet-tip { margin: 8px 4px 2px; font-size: 11.5px; color: #6b7486; text-align: center; }

@keyframes sheetUp { from { transform: translateY(14px); opacity: 0.6; } to { transform: none; opacity: 1; } }

/* ---------- 图片大图 ---------- */
.lightbox {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 6, 10, 0.93);
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 88%; border-radius: 12px; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #33415e;
  border-radius: 50%;
  background: rgba(30, 37, 50, 0.9);
  color: #dbe3ef;
  font-size: 16px;
  cursor: pointer;
}

/* 小屏（<380px）时把输入区按钮压窄一点，别把输入框挤没 */
@media (max-width: 379px) {
  .icon-btn { width: 36px; }
  .send { min-width: 58px; padding: 0 12px; }
  .brand-text .nick { max-width: 34vw; }
}
