:root {
  --bg: #13171d;
  --line: rgba(223, 228, 235, 0.08);
  --text: #eef2f6;
  --muted: #98a2b0;
  --accent: #c2ccd8;
  --shadow: 0 28px 72px rgba(2, 6, 12, 0.32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(91, 107, 130, 0.22), transparent 24%),
    radial-gradient(circle at 82% 14%, rgba(146, 149, 156, 0.1), transparent 18%),
    linear-gradient(160deg, #0d1116 0%, #151a21 42%, #1b2028 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.screen { display: none; position: relative; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); }
.screen.active { display: block; }

.ambient {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.ambient::before, .ambient::after {
  content: ""; position: absolute; border-radius: 999px; filter: blur(30px);
}
.ambient-login::before { width: 260px; height: 260px; left: -40px; top: 8px; background: rgba(88, 82, 95, .28); }
.ambient-login::after { width: 200px; height: 200px; right: 8%; bottom: 12%; background: rgba(148, 136, 124, .12); }
.ambient-chat::before { width: 260px; height: 260px; right: -70px; top: 86px; background: rgba(89, 104, 126, .18); }
.ambient-chat::after { width: 200px; height: 200px; left: -40px; bottom: 120px; background: rgba(135, 145, 160, .08); }

.login-wrap, .device-layout {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start;
}

.mood-panel, .phone-shell {
  border: 1px solid var(--line); box-shadow: var(--shadow);
}

.mood-panel {
  padding: 38px 34px; border-radius: 34px; backdrop-filter: blur(24px);
  background: linear-gradient(180deg, rgba(28, 31, 38, .86), rgba(20, 23, 29, .78));
}

.brand-kicker {
  margin: 0; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
}

.mood-panel h1 {
  margin: 18px 0 0; max-width: 720px; font-size: clamp(42px, 6vw, 72px); line-height: .92; letter-spacing: -.06em;
}

.mood-copy, .login-lead, .presence-text, .message-meta, .media-caption, .message-text, .time-tag, .attachment-meta, .composer-hints, .typing-bar p {
  color: var(--muted);
}

.mood-copy { max-width: 620px; margin: 22px 0 0; font-size: 17px; line-height: 1.9; }
.signal-pill, .burn-status, .time-tag, .day-divider, .unread-divider {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
}

.phone-stage { display: grid; place-items: center; }
.phone-shell {
  position: relative; width: min(720px, 100%); padding: 14px; border-radius: 34px;
  background: linear-gradient(180deg, rgba(18, 23, 30, .94), rgba(24, 30, 38, .92));
}
.phone-screen { min-height: 760px; border-radius: 26px; overflow: hidden; }
.phone-login-card {
  padding: 46px 24px 24px; background: linear-gradient(180deg, rgba(34, 37, 45, .92), rgba(24, 27, 34, .88));
}
.login-title { margin: 16px 0 0; font-size: 30px; line-height: 1.08; letter-spacing: -.04em; }
.login-lead { margin: 14px 0 0; font-size: 15px; line-height: 1.8; }
.form-block { margin-top: 22px; }
.field-label {
  display: block; margin-bottom: 10px; color: #d8c6cf; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.field-control, .composer-input {
  width: 100%; border: 1px solid rgba(255,231,239,.08); border-radius: 22px; padding: 15px 16px; background: rgba(255,251,252,.06); color: var(--text); font-size: 15px; outline: none;
}
.field-control:focus, .composer-input:focus {
  border-color: rgba(201,167,183,.34); box-shadow: 0 0 0 4px rgba(201,167,183,.08);
}

.primary-button, .ghost-button, .plain-button, .soft-icon, .send-button, .icon-button, .mini-button {
  cursor: pointer; transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}
.primary-button:hover, .ghost-button:hover, .plain-button:hover, .soft-icon:hover, .send-button:hover, .icon-button:hover, .mini-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  width: 100%; margin-top: 24px; border: 0; border-radius: 999px; padding: 15px 20px;
  background: linear-gradient(135deg, #bea2af 0%, #766771 100%); color: white; font-size: 15px; font-weight: 700;
}
.secondary-button {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(219, 227, 236, .08);
  border-radius: 999px;
  padding: 15px 20px;
  background: rgba(247, 250, 252, .04);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.primary-button:disabled, .send-button:disabled, .soft-icon:disabled, .shield-toggle:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.login-feedback {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(232, 142, 166, 0.18);
  background: rgba(115, 42, 59, 0.2);
  color: #f1ccd8;
  font-size: 12px;
  line-height: 1.7;
}
.phone-chat-app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 760px;
  height: 100%;
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(22, 27, 35, 0.98), rgba(20, 24, 31, 0.98)),
    radial-gradient(circle at top, rgba(106, 120, 139, 0.08), transparent 34%);
  overflow: hidden;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 2px 2px 14px;
}
.subtle-button, .mini-button {
  border-radius: 999px; border: 1px solid rgba(219, 227, 236, .08); background: rgba(247, 250, 252, .04); color: var(--text);
}
.subtle-button {
  width: min(30%, 112px);
  min-width: 92px;
  padding: 9px 18px;
  font-size: 12px;
}
.topbar-center { text-align: left; }
.topbar-title { margin: 0; }
.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 34%, #f3f7fb 0, #c8d0da 36%, #6d7886 66%, #3b4654 100%);
  box-shadow: 0 0 0 1px rgba(239, 244, 248, 0.18), 0 0 18px rgba(173, 187, 202, 0.18);
}
.brand-primary { color: #f4f7fa; }
.brand-secondary { color: #909daa; font-weight: 500; letter-spacing: .16em; }

.session-panel, .system-note {
  border: 1px solid rgba(255, 228, 237, 0.07);
  background: rgba(255, 247, 250, 0.04);
}

.system-note {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 14px; padding: 10px 12px; border-radius: 16px;
  border-color: rgba(208, 217, 226, 0.08);
  background: rgba(244, 248, 251, 0.035);
}

.system-note-dot {
  width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto;
  background: #c4b0ba; box-shadow: 0 0 10px rgba(196, 176, 186, 0.28);
}

.system-note p {
  margin: 0; color: #a9b3bf; font-size: 11px; line-height: 1.55;
}
.system-inline-card {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 6px 0 18px;
}
.system-inline-text {
  margin: 0;
  max-width: min(82%, 360px);
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(245, 249, 252, 0.06);
  border: 1px solid rgba(219, 227, 236, 0.08);
  color: #aeb8c4;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.chat-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 2px 12px;
  flex-wrap: wrap;
  max-width: 100%;
}
.chat-actions-tools { min-width: 0; }
.chat-actions-row .ghost-button {
  padding: 8px 14px;
  font-size: 12px;
}
.admin-history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 2px 14px;
}
.admin-history-toolbar-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.admin-label {
  margin-bottom: 0;
  color: #bac4cf;
}
.history-toolbar-copy {
  margin: 6px 0 0;
  color: #8f9aa8;
  font-size: 12px;
  line-height: 1.5;
}
.history-date-select {
  width: min(48%, 220px);
  border: 1px solid rgba(219, 227, 236, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(247, 250, 252, 0.05);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.history-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.history-stat {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 236, 0.06);
  background: rgba(246, 249, 252, 0.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.history-stat-label {
  display: block;
  color: #8c98a6;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.history-stat-value {
  display: block;
  margin-top: 8px;
  color: #f2f6fa;
  font-size: 18px;
  font-weight: 600;
}
.admin-history-timeline {
  padding-top: 18px;
  gap: 6px;
}
.history-day-header {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: center;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 23, 30, 0.92);
  border: 1px solid rgba(219, 227, 236, 0.08);
  color: #d8e1ea;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}
.history-asset-kicker {
  margin-bottom: 8px;
  color: #aab6c4;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.read-receipt, .voice-meta-line, .micro-reaction {
  margin: 0;
}
.micro-reaction {
  border: 1px solid rgba(255, 231, 239, 0.1);
  color: var(--text);
  background: rgba(255, 249, 251, 0.05);
  cursor: pointer;
}

.empty-state {
  padding: 18px 14px;
  margin: auto 4px;
  border: 1px dashed rgba(213, 221, 229, 0.12);
  border-radius: 18px;
  color: #8e99a7;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  background: rgba(245, 249, 252, 0.02);
}

.chat-timeline {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 18px 14px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(19, 24, 31, .88), rgba(23, 28, 35, .94));
  border: 1px solid rgba(219, 227, 236, .06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02), 0 16px 36px rgba(7, 10, 15, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.time-tag, .day-divider, .unread-divider {
  margin: 0 auto 18px; width: fit-content; padding: 8px 12px; background: rgba(245,249,252,.05); border: 1px solid rgba(219,227,236,.06); font-size: 12px;
}
.day-divider { margin-top: 4px; }
.unread-divider {
  color: #efd5df;
  background: rgba(215, 140, 169, 0.12);
}

.message-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px; min-width: 0; max-width: 100%; }
.message-row.self { justify-content: flex-end; }
.avatar-badge {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px;
  background: rgba(240, 245, 250, 0.08); color: #d8e0e8; font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.message-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; }
.self-stack { align-items: flex-end; }
.message-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}
.self-footer { align-items: flex-end; }
.read-receipt {
  color: #bda8b3; font-size: 11px; line-height: 1.5; padding-right: 4px;
}
.reaction-summary {
  color: #dcb8c7;
  font-size: 11px;
  line-height: 1.5;
  padding-left: 4px;
}
.message-card {
  width: fit-content;
  max-width: min(92%, 520px);
  min-width: 0;
  padding: 15px 16px 13px;
  border-radius: 24px;
  background: rgba(243, 247, 251, .06);
  border: 1px solid rgba(219, 227, 236, .06);
  box-shadow: 0 18px 32px rgba(5, 9, 14, .18);
  transition: opacity 500ms ease, transform 500ms ease, box-shadow 240ms ease;
}
.message-card.outgoing { background: linear-gradient(145deg, rgba(71, 83, 97, .82), rgba(56, 66, 79, .94)); }
.message-card.incoming { background: linear-gradient(145deg, rgba(35, 41, 50, .92), rgba(27, 33, 41, .96)); }

/* 语音条：播放键 + 声波 + 秒数，宽度随时长变化 */
.message-card.voice-card { width: var(--voice-w, 150px); padding: 8px 12px; }
.voice-row { display: flex; align-items: center; gap: 10px; }
.voice-card.self .voice-row { flex-direction: row-reverse; }
.voice-play {
  width: 26px; height: 26px; flex: 0 0 auto; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12);
  color: #eef2f6; display: grid; place-items: center; cursor: pointer;
}
.voice-play:active { transform: scale(.94); }
.voice-play .vp-icon { width: 12px; height: 12px; fill: currentColor; }
.voice-play .vp-pause { display: none; }
.voice-card.playing .voice-play .vp-play { display: none; }
.voice-card.playing .voice-play .vp-pause { display: block; }
.voice-wave { display: flex; align-items: center; gap: 3px; height: 16px; flex: 1; min-width: 0; }
.voice-card.self .voice-wave { justify-content: flex-end; }
.voice-bar { width: 2.5px; height: 16px; border-radius: 2px; background: rgba(174, 184, 196, .5); transform-origin: center; }
.voice-card.self .voice-bar { background: rgba(201, 210, 220, .6); }
.voice-bar.on { background: #eef2f6; }
.voice-card.playing .voice-bar { animation: voiceBar .9s ease-in-out infinite; }
.voice-card.playing .voice-bar:nth-child(2n) { animation-delay: .12s; }
.voice-card.playing .voice-bar:nth-child(3n) { animation-delay: .24s; }
.voice-card.playing .voice-bar:nth-child(4n) { animation-delay: .36s; }
@keyframes voiceBar { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.voice-card.loading .voice-play { opacity: .55; }
.voice-dur { flex: 0 0 auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.voice-card.self .voice-dur { color: #c9d2dc; }
.voice-audio { display: none; }

/* 屏幕特效层：覆盖手机屏、不挡点击，粒子由 JS(Web Animations)驱动，结束自动清理 */
.fx-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.fx-particle { position: absolute; top: 0; left: 0; line-height: 1; user-select: none; -webkit-user-select: none; will-change: transform, opacity; }
.message-card:hover {
  box-shadow: 0 20px 36px rgba(5, 9, 14, 0.22);
}
.message-text, .media-caption, .message-meta { margin: 0; }
.message-text, .media-caption { color: #edf2f7; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; word-break: break-word; }
.message-meta { font-size: 12px; line-height: 1.5; color: #95a0ad; }
.media-card, .video-card { padding: 12px; overflow: hidden; }
.media-slot {
  display: block;
}
.media-gradient, .video-placeholder { border-radius: 16px; margin-bottom: 10px; }
.media-gradient {
  height: 136px; background: linear-gradient(145deg, rgba(137,88,112,.96), rgba(238,181,144,.7)), radial-gradient(circle at 24% 20%, rgba(255,255,255,.18), transparent 30%);
}
.video-placeholder {
  display: grid; place-items: center; height: 152px; background: linear-gradient(135deg, #2f2432, #8d5570);
}
.real-media {
  width: 100%;
  display: block;
  border-radius: 16px;
  margin-bottom: 10px;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  background: rgba(255,255,255,.04);
}
.real-audio {
  width: 100%;
  margin-bottom: 10px;
}
.media-missing {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 18px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(219, 227, 236, 0.1);
  background: rgba(245, 249, 252, 0.03);
  color: #b0bac6;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.compact-video { height: 132px; }
.play-mark {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.16); color: white; font-size: 18px;
}

.voice-wave {
  display: flex; align-items: end; gap: 5px; height: 28px; margin-bottom: 10px;
}

.voice-wave span {
  width: 4px; border-radius: 999px; background: rgba(255, 236, 242, 0.7); animation: wave 1.8s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { height: 10px; }
.voice-wave span:nth-child(2) { height: 18px; animation-delay: .1s; }
.voice-wave span:nth-child(3) { height: 24px; animation-delay: .2s; }
.voice-wave span:nth-child(4) { height: 16px; animation-delay: .3s; }
.voice-wave span:nth-child(5) { height: 12px; animation-delay: .4s; }

.voice-meta-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: #e7d3db; font-size: 12px; line-height: 1.5;
}

.micro-reaction-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.micro-reaction {
  padding: 7px 10px; border-radius: 999px; font-size: 11px; transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.micro-reaction.active {
  background: rgba(201, 167, 183, 0.16);
  border-color: rgba(201, 167, 183, 0.24);
  color: #f5eaee;
}

.micro-reaction:hover {
  transform: translateY(-1px);
}

.typing-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
  flex: 0 0 auto;
}
.typing-dot-group {
  display: inline-flex; gap: 5px;
}
.typing-dot-group span {
  width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 229, 238, 0.45); animation: pulse 1.2s infinite ease-in-out;
}
.typing-dot-group span:nth-child(2) { animation-delay: .15s; }
.typing-dot-group span:nth-child(3) { animation-delay: .3s; }

.composer-zone {
  padding-top: 14px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.attachment-sheet {
  margin-bottom: 10px; padding: 12px; border-radius: 18px; background: rgba(255,248,250,.04); border: 1px solid rgba(255,226,236,.06);
}
.attachment-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.attachment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.attachment-title, .attachment-name { margin: 0; }
.attachment-title { font-size: 12px; color: #dfc8d2; }
.mini-button { padding: 8px 10px; font-size: 12px; }
.attachment-card { display: flex; align-items: center; gap: 12px; }
.attachment-copy {
  min-width: 0;
  flex: 1;
}
.attachment-thumb { width: 62px; height: 62px; border-radius: 16px; flex: 0 0 auto; }
.attachment-thumb-image {
  display: block;
  object-fit: cover;
}
.image-thumb {
  background: linear-gradient(145deg, rgba(137,88,112,.96), rgba(238,181,144,.7)), radial-gradient(circle at 24% 20%, rgba(255,255,255,.18), transparent 30%);
}
.video-thumb { display: grid; place-items: center; background: linear-gradient(135deg, #2f2432, #8d5570); color: white; }
.attachment-name { font-size: 14px; color: #f1e4ea; }
.attachment-meta { margin: 4px 0 0; font-size: 12px; line-height: 1.6; }
.attachment-progress {
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 241, 246, 0.08);
  border: 1px solid rgba(255, 228, 237, 0.06);
}
.attachment-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(190, 162, 175, .9), rgba(212, 193, 178, .9));
  transition: width 220ms ease;
}
.attachment-status {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #dec5cf;
}
.attachment-status.error {
  color: #f0b8c7;
}
.burn-status-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.burn-status {
  padding: 8px 12px; background: rgba(245, 249, 252, 0.06); border: 1px solid rgba(219, 227, 236, 0.08); font-size: 12px;
  color: #d8e0e8;
}
.peer-presence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #eef3f8;
}
.composer {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px 40px 40px; gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 24px;
  background: rgba(246, 249, 252, 0.04);
  border: 1px solid rgba(219, 227, 236, 0.06);
  box-shadow: 0 10px 28px rgba(7, 10, 15, 0.16);
}
.ghost-button, .plain-button, .soft-icon {
  border-radius: 999px; border: 1px solid rgba(219,227,236,.08); background: rgba(247,250,252,.04); color: var(--text);
}
.ghost-button, .plain-button { padding: 10px 14px; }
.soft-icon { height: 46px; font-size: 14px; }
.composer-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  padding: 15px 18px;
  background: rgba(250, 252, 253, 0.06);
}
.composer { max-width: 100%; min-width: 0; }
.send-button {
  border: 0; border-radius: 18px; background: linear-gradient(135deg, #738295, #4e5d70); color: white; font-weight: 700;
}
.send-button:disabled { opacity: .7; }

/* 微信式输入栏：语音切换 / 按住说话 / + 二级面板 / 录音浮层 */
.composer .soft-icon {
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 19px;
  padding: 0;
}
.hold-to-talk {
  height: 44px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 236, 0.1);
  background: rgba(250, 252, 253, 0.06);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hold-to-talk:active {
  background: rgba(201, 167, 183, 0.18);
}

.plus-panel {
  margin-bottom: 10px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.04);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.plus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}
.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #cdd6e0;
  cursor: pointer;
}
.plus-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(245, 249, 252, 0.06);
  font-size: 24px;
}
.plus-label { font-size: 12px; color: #9aa6b3; }

.record-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 8, 12, 0.55);
  backdrop-filter: blur(2px);
}
.record-bubble {
  min-width: 180px;
  min-height: 90px;
  display: grid;
  place-items: center;
  padding: 18px 24px;
  border-radius: 22px;
  background: linear-gradient(145deg, #5b8f6a, #4e7d5d);
  transition: background 160ms ease;
}
.record-bubble.cancel {
  background: linear-gradient(145deg, #9c5560, #82454e);
}
.record-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
}
.record-wave span {
  width: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  animation: recordWave 0.9s ease-in-out infinite;
}
.record-wave span:nth-child(odd) { height: 14px; animation-delay: .15s; }
.record-wave span:nth-child(even) { height: 24px; }
.record-timer { margin: 0; color: #eef3f8; font-size: 18px; font-variant-numeric: tabular-nums; }
.record-status { margin: 0; min-height: 16px; color: #cdd6e0; font-size: 12px; }
.record-actions {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}
.record-btn {
  min-width: 110px;
  padding: 13px 0;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.record-cancel {
  border: 1px solid rgba(219, 227, 236, 0.22);
  background: rgba(245, 249, 252, 0.06);
  color: #e7ecf2;
}
.record-cancel:hover { background: rgba(245, 249, 252, 0.12); }
.record-send {
  border: 0;
  background: linear-gradient(135deg, #5b8f6a, #4e7d5d);
  color: #ffffff;
}
.record-send:hover { filter: brightness(1.06); }
.record-send:disabled { opacity: .6; }
@keyframes recordWave {
  0%, 100% { transform: scaleY(.5); opacity: .6; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* 表情面板 */
.emoji-panel {
  margin-bottom: 10px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  max-height: 42vh;
  overflow: hidden;
}
.emoji-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  flex: 0 0 auto;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(219, 227, 236, 0.06);
}
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
  /* 少时等分撑满整行（对齐、无空白），多到放不下时按 min-width 横向滚动 */
  flex: 1 0 auto;
  min-width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.05);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.emoji-tab.active {
  background: rgba(201, 167, 183, 0.18);
  border-color: rgba(201, 167, 183, 0.32);
}
.emoji-grid {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 8px;
}
.emoji-section-title {
  font-size: 11px;
  color: #9aa6b3;
  margin: 10px 4px 6px;
}
.emoji-section-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.emoji-cell {
  display: grid;
  place-items: center;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
}
.emoji-cell:hover { background: rgba(245, 249, 252, 0.08); }
.emoji-panel-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid rgba(219, 227, 236, 0.06);
}
.emoji-del {
  padding: 6px 16px;
  border-radius: 10px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.05);
  color: #cdd6e0;
  font-size: 16px;
  cursor: pointer;
}

/* 纯表情放大显示 */
.message-card.emoji-jumbo {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
}
.message-card.emoji-jumbo .message-text {
  font-size: 40px;
  line-height: 1.15;
}

@keyframes pulse {
  0%, 80%, 100% { transform: scale(.7); opacity: .45; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes wave {
  0%, 100% { transform: scaleY(.75); opacity: .55; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

@media (max-width: 1100px) {
  .login-wrap, .device-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .app-shell {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .screen,
  .screen.active {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .mood-panel { display: none; }
  .phone-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow-x: hidden;
  }
  .phone-screen {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    overflow-x: hidden;
  }
  .phone-chat-app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: 0;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    overflow-x: hidden;
  }
  .device-layout,
  .phone-stage {
    gap: 0;
    height: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  /* 关键：phone-stage 默认是 grid 自动列，会被子树最宽内容撑开；移动端改块级，宽度严格=屏宽 */
  .phone-stage { display: block; }
  .device-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-timeline {
    min-height: 0;
    padding-left: 10px;
    padding-right: 10px;
  }
  .app-topbar {
    padding-bottom: 12px;
  }
  .admin-history-toolbar-head {
    flex-direction: column;
    align-items: stretch;
  }
  .history-date-select {
    width: 100%;
  }
  .history-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-actions-row {
    margin-bottom: 10px;
  }
}

/* 引用回复 + per-message 轻回应 */
/* 确保 hidden 属性始终生效，避免被元素自身的 display 覆盖 */
[hidden] { display: none !important; }

.reply-quote {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-left: 2px solid rgba(219, 227, 236, 0.28);
  border-radius: 8px;
  background: rgba(245, 249, 252, 0.05);
  color: #b6c0cd;
  font-size: 12px;
  line-height: 1.5;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.05);
  max-width: 100%;
  overflow: hidden;
}
.reply-bar > .mini-button { flex: 0 0 auto; }
.reply-bar-body {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.reply-bar-label {
  flex: 0 0 auto;
  font-size: 11px;
  color: #9aa6b3;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(201, 167, 183, 0.16);
}
.reply-bar-text {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 13px;
  color: #cdd6e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-action-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 12, 0.5);
  backdrop-filter: blur(2px);
}
.msg-action-sheet {
  width: 100%;
  max-width: 360px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(219, 227, 236, 0.1);
  background: linear-gradient(180deg, rgba(33, 39, 48, 0.98), rgba(26, 31, 39, 0.98));
  box-shadow: 0 24px 60px rgba(2, 6, 12, 0.5);
}
.msg-action-excerpt {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #9aa6b3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-action-reactions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.msg-reaction {
  padding: 8px 0;
  border-radius: 14px;
  border: 1px solid rgba(219, 227, 236, 0.08);
  background: rgba(245, 249, 252, 0.05);
  font-size: 22px;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.msg-reaction:hover {
  transform: translateY(-2px);
  background: rgba(201, 167, 183, 0.16);
}
.msg-action-reply {
  width: 100%;
  padding: 12px 0;
  border-radius: 14px;
  border: 1px solid rgba(201, 167, 183, 0.24);
  background: rgba(201, 167, 183, 0.16);
  color: #f5eaee;
  font-size: 14px;
  cursor: pointer;
}
.msg-action-reply:hover {
  background: rgba(201, 167, 183, 0.24);
}
.msg-action-keep {
  width: 100%;
  padding: 12px 0;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1px solid rgba(219, 227, 236, 0.12);
  background: rgba(245, 249, 252, 0.06);
  color: #e7ecf2;
  font-size: 14px;
  cursor: pointer;
}
.msg-action-keep:hover { background: rgba(245, 249, 252, 0.1); }
.msg-action-reply { margin-bottom: 10px; }
.msg-action-recall {
  width: 100%;
  padding: 12px 0;
  border-radius: 14px;
  border: 1px solid rgba(201, 120, 130, 0.32);
  background: rgba(201, 120, 130, 0.12);
  color: #e7a6ad;
  font-size: 14px;
  cursor: pointer;
}
.msg-action-recall:hover { background: rgba(201, 120, 130, 0.2); }
.recall-card .system-inline-text { font-style: italic; opacity: 0.75; }

/* 方便度 + 想你 工具区 */
.chat-actions-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
