/**
 * 小手机 — 聊天样式
 * 莫奈印象派 · iOS 扁平风
 */

/* ═══════ 聊天列表（微信风格：大头像+细线分割） ═══════ */

.chat-list {
  flex: 1;
  overflow-y: auto;
  background: var(--surface-card);
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;                          /* 上下紧凑，给大头像留空间 */
  cursor: pointer;
  background: var(--surface-card);
  border-bottom: 0.5px solid var(--border-separator);  /* 浅灰色细线分割 */
  margin: 0;
  min-height: 68px;                            /* 保证每行足够高度，不贴在一起 */
}
.chat-list-item:active { background: var(--surface-page); }

/* 头像 — 大大大，占卡片上下空间一半 */
.chat-list-item .avatar {
  width: 52px; height: 52px;
  border-radius: 6px;                            /* 微信圆角 */
  flex-shrink: 0;
  font-size: 24px;
}

.chat-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;                       /* 垂直居中 */
  gap: 3px;
}
.chat-list-name {
  font-size: 15px;                               /* 与大头像匹配 */
  font-weight: var(--font-wt-medium);
  letter-spacing: 0.5px;
  color: var(--ink);
  line-height: 1.3;
}
.chat-list-preview {
  font-size: 13px;
  color: var(--ink-subtle);
  font-weight: var(--font-wt-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.chat-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.chat-list-time {
  font-size: 11px;
  color: var(--ink-subtle);
  font-weight: var(--font-wt-regular);
  letter-spacing: 0.5px;
}
.chat-list-badge {
  min-width: 18px; height: 18px;
  background: var(--monet-blue);
  color: #fff;
  font-size: 10px;
  font-weight: var(--font-wt-medium);
  letter-spacing: 0.5px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* 群聊分隔标题 */
.chat-list-section-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: var(--font-wt-medium);
  color: var(--ink-subtle);
  letter-spacing: 1.2px;
  background: var(--surface-page);
}

/* ═══════ 聊天界面 ═══════ */

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overflow-anchor: auto;        /* 浏览器原生滚动锚定 */
  scroll-behavior: smooth;
  padding: 10px 12px;
  background: transparent;
  position: relative;
}
/* 把锚点放在最后一条消息上，防止历史内容插入时跳顶 */
.chat-messages > :last-child {
  overflow-anchor: auto;
}

/* ─── 聊天背景层 ─── */
.chat-bg-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}
.chat-bg-dim-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0,0,0,0);
  pointer-events: none;
}
/* 消息行不设 z-index，避免创建层叠上下文把弹出菜单困住 */
.chat-messages > * {
  position: relative;
}

/* ─── 消息行 — 微信标准布局 ─── */

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;                /* 防止部分浏览器 flex 子元素宽度塌陷 */
  min-width: 0;               /* 允许内容正常收缩换行 */
}

.message-row.mine {
  flex-direction: row-reverse;
  justify-content: flex-start;
  /* 保持整行占满宽度，避免子元素按内容收缩后把中文气泡压成竖排 */
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}
.message-row.other { flex-direction: row; }

.message-content {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: min(65%, 320px);
  display: flex;
  flex-direction: column;
}
.message-row.mine .message-content {
  max-width: min(220px, calc(100vw - 120px));
}

/* 气泡 */
.message-bubble {
  display: block;
  width: auto;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 0.95em;
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: normal;
  position: relative;
  min-width: 20px;            /* 防止气泡塌陷成竖排 */
}

/* 我的气泡：莫奈蓝 */
.message-row.mine .message-bubble {
  background: var(--bubble-mine);
  color: var(--bubble-mine-text, #fff);
  border-radius: var(--bubble-mine-radius, 18px 4px 18px 18px);
  box-shadow: var(--bubble-shadow, 0 4px 16px rgba(123,165,184,0.2));
}

/* 对方气泡：纯白 */
.message-row.other .message-bubble {
  background: var(--bubble-other);
  color: var(--bubble-other-text, var(--ink));
  border-radius: var(--bubble-other-radius, 4px 18px 18px 18px);
  border: 1px solid var(--border-light);
  box-shadow: var(--bubble-other-shadow, 0 1px 6px rgba(0,0,0,0.03));
}

/* 消息时间 */
.message-time {
  font-size: 10px;
  color: var(--ink-subtle);
  font-weight: 300;
  letter-spacing: 0.8px;
  margin-top: 3px;
}
.message-row.mine .message-time { text-align: right; padding-right: 4px; }
.message-row.other .message-time { padding-left: 4px; }

/* ── 翻译气泡 ── */
.trans-bubble {
  margin-top: 2px !important;
  padding: 4px 12px 5px !important;
  font-size: 13px !important;
  opacity: 0.78;
  color: var(--ink-subtle);
  border-radius: 4px 14px 14px 14px !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  cursor: default !important;
}
.message-row.other .trans-bubble {
  padding-left: 2px !important;
}

/* ═══════ 系统消息 ═══════ */

.message-system {
  text-align: center;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--ink-subtle);
}

