/**
 * 小手机 — 聊天样式
 * 莫奈印象派 · 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;
  overflow-y: auto;
  padding: 10px 12px;
  background: transparent;
  position: relative;
}

/* ─── 聊天背景层 ─── */
.chat-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}
.chat-bg-dim-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0,0,0,0);
  pointer-events: none;
}
.chat-messages > * {
  position: relative;
  z-index: 1;
}

/* ─── 消息行 — 微信标准布局 ─── */

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.message-row.mine { flex-direction: row-reverse; }
.message-row.other { flex-direction: row; }

.message-content {
  max-width: 65%;
  display: flex;
  flex-direction: column;
}

/* 气泡 */
.message-bubble {
  padding: 10px 14px;
  font-size: 0.95em;
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

/* 我的气泡：莫奈蓝 */
.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: 5px 12px !important;
  font-size: 12px !important;
  font-style: italic;
  opacity: 0.75;
  color: var(--ink-subtle);
  border-radius: 4px 14px 14px 14px !important;
  border: 1px dashed rgba(128,128,128,0.2) !important;
  box-shadow: none !important;
  background: rgba(128,128,128,0.04);
  cursor: default !important;
}
.message-row.other .trans-bubble {
  border-radius: 4px 14px 14px 14px !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;
  align-items: flex-end;
  gap: 6px;
  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;
  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: 11px; padding: 6px 9px; margin-bottom: 4px;
  background: rgba(0,0,0,0.08); border-radius: 6px;
  border-left: 3px solid rgba(0,0,0,0.25);
  color: var(--ink-default); letter-spacing: 0.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%; cursor: pointer;
}
.message-row.mine .quote-preview {
  background: rgba(0,0,0,0.2);
  border-left-color: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.95);
}
.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-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 {
  display: none;
  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;
  word-break: break-word;
}

.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-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; }
.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: 10; 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;
}

/* ═══════ 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; }

/* 图片全屏查看 */
.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; word-break: break-word;
}
.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; word-break: break-word;
}
.rp-paragraph-body.user { color: var(--ink-light); }

.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-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;
}
