/* ==========================================================================
   zzchar · 设计系统
   ========================================================================== */

:root {
  --brand: #07c160;
  --brand-dark: #06a050;
  --brand-soft: #e7f8ee;
  --bg: #f2f3f5;
  --panel: #ffffff;
  --sidebar: #f7f7f8;
  --text: #18191c;
  --text-2: #5f6673;
  --text-3: #98a0ac;
  --border: #e6e8eb;
  --border-strong: #d8dce1;
  --bubble-self: #95ec69;
  --bubble-self-text: #14310a;
  --bubble-other: #ffffff;
  --hover: #eceef0;
  --active: #e4e6e9;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warning: #f5a524;
  --warning-text: #9a6205;
  --warning-border: #f6e2bd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.18);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-w: 328px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  /* 次级表面：输入框底色、标签、表头等 */
  --surface-2: #f4f5f6;
  --surface-3: #eef0f2;
  --table-head: #fafbfb;
  --row-hover: #fbfcfc;
  --highlight: #fff4e0;
  --nav-bg: #10151c;
  /* 吸顶栏/浮层的半透明底色，深色主题必须跟着换，否则会露出一条白 */
  --glass: rgba(255, 255, 255, 0.86);
  --glass-strong: rgba(255, 255, 255, 0.98);
  color-scheme: light;
}

/* ==========================================================================
   深色主题
   两种生效方式：手动指定 data-theme="dark"，或跟随系统且未手动锁定为 light
   ========================================================================== */
[data-theme="dark"] {
  --brand: #07c160;
  --brand-dark: #0fa95c;
  --brand-soft: #123322;
  --bg: #0f1114;
  --panel: #171a1f;
  --sidebar: #13161a;
  --text: #e6e8eb;
  --text-2: #9aa3af;
  --text-3: #6b7480;
  --border: #252a31;
  --border-strong: #333a43;
  --bubble-self: #1e6f42;
  --bubble-self-text: #e9f8ef;
  --bubble-other: #1e2228;
  --hover: #1c2026;
  --active: #242932;
  --danger: #ff6b6f;
  --danger-soft: #3a1d1e;
  --warning: #f5b942;
  --warning-text: #f5c46b;
  --warning-border: #5a4620;
  --surface-2: #1b1f26;
  --surface-3: #222831;
  --table-head: #1b1f26;
  --row-hover: #1e232a;
  --highlight: #3a2f18;
  --nav-bg: #0b0d10;
  --glass: rgba(23, 26, 31, 0.86);
  --glass-strong: rgba(23, 26, 31, 0.98);
  /* 让原生控件（下拉框、滚动条、日期选择器）也走深色 */
  color-scheme: dark;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.65);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #07c160;
    --brand-dark: #0fa95c;
    --brand-soft: #123322;
    --bg: #0f1114;
    --panel: #171a1f;
    --sidebar: #13161a;
    --text: #e6e8eb;
    --text-2: #9aa3af;
    --text-3: #6b7480;
    --border: #252a31;
    --border-strong: #333a43;
    --bubble-self: #1e6f42;
    --bubble-self-text: #e9f8ef;
    --bubble-other: #1e2228;
    --hover: #1c2026;
    --active: #242932;
    --danger: #ff6b6f;
    --danger-soft: #3a1d1e;
    --warning: #f5b942;
    --surface-2: #1b1f26;
    --surface-3: #222831;
    --table-head: #1b1f26;
    --row-hover: #1e232a;
    --highlight: #3a2f18;
    --nav-bg: #0b0d10;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.65);
    --glass: rgba(23, 26, 31, 0.86);
    --glass-strong: rgba(23, 26, 31, 0.98);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