/* ═══════ 输入区 ═══════ */

.chat-input-area {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  padding: 8px 10px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.3);
  padding-bottom: calc(8px + var(--sab));
  box-shadow: var(--shadow-nav);
}
@supports not (backdrop-filter: blur(1px)) {
  .chat-input-area { background: rgba(255,255,255,0.95); }
  html.dark-mode .chat-input-area { background: rgba(26,29,36,0.95); }
}

.chat-input-extra {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--ink-light);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  font-weight: 300;
}
.chat-input-extra:active { background: var(--surface-page); }

.chat-input-box {
  flex: 1;
  min-height: 36px;
  max-height: 100px;
  padding: 8px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.6px;
  line-height: 1.4;
  color: var(--ink);
  resize: none;
}
.chat-input-box:focus {
  border-color: var(--monet-blue);
}
.chat-input-box::placeholder { color: var(--ink-subtle); }

.chat-send-msg-btn {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--monet-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 1px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
}
.chat-send-msg-btn:active { background: var(--monet-deepwater); }

/* ─── 引用回复条 ─── */
.chat-reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 4px;
  background: var(--surface-input); border-radius: 10px;
  border-left: 3px solid var(--monet-blue);
  width: 100%; box-sizing: border-box;
  flex-shrink: 0;
  animation: replyBarIn 0.2s ease;
}
@keyframes replyBarIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
.chat-reply-content {
  flex: 1; min-width: 0;
  font-size: 11px; color: var(--ink-subtle);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: 0.5px;
}
.chat-reply-content .reply-name {
  font-weight: 500; color: var(--monet-blue);
}
.chat-reply-close {
  width: 20px; height: 20px; border-radius: 10px;
  border: none; background: transparent;
  color: var(--ink-subtle); font-size: 12px; cursor: pointer;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.chat-reply-close:active { background: var(--surface-page); }

/* ─── 消息气泡中的引用预览 ─── */
.quote-preview {
  font-size: 10px; padding: 4px 8px; margin-bottom: 3px;
  background: rgba(0,0,0,0.06); border-radius: 5px;
  border-left: 2px solid rgba(0,0,0,0.2);
  color: var(--ink-default); letter-spacing: 0.2px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  max-width: 85%; cursor: pointer; line-height: 1.4;
}
.message-row.mine .quote-preview {
  background: rgba(0,0,0,0.15);
  border-left-color: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.9);
}
.quote-preview .quote-name {
  font-weight: 600; opacity: 0.9;
}

.chat-call-ai-btn {
  width: 36px; height: 36px;
  border-radius: 18px;
  background: var(--monet-blue);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
  padding: 0;
  line-height: 1;
}
.chat-call-ai-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}
.chat-call-ai-btn.spectate svg {
  width: 12px;
  height: 12px;
}
.chat-call-ai-btn:active { background: var(--monet-deepwater); }

/* ═══════ 输入扩展面板 ═══════ */

.input-panel {
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  padding: 10px;
  display: none;
}
.input-panel.show { display: block; }

.input-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.input-panel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: 14px;
  cursor: pointer;
}
.input-panel-item:active { background: var(--surface-page); }
.input-panel-item .item-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.input-panel-item .item-label {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.8px;
  color: var(--ink-light);
}

/* ═══════ 加载更早消息 ═══════ */

.chat-load-earlier {
  text-align: center;
  padding: 14px 0;
  margin: 4px 0 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--monet-blue);
  letter-spacing: 0.5px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.chat-load-earlier:hover { opacity: 0.7; }
.chat-load-earlier:active { opacity: 0.5; }

/* ═══════ 正在输入 ═══════ */

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0 8px 48px;
}
.typing-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-subtle);
  animation: dotBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ═══════ 滚动到底部 ═══════ */

.scroll-bottom-btn {
  position: absolute;
  bottom: 70px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 17px;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-light);
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}
.scroll-bottom-btn.show { opacity: 1; }

/* ═══════ 语音消息气泡 · 微信风格 ═══════ */

