/* Spark — 白色主题 · 移动端 IM */

:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --text: #111827;
  --muted: #6b7280;
  --placeholder: #9ca3af;
  --brand: #07c160;
  --primary: var(--brand);
  --brand-hover: #06ad56;
  --brand-dim: rgba(7, 193, 96, 0.12);
  --brand-text: #ffffff;
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.1);
  --success: #22c55e;
  --press: rgba(0, 0, 0, 0.04);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header: calc(52px + var(--safe-top));
  --tab: calc(52px + var(--safe-bottom));
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --control-h: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

/* 全站可滚动区域：隐藏滚动条，保留触摸/滚轮滚动 */
html,
body,
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

/* 主应用：禁用系统长按/右键菜单，输入框除外 */
.page-app {
  -webkit-touch-callout: none;
}

.page-app .composer .input,
.page-app textarea,
.page-app input:not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="image"]) {
  -webkit-touch-callout: default;
  user-select: text;
  -webkit-user-select: text;
}

button, input {
  font: inherit;
  color: inherit;
}

a { color: var(--brand); text-decoration: none; }
a:active { opacity: 0.8; }

#app { height: 100%; }

/* ── 通用组件 ── */

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input::placeholder { color: var(--placeholder); }

.input:focus {
  border-color: var(--brand);
}

textarea.input,
.input.input-area {
  height: auto;
  min-height: 72px;
  padding: 10px 14px;
  line-height: 1.45;
  resize: vertical;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field[hidden] {
  display: none !important;
  margin: 0;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: -2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand);
  color: var(--brand-text);
}

.btn-primary:active { background: var(--brand-hover); }

.btn-ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--border);
}

.btn-danger:active { background: var(--danger-dim); }

.btn-block { width: 100%; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: var(--brand-dim);
  color: var(--brand);
  flex-shrink: 0;
}

.btn-icon i { font-size: 1.125rem; }

.btn-send {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  flex-shrink: 0;
}

.btn-send i { font-size: 1.125rem; }

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--danger);
  background: var(--danger-dim);
  border-radius: 8px;
}

.avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
  font-size: 1.125rem;
  display: grid;
  place-items: center;
}

.avatar-lg {
  width: 88px;
  height: 88px;
  font-size: 2rem;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 2.25rem;
}

.avatar-img {
  overflow: hidden;
  padding: 0;
  background: var(--surface-2);
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.list-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bg-elevated, rgba(0, 0, 0, 0.06));
}

.badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ── 登录 ── */

.page-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(16px, var(--safe-top)) 16px max(16px, var(--safe-bottom));
  background: var(--bg);
}