svg {
  display: block;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.app-root {
  height: 100dvh;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* ============================ 基础组件 ============================ */

.avatar {
  --size: 42px;
  width: var(--size);
  height: var(--size);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: calc(var(--size) * 0.4);
  font-weight: 600;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.avatar.sm {
  --size: 32px;
  border-radius: 6px;
}
.avatar.lg {
  --size: 64px;
  border-radius: 14px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.avatar-stack {
  display: flex;
}
.avatar-stack .avatar {
  margin-left: -10px;
  border: 2px solid var(--panel);
}
.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  background: var(--surface-3);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--hover);
}
.btn.danger {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--panel);
}
.btn.danger:hover {
  background: var(--danger-soft);
}
.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.btn.block {
  width: 100%;
}
.btn.icon {
  width: 38px;
  padding: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  flex: 0 0 auto;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.icon-btn.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.input,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
}
.input:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.14);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.badge.soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
  background: var(--surface-3);
  color: var(--text-2);
}
.chip.green {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.chip.amber {
  background: var(--highlight);
  color: var(--warning-text);
}
.chip.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-3);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}
.empty svg {
  opacity: 0.55;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================ 表单页 ============================ */

.auth {
  height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #0b8f4d 0%, #07c160 55%, #43d98a 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.auth-brand::before {
  width: 520px;
  height: 520px;
  right: -180px;
  top: -160px;
}
.auth-brand::after {
  width: 360px;
  height: 360px;
  left: -140px;
  bottom: -120px;
  background: rgba(255, 255, 255, 0.08);
}
.auth-brand > * {
  position: relative;
  z-index: 1;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand-mark img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.auth-headline {
  font-size: 40px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}
.auth-sub {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
  max-width: 420px;
}
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 36px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.94);
}
.auth-feature .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.auth-foot {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-card h1 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.auth-card .lead {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 28px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 9px;
  margin-bottom: 26px;
}
.auth-tabs button {
  flex: 1;
  height: 34px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-tabs button.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.form-error {
  min-height: 0;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 6px;
  padding: 9px 12px;
  line-height: 1.5;
}
.form-error:empty {
  display: none;
}
.auth-hint {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.7;
}

/* ============================ 主框架 ============================ */

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.side-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}
.side-me {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 9px;
  transition: background 0.15s;
  text-align: left;
}
.side-me:hover {
  background: var(--hover);
}
.side-me-name {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-me-sub {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: 0 0 auto;
}
.status-dot.off {
  background: var(--text-3);
}

.side-search {
  padding: 4px 14px 10px;
  position: relative;
}
.side-search svg {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-40%);
  color: var(--text-3);
  pointer-events: none;
}
.side-search input {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--hover);
  padding: 0 12px 0 34px;
  font-size: 13.5px;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.side-search input:focus {
  background: var(--panel);
  border-color: var(--brand);
}

.side-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 10px;
}
.side-actions .btn {
  flex: 1;
  height: 32px;
  font-size: 13px;
  background: var(--panel);
  border-color: var(--border);
}

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 8px 12px;
  min-height: 0;
}