.voice-input-bar {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  box-sizing: border-box;
  background: var(--surface-input);
  border: 0.5px solid var(--border-light);
  border-radius: 12px;
  animation: replyBarIn 0.16s ease;
}
.voice-input-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ink-subtle);
  letter-spacing: 0.5px;
}
.voice-input-field {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}
.voice-input-field::placeholder { color: var(--ink-light); }
.voice-input-send,
.voice-input-close {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.voice-input-send {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--monet-blue);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.voice-input-close {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-subtle);
  font-size: 13px;
}
.voice-input-send:active { background: var(--monet-deepwater); }
.voice-input-close:active { background: var(--surface-page); color: var(--ink); }

.voice-message-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 16px;
  min-height: 40px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, filter 0.15s;
}

.voice-message-bar.voice-mine {
  background: var(--monet-blue);
  color: #fff;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.voice-message-bar.voice-other {
  background: #fff;
  color: var(--ink);
  flex-direction: row;
  border: 1px solid rgba(0,0,0,0.06);
}

.voice-message-bar.voice-pending {
  opacity: 0.55;
  cursor: default;
  border-style: dashed;
}
.voice-message-bar.voice-loading {
  opacity: 0.7;
  cursor: default;
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

.voice-message-bar:active:not(.voice-pending) {
  filter: brightness(0.92);
}

.voice-play-icon-svg {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
}

.voice-message-bar.voice-other .voice-play-icon-svg {
  background: rgba(143,175,191,0.15);
  color: var(--monet-deepwater);
}

.voice-message-bar.voice-mine .voice-play-icon-svg {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.voice-play-icon-svg.playing {
  animation: voicePulse 0.8s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.voice-duration {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  min-width: 24px;
  text-align: center;
}

.voice-transcript-row {
  display: flex; align-items: flex-start; gap: 6px;
}
.voice-transcript {
  display: none; flex: 1;
  max-width: min(260px, 74vw);
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(143,175,191,0.12);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
.voice-transcript.show { display: block; }

.message-row.mine .voice-transcript {
  margin-left: auto;
  background: rgba(143,175,191,0.18);
  color: var(--ink);
}

html.dark-mode .voice-message-bar.voice-other {
  background: #2c2f3a;
  border-color: rgba(255,255,255,0.08);
  color: #e4e6ea;
}
html.dark-mode .voice-input-bar {
  background: #242833;
  border-color: rgba(255,255,255,0.08);
}

html.dark-mode .voice-message-bar.voice-other .voice-play-icon-svg {
  background: rgba(143,175,191,0.12);
  color: var(--monet-blue);
}

html.dark-mode .voice-transcript {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
}

/* ═══════ 表情包消息 ═══════ */

/* ─── 气泡预设卡片 ─── */
.bubble-preset-card {
  padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--border-light);
  background: var(--surface-card); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.bubble-preset-card:active { background: var(--surface-input); }

.sticker-bubble {
  max-width: 130px;
  max-height: 130px;
  border-radius: 14px;
  display: block;
}
.message-content.has-sticker {
  background: transparent !important;
  box-shadow: none !important;
}

/* ═══════ AI 消息操作 ⋯ ═══════ */
.msg-more-wrap {
  position: relative;
  align-self: flex-start; margin-left: 2px; margin-top: 2px;
}
.msg-more-btn {
  width: 20px; height: 20px; border-radius: 10px;
  border: none; background: transparent; color: var(--ink-subtle);
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  letter-spacing: 0; line-height: 1;
}
.message-row:hover .msg-more-btn,
.message-row:active .msg-more-btn { opacity: 0.6; }
/* 确保消息菜单浮在后续消息上方，不被遮挡 */
.message-row.msg-menu-open { position: relative; z-index: 100; }
.msg-more-btn:active { opacity: 1 !important; background: var(--surface-input); }
.msg-more-menu {
  position: absolute; top: 22px; right: 0;
  background: var(--surface-card); border-radius: 10px;
  border: 0.5px solid var(--border-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  z-index: 100; min-width: 90px; overflow: hidden;
}
.msg-more-menu.show { display: block; }
.msg-more-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 11px; font-weight: 300;
  letter-spacing: 0.8px; color: var(--ink); cursor: pointer;
  white-space: nowrap; border-bottom: 0.5px solid var(--border-separator);
}
.msg-more-item:last-child { border-bottom: none; }
.msg-more-item:active { background: var(--surface-input); }
.msg-more-item svg { flex-shrink: 0; opacity: 0.5; }

/* 群聊发言者名称 */
/* ═══════ 一起看书 — 悬浮小窗 + 全屏 ═══════ */
.reader-panel {
  position: fixed; bottom: 80px; right: 12px;
  width: 260px; height: 340px;
  background: #faf8f2; border-radius: 14px;
  border: 0.5px solid #d0ccc0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; z-index: 600;  /* 高于 modal(500)，阅读器不会被模态层盖住 */
  overflow: hidden; font-family: KaiTi, STKaiti, serif;
  resize: both; min-width: 200px; min-height: 220px;
  max-width: 440px; max-height: 75vh;
  pointer-events: auto;
}
.reader-panel.fullscreen {
  bottom: 0; right: 0; width: 100%; height: 100%;
  max-width: 100%; max-height: 100%; border-radius: 0;
  resize: none; z-index: 200;
}
.reader-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--monet-blue);
  color: #fff; flex-shrink: 0; cursor: grab; user-select: none;
}
.reader-header:active { cursor: grabbing; }
.reader-title { font-size: 11px; font-weight: 400; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.reader-header-btns { display: flex; gap: 3px; flex-shrink: 0; }
.reader-hdr-btn {
  width: 22px; height: 22px; border-radius: 6px; border: none;
  background: rgba(255,255,255,0.2); color: #fff; cursor: pointer;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.reader-hdr-btn:active { background: rgba(255,255,255,0.4); }
.reader-body {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  background: #f6f4ec; color: #3d3226;
}
.reader-panel.fullscreen .reader-body { padding: 24px 20px; }
.reader-chapter {
  font-size: 11px; color: var(--monet-blue); font-weight: 400;
  margin-bottom: 8px; letter-spacing: 0.5px; text-align: center;
}
.reader-content {
  font-size: 14px; line-height: 2; font-weight: 300;
  letter-spacing: 0.3px; text-align: justify;
  font-family: KaiTi, STKaiti, serif;
  white-space: pre-wrap;
}
.reader-panel.fullscreen .reader-content { font-size: 16px; line-height: 2.2; }
.reader-page-info {
  font-size: 10px; color: #999; margin-top: 10px;
  text-align: center; letter-spacing: 0.5px;
}
.reader-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-top: 0.5px solid #e0dcd0;
  flex-shrink: 0; background: #faf8f2;
}
.reader-ctrl-btn {
  width: 30px; height: 30px; border-radius: 15px;
  border: 0.5px solid #d0ccc0; background: transparent;
  color: #666; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.reader-ctrl-btn:active { background: rgba(0,0,0,0.08); }
.reader-ctrl-info { font-size: 10px; color: #999; letter-spacing: 0.5px; min-width: 50px; text-align: center; }

/* 点击翻页区（全屏模式） */
.reader-click-zone { position: absolute; top: 48px; bottom: 48px; z-index: 1; }
.reader-click-zone.left { left: 0; width: 25%; }
.reader-click-zone.right { right: 0; width: 25%; }
.reader-header,
.reader-controls,
.reader-chapter,
.reader-page-info,
.reader-chapter-nav { position: relative; z-index: 6; }
.reader-content { position: relative; z-index: 2; }

/* 书架 */
.reader-book-item {
  display: flex; align-items: center; padding: 12px; margin: 4px 8px;
  background: var(--surface-input); border-radius: 12px; cursor: pointer;
  border: 0.5px solid var(--border-light);
}
.reader-book-item:active { background: var(--surface-page); }
.reader-book-info { flex: 1; min-width: 0; }
.reader-book-title { font-size: 13px; font-weight: 400; letter-spacing: 0.5px; }
.reader-book-meta { font-size: 10px; color: var(--ink-subtle); margin-top: 2px; }
.reader-book-del { width: 22px; height: 22px; border-radius: 11px; border: none; background: transparent; color: var(--ink-subtle); font-size: 11px; cursor: pointer; flex-shrink: 0; }
.reader-import-zone {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 10px 8px; padding: 14px; border: 1.5px dashed var(--border-light);
  border-radius: 14px; cursor: pointer; color: var(--ink-light); font-size: 13px;
}
.group-speaker-name {
  font-size: 10px; font-weight: 400; letter-spacing: 0.3px;
  color: var(--monet-blue); margin-bottom: 1px;
  padding-left: 8px; opacity: 0.8;
}
.group-speaker-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0 0 3px 6px;
}
.group-speaker-line .group-speaker-name {
  margin: 0;
  padding: 0;
}
.group-title-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 500;
  line-height: 16px;
  color: var(--ink-subtle);
  background: var(--surface-input);
  border: 1px solid var(--border-light);
}
.group-title-badge.owner {
  color: #8a5b13;
  background: #fff4d8;
  border-color: #f0d393;
}
.group-title-badge.admin {
  color: #2f6474;
  background: #e9f5f8;
  border-color: #c7e4ec;
}
.group-title-badge.muted {
  color: #a13f3f;
  background: #fff0f0;
  border-color: #f2c7c7;
}
html.dark-mode .group-title-badge {
  color: #b8b8b8;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
html.dark-mode .group-title-badge.owner {
  color: #f0d393;
  background: rgba(240, 211, 147, 0.12);
  border-color: rgba(240, 211, 147, 0.26);
}
html.dark-mode .group-title-badge.admin {
  color: #a8d8e5;
  background: rgba(120, 190, 210, 0.12);
  border-color: rgba(120, 190, 210, 0.26);
}
html.dark-mode .group-title-badge.muted {
  color: #f0b0b0;
  background: rgba(220, 80, 80, 0.12);
  border-color: rgba(220, 80, 80, 0.28);
}

/* 群成员管理弹窗 */
.group-manage-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-manage-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 2px 0 4px;
}
.group-manage-stat {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-input);
  text-align: center;
}
.group-manage-stat strong {
  display: block;
  font-size: 17px;
  line-height: 1;
  color: var(--ink);
  font-weight: 500;
}
.group-manage-stat span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--ink-subtle);
}
.group-manage-list {
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-card);
}
.group-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
}
.group-manage-row:last-child {
  border-bottom: 0;
}
.group-manage-row.is-muted {
  background: rgba(220, 38, 38, 0.035);
}
html.dark-mode .group-manage-row.is-muted {
  background: rgba(220, 80, 80, 0.08);
}
.group-manage-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-input);
  border: 1px solid var(--border-light);
  color: var(--ink-subtle);
  font-size: 16px;
}
.group-manage-main {
  flex: 1;
  min-width: 0;
}
.group-manage-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.group-manage-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.group-manage-meta {
  margin-top: 3px;
  font-size: 10px;
  color: var(--ink-subtle);
}
.group-manage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.group-action-btn {
  height: 28px;
  min-width: 54px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}