.auth-card {
  width: min(400px, 100%);
  padding: 32px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.auth-brand { text-align: center; margin-bottom: 28px; }

.auth-logo {
  display: block;
  font-size: 2.5rem;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 8px;
}

.auth-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.auth-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.auth-form { margin-bottom: 8px; }

.auth-footer {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.875rem;
}

/* ── App 壳 ── */

.page-app {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-main {
  flex: 1;
  min-height: 0;
  position: relative;
}

.app-main > section {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  flex-shrink: 0;
  height: var(--header);
  padding: var(--safe-top) 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title-left { text-align: left; }

.topbar-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 8px;
}

.topbar-grid .topbar-back {
  grid-column: 1;
  justify-self: start;
}

.topbar-grid .topbar-title,
.topbar-grid .topbar-title-btn {
  grid-column: 2;
  justify-self: center;
  flex: none;
  width: auto;
  max-width: 58vw;
  text-align: center;
}

.topbar-grid > .topbar-side {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-grid > .topbar-spacer {
  grid-column: 3;
  justify-self: end;
  width: 44px;
}

.topbar-side {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 44px;
}

.topbar-back {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
}

.topbar-back:active { background: var(--press); }

.topbar-spacer { width: 44px; flex-shrink: 0; }

.tabbar {
  flex-shrink: 0;
  height: var(--tab);
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tabbar button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.6875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}

.tabbar button i { font-size: 1.375rem; }

.tabbar button.active {
  color: var(--brand);
  font-weight: 500;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

.stack {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.stack-video {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #000;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  min-height: 72px;
  background: var(--surface);
}

.list-item:active { background: var(--press); }

.list-item:last-child { border-bottom: none; }

.list-item-entry { min-height: 64px; }

.list-item-request {
  flex-wrap: wrap;
  align-items: center;
}

.avatar-entry {
  background: var(--brand);
  color: var(--brand-text);
  font-size: 1.125rem;
}

.request-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.list-body-request {
  flex: 1;
  min-width: 0;
}

.list-preview-note {
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.45);
}

.prompt-dialog {
  width: min(100%, 360px);
  padding: 20px 16px 16px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.prompt-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.prompt-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.prompt-field {
  display: block;
  margin-top: 16px;
}

.prompt-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.prompt-input {
  width: 100%;
}

.prompt-input.input-area {
  min-height: 72px;
  resize: vertical;
}

.prompt-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.prompt-btn {
  flex: 1;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.list-body { flex: 1; min-width: 0; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.list-preview {
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-pinned {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.list-pin-icon {
  margin-right: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  vertical-align: 0.05em;
}

.avatar-group {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-2));
  color: var(--brand);
  font-size: 1.125rem;
}

.group-form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.group-form .btn-block + .btn-block {
  margin-top: 12px;
}

.group-form .btn-block + .field {
  margin-top: 12px;
}

.group-form-in-scroll {
  border-bottom: none;
}

.group-form-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.group-form-hint-pad {
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.member-tag {
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

.member-tag-me {
  color: var(--muted);
}

.group-form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-profile > .settings-group-inset:first-of-type {
  margin-top: 0;
}

.contact-profile-info.settings-group-inset {
  margin-top: 0;
}

.profile-hero-avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
  font: inherit;
  color: inherit;
}

.profile-hero-avatar-btn.is-editable {
  cursor: pointer;
}

.profile-hero-avatar-btn.is-editable:active {
  opacity: 0.85;
}

.profile-hero-avatar-hint {
  font-size: 0.8125rem;
  color: var(--brand);
}

.profile-edit-block {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.profile-edit-block:last-child {
  border-bottom: none;
}

.profile-edit-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.profile-edit-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-edit-inline .input-compact {
  flex: 1;
  min-width: 0;
}

.profile-edit-block-action {
  margin-top: 8px;
}

.profile-notice-item {
  align-items: flex-start;
}

.profile-notice-value {
  max-width: 62%;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-action-group {
  margin-bottom: 24px;
}

.settings-item-link {
  justify-content: center;
  font-size: 0.9375rem;
  color: var(--text);
}

.settings-item-link-danger {
  color: var(--danger);
}

.input-compact {
  height: 36px;
  padding: 0 10px;
  font-size: 0.9375rem;
  border-radius: 8px;
}

.input-compact-area {
  min-height: 56px;
  padding: 8px 10px;
  font-size: 0.9375rem;
  border-radius: 8px;
}

.list-item-check {
  cursor: pointer;
}

.list-check {
  flex-shrink: 0;
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.message-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  width: fit-content;
  max-width: min(78%, 320px);
}

.message-row-self {
  align-self: flex-end;
  align-items: flex-end;
}

.message-read-receipt {
  display: block;
  align-self: flex-end;
  margin: 2px 4px 6px 0;
  padding-right: 2px;
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.2;
}

.message-sender {
  margin-bottom: 2px;
  padding-left: 2px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.2;
}

.message-row-self .message-sender {
  padding-left: 0;
  padding-right: 2px;
}

.message-row .bubble {
  max-width: 100%;
}

.mention {
  color: var(--primary);
  font-weight: 500;
}

.list-muted-icon {
  flex-shrink: 0;
  margin-right: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.85;
}

.btn-icon-muted {
  color: var(--muted);
}

.notify-profile-option {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.notify-profile-option:last-child {
  border-bottom: none;
}

.notify-profile-option.active {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.notify-sheet-option-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.notify-sheet-option-hint {
  grid-column: 1;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}

.notify-profile-option .bi-check-lg {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--brand);
  font-size: 1.125rem;
}

.notify-sheet-sub {
  margin: 0;
  padding: 10px 16px 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.chat-typing-bar {
  flex-shrink: 0;
  padding: 4px 12px 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}

.member-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.chat-notice {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
}

.chat-notice .bi {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--primary);
}

.chat-notice .bi::before {
  vertical-align: 0;
  line-height: 1;
}

.chat-notice-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}

.at-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  z-index: 5;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.at-picker-empty {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

.at-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.at-picker-item:active {
  background: var(--press);
}

.at-picker-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.emoji-picker {
  --emoji-picker-h: 248px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  height: var(--emoji-picker-h);
  max-height: var(--emoji-picker-h);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.emoji-picker-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 6px 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.emoji-picker-tab {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.emoji-picker-tab.active {
  color: var(--text);
  background: var(--press);
}

.emoji-picker-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
}

.emoji-picker-cell {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1.2;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
}

.emoji-picker-cell:active {
  background: var(--press);
}

.at-picker-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.search-box {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.search-box .btn { margin-top: 10px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.profile-card-link {
  cursor: pointer;
}

.profile-card-link:active {
  background: var(--press);
}

.profile-card-body {
  flex: 1;
  min-width: 0;
}

.profile-card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.profile-edit {
  padding: 24px 16px;
  background: var(--bg);
}

.profile-edit-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.profile-edit-avatar-hint {
  font-size: 0.875rem;
  color: var(--brand);
}

.profile-edit-avatar-remove {
  display: block;
  width: 100%;
  margin: -12px 0 20px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}

.contact-profile {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 0 32px;
  background: var(--bg);
}

.contact-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 28px 16px;
  background: var(--surface);
  border-radius: 12px;
  cursor: pointer;
}

.contact-profile-hero:active {
  background: var(--press);
}

.contact-profile-hero-static {
  cursor: default;
}

.contact-profile-hero-static:active {
  background: var(--surface);
}

.contact-profile-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.contact-profile-account {
  font-size: 0.875rem;
  color: var(--muted);
}

.contact-profile-info {
  margin-top: 0;
}

.contact-profile-value {
  font-size: 0.9375rem;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.contact-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 16px 0;
}

.contact-profile-call-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-profile-call-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.contact-profile-hint {
  margin: 20px 16px 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.contact-profile-loading {
  padding: 48px 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.topbar-title-btn {
  grid-column: 2;
  justify-self: center;
  max-width: 58vw;
  padding: 0 4px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
}

.topbar-title-btn:disabled {
  cursor: default;
  opacity: 1;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
}

.image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
}

.settings-group {
  margin-top: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.settings-group-inset {
  margin-left: 16px;
  margin-right: 16px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:active {
  background: var(--press);
}

.settings-item-static {
  cursor: default;
}

.settings-item-static:active {
  background: var(--surface);
}

.settings-label {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  color: var(--text);
}

.settings-item-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.settings-hint {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.settings-page-hint {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  background: var(--bg);
}

.settings-page-hint-inset {
  padding: 0 16px 12px;
  background: transparent;
}

.settings-page-hint-foot {
  padding: 12px 16px 16px;
  background: transparent;
}

.settings-section-title {
  margin: 16px 16px 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-scroll {
  flex: 1;
  min-height: 0;
}

.list-item-btn {
  width: 100%;
  border: none;
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.notify-sheet {
  max-height: min(72vh, 520px);
  overflow-y: auto;
}

.settings-arrow,
.settings-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.profile-account {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}

.profile-meta {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.custom-select {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.select-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger.is-placeholder .select-trigger-text {
  color: var(--placeholder);
}

.select-trigger-arrow {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.custom-select.is-open .select-trigger {
  border-color: var(--brand);
}

.custom-select.is-open .select-trigger-arrow {
  transform: rotate(180deg);
  color: var(--brand);
}

.message-action-body {
  padding: 0;
}

.message-action-body .picker-sheet-item {
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
}

.message-action-body .picker-sheet-item:last-child {
  border-bottom: none;
}

.message-action-recall {
  color: var(--text);
}

.message-action-delete {
  color: var(--danger);
}

.contact-profile-actions .btn-danger {
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.picker-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
}

.picker-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(70vh, 520px);
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.picker-sheet-head {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  flex-shrink: 0;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.picker-sheet-title {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.picker-sheet-btn {
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
}

.picker-sheet-btn-action {
  justify-self: end;
  color: var(--brand);
}

.picker-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.picker-sheet-item {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  background: transparent;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.picker-sheet-item:last-child {
  border-bottom: none;
}

.picker-sheet-item:active {
  background: var(--press);
}

.picker-sheet-item.active {
  color: var(--brand);
  font-weight: 600;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.birth-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.birth-picker-part {
  min-width: 0;
}

.page-pad {
  padding: 16px;
  background: var(--bg);
}

.page-pad .btn-danger {
  background: var(--surface);
  color: var(--danger);
}

.push-setting {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.push-setting-label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.push-setting-hint {
  margin: 6px 0 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.push-setting .btn { margin-top: 0; }

/* 聊天 */
.message-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.message-area .empty {
  padding: 32px 16px;
}

.bubble {
  max-width: min(78%, 320px);
  padding: 10px 14px;
  border-radius: 6px;
  line-height: 1.45;
  word-break: break-word;
  font-size: 0.9375rem;
  user-select: none;
  -webkit-user-select: none;
}

.bubble-self {
  background: #95ec69;
  color: var(--text);
  border: 1px solid #87d962;
  border-top-right-radius: 2px;
}

.bubble-other {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-top-left-radius: 2px;
}

.bubble-pending { opacity: 0.6; }

.bubble-failed.bubble-self {
  background: #fde8e8;
  border-color: #f5b8b8;
}

.bubble-held.bubble-self {
  background: #fff8e6;
  border-color: #f0d78c;
}

.bubble-held-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.75rem;
}

.bubble-held-hint {
  color: #9a7b2e;
}

.bubble-fail-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
}

.bubble-fail-hint {
  color: var(--danger);
}

.bubble-fail-retry {
  border: none;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.message-call {
  align-self: center;
  max-width: 90%;
  padding: 4px 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.message-recalled {
  align-self: center;
  max-width: 90%;
  padding: 4px 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.message-loading {
  align-self: center;
  padding: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.page-loading {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9375rem;
}

.bubble-image {
  padding: 4px;
  background: transparent;
  border: none;
}

.bubble-image.bubble-self { background: transparent; border: none; }
.bubble-image.bubble-other { background: transparent; border: none; }

.bubble-voice {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px 12px;
  min-width: 76px;
  max-width: min(78vw, 240px);
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: filter 0.12s ease;
}

.bubble-voice:active:not(:disabled) {
  filter: brightness(0.96);
}

.bubble-voice-playing.bubble-self {
  border-color: #6fc84a;
}

.bubble-voice-playing.bubble-other {
  border-color: var(--primary);
}

.voice-bubble-body {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.voice-bubble-body-self {
  flex-direction: row-reverse;
}

.voice-speaker {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 1.125rem;
  line-height: 1;
  opacity: 0.92;
}

.bubble-other.bubble-voice .voice-speaker {
  color: var(--primary);
}

.voice-waves {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 28px;
  max-width: 80px;
  height: 18px;
}

.voice-bar {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.32;
  transform-origin: center bottom;
}

.voice-bar:nth-child(1) { height: 7px; }
.voice-bar:nth-child(2) { height: 11px; }
.voice-bar:nth-child(3) { height: 15px; }

.voice-waves.is-playing .voice-bar {
  animation: voice-bar-pulse 0.85s ease-in-out infinite;
}

.voice-waves.is-playing .voice-bar:nth-child(2) {
  animation-delay: 0.12s;
}

.voice-waves.is-playing .voice-bar:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes voice-bar-pulse {
  0%, 100% {
    transform: scaleY(0.5);
    opacity: 0.4;
  }
  50% {
    transform: scaleY(1);
    opacity: 0.95;
  }
}

.voice-dur {
  flex-shrink: 0;
  min-width: 1.75em;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.88;
}

.bubble-voice-compact {
  padding: 6px 10px;
  max-width: 200px;
}

.bubble-voice-compact .voice-waves {
  max-width: 56px;
  height: 14px;
}

.bubble-voice-compact .voice-bar:nth-child(1) { height: 5px; }
.bubble-voice-compact .voice-bar:nth-child(2) { height: 8px; }
.bubble-voice-compact .voice-bar:nth-child(3) { height: 11px; }

.bubble-voice .bubble-fail-row {
  width: 100%;
}

.voice-message-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.voice-message-wrap-self {
  flex-direction: row-reverse;
}

.voice-unread-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fa5151;
  box-shadow: 0 0 0 1px var(--bg);
}

.bubble-video {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  max-width: min(260px, 78vw);
  background: transparent;
  border: none;
}

.bubble-video.bubble-self,
.bubble-video.bubble-other {
  background: transparent;
  border: none;
}

.video-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.video-msg-hit {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.video-msg-hit:disabled {
  cursor: default;
  opacity: 0.65;
}

.video-msg-preview {
  display: block;
  width: 100%;
  max-width: min(220px, 72vw);
  max-height: 280px;
  border-radius: 6px;
  background: #000;
  object-fit: cover;
  pointer-events: none;
}

.video-msg-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  pointer-events: none;
}

.video-msg-dur {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 0 4px 2px;
}

.video-player-fs {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100dvh;
  max-height: 100vh;
  background: #000;
  padding: var(--safe-top) 0 var(--safe-bottom);
}

.video-player-fs__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
}

.video-player-fs__orient {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
}

.video-player-fs__orient-hint {
  flex: 1;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
  padding-right: 4px;
}

.video-player-fs__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
}

.video-player-fs__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.video-player-fs__video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.video-player-fs--landscape {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.video-player-fs--landscape .video-player-fs__stage {
  padding: 0 8px;
}

.video-player-fs--landscape .video-player-fs__bar {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.video-player-fs__bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.video-player-fs__play {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
}

.video-player-fs__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  min-width: 72px;
}

.video-player-fs__track {
  flex: 1;
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  touch-action: none;
}

.video-player-fs__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  background: var(--brand);
  pointer-events: none;
}

.video-player-fs__thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

.bubble-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  max-width: min(280px, 82vw);
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.bubble-file .bi {
  font-size: 1.5rem;
  color: var(--brand);
  flex-shrink: 0;
}

.file-msg-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.file-msg-name {
  font-size: 0.9375rem;
  word-break: break-all;
  line-height: 1.3;
}

.file-msg-size {
  font-size: 0.75rem;
  color: var(--muted);
}

.btn-composer-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.bubble-image img {
  display: block;
  max-width: min(220px, 72vw);
  max-height: 280px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
}

.bubble-image-retry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
  min-height: 100px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.bubble-image-retry .bi {
  font-size: 1.25rem;
}

.btn-composer {
  flex-shrink: 0;
  color: var(--muted);
}

.composer-shell {
  flex-shrink: 0;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.composer-bar-wrap {
  position: relative;
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.composer .input,
.composer .btn-icon,
.composer .btn-send,
.composer .composer-btn-plus.btn-icon {
  height: var(--control-h);
  min-height: var(--control-h);
  box-sizing: border-box;
}

.composer .input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  line-height: calc(var(--control-h) - 2px);
  border-radius: 10px;
  background: var(--surface);
}

.composer-btn-plus.btn-icon {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.composer-btn-plus.btn-icon.is-open {
  color: var(--text);
}

.composer-btn-plus.btn-icon:active {
  background: var(--press);
  transform: scale(0.98);
}

.composer-btn-plus.btn-icon i {
  font-size: 1.25rem;
  line-height: 1;
}

.composer-drawer {
  padding: 20px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border-light);
}

.composer-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 4px;
  max-width: 400px;
}

.composer-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.composer-drawer-item:active .composer-drawer-icon {
  opacity: 0.85;
  transform: scale(0.96);
}

.composer-drawer-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.625rem;
  color: #fff;
}

.composer-drawer-icon-image { background: #576b95; }
.composer-drawer-icon-camera { background: #3d9a6e; }
.composer-drawer-icon-video { background: #7b5fad; }
.composer-drawer-icon-file { background: #e6a23c; }
.composer-drawer-icon-voice { background: var(--brand); }

.composer-drawer-voice-active .composer-drawer-icon-voice {
  background: var(--brand-hover);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.composer-drawer-label {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.2;
}

.composer-drawer-voice-active .composer-drawer-label {
  color: var(--brand);
}

/* 通话 */
.call-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  border: none;
  background: var(--brand);
  color: var(--brand-text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.call-bar .bi {
  flex-shrink: 0;
  font-size: 1rem;
}

.call-bar-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.call-bar-hint {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.9;
}

.app-main--call-bar {
  padding-top: calc(44px + var(--safe-top));
}

.call-minimize-btn {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--muted);
  font-size: 1.125rem;
  cursor: pointer;
}

.call-overlay .call-minimize-btn {
  background: var(--surface-2);
}

.call-minimize-btn--video {
  position: static;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  pointer-events: auto;
}

.composer-reply {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  border-radius: 6px;
}

.composer-reply-body {
  flex: 1;
  min-width: 0;
}

.composer-reply-name {
  display: block;
  font-size: 0.75rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.composer-reply-text {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 6px 8px;
  text-align: left;
  border: none;
  border-left: 3px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  cursor: pointer;
}

.bubble-other .message-reply {
  border-left-color: var(--primary);
  background: rgba(0, 0, 0, 0.04);
}

.message-reply-name {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 2px;
}

.message-reply-text {
  display: block;
  font-size: 0.8125rem;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-forward-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.bubble-forward-inner {
  margin-top: 2px;
}

.forward-pick-body {
  max-height: 50vh;
  overflow-y: auto;
}

.forward-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.forward-pick-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-pick-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.chat-search-panel {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.chat-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-search-row .input,
.chat-search-row .btn,
.chat-search-row .btn-icon {
  height: var(--control-h);
  min-height: var(--control-h);
  box-sizing: border-box;
}

.chat-search-row .input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  line-height: calc(var(--control-h) - 2px);
}

.chat-search-row .btn,
.chat-search-row .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-search-hint {
  padding: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.chat-search-hit {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}

.chat-search-hit-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.chat-search-hit-text {
  display: block;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-ios-hint {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 210;
  margin: 0;
  padding: calc(6px + var(--safe-top)) 12px 6px;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  color: #7a5c10;
  background: #fff8e6;
  border-bottom: 1px solid #f0e0b8;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: var(--surface);
}

.call-overlay h2 {
  margin: 12px 0 4px;
  font-size: 1.5rem;
  color: var(--text);
}

.call-overlay p {
  margin: 0;
  color: var(--muted);
}

.call-meta {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.call-timer {
  margin-top: 8px;
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.call-actions {
  display: flex;
  gap: 48px;
  margin-top: 48px;
}

.call-actions-wide {
  gap: 32px;
  align-items: center;
  justify-content: center;
}

.call-btn-speaker {
  background: #576b95;
}

/* 通话按钮：语音 / 视频 / 来电页统一 */
.call-btn {
  width: 68px;
  height: 68px;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.call-btn:active { transform: scale(0.98); }

.call-btn-accept { background: var(--success); }
.call-btn-reject,
.call-btn-hangup { background: var(--danger); }

.video-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(12px + var(--safe-top)) 12px 12px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  color: #fff;
  pointer-events: none;
}

.video-bar .video-bar-name,
.video-bar .video-bar-time {
  pointer-events: none;
}

.video-bar-name {
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-bar-time {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.video-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-local {
  position: absolute;
  top: calc(var(--safe-top) + 56px);
  right: 16px;
  width: 108px;
  height: 148px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--surface);
  background: #000;
  z-index: 2;
}

.call-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 16px 16px calc(24px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.toast-msg {
  position: fixed;
  bottom: calc(72px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90%, 320px);
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  z-index: 200;
  text-align: center;
  pointer-events: none;
}