.conv {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s ease;
  position: relative;
  text-align: left;
  width: 100%;
}
.conv:active { transform: scale(.992); }
.conv:hover {
  background: var(--hover);
}
.conv.active {
  background: var(--active);
}
.conv-main {
  flex: 1;
  min-width: 0;
}
.conv-row1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.conv-name {
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.conv-time {
  font-size: 11.5px;
  color: var(--text-3);
  flex: 0 0 auto;
}
.conv-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.conv-preview {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.conv-preview strong {
  color: var(--text-2);
  font-weight: 500;
}
.conv-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.pin-flag {
  font-size: 10px;
  color: var(--text-3);
}

/* ============================ 聊天区 ============================ */

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  position: relative;
}

.chat-head {
  height: 58px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.chat-head-main {
  min-width: 0;
  flex: 1;
}
.chat-title {
  font-size: 15.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.back-btn {
  display: none;
}

.msg-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 18px;
  min-height: 0;
  position: relative;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

.msg-loading {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 10px;
  min-height: 30px;
  flex: 0 0 auto;
}

.msg-list {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  margin-top: auto; /* 消息较少时贴着输入框排列，符合聊天软件直觉 */
}

.time-divider {
  text-align: center;
  margin: 14px 0 10px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.2px;
}
.time-divider span {
  background: rgba(0, 0, 0, 0.045);
  padding: 3px 9px;
  border-radius: 5px;
}

.sys-msg {
  text-align: center;
  margin: 8px 0;
  font-size: 12px;
  color: var(--text-3);
  padding: 0 40px;
  line-height: 1.6;
}
.sys-msg span {
  background: rgba(0, 0, 0, 0.045);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.msg {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  align-items: flex-start;
  animation: msg-in 0.18s ease-out;
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.msg.self {
  flex-direction: row-reverse;
}
.msg-body {
  min-width: 0; /* 关键：允许 flex 子项收缩，否则 nowrap 的引用块会撑破气泡 */
  max-width: min(72%, 620px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg.self .msg-body {
  align-items: flex-end;
}
.msg-sender {
  font-size: 11.5px;
  color: var(--text-3);
  padding: 0 2px;
}
.bubble {
  position: relative;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--bubble-other);
  font-size: 14.8px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal; /* 内部空白折叠，避免模板缩进被渲染成空行 */
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.bubble-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.search-results-panel {
  position: absolute;
  z-index: 20;
  top: 62px;
  right: 18px;
  width: min(380px, calc(100% - 36px));
  max-height: 62%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.search-results-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.search-results-head span { margin-left: auto; color: var(--text-3); font-size: 12px; }
.search-results-list { padding: 4px; }
.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 9px 8px;
  text-align: left;
  cursor: pointer;
}
.search-result:hover { background: var(--hover); }
.search-result span { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.search-result em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-size: 13px; }
.search-result time { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.msg.self .bubble {
  background: var(--bubble-self);
  color: var(--bubble-self-text);
}
.bubble.revoked {
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 13px;
  font-style: normal;
  box-shadow: none;
}
.msg.self .bubble.revoked {
  background: var(--surface-3);
  color: var(--text-3);
}
.bubble.media {
  padding: 4px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 引用块：显示在气泡内，点击可定位原消息 */
.quote {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
  border-left: 2px solid rgba(0, 0, 0, 0.16);
  background: rgba(0, 0, 0, 0.045);
  border-radius: 4px;
  padding: 5px 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}
.quote:hover {
  background: rgba(0, 0, 0, 0.08);
}
.msg.self .quote {
  border-left-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.055);
}
.quote-name {
  color: var(--text-2);
  font-weight: 600;
  margin-right: 6px;
}
.quote-text {
  color: var(--text-2);
}

.msg-highlight .bubble {
  animation: quote-flash 1.4s ease-out;
}
@keyframes quote-flash {
  0%,
  35% {
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.38);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}
.bubble.media img {
  display: block;
  max-width: min(320px, 52vw);
  max-height: 320px;
  border-radius: 5px;
  object-fit: cover;
  cursor: zoom-in;
}
.file-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  min-width: 210px;
  max-width: 300px;
}
.file-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.file-meta {
  min-width: 0;
  flex: 1;
}
.file-name {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.msg-time {
  font-size: 10.5px;
  color: var(--text-3);
  padding: 0 3px;
}

.msg-hover-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  align-self: center;
}
.msg:hover .msg-hover-actions {
  opacity: 1;
}
@media (hover: none) {
  /* 触摸设备不显示常驻操作按钮，改用长按菜单 */
  .msg-hover-actions {
    display: none;
  }
  /* 关闭系统长按选词，避免与自定义长按菜单冲突 */
  .bubble {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.typing-hint {
  height: 20px;
  padding: 0 26px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.typing-dots {
  display: inline-flex;
  gap: 2px;
}
.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.2s infinite;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.35;
  }
  30% {
    opacity: 1;
  }
}

/* 输入区 */
.composer {
  position: relative;
  flex: 0 0 auto;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
}

/* 待发送的引用提示条 */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  border-radius: 5px;
  font-size: 12.5px;
  animation: msg-in 0.15s ease-out;
}
.reply-bar-main {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-name {
  color: var(--brand-dark);
  font-weight: 600;
  margin-right: 6px;
}
.reply-bar-text {
  color: var(--text-2);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}
.sticker-trigger {
  font-size: 22px;
  line-height: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}
.sticker-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 2px);
  max-height: min(360px, 48dvh);
  overflow: auto;
  padding: 12px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 14px 14px 8px 8px;
  box-shadow: var(--shadow-lg);
  animation: sticker-panel-in 0.16s ease-out;
  z-index: 12;
}
.sticker-panel-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
}
.sticker-panel-head span {
  font-size: 11px;
  color: var(--text-3);
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.sticker-tile,
.sticker-upload-tile {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
}
.sticker-image-btn,
.sticker-upload-tile {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.sticker-image-btn:hover,
.sticker-upload-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  background: var(--brand-soft);
}
.sticker-image-btn:active,
.sticker-upload-tile:active { transform: scale(.96); }
.sticker-image-btn img { width: 100%; height: 100%; object-fit: contain; }
.sticker-upload-tile { color: var(--brand-dark); font-size: 26px; }
.sticker-upload-tile small { display: block; font-size: 11px; }
.sticker-remove-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(24, 25, 28, .72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
}
.sticker-empty {
  grid-column: 1 / -1;
  padding: 22px 0;
  color: var(--text-3);
  text-align: center;
  font-size: 13px;
}
@keyframes sticker-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.composer-tools .spacer {
  flex: 1;
}
.composer-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 132px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--surface-2);
  outline: none;
  resize: none;
  line-height: 1.5;
  font-size: 14.8px;
  transition: background 0.15s, border-color 0.15s;
}
.composer textarea:focus {
  background: var(--panel);
  border-color: var(--brand);
}
.send-btn {
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
}
.send-btn:hover {
  background: var(--brand-dark);
}
.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.composer-hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 6px;
  display: flex;
  gap: 10px;
}
.kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--surface-2);
}

.offline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--highlight);
  color: var(--warning-text);
  font-size: 12.5px;
  padding: 6px;
  border-bottom: 1px solid var(--warning-border);
}