.group-action-btn:active {
  transform: translateY(1px);
  background: var(--surface-input);
}
.group-action-btn.mute {
  color: #9c3e3e;
  border-color: #e8c2c2;
  background: #fff6f6;
}
.group-action-btn.unmute {
  color: #2f6474;
  border-color: #c7e4ec;
  background: #f0fafc;
}
.group-action-btn.admin {
  color: #2f6474;
}
html.dark-mode .group-action-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--ink);
}
html.dark-mode .group-action-btn.mute {
  color: #f0b0b0;
  border-color: rgba(220,80,80,0.28);
  background: rgba(220,80,80,0.08);
}
html.dark-mode .group-action-btn.unmute,
html.dark-mode .group-action-btn.admin {
  color: #a8d8e5;
  border-color: rgba(120,190,210,0.26);
  background: rgba(120,190,210,0.08);
}
.group-manage-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-subtle);
}
@media (max-width: 420px) {
  .group-manage-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .group-manage-row { align-items: flex-start; }
  .group-manage-actions { flex-direction: column; align-items: stretch; }
  .group-action-btn { min-width: 50px; }
}

/* ═══════ AI 生图消息 ═══════ */

.chat-image-msg {
  max-width: 240px;
  max-height: 320px;
  border-radius: 14px;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
  object-fit: cover;
}
.chat-image-msg:active { opacity: 0.85; }