/* 拖拽上传遮罩 */
.drop-mask {
  position: absolute;
  inset: 0;
  background: rgba(7, 193, 96, 0.08);
  border: 2px dashed var(--brand);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-dark);
  z-index: 20;
  pointer-events: none;
  margin: 8px;
}

/* ============================ 右侧信息面板 ============================ */

.panel {
  width: 340px;
  max-width: 88vw;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  z-index: 15;
  animation: slide-in 0.2s ease-out;
}

/* 打开信息面板时挤压聊天区，而不是遮住消息 */
.shell.panel-open {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
}
@keyframes slide-in {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.panel-head {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.panel-title {
  font-weight: 600;
  font-size: 14.5px;
  flex: 1;
}
.panel-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-section:last-child {
  border-bottom: none;
}
.panel-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  border-radius: 8px;
}
.member-row:hover {
  background: var(--hover);
}
.member-main {
  flex: 1;
  min-width: 0;
}
.member-name {
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.member-ops {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}
.owner-tag {
  font-size: 10.5px;
  background: var(--highlight);
  color: var(--warning-text);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}
.admin-tag {
  font-size: 10.5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}

/* 头像裁剪 */
.cropper {
  padding: 6px 0 2px;
}
.cropper-stage {
  margin: 0 auto;
  background: var(--nav-bg);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.cropper-stage canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}
.cropper-stage canvas.dragging {
  cursor: grabbing;
}
.cropper-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px auto 2px;
  max-width: 300px;
  color: var(--text-3);
}
.cropper-zoom input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
  height: 4px;
}
.cropper-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

/* 头像上传 */
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}
.avatar-upload {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid var(--panel);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.22);
  transition: background 0.15s;
}
.avatar-wrap:hover .avatar-upload {
  background: var(--brand-dark);
}