/* 图片下载按钮 */
.img-msg-actions { margin-top: 4px; }
.img-download-btn {
  display: inline-block;
  font-size: 11px;
  color: var(--monet-blue, #1d9bf0);
  text-decoration: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--monet-blue, #1d9bf0);
  transition: all 0.2s;
}
.img-download-btn:hover {
  background: var(--monet-blue, #1d9bf0);
  color: #fff;
}

/* 图片全屏查看 */
.image-fullscreen-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.image-fullscreen-overlay img {
  max-width: 95vw; max-height: 95vh;
  border-radius: 8px; object-fit: contain;
}

/* ═══════ 离线模式卡片 ═══════ */

.offline-mode .chat-messages {
  background: transparent;
  padding: 12px;
}

.offline-card {
  background: var(--surface-card);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
.offline-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.offline-card-avatar {
  width: 36px; height: 36px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background-color: var(--surface-input);
  border: 1px solid var(--border-light);
}
.offline-card-info { flex: 1; min-width: 0; }
.offline-card-name {
  font-weight: 300; letter-spacing: 1px;
  font-size: 13px; color: var(--ink);
}
.offline-card-time {
  font-size: 10px; color: var(--ink-subtle);
  font-weight: 300; letter-spacing: 0.8px; margin-top: 2px;
}
.offline-card-floor {
  font-size: 10px; color: var(--ink-light);
  font-weight: 300; background: var(--surface-input);
  padding: 3px 10px; border-radius: 12px; letter-spacing: 0.8px;
}
.offline-card-actions { display: flex; gap: 6px; align-items: center; }
.offline-action-btn {
  cursor: pointer; padding: 4px 8px; border-radius: 10px;
  font-size: 13px; font-weight: 300; border: none; background: none;
}
.offline-action-btn.edit { color: var(--monet-blue); }
.offline-action-btn.edit:active { background: rgba(123,165,184,0.12); }
.offline-action-btn.delete { color: #EF4444; }
.offline-action-btn.delete:active { background: #FEE2E2; }
.offline-card-content {
  font-size: 14px; font-weight: 300; letter-spacing: 0.5px;
  line-height: 1.8; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.offline-scene-card {
  border-radius: 14px;
  border-color: rgba(20, 31, 38, 0.12);
  box-shadow: 0 8px 22px rgba(20, 31, 38, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,250,0.96));
}
.offline-scene-header {
  align-items: flex-start;
  gap: 9px;
}
.offline-scene-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
  background: var(--surface-input);
  border: 1px solid var(--border-light);
}
.offline-scene-mark svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.offline-scene-content {
  font-size: 14px;
  line-height: 1.9;
}

/* ═══════ 离线底部输入栏 ═══════ */

.offline-bottom-bar {
  display: none; gap: 8px; padding: 8px 12px;
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  align-items: flex-end;
  padding-bottom: calc(8px + var(--sab));
}
.offline-mode-active .offline-bottom-bar { display: flex; }
.offline-mode-active .chat-input-area { display: none; }

.offline-input {
  flex: 1; background: var(--surface-input);
  border: 1px solid var(--border-light); border-radius: 20px;
  padding: 10px 14px; font-size: 15px; font-weight: 300;
  letter-spacing: 0.6px; resize: none; max-height: 100px;
  outline: none; font-family: inherit; color: var(--ink);
}
.offline-input::placeholder { color: var(--ink-subtle); }

.offline-btn {
  width: 38px; height: 38px; border-radius: 19px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.offline-btn.secondary {
  background: var(--surface-input); color: var(--ink-light);
  border: 1px solid var(--border-light);
}
.offline-btn.secondary:active { background: var(--surface-page); }
.offline-btn.primary {
  background: var(--monet-blue); color: #fff;
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
}
.offline-btn.primary:active { background: var(--monet-deepwater); }

/* ═══════ RP 模式页面 ═══════ */

.rp-story-area {
  flex: 1; overflow-y: auto;
  padding: 16px 14px; background: transparent;
}
.rp-paragraph {
  margin-bottom: 22px;
  animation: rpFadeIn 0.4s ease;
}
@keyframes rpFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.rp-paragraph-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-paragraph-avatar {
  width: 28px; height: 28px; border-radius: 12px;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
  background-color: var(--surface-input); border: 1px solid var(--border-light);
}
.rp-paragraph-name {
  font-size: 12px; font-weight: 300; letter-spacing: 1px;
  color: var(--ink);
}
.rp-paragraph-role {
  font-size: 10px; font-weight: 300; color: var(--ink-light);
  margin-left: 4px; letter-spacing: 0.8px;
}
.rp-paragraph-body {
  font-size: 14px; font-weight: 300; letter-spacing: 0.5px;
  line-height: 1.85; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.rp-paragraph-body.user { color: var(--ink-light); }

/* RP 消息操作菜单 */
.rp-msg-menu-btn {
  background: none; border: none; color: var(--ink-subtle);
  font-size: 14px; padding: 2px 6px; cursor: pointer; border-radius: 4px;
  line-height: 1; letter-spacing: 1px;
}
.rp-msg-menu-btn:hover { background: var(--surface-card); color: var(--ink); }
.rp-msg-menu-dropdown {
  position: absolute; right: 0; top: 100%;
  background: var(--surface-card); border: 1px solid var(--border-light);
  border-radius: 8px; box-shadow: var(--shadow-float-sm);
  z-index: 50; min-width: 100px; overflow: hidden;
}
.rp-msg-menu-dropdown button {
  display: block; width: 100%; padding: 8px 14px;
  background: none; border: none; font-size: 13px;
  color: var(--ink); cursor: pointer; text-align: left;
  font-family: inherit;
}
.rp-msg-menu-dropdown button:hover { background: var(--surface-page); }

.rp-separator {
  text-align: center; margin: 14px 0;
  font-size: 11px; font-weight: 300; letter-spacing: 1.5px;
  color: var(--ink-subtle);
}
.rp-separator::before, .rp-separator::after {
  content: ' ─ '; color: var(--border-light);
}

.rp-input-bar {
  display: flex; gap: 8px; padding: 10px 14px;
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  align-items: flex-end;
  padding-bottom: calc(10px + var(--sab));
}

.rp-textarea {
  flex: 1; min-height: 44px; max-height: 150px;
  padding: 10px 14px; background: var(--surface-input);
  border: 1px solid var(--border-light); border-radius: 16px;
  font-size: 15px; font-weight: 300; letter-spacing: 0.6px;
  line-height: 1.5; color: var(--ink);
  resize: none; font-family: inherit;
}
.rp-textarea:focus { border-color: var(--monet-blue); }
.rp-textarea::placeholder { color: var(--ink-subtle); }

.rp-send-btn {
  width: 38px; height: 38px; border-radius: 19px;
  background: var(--monet-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; border: none;
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
}
.rp-send-btn:active { background: var(--monet-deepwater); }

.rp-loading { display: flex; gap: 3px; padding: 8px 0; }
.rp-loading-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-subtle);
  animation: dotBounce 1.4s infinite ease-in-out;
}
.rp-loading-dot:nth-child(1) { animation-delay: 0s; }
.rp-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.rp-loading-dot:nth-child(3) { animation-delay: 0.4s; }

/* ═══════ AI 状态弹窗（内心话） ═══════ */

.ai-status-card {
  padding: 4px 0;
}

.status-star-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 6px;
}

.status-star-icon {
  display: flex; align-items: center; justify-content: center;
}

.status-fav-value {
  font-size: 28px;
  font-weight: 200;
  letter-spacing: 1px;
  color: var(--monet-deepwater);
}

.status-fav-label {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--ink-subtle);
  background: var(--surface-input);
  padding: 2px 10px;
  border-radius: 10px;
}

.status-divider {
  border: none;
  border-top: 0.5px solid var(--border-light);
  margin: 10px 4px;
}

.status-section {
  padding: 2px 4px;
}

.status-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--ink-subtle);
  margin-bottom: 8px;
}

.status-thought-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  font-weight: 300;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  background: var(--surface-input);
  border-radius: 12px;
  border-left: 2px solid var(--monet-deepwater);
}
.status-thought-trans {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-light, #999);
  font-style: normal;
  padding: 6px 14px;
  background: var(--surface-input);
  border-radius: 0 0 12px 12px;
  border-left: 2px solid var(--monet-deepwater);
}

.status-history-list {
  max-height: 120px;
  overflow-y: auto;
}

.fav-history-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--ink-subtle);
  font-weight: 300;
}

.fav-history-reason {
  flex: 1;
  opacity: 0.8;
  letter-spacing: 0.3px;
}

/* ═══════════════ 模拟照片卡片 ═══════════════ */
.sim-photo-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
/* 自己发的模拟照片 */
.message-row.sent .sim-photo-card {
  background: #1a1a1a !important;
}
/* 对方发的模拟照片 */
.message-row.other .sim-photo-card {
  background: #2a3040 !important;
}
/* 暗色模式 */
html.dark-mode .message-row.other .sim-photo-card {
  background: #1e2432 !important;
}

/* ═══ 小屏手机适配 ≤360px ═══ */
@media (max-width: 360px) {
  .chat-input-box { font-size: 14px; padding: 8px 10px; }
  .chat-send-msg-btn { padding: 8px 9px; font-size: 12px; min-width: 42px; }
  .chat-input-extra { width: 32px; height: 32px; }
  .chat-call-ai-btn { width: 32px; height: 32px; }
  .chat-input-area { padding: 4px 5px; gap: 3px; }
  .voice-input-bar { gap: 4px; padding: 5px 6px; }
  .voice-input-label { display: none; }
  .voice-input-send { padding: 0 9px; }
  .voice-input-close { width: 28px; }
  .message-row { max-width: 90%; }
}