/* ============================ 弹窗 / 提示 ============================ */

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(2px);
  animation: fade 0.15s ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide {
  max-width: 720px;
}
@keyframes pop {
  from {
    transform: scale(0.97) translateY(6px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.modal-head {
  padding: 18px 20px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.modal-head h3 {
  margin: 0;
  font-size: 16.5px;
  flex: 1;
  letter-spacing: -0.2px;
}
.modal-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}
.modal-body {
  padding: 6px 20px 4px;
  overflow-y: auto;
  min-height: 0;
}
.modal-foot {
  padding: 14px 20px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.modal-foot .btn.block {
  flex: 1;
}

.picker-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 4px -6px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.picker-item:hover {
  background: var(--hover);
}
.picker-item.selected {
  background: var(--brand-soft);
}
.picker-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: transparent;
}
.picker-item.selected .picker-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chosen-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.chosen-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 3px 6px 3px 4px;
  font-size: 12.5px;
}
.chosen-chip button {
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(24, 25, 28, 0.92);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
  max-width: 86vw;
  text-align: center;
}
.toast.error {
  background: rgba(190, 40, 45, 0.95);
}
.toast.success {
  background: rgba(6, 140, 72, 0.95);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ctx-menu {
  position: fixed;
  z-index: 150;
  min-width: 150px;
  background: var(--panel);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  animation: pop 0.12s ease-out;
}
.ctx-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text);
}
.ctx-menu button:hover {
  background: var(--hover);
}
.ctx-menu button.danger {
  color: var(--danger);
}

/* 图片查看器 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* 成员卡片视图：仅移动端使用，避免表格在窄屏挤压内容 */
.users-card-view {
  display: none;
}
.user-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.uc-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.uc-main {
  flex: 1;
  min-width: 0;
}
.uc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  flex-wrap: wrap;
}
.uc-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.uc-dim {
  font-size: 11.5px;
  color: var(--text-3);
}
.uc-ip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  text-align: left;
}
.uc-ip code {
  font-size: 11.5px;
  color: var(--text-2);
  letter-spacing: 0.2px;
}
.uc-ip span {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================ 管理后台 ============================ */

.admin {
  height: 100%;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
}
.admin-nav {
  background: var(--nav-bg);
  color: #cdd5df;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  min-height: 0;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}
.admin-logo span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.admin-logo img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.admin-nav-group {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5f6b7a;
  padding: 12px 10px 6px;
}
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: #b7c1cd;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.admin-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.admin-nav button.active {
  background: rgba(7, 193, 96, 0.16);
  color: #4ade80;
}
.admin-nav-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 抽屉相关元素在桌面端不显示
   注意：.admin-nav button 的优先级高于单一类选择器，这里必须带层级前缀才能压住它 */
.admin-nav .admin-nav-close,
.admin-menu-btn,
.admin-nav-mask {
  display: none;
}
/* 「更多操作」在桌面端也要能点：限制/解除限制放在这个菜单里 */
.ops-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  flex: 0 0 auto;
  color: var(--text-2);
}
.ops-trigger:hover {
  color: var(--text);
  background: var(--hover);
}
.admin-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex: 0 0 auto;
}
.admin-menu-btn:hover {
  background: var(--bg);
}

.admin-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-head {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.admin-head h2 {
  font-size: 16px;
  margin: 0;
  flex: 1;
}
.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 40px;
  min-height: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat-foot {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-size: 14px;
  margin: 0;
  flex: 1;
}
.card-body {
  padding: 14px 16px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* 窄屏时给底部留出滚动条空间，避免遮挡最后一行 */
  padding-bottom: 2px;
}
table.data {
  /* 按内容撑开，窄屏下横向滚动而不是把列压成竖排 */
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 11.5px;
  padding: 9px 12px;
  background: var(--table-head);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data tr:hover td {
  background: var(--row-hover);
}
.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 140px;
}
.cell-main {
  font-weight: 500;
  white-space: nowrap;
}
.cell-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.cell-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}
/* 操作列：始终贴右，横向滚动时也不会被推出视野 */
table.data th.col-ops,
table.data td.col-ops {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1%;
  white-space: nowrap;
  padding-right: 14px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 12px -10px rgba(0, 0, 0, 0.3);
}
table.data th.col-ops {
  background: var(--table-head);
}
table.data tr:hover td.col-ops {
  background: var(--row-hover);
}
/* 只放图标的方形小按钮 */
.btn.icon-only {
  width: 30px;
  padding: 0;
  justify-content: center;
}

/* ---------------- 问卷 ---------------- */
.sv-field { margin-bottom: 14px; }
.sv-field:last-child { margin-bottom: 0; }
.sv-field > label { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.sv-field .input { width: 100%; }

.sv-q {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--surface-2);
}
.sv-q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.sv-q-no { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.sv-q-type { width: auto !important; height: 28px; padding: 0 8px; font-size: 12.5px; }
.sv-req { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.sv-q-title { width: 100%; }
.sv-options { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sv-opt { display: flex; align-items: center; gap: 8px; }
.sv-opt-mark { width: 16px; text-align: center; color: var(--text-3); font-size: 12px; }
.sv-opt .input { flex: 1; height: 32px; }

.sv-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sv-user { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sv-user em { font-style: normal; color: var(--text-3); font-size: 11.5px; }

/* 统计条形图 */
.sv-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 2fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.sv-bar-label { font-size: 13px; word-break: break-word; }
.sv-bar-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.sv-bar-fill { height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.sv-bar-num { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 侧栏「待填问卷」提示条 */
.survey-banner {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.survey-banner:hover { filter: brightness(.98); }
.survey-banner .sb-count {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.survey-banner .sb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 答题弹窗 */
.sv-answer-q { margin-bottom: 20px; }
.sv-answer-q:last-child { margin-bottom: 4px; }
.sv-answer-title { font-size: 14px; font-weight: 500; margin-bottom: 10px; line-height: 1.5; }
.sv-answer-title .sv-need { color: var(--danger); margin-left: 4px; font-weight: 400; font-size: 12px; }
.sv-answer-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 7px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.5;
}
.sv-answer-opt:hover { border-color: var(--border-strong); }
.sv-answer-opt.checked { border-color: var(--brand); background: var(--brand-soft); }
.sv-answer-opt input { margin-top: 3px; accent-color: var(--brand); }

/* 题目图片（编辑器 / 答题弹窗 / 统计页通用） */
.sv-q-image-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.sv-q-image {
  max-width: 320px;
  max-height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  object-fit: contain;
  background: var(--surface-2);
}
.sv-answer-text,
.sv-answer-q .sv-answer-text {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 9px 11px;
}
.sv-text-answers { display: flex; flex-direction: column; gap: 7px; }
.sv-text-answer {
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

/* 聊天流里的问卷/投票卡片 */
.card-msg {
  width: min(320px, 76vw);
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 99px;
  padding: 2px 9px;
  width: fit-content;
}
.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.card-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.card-meta { font-size: 11.5px; color: var(--text-3); }
.survey-card .btn { align-self: flex-start; }

.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color .12s;
}
.poll-opt:hover:not(:disabled) { border-color: var(--brand); }
.poll-opt.chosen { border-color: var(--brand); }
.poll-opt:disabled { cursor: default; opacity: .85; }
.poll-bar {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.poll-bar > span {
  display: block;
  height: 100%;
  background: var(--brand-soft);
  opacity: .55;
}
.poll-opt-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.poll-opt-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; word-break: break-word; }
.poll-opt-num { font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }


/* 数字列：右对齐 + 等宽数字，纵向才能对齐 */
table.data th.num,
table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 中等宽度屏幕（1024~1200）：表格收紧，避免出现横向滚动条 */
@media (max-width: 1200px) {
  table.data {
    font-size: 12.5px;
  }
  table.data th,
  table.data td {
    padding: 9px 9px;
  }
  .cell-actions {
    gap: 4px;
  }
  .cell-actions .btn.sm {
    padding: 0 8px;
  }
}
/* 再窄一点就藏掉「最后在线」列：这列信息量最低，藏掉能省出一条操作列的空间 */
@media (max-width: 1080px) {
  .users-table-view table.data th:nth-child(7),
  .users-table-view table.data td:nth-child(7) {
    display: none;
  }
}
.msg-audit {
  max-width: 460px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 操作日志的详情列：单行省略，完整内容看 title */
.log-detail {
  max-width: 420px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.admin-toolbar .input {
  height: 36px;
  width: auto;
  min-width: 200px;
  flex: 0 1 280px;
}
.admin-toolbar select.input {
  min-width: 130px;
  flex: 0 0 auto;
}
.admin-toolbar .sort-direction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.pager {
  display: flex;
  justify-content: center;
  padding: 14px;
}

/* 审计对话视图 */
.audit-chat {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 210px);
  min-height: 320px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
}
.audit-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}
.audit-msg {
  display: flex;
  gap: 9px;
  margin-bottom: 12px;
}
.audit-msg .msg-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 3px;
}
.audit-msg .bubble {
  box-shadow: none;
  background: var(--panel);
}

/* 后台消息里的图片缩略图 */
.audit-thumb {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.audit-thumb:hover {
  border-color: var(--accent);
}
.audit-thumb img {
  display: block;
  max-width: min(260px, 46vw);
  max-height: 260px;
  width: auto;
  height: auto;
}
.audit-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12.5px;
  word-break: break-all;
}
.audit-file:hover {
  text-decoration: underline;
}
/* 表格里的“最新消息 / 消息审计”只给一个小缩略图 */
.msg-audit .audit-thumb img {
  max-width: 52px;
  max-height: 52px;
  object-fit: cover;
  border-radius: 6px;
}
.msg-audit .audit-file {
  font-size: 12px;
}

/* 后台设置项：单选列表（图片压缩档位等） */
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}
.opt-item:hover {
  border-color: var(--border-strong);
}
.opt-item.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.opt-item input {
  margin-top: 2px;
  accent-color: var(--brand);
}
.opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.opt-text strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.opt-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.opt-meta {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 附件文件已从磁盘上消失时的兜底提示（历史遗留裂图） */
.media-broken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 64px;
  padding: 0 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 12px;
  background: var(--surface-2);
}

/* ============================ 响应式 ============================ */

@media (max-width: 900px) {
  :root {
    --sidebar-w: 280px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .auth-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
    position: relative;
  }
  .shell.panel-open {
    grid-template-columns: 1fr;
  }
  .panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    border-left: none;
    z-index: 45;
  }
  .sidebar {
    border-right: none;
  }
  .chat {
    position: absolute;
    inset: 0;
    z-index: 30;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    visibility: hidden;
  }
  .chat-head {
    height: 56px;
    padding: 0 10px;
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
  }
  .chat-head-actions { gap: 0; }
  .chat-head-actions .icon-btn { width: 38px; height: 38px; }
  .sidebar { padding-top: env(safe-area-inset-top); }
  body.mobile-chat-open .chat {
    transform: none;
    visibility: visible;
  }
  body.mobile-chat-open .sidebar {
    transform: translateX(-18%);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .back-btn {
    display: grid;
  }
  .msg-list {
    padding: 0 12px;
  }
  .msg-body {
    max-width: min(82%, 420px);
  }
  .composer {
    padding: 7px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--glass);
    backdrop-filter: blur(10px);
  }
  .composer-tools { gap: 1px; }
  .composer-tools .icon-btn { width: 38px; height: 38px; }
  .composer-input { gap: 7px; }
  .composer textarea { min-height: 40px; max-height: 112px; font-size: 16px; }
  .send-btn { min-width: 54px; height: 40px; }
  .composer-hint {
    display: none;
  }
  .panel {
    width: 100%;
    max-width: none;
    border-left: none;
  }
  .sticker-panel {
    left: 6px;
    right: 6px;
    max-height: 52dvh;
    padding: 10px;
  }
  .sticker-grid { grid-template-columns: repeat(5, minmax(52px, 1fr)); gap: 7px; }
  .admin {
    grid-template-columns: 1fr;
  }

  /* 移动端导航改为左侧抽屉，避免 9 个菜单挤成一排看不全 */
  .admin-menu-btn {
    display: inline-flex;
  }
  .admin-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    max-width: 82vw;
    z-index: 70;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.28);
  }
  .admin-nav.open {
    transform: translateX(0);
  }
  .admin-logo {
    display: flex;
    padding: 4px 6px 16px;
  }
  .admin-logo img {
    width: 26px;
    height: 26px;
  }
  .admin-logo span {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-nav .admin-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin-left: auto;
    border-radius: 7px;
    color: #9aa6b4;
  }
  .admin-nav .admin-nav-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .admin-nav-group {
    display: block;
    padding: 10px 10px 4px;
  }
  .admin-nav button {
    width: 100%;
    white-space: nowrap;
    padding: 10px 10px;
    font-size: 14px;
  }
  .admin-nav-foot {
    margin: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 0 0;
  }
  .admin-nav-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .admin-nav-mask.open {
    opacity: 1;
    pointer-events: auto;
  }
  body.admin-nav-open {
    overflow: hidden;
  }

  .admin-head {
    height: 54px;
    padding: 0 10px 0 8px;
    gap: 8px;
  }
  .admin-head h2 {
    font-size: 15px;
  }
  .admin-head .btn span {
    display: none;
  }
  .admin-body {
    padding: 14px 10px calc(28px + env(safe-area-inset-bottom));
  }

  /* 表格在窄屏保持可读，横向滚动查看其余列 */
  .table-wrap {
    border-radius: 10px;
  }
  table.data {
    font-size: 12.5px;
  }
  table.data th,
  table.data td {
    padding: 9px 10px;
    /* 窄屏强制不换行，靠横向滚动查看，避免列被压成一个字 */
    white-space: nowrap;
  }
  table.data td.wrap {
    white-space: normal;
    min-width: 180px;
    max-width: 260px;
  }
  /* 操作列固定在右侧，横向滑动时按钮始终可见 */
  table.data th.col-ops,
  table.data td.col-ops {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 12px -10px rgba(0, 0, 0, 0.3);
  }
  table.data th.col-ops {
    background: var(--table-head);
  }
  table.data tr:hover td.col-ops {
    background: var(--row-hover);
  }
  /* 卡片里的「更多」按钮 */
  .user-card .ops-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    padding: 0;
  }

  /* 表格视图在移动端让位给卡片视图 */
  .users-table-view {
    display: none;
  }
  .users-card-view {
    display: block;
  }
  /* 让横向滚动条可见，提示还有内容 */
  .table-wrap::-webkit-scrollbar {
    height: 5px;
  }
  .table-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 3px;
  }
  .table-wrap::-webkit-scrollbar-track {
    background: transparent;
  }

  .audit-chat {
    height: calc(100dvh - 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .toast-host {
    bottom: auto;
    top: 44%;
  }
  /* 后台统计卡：固定两列，奇数张时最后一张占满整行，避免孤零零吊在一侧 */
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .stat-card {
    padding: 13px 14px;
  }
  .stat-value {
    font-size: 21px;
    letter-spacing: -0.5px;
    margin-top: 6px;
    word-break: break-all;
  }
  .stat-label,
  .stat-foot {
    font-size: 11.5px;
  }
}

@media (max-width: 360px) {
  .side-actions .btn span {
    display: none;
  }
}

/* 外观切换（个人设置内） */
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.theme-row-label {
  font-size: 13px;
  color: var(--text-2);
}
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-2);
}
.seg button {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  background: transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg button.on {
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ntfy 手机推送引导 */
.ntfy-intro {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.ntfy-steps {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-2);
}
.ntfy-steps b {
  color: var(--text);
  font-weight: 600;
}
.ntfy-topic {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  color: var(--text);
  word-break: break-all;
  text-align: center;
  user-select: all;
}
.ntfy-note {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}

/* 全站公告 */
.announce-modal {
  max-width: 440px;
}
.announce-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.announce-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  max-height: 52vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.announce-foot {
  display: flex;
  gap: 10px;
}
.announce-foot .btn {
  flex: 1;
}

/* 未读分隔条 */
.unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 16px 6px;
  color: var(--brand-dark);
  font-size: 11.5px;
}
.unread-divider::before,
.unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--brand-soft);
}
.unread-divider span {
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  white-space: nowrap;
}