/* ═══ 拉黑横幅 ═══ */
.blocked-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 12px 6px;
  background: #FFF5F5;
  border: 1px solid #FECACA;
  border-radius: 14px;
  font-family: var(--font-family);
}
html.dark-mode .blocked-banner {
  background: #2D1F1F;
  border-color: #5C3030;
}
.blocked-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.blocked-banner-text {
  flex: 1;
  min-width: 0;
}
.blocked-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: #DC2626;
}
html.dark-mode .blocked-banner-title { color: #F87171; }
.blocked-banner-sub {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 2px;
}
.blocked-banner-btn {
  flex-shrink: 0;
  background: #EF4444;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family);
}
.blocked-banner-btn:active { opacity: 0.8; }

/* ═══ 申请解封弹窗 ═══ */
.appeal-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 20px;
}
.appeal-popup-overlay.show { opacity: 1; }

.appeal-popup-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  transform: translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  font-family: var(--font-family);
}
.appeal-popup-card.show { transform: translateY(0); }
html.dark-mode .appeal-popup-card {
  background: #1F2937;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.appeal-popup-avatar {
  margin-bottom: 10px;
}
.appeal-popup-avatar span,
.appeal-popup-avatar img {
  display: inline-block;
}

.appeal-popup-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.appeal-popup-msg {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  padding: 12px 16px;
  background: #F9FAFB;
  border-radius: 14px;
  margin-bottom: 18px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
html.dark-mode .appeal-popup-msg {
  background: #111827;
}

.appeal-popup-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.appeal-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
  transition: opacity 0.15s;
}
.appeal-btn:active { opacity: 0.8; }
.appeal-btn.unblock {
  background: var(--monet-blue, #1d9bf0);
  color: #fff;
}
.appeal-btn.keep {
  background: #F3F4F6;
  color: #6B7280;
}
html.dark-mode .appeal-btn.keep {
  background: #374151;
  color: #9CA3AF;
}

/* ═══════════════ 角色消息通知条 ═══════════════ */
#msg-notification {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  max-width: 360px;
  background: rgba(255,255,255,0.94);
  color: #333;
  border-radius: 14px;
  padding: 12px 14px;
  z-index: 9999;
  transition: top 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  pointer-events: none;
}
#msg-notification.show {
  top: 52px;
  pointer-events: auto;
}
#msg-notif-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #E8ECF0;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
#msg-notif-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#msg-notif-sender {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  color: #222;
}
#msg-notif-text {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 暗色模式 */
html.dark-mode #msg-notification {
  background: rgba(30,34,42,0.94);
  color: #ddd;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
}
html.dark-mode #msg-notif-avatar {
  background: #2D3240;
  color: #999;
}
html.dark-mode #msg-notif-sender { color: #eee; }
html.dark-mode #msg-notif-text { color: #aaa; }

/* ═══════ 导入聊天样本 ═══════ */

/* 导入样本的分割线 */
.chat-import-divider {
  text-align: center;
  padding: 10px 20px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 1px;
  user-select: none;
  position: relative;
}
.chat-import-divider::before,
.chat-import-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 32%;
  height: 0.5px;
  background: var(--border-light);
}
.chat-import-divider::before { left: 8px; }
.chat-import-divider::after { right: 8px; }
.chat-import-divider-start {
  color: var(--monet-blue);
  font-weight: 500;
}
.chat-import-divider-start::before,
.chat-import-divider-start::after {
  background: var(--monet-blue);
  opacity: 0.25;
}

/* 折叠按钮 */
.chat-import-toggle {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--monet-blue);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.chat-import-toggle:hover { opacity: 0.7; }

/* 导入样本气泡 — 略微淡化背景，与实时消息区分 */
.message-row.imported-sample .message-bubble {
  opacity: 0.72;
}
.message-row.imported-sample.mine .message-bubble {
  background: var(--bubble-mine);
  filter: saturate(0.6);
}
.message-row.imported-sample.other .message-bubble {
  background: var(--bubble-other);
  filter: saturate(0.6);
}

/* 导入样本 hover 时恢复正常 */
.message-row.imported-sample:hover .message-bubble {
  opacity: 0.92;
  filter: none;
}

/* 导入弹窗 */
.import-preview-wrap {
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  background: var(--surface-input);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}
.import-preview-wrap .ip-me { color: var(--monet-blue); }
.import-preview-wrap .ip-role { color: var(--ink); }
.import-speaker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border-light);
}
.import-speaker-row:last-child { border-bottom: none; }
.import-speaker-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.import-speaker-count {
  font-size: 11px;
  color: var(--ink-subtle);
  margin-left: 6px;
}
.import-speaker-select {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 0.5px solid var(--border-light);
  background: var(--surface-card);
  color: var(--ink);
  cursor: pointer;
}
.import-speaker-select:focus { outline: none; border-color: var(--monet-blue); }