/* 语音消息 */
.bubble.voice {
  padding: 0;
  background: transparent;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
/* 气泡与「转文字」按钮：按钮脱离文档流，浮在气泡外侧，不占气泡空间 */
.voice-row {
  position: relative;
  display: flex;
  align-items: center;
}
/* 自己发的消息气泡靠右，按钮浮到左侧 */
.msg.self .bubble.voice {
  align-items: flex-end;
}
.voice-asr {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(100% + 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.1);
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
/* 自己发的：按钮浮到气泡左边 */
.msg.self .voice-asr {
  left: auto;
  right: calc(100% + 12px);
}
.voice-asr:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: transparent;
  transform: translateY(-50%) scale(1.08);
}
.voice-asr:disabled {
  opacity: 0.6;
  cursor: default;
}
.voice-asr.loading {
  animation: asrPulse 1s ease-in-out infinite;
}
@keyframes asrPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.3; }
}
.voice-text {
  max-width: 250px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--surface-2);
  word-break: break-word;
}
.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--bubble-other);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}
.msg.self .voice-btn {
  background: var(--bubble-self);
  border-color: transparent;
  color: var(--bubble-self-text);
}
.voice-btn .voice-icon {
  display: inline-flex;
  opacity: 0.85;
}
.voice-btn .voice-dur {
  font-size: 12.5px;
  color: inherit;
  opacity: 0.75;
  margin-left: auto;
}
.voice-btn.playing .voice-icon {
  animation: voicePulse 0.9s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* 录音状态条 */
.recording-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}
.recording-bar .spacer {
  flex: 1;
}
.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: recBlink 1s ease-in-out infinite;
  flex: 0 0 auto;
}
.recording-hint {
  color: var(--text-3);
  font-size: 12px;
}
@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
#btn-voice.recording {
  color: var(--danger);
  background: var(--danger-soft);
}

/* 弹窗内的用户选择搜索框 */.picker-search {
  position: relative;
  padding: 0 0 10px;
}
.picker-search svg {
  position: absolute;
  left: 12px;
  top: 9px;
  color: var(--text-3);
  pointer-events: none;
}
.picker-search input {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  padding: 0 12px 0 34px;
  font-size: 13.5px;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.picker-search input:focus {
  background: var(--panel);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

/* 成员选择：分组标题与全选 */
.picker-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
  font-size: 11.5px;
  color: var(--text-3);
}
.picker-all button {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 500;
}
