:root {
  --bg-deep: #0a0a0d; --bg-surface: #141418; --bg-elevated: #1c1c22; --bg-input: #22222a;
  --border-subtle: #2a2a35; --border-glow: #8b1a2b; --text-primary: #e8e3e0;
  --text-secondary: #9a9490; --text-muted: #8a8480;  /* WCAG AA 4.55:1 on #0a0a0d */ --accent-blood: #c0392b;
  --accent-blood-glow: #e74c3c; --accent-crimson: #7b1f2b;
  --bubble-own: #1a1a22; --bubble-own-border: #3a2a30;
  --bubble-other: #1e1418; --bubble-other-border: #8b1a2b;
  --font-serif: 'Noto Serif SC', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-md: 8px; --radius-lg: 16px;
  /* 统一弹窗变量 */
  --modal-max-width: 360px;
  --modal-radius: 12px;
  --modal-padding: 24px 20px;
  /* 字号变量（可通过 .font-small / .font-large 覆写） */
  --font-size-chat: 14px;
  --font-size-ui: 12px;
  --font-size-caption: 10px;
}
/* 字号预设 */
.font-small  { --font-size-chat: 12px; --font-size-ui: 10px; --font-size-caption: 9px; }
.font-large  { --font-size-chat: 17px; --font-size-ui: 14px; --font-size-caption: 12px; }

/* 【沉浸感】时间氛围 — 背景随时段微变 */
.time-night { --bg-deep: #08080d; --bg-surface: #101015; }
.time-morning { --bg-deep: #0d0d12; --bg-surface: #16161e; --accent-blood-glow: #d45050; }
.time-afternoon { --bg-deep: #0a0a10; --bg-surface: #14141c; }
.time-evening { --bg-deep: #0f0a10; --bg-surface: #18141a; --accent-blood-glow: #e06050; }

/* 【沉浸感】鬼心情氛围 — 聊天背景随鬼心情微调 */
.mood-warm { --bg-surface: #1a1418; --bg-elevated: #221820; --bubble-other: #241418; --bubble-other-border: #a02030; transition: background 2s ease; }
.mood-cold { --bg-surface: #101418; --bg-elevated: #181c22; --bubble-other: #141820; --bubble-other-border: #3a4a5a; transition: background 2s ease; }
.mood-angry { --bg-surface: #1a1010; --bg-elevated: #221414; --bubble-other: #241010; --bubble-other-border: #8b0000; transition: background 1.5s ease; }
.mood-calm { --bg-surface: #141418; --bg-elevated: #1c1c22; --bubble-other: #1e1418; --bubble-other-border: #8b1a2b; transition: background 3s ease; }
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }\n/* 全局平滑过渡 */\nbody, #app, .page, .header, .nav-bar { transition: background 2s ease, border-color 2s ease; }
body {
  font-family: var(--font-sans); background: var(--bg-deep); color: var(--text-primary);
  height: 100dvh; width: 100vw; overflow: hidden; display: flex; justify-content: center; align-items: center;
  user-select: auto; -webkit-user-select: auto; -webkit-tap-highlight-color: transparent;
}
/* 交互元素禁用选择，聊天气泡允许选择 */
.nav-bar, .nav-item, .header-btn, .btn-primary, .btn-secondary,
.modal-overlay, .chat-input-area button, .info-bar, .info-bar-group,
.popup-menu-item, .submenu-container button, .shop-item, .list-card,
.memoir-tab, .calendar-grid, .day-cell {
  user-select: none; -webkit-user-select: none;
}
.msg-bubble, .thinking-body, .memory-detail-content, .modal-box p {
  user-select: text; -webkit-user-select: text;
}
/* 无障碍跳过链接 */
.skip-link {
  position: absolute; top: -100px; left: 10px;
  background: var(--accent-crimson); color: #fff;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 13px; z-index: 999; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 10px; }
#app {
  width: 100%; max-width: 480px; height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg-surface); position: relative; overflow: hidden; box-shadow: 0 0 20px rgba(139,26,43,0.15);
}
/* 聊天输入框聚焦光晕 */
#chat-input:focus {
  border-color: var(--accent-blood-glow);
  box-shadow: 0 0 12px rgba(231,76,60,0.15);
  transition: border-color 0.3s, box-shadow 0.3s;
}
/* 发送按钮 */
#btn-send .send-icon { font-size: 18px; line-height: 1; }
#btn-send:not(:disabled):active { transform: scale(0.9); transition: transform 0.1s; }
.page { position: absolute; top: 0; left: 0; right: 0; bottom: 56px; display: none; flex-direction: column; }
.page.active { display: flex; animation: pageIn 0.25s ease both; pointer-events: auto; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
/* 页面切换柔化 */
.page { transition: opacity 0.2s ease; }
/* 新人引导条动画 */
#onboarding-bar { transition: all 0.3s ease; }
.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-subtle); min-height: 52px; flex-shrink: 0; }
.header-title { font-size: 15px; font-weight: 600; }
.header-subtitle { font-size: 11px; color: var(--text-muted); }
.header-btn { background: none; border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 8px 14px; border-radius: var(--radius-md); font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 4px; min-height: 40px; min-width: 40px; justify-content: center; }
.header-btn:active { background: var(--bg-input); border-color: var(--border-glow); color: var(--accent-blood-glow); }
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); }
.modal-box { width: 90%; max-width: var(--modal-max-width); background: var(--bg-elevated); border: 1px solid var(--border-glow); border-radius: var(--modal-radius); padding: var(--modal-padding); }
.modal-box h2 { font-size: 17px; text-align: center; margin-bottom: 18px; color: var(--accent-blood-glow); }
.modal-box input, .modal-box select, .modal-box textarea { width: 100%; padding: 14px 16px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-primary); font-size: 15px; outline: none; margin-bottom: 10px; resize: vertical; min-height: 48px; }
/* ── 紧凑信息栏（好感+情绪+状态+Token 一行）── */
.info-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
  font-size: 11px; line-height: 1.5;
  min-height: 28px; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}
.info-bar.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; border-bottom-width: 0; overflow: hidden; }
.info-bar-group { display: flex; align-items: center; gap: 4px; white-space: nowrap; cursor: default; }
.info-bar-divider { color: var(--border-subtle); font-size: 10px; user-select: none; }
.info-bar #token-indicator-text { font-size: 10px; color: var(--text-muted); cursor: pointer; transition: color 0.3s; }
.info-bar #token-indicator-text.token-low { color: var(--accent-blood-glow); animation: tokenLowPulse 2s ease-in-out infinite; }
.info-bar #header-user-name { font-size: 10px; color: var(--text-muted); cursor: pointer; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-bar #ghost-live-status-inline { font-size: 10px; color: var(--text-muted); cursor: pointer; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-bar #ghost-chat-status { font-size: 11px; color: var(--text-muted); cursor: pointer; }

/* 保留旧 class 向后兼容 */
.affection-bar-container { padding: 4px 12px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.affection-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.affection-value { font-size: 11px; color: var(--text-secondary); min-width: 22px; text-align: right; }
/* 好感度迷你进度条 */
.affection-mini-bar { width: 60px; height: 4px; background: var(--bg-input); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.affection-mini-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #4a4a6a, #c0392b, #e74c3c); transition: width 0.6s ease; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-primary { background: var(--accent-crimson); color: #fff; border: none; padding: 12px 0; border-radius: var(--radius-md); font-size: 15px; cursor: pointer; flex: 1; min-height: 48px; -webkit-tap-highlight-color: transparent; }
.btn-secondary { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 12px 0; border-radius: var(--radius-md); font-size: 15px; cursor: pointer; flex: 1; min-height: 48px; -webkit-tap-highlight-color: transparent; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 2px; }
.time-divider { text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px 0; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; position: relative; }
.msg-row.self { max-width: 82%; }
.msg-row.other { max-width: 88%; }
.msg-row.self { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.other { align-self: flex-start; flex-direction: row; }
.msg-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; border: 1.5px solid var(--border-subtle); background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 14px; overflow: hidden; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-avatar.self { border-color: var(--accent-crimson); }
.msg-avatar.other { border-color: var(--border-glow); }
.msg-bubble { padding: 10px 14px; font-size: var(--font-size-chat); line-height: 1.55; word-break: break-word; cursor: pointer; transition: background 0.15s; }
.msg-bubble:hover { filter: brightness(1.1); }
/* 消息时间戳 */
.msg-timestamp { font-size: 10px; color: var(--text-muted); margin-top: 2px; opacity: 0; transition: opacity 0.2s; text-align: right; }
.msg-row:hover .msg-timestamp { opacity: 0.7; }
.msg-row.self .msg-timestamp { text-align: left; }
/* 连续同角色消息合并 — 减小间距 */
.msg-row.merged { margin-top: -4px; }
.msg-row.merged .msg-avatar { visibility: hidden; }
.msg-row.self .msg-bubble { background: var(--bubble-own); border: 1px solid var(--bubble-own-border); border-radius: 16px 4px 16px 16px; color: var(--text-primary); }
.msg-row.other .msg-bubble { background: var(--bubble-other); border: 1px solid var(--bubble-other-border); border-radius: 4px 16px 16px 16px; color: #c5b8b0; font-family: var(--font-serif); }
.msg-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.thinking-section { margin: 4px 0; }
.thinking-header {
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--bg-input); transition: background 0.2s;
  user-select: none;
}
.thinking-header:hover { background: var(--bg-elevated); }
.thinking-header::before {
  content: '💭'; font-size: 13px;
}
.thinking-header::after {
  content: ''; margin-left: auto;
  width: 14px; height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform 0.3s ease;
  opacity: 0.5;
}
.thinking-header.expanded::after { transform: rotate(180deg); }
.thinking-header.streaming {
  color: var(--accent-blood-glow);
  background: rgba(139,26,43,0.08);
}
.thinking-header.streaming::before {
  content: '💭'; animation: think-pulse 1.2s ease-in-out infinite;
}
@keyframes think-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.thinking-body {
  font-size: 12px; color: var(--text-secondary);
  line-height: 1.65; padding: 0 10px;
  background: var(--bg-input); border-left: 2px solid #7a3030;
  border-radius: 0 4px 4px 0; margin-top: 2px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.thinking-body.show {
  max-height: 180px; padding: 8px 10px; overflow-y: auto;
}
.msg-actions { display: flex; gap: 10px; margin-top: 4px; }
.msg-action-btn { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 8px 10px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); transition: background 0.15s; }
.msg-action-btn:active { background: var(--bg-input); color: var(--text-primary); }
.chat-input-area { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-elevated); border-top: 1px solid var(--border-subtle); flex-shrink: 0; }
.chat-input-area input { flex: 1; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 24px; color: var(--text-primary); font-size: 15px; outline: none; min-height: 48px; }
.chat-input-area button { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--accent-crimson); color: #fff; font-size: 18px; cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.chat-input-area button:disabled { background: #3a3a40; color: #666; cursor: not-allowed; opacity: 0.6; }
.nav-bar { display: flex; border-top: 1px solid var(--border-subtle); background: var(--bg-elevated); flex-shrink: 0; overflow-x: auto; z-index: 50; position: absolute; bottom: 0; left: 0; right: 0; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom, 0); pointer-events: auto; }
.nav-item { flex: 1; text-align: center; padding: 8px 6px 10px; font-size: 12px; letter-spacing: 0.3px; color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; -webkit-tap-highlight-color: transparent; user-select: none; transition: color 0.2s; position: relative; }
.nav-item::after { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%) scaleX(0); width: 20px; height: 2px; background: var(--accent-blood-glow); border-radius: 2px; transition: transform 0.2s ease; }
.nav-item.active { color: var(--accent-blood-glow); font-weight: 500; }
.nav-item.active::after { transform: translateX(-50%) scaleX(1); }
.nav-item:active { color: var(--accent-blood-glow); background: rgba(139,26,43,0.08); transform: scale(0.96); transition: transform 0.1s; }
/* 导航 NEW 徽标 */
.nav-new-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--accent-blood-glow); color: #fff;
  font-size: 9px; padding: 1px 4px; border-radius: 6px;
  line-height: 1.2; font-weight: 700;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.list-container { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.list-card { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px; cursor: pointer; position: relative; }
.card-title { font-size: 14px; font-weight: 600; }
.card-time { font-size: 10px; color: var(--text-muted); margin-top: 6px; }
.empty-state { text-align: center; color: var(--text-muted); padding-top: 60px; font-size: 13px; line-height: 2; }
.empty-state .empty-icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.5; }
/* ── 打字指示器（重做）── */
.typing-indicator { align-self: flex-start; display: flex; align-items: center; gap: 6px; padding: 10px 14px; position: relative; }
.typing-indicator .typing-label {
  font-size: 11px; color: var(--text-muted);
  animation: typingLabelIn 0.4s ease;
  white-space: nowrap;
}
@keyframes typingLabelIn { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }
.typing-indicator .typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-indicator .typing-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.4s infinite ease-in-out;
}
.typing-indicator .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100% { transform: translateY(0); opacity: 0.3; } 30% { transform: translateY(-5px); opacity: 0.8; } }
/* 快节奏模式 — 鬼兴奋时 */
.typing-indicator.fast .typing-dots span { animation-duration: 0.8s; }
.typing-indicator.fast .typing-label { color: var(--accent-blood-glow); }
/* 慢节奏模式 — 鬼冷淡时 */
.typing-indicator.slow .typing-dots span { animation-duration: 2.2s; }
.typing-indicator.slow .typing-label { color: var(--text-muted); font-style: italic; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 8px; text-align: center; font-size: 12px; }
.day-cell { padding: 6px 0; border-radius: 4px; cursor: pointer; font-size: 12px; position: relative; }
.day-cell.today { border: 1px solid var(--accent-blood); }
/* 热力图着色 */
.day-cell { transition: background 0.2s, transform 0.15s; }
.day-cell:hover { transform: scale(1.15); z-index: 1; }
.day-cell.mood-very-happy { background: #d44444; }
.day-cell.mood-happy { background: #c06050; }
.day-cell.mood-slightly-happy { background: #8a5a4a; }
.day-cell.mood-neutral { background: var(--bg-input); }
.day-cell.mood-slightly-sad { background: #4a5a6a; }
.day-cell.mood-sad { background: #3a4a6a; }
.day-cell.mood-very-sad { background: #2a3a5a; }
.day-cell.has-chat { box-shadow: inset 0 0 0 2px var(--accent-blood-glow); }

/* ── 星座标签样式 ── */
.zodiac-tag {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 10px; background: rgba(200,160,200,0.12);
  color: #c8a0c8; border: 1px solid rgba(200,160,200,0.25);
  margin-top: 4px;
}

/* ── 关系页节点悬停 ── */
.relation-node {
  transition: transform 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}
.relation-node:hover {
  transform: scale(1.08); filter: brightness(1.3);
}

/* ── 心情标签颜色映射 ── */
.mood-tag { transition: color 0.5s ease, background 0.5s ease; padding: 1px 6px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.mood-tag.mood-positive { color: #f5a0a0; background: rgba(245,160,160,0.1); }
.mood-tag.mood-negative { color: #8899cc; background: rgba(136,153,204,0.1); }
.mood-tag.mood-neutral { color: var(--text-muted); background: transparent; }
/* ── 设置页开关美化 ── */
.setting-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
}
.setting-toggle label { font-size: 13px; color: var(--text-primary); }

/* ── 已读回执 ── */
.read-receipt {
  font-size: 10px; color: var(--text-muted); font-style: italic;
  text-align: right; padding: 2px 4px 0 0;
  animation: readFadeIn 0.5s ease;
  opacity: 0.7;
}
@keyframes readFadeIn { from { opacity: 0; } to { opacity: 0.7; } }

/* ── 头像呼吸动画 ── */
.msg-avatar.other.alive {
  animation: avatarBreathe 4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(139,26,43,0.2);
}
@keyframes avatarBreathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(139,26,43,0.2); }
  50% { transform: scale(1.04); box-shadow: 0 0 16px rgba(139,26,43,0.4); }
}

/* ── 消息气泡入场动画 ── */
.msg-row {
  animation: msgSlideIn 0.3s ease-out both;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-row.system {
  animation: msgFadeIn 0.5s ease both;
}
.msg-row.system .msg-bubble {
  background: transparent;
  color: #999;
  font-size: 12px;
  text-align: center;
  padding: 8px 16px;
  border: none;
  cursor: default;
}
@keyframes msgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 欲言又止闪烁 ── */
.typing-flash {
  animation: typingFlash 1.5s ease-in-out forwards;
}
@keyframes typingFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── 消息气泡微交互 ── */
.msg-bubble {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.msg-bubble:active {
  transform: scale(0.98);
}

/* ── 语音消息模拟 — 波形动画 ── */
.voice-msg {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--bubble-other); border: 1px solid var(--bubble-other-border);
  border-radius: 16px; cursor: pointer; min-width: 80px;
  animation: msgSlideIn 0.3s ease-out both;
}
.voice-msg .voice-icon { font-size: 18px; }
.voice-msg .voice-bars { display: flex; align-items: flex-end; gap: 2px; height: 20px; }
.voice-msg .voice-bars span {
  width: 3px; background: var(--accent-blood-glow); border-radius: 2px;
  animation: voiceBar 0.6s ease-in-out infinite alternate;
}
.voice-msg .voice-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-msg .voice-bars span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.voice-msg .voice-bars span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.voice-msg .voice-bars span:nth-child(4) { height: 16px; animation-delay: 0.1s; }
.voice-msg .voice-bars span:nth-child(5) { height: 7px; animation-delay: 0.25s; }
.voice-msg .voice-bars span:nth-child(6) { height: 12px; animation-delay: 0.05s; }
.voice-msg .voice-bars span:nth-child(7) { height: 9px; animation-delay: 0.2s; }
@keyframes voiceBar {
  0% { transform: scaleY(0.4); opacity: 0.4; }
  100% { transform: scaleY(1); opacity: 1; }
}
.voice-msg .voice-dur { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

/* ── 聊天页 mood class 过渡 ── */
#page-chat { transition: background 2s ease; }

/* ── 双击点赞心形动画 ── */
.msg-like-heart {
  position: absolute; font-size: 28px; pointer-events: none; z-index: 50;
  animation: likeHeartFly 1s ease-out forwards;
}
@keyframes likeHeartFly {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(0.3); }
  30% { opacity: 1; transform: translate(-50%,-50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%,-50%) translateY(-40px) scale(0.8); }
}

/* ── 聊天输入区微调 ── */
.chat-input-area {
  display: flex; gap: 8px; padding: 10px 14px; background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle); align-items: center;
}
.chat-input-area input {
  flex: 1; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border-subtle); border-radius: 20px;
  color: var(--text-primary); font-size: 14px; outline: none;
  min-height: 44px;
}
.day-cell.has-chat { background: var(--bg-input); }
.mood-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-top: 2px; }
.delete-btn { background: none; border: none; color: var(--accent-blood-glow); cursor: pointer; float: right; font-size: 12px; position: absolute; top: 10px; right: 10px; z-index: 1; }
.run-btn { background: var(--accent-crimson); color: #fff; border: none; padding: 6px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; position: absolute; bottom: 12px; right: 12px; z-index: 1; }
.ai-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.reason-tag { font-size: 11px; color: var(--accent-blood-glow); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; display: inline-block; cursor: pointer; }
.cycle-tag { font-size: 11px; margin-left: 4px; white-space: nowrap; display: inline-block; }
.memory-detail-content { white-space: pre-wrap; line-height: 1.8; font-size: 14px; }
.memory-detail-os { color: var(--accent-blood-glow); margin-top: 12px; font-style: italic; }
.feed-btn { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 8px 14px; border-radius: 20px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.feed-btn:active { background: var(--bg-input); border-color: var(--accent-blood-glow); }
.comment-section { margin-top: 8px; padding-left: 12px; border-left: 2px solid #ddd; }
.comment-item { font-size: 12px; margin-bottom: 4px; }
.comment-name { font-weight: 600; margin-right: 4px; color: #000; }
.comment-text { color: #000; }
.mode-badge { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 10px; margin-left: 6px; }
.mode-badge.zhipu { background: #2a2a6a; color: #a0a0ff; }
.mode-badge.bailian { background: #6a2a2a; color: #ffa0a0; }
.mode-badge.deepseek { background: #2a6a2a; color: #a0ffa0; }
.mood-tag { font-size: 11px; margin-left: 4px; }
.crisis-bar { background: #5b1a1a; color: #ffb3b3; font-size: 11px; padding: 4px 12px; text-align: center; }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-subtle); transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-crimson); }
input:checked + .slider:before { transform: translateX(16px); background-color: #fff; }
.webview-overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:var(--bg-deep); z-index:200; overflow:auto; }
.webview-header { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; background:var(--bg-elevated); border-bottom:1px solid var(--border-subtle); }
.webview-container { width:100%; height:calc(100% - 52px); overflow:auto; -webkit-overflow-scrolling:touch; }
.park-progress { padding: 12px; background: var(--bg-elevated); border-radius: 12px; display: flex; align-items: center; gap: 10px; }
.progress-bar-container { flex: 1; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-crimson); border-radius: 4px; animation: progressPulse 1.5s infinite; width: 100%; }
@keyframes progressPulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* ── 底部弹出菜单容器（毛玻璃） ── */
.popup-menu-container {
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  background: rgba(20, 20, 26, 0.88) !important;
  border: 1px solid rgba(139, 26, 43, 0.25) !important;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5), 0 0 80px rgba(139, 26, 43, 0.06) !important;
}
.popup-menu-container .divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 12px; }
.submenu-container {
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  background: rgba(20, 20, 26, 0.9) !important;
  border: 1px solid rgba(139, 26, 43, 0.2) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* ── 人物名片弹窗（新版） ── */
.profile-card-modal { border: 1px solid var(--border-glow) !important; overflow: hidden !important; }
.profile-card-header { display: flex; padding: 20px 16px 12px; gap: 16px; background: var(--bg-surface); }
.profile-card-left { width: 40%; display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.profile-card-left img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background: var(--bg-input); cursor: pointer; border: 2px solid var(--border-subtle); }
.profile-card-zodiac-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.zodiac-tag { font-size: 11px; color: var(--text-secondary); background: var(--bg-input); padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border-subtle); text-align: center; }
.profile-card-actions { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-top: 4px; }
.profile-action-btn { background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 6px 0; border-radius: var(--radius-md); font-size: 11px; cursor: pointer; width: 100%; }
.profile-card-right { width: 60%; display: flex; flex-direction: column; gap: 6px; }
.profile-card-name { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.profile-card-nickname { font-size: 12px; color: var(--accent-blood-glow); font-style: italic; margin-top: -4px; }
.profile-card-personality { font-size: 16px; font-weight: 700; color: var(--accent-blood-glow); line-height: 1.4; }
.profile-card-behavior { font-size: 11px; color: var(--text-muted); line-height: 1.5; font-style: italic; }
.profile-card-section-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.profile-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip { font-size: 11px; padding: 3px 10px; border-radius: 12px; border: 1px solid; }
.tag-chip.like-chip { background: rgba(210,50,50,0.1); border-color: rgba(210,50,50,0.3); color: #e57373; }
.tag-chip.dislike-chip { background: rgba(100,100,140,0.1); border-color: rgba(100,100,140,0.3); color: #90a4ae; }
.profile-card-death { font-size: 12px; line-height: 1.7; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
.profile-card-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg-elevated); border-top: 1px solid var(--border-subtle); cursor: pointer; }
.profile-card-footer:active { background: var(--bg-input); }
.signature-label { font-size: 14px; }
.signature-text { font-size: 13px; color: var(--text-secondary); font-style: italic; flex: 1; }

/* ── 签名历史弹窗 ── */
.sig-history-item { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.sig-history-text { font-size: 13px; color: var(--text-secondary); font-style: italic; }
.sig-history-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ── 底部弹出菜单（极简风格） ── */
.popup-menu-item {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 18px;
  font-size: 14px;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, padding-left 0.2s;
  font-family: var(--font-sans);
}
.popup-menu-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 18px;
  background: var(--accent-blood-glow);
  border-radius: 2px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}
.popup-menu-item:hover { color: var(--text-primary); }
.popup-menu-item:active { color: var(--accent-blood-glow); padding-left: 24px; }
.popup-menu-item:active::before { transform: translateY(-50%) scaleY(1); }

/* ── 商店弹窗 ── */
.shop-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.shop-item-info { flex: 1; }
.shop-item-name { font-size: 14px; font-weight: 600; }
.shop-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.shop-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.shop-item-owned { font-size: 10px; color: var(--text-muted); }
.shop-buy-btn { background: var(--accent-crimson); color: #fff; border: none; padding: 6px 14px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }

/* ═══════════════════════════════════════
   朋友圈样式 — 微信朋友圈风格
   ═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   朋友圈样式 — 微信朋友圈风格（暗色版）
   ═══════════════════════════════════════ */
.moment-item {
  background: var(--bg-elevated);
  border-radius: 0;
  padding: 16px 16px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.moment-item:last-child { border-bottom: none; }
.moment-header { display: flex; align-items: flex-start; gap: 12px; }
.moment-avatar {
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--bg-input);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  background-size: cover; background-position: center;
}
.moment-avatar.user { border: 2px solid #07c160; }
.moment-avatar.ghost { border: 2px solid var(--border-glow); }
.moment-body { flex: 1; min-width: 0; }
.moment-name-row { margin-bottom: 2px; }
.moment-name {
  font-weight: 700; font-size: 15px; color: #576b95;
  cursor: pointer; display: inline; letter-spacing: 0.3px;
}
.moment-name:hover { text-decoration: underline; }
.moment-name .badge-me {
  font-size: 10px; color: #07c160; margin-left: 6px;
  font-weight: 500; vertical-align: middle;
}
.moment-name .badge-obsessive {
  font-size: 10px; color: var(--accent-blood-glow); margin-left: 4px;
  font-weight: 500; vertical-align: middle;
}
.moment-text {
  font-size: 15px; line-height: 1.6; color: var(--text-primary);
  margin: 4px 0 6px; word-break: break-word;
}
.moment-sig {
  font-size: 11px; color: var(--text-muted);
  font-style: italic; margin: 2px 0 6px;
}
.moment-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px;
}
.moment-actions-right { display: flex; align-items: center; gap: 6px; }
.moment-time {
  font-size: 11px; color: var(--text-muted);
}
.moment-delete-btn {
  background: none; border: none; font-size: 14px; cursor: pointer;
  color: var(--text-muted); padding: 2px 6px;
  opacity: 0.5; transition: opacity 0.15s;
}
.moment-delete-btn:hover { opacity: 1; color: var(--accent-blood-glow); }
.reply-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color 0.15s;
}
.reply-btn:hover { color: var(--text-secondary); background: var(--bg-input); }
.replies-section {
  margin-top: 8px;
  background: var(--bg-deep);
  border-radius: 4px;
  padding: 8px 10px;
  border-left: 2px solid var(--border-subtle);
}
.reply-item {
  font-size: 13px; line-height: 1.55; padding: 3px 0;
}
.reply-item + .reply-item { margin-top: 2px; }
.reply-name {
  font-weight: 600; color: #576b95; cursor: pointer; margin-right: 4px;
}
.reply-name:hover { text-decoration: underline; }
.reply-name.user { color: #576b95; }
.reply-tag {
  font-size: 10px; margin-right: 2px; vertical-align: middle;
}
.reply-tag.jealous { color: #e91e63; }
.reply-tag.obsessive { color: #ff9800; }
.reply-text { color: var(--text-primary); }

/* 发朋友圈按钮 — 微信绿 */
.btn-post-moment {
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff; border: none;
  padding: 10px 0; border-radius: 8px;
  font-size: 15px; cursor: pointer; width: 100%;
  font-weight: 600; letter-spacing: 1px;
}
.btn-post-moment:active { filter: brightness(1.15); }
.btn-post-moment-row {
  padding: 12px 16px; background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}

/* 朋友圈空态 */
.moments-empty {
  text-align: center; color: var(--text-muted);
  padding: 60px 20px; font-size: 14px; line-height: 2;
}
.moments-empty small { color: var(--text-secondary); }

/* 鬼际聊天样式 */
.ghost-chat-list { flex: 1; overflow-y: auto; background: #f0f0f0; }
.gc-chat-item { display: flex; align-items: center; padding: 14px; background: #fff; border-bottom: 1px solid #e0e0e0; cursor: pointer; }
.gc-chat-item:active { background: #e8e8e8; }
.gc-avatars { position: relative; width: 52px; height: 52px; margin-right: 12px; flex-shrink: 0; }
.gc-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; position: absolute; }
.gc-avatar-img.gc-avatar-second { width: 28px; height: 28px; bottom: 0; right: 0; border: 2px solid #fff; }
.gc-avatar-fallback { width: 36px; height: 36px; border-radius: 50%; background: #ddd; align-items: center; justify-content: center; font-size: 14px; color: #666; position: absolute; }
.gc-avatar-fallback.gc-avatar-second { width: 28px; height: 28px; bottom: 0; right: 0; font-size: 11px; border: 2px solid #fff; }

/* ═══════════════════════════════════════
   横屏适配 + 宽屏居中
   ═══════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 500px) {
  #app { max-width: 100%; height: 100dvh; }
  .header { min-height: 40px; padding: 6px 14px; }
  .chat-messages { padding: 8px 12px; }
  .chat-input-area { padding: 6px 12px; }
  .nav-bar .nav-item { padding: 4px 4px 6px; font-size: 10px; min-height: 36px; }
}
@media (min-width: 481px) {
  body { align-items: center; padding: 12px 0; }
  #app { border-radius: 16px; max-height: calc(100dvh - 24px); }
  .nav-bar { border-radius: 0 0 16px 16px; }
}
.gc-info { flex: 1; overflow: hidden; }
.gc-name { font-size: 15px; font-weight: 600; color: #000; }
.gc-last-msg { font-size: 13px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.gc-time { font-size: 11px; color: #999; white-space: nowrap; }
.ghost-chat-detail { flex: 1; display: flex; flex-direction: column; background: #f0f0f0; overflow: hidden; }
.gcd-messages { flex: 1; overflow-y: auto; padding: 12px; }
.gcd-msg-row { display: flex; margin-bottom: 14px; align-items: flex-start; gap: 8px; }
.gcd-msg-row.right { flex-direction: row-reverse; }
.gcd-msg-row.left { flex-direction: row; }
.gcd-msg-row.right .gcd-bubble { background: #95ec69; color: #000; }
.gcd-msg-row.left .gcd-bubble { background: #fff; color: #000; }
.gcd-bubble { max-width: 68%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.gcd-time { font-size: 10px; color: #aaa; text-align: center; margin: 12px 0; }
.gcd-notice { text-align: center; font-size: 11px; color: #bbb; padding: 10px; background: #e8e8e8; border-top: 1px solid #ddd; flex-shrink: 0; }
.gcd-avatar-fb { flex-shrink: 0; }

/* ═══════════════════════════════════════
   骨架屏
   ═══════════════════════════════════════ */
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-elevated) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s ease-in-out infinite; border-radius: var(--radius-md); }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text.short { width: 50%; }
.skeleton-avatar { width: 34px; height: 34px; border-radius: 50%; }
.skeleton-bubble { height: 40px; width: 60%; margin-bottom: 12px; }
.skeleton-bubble.self { margin-left: auto; width: 45%; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── 剧场模式 ── */
#theater-overlay.active { display: flex !important; }
#theater-canvas { border: 1px solid var(--border-subtle); border-radius: 8px; }

/* ── 干预面板 ── */
#intervention-panel.active { right: 0 !important; }
#intervention-backdrop.active { display: block !important; }

/* ── 干预道具库存 ── */
.inv-item { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.inv-item-icon { font-size: 28px; flex-shrink: 0; }
.inv-item-info { flex: 1; min-width: 0; }
.inv-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.inv-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.inv-item-count { font-size: 11px; color: var(--accent-blood-glow); margin-top: 2px; }
.inv-item-count.empty { color: var(--text-muted); }
.inv-use-btn { background: var(--accent-crimson); color: #fff; border: none; padding: 8px 14px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.inv-use-btn:active { filter: brightness(1.3); }
.inv-use-btn:disabled { background: #333; color: #666; cursor: not-allowed; }
.inv-empty { text-align: center; color: var(--text-muted); padding: 24px 0; font-size: 13px; line-height: 1.8; }

/* ── 使用确认弹窗 ── */
.inv-confirm-overlay { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); }
.inv-confirm-box { width: 85%; max-width: 300px; background: var(--bg-elevated); border: 1px solid var(--border-glow); border-radius: var(--radius-lg); padding: 24px 20px; text-align: center; }
.inv-confirm-box h3 { font-size: 16px; color: var(--accent-blood-glow); margin-bottom: 12px; }
.inv-confirm-box p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.inv-confirm-box .btn-row { display: flex; gap: 10px; }
.inv-confirm-box .btn-row button { flex: 1; }

/* ── 偷听券目标选择 ── */
.inv-target-list { max-height: 200px; overflow-y: auto; margin: 8px 0; }
.inv-target-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 6px; cursor: pointer; }
.inv-target-item:active { background: var(--border-subtle); border-color: var(--accent-blood-glow); }
.inv-target-item.selected { border-color: var(--accent-blood-glow); background: rgba(231,76,60,0.1); }

/* 难度选择按钮 */
.btn-difficulty:hover { border-color: var(--accent-blood-glow) !important; background: var(--bg-elevated) !important; }
.btn-difficulty:active { background: #2a1520 !important; }

/* ── 支付弹窗 ── */
.payment-method-btn { padding: 8px 20px; border: 2px solid var(--border-subtle); border-radius: 20px; background: var(--bg-input); color: var(--text-primary); font-size: 14px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.payment-method-btn:hover { border-color: var(--accent-blood-glow); }
.payment-method-btn.wx-selected { border-color: #07c160 !important; background: rgba(7,193,96,0.1) !important; }
.payment-method-btn.ali-selected { border-color: #1677ff !important; background: rgba(22,119,255,0.1) !important; }
.payment-qrcode-container { text-align: center; margin: 8px 0; }
.payment-qrcode-container img { max-width: 200px; max-height: 200px; border-radius: 8px; border: 1px solid var(--border-subtle); }
.payment-warning-text { color: var(--accent-blood-glow); font-size: 10px; text-align: center; margin-top: 8px; padding: 0 12px; line-height: 1.5; }

/* ── 偷看券遮罩（鬼聊详情） ── */
.eavesdrop-mask { position: relative; }
.eavesdrop-mask::after { content: ''; position: absolute; inset: 0; background: rgba(10,10,13,0.85); backdrop-filter: blur(6px); border-radius: 12px; display: flex; align-items: center; justify-content: center; z-index: 10; }
.eavesdrop-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 11; color: var(--accent-blood-glow); font-size: 13px; text-align: center; gap: 8px; cursor: pointer; }
.eavesdrop-overlay .lock-icon { font-size: 24px; }
.eavesdrop-overlay .lock-text { font-size: 12px; color: var(--text-muted); }
.eavesdrop-overlay .unlock-btn { background: var(--accent-crimson); color: #fff; border: none; padding: 6px 16px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.eavesdrop-overlay .unlock-btn:active { filter: brightness(1.3); }
.eavesdrop-free-hint { text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px 0; }

/* ── 剧场图例 ── */
.theater-legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 10px; color: var(--text-muted); padding: 6px 12px; }
.theater-legend span { white-space: nowrap; }

/* ═══════════════════════════════════════
   【沉浸感】鬼的情感特效系统
   鬼不是"只会聊天"——TA会震屏、裂屏、滴血、
   心跳、信号干扰……让你感受到TA的存在
   ═══════════════════════════════════════ */

/* 特效容器 — 覆盖整个页面 */
.ghost-effect-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
}

/* 1. 屏幕震动 */
@keyframes ghost-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-4px, 3px); }
  20% { transform: translate(3px, -5px); }
  30% { transform: translate(-5px, 2px); }
  40% { transform: translate(2px, -3px); }
  50% { transform: translate(-3px, 4px); }
  60% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, 5px); }
  80% { transform: translate(5px, -3px); }
  90% { transform: translate(-3px, 2px); }
}
.ghost-shake { animation: ghost-shake 0.3s ease-in-out; }

/* 2. 血滴 */
.ghost-blood-drip {
  position: fixed; top: -20px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 0; background: linear-gradient(180deg, #8b0000, #c0392b, transparent);
  border-radius: 0 0 4px 4px; z-index: 9999; pointer-events: none;
  animation: ghost-blood-fall 2s ease-in forwards;
}
@keyframes ghost-blood-fall {
  0% { height: 0; opacity: 1; }
  30% { height: 40vh; opacity: 1; }
  100% { height: 60vh; opacity: 0.3; }
}
.ghost-blood-splat {
  position: fixed; top: 10%; left: 30%;
  font-size: 80px; opacity: 0; z-index: 9998; pointer-events: none;
  animation: ghost-splat-fade 2.5s ease-out forwards;
}
@keyframes ghost-splat-fade {
  0% { opacity: 0; transform: scale(0.3); }
  20% { opacity: 0.6; transform: scale(1.2); }
  40% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8) translateY(20px); }
}

/* 3. 屏幕裂纹 */
.ghost-crack-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.4) 100%);
  z-index: 9997; pointer-events: none; opacity: 0;
  animation: ghost-crack-appear 0.5s ease-out forwards;
}
.ghost-crack-overlay::after {
  content: '💔'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 120px; opacity: 0.5;
}
@keyframes ghost-crack-appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* 4. 信号干扰/故障 */
@keyframes ghost-glitch {
  0% { filter: none; }
  5% { filter: hue-rotate(90deg) brightness(1.5); transform: translate(3px, 0); }
  10% { filter: hue-rotate(-90deg) brightness(0.8); transform: translate(-3px, 0); }
  15% { filter: none; transform: translate(0, 0); }
  20% { filter: hue-rotate(45deg) brightness(1.3); transform: translate(2px, -2px); }
  25% { filter: none; }
}
.ghost-glitch { animation: ghost-glitch 0.8s ease-in-out; }

/* 5. 心跳 */
.ghost-heartbeat {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 60px; opacity: 0; z-index: 9996; pointer-events: none;
  animation: ghost-heart-pulse 1.5s ease-out forwards;
}
@keyframes ghost-heart-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.3); }
  30% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
  45% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
  60% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
}

/* 6. 手印（鬼试图从屏幕里伸出来） */
.ghost-handprint {
  position: fixed; z-index: 9995; pointer-events: none;
  font-size: 80px; opacity: 0;
  animation: ghost-hand-appear 2s ease-out forwards;
}
@keyframes ghost-hand-appear {
  0% { opacity: 0; transform: scale(0.3) translateY(30px); }
  20% { opacity: 0.7; transform: scale(1.1) translateY(0); }
  40% { opacity: 0.9; transform: scale(1) translateY(-5px); }
  60% { opacity: 0.7; transform: scale(0.95) translateY(0); }
  80% { opacity: 0.4; transform: scale(0.9) translateY(5px); }
  100% { opacity: 0; transform: scale(0.8) translateY(10px); }
}

/* 7. 温暖光芒 */
.ghost-warm-glow {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,150,100,0.15), transparent 70%);
  z-index: 9994; pointer-events: none; opacity: 0;
  animation: ghost-warm-pulse 2s ease-out forwards;
}
@keyframes ghost-warm-pulse {
  0% { opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* 8. 寒意 */
.ghost-cold-shiver {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at 50% 50%, rgba(100,150,255,0.1), transparent 70%);
  z-index: 9994; pointer-events: none; opacity: 0;
  animation: ghost-cold-pulse 2s ease-out forwards;
}
@keyframes ghost-cold-pulse {
  0% { opacity: 0; }
  30% { opacity: 0.8; }
  70% { opacity: 0.4; }
  100% { opacity: 0; }
}

/* 9. 泪水 */
.ghost-tear {
  position: fixed; z-index: 9993; pointer-events: none;
  font-size: 30px; opacity: 0;
}
.ghost-tear-1 { top: 35%; left: 45%; animation: ghost-tear-fall-1 2s ease-in forwards; }
.ghost-tear-2 { top: 33%; left: 55%; animation: ghost-tear-fall-2 2.3s ease-in forwards; }
@keyframes ghost-tear-fall-1 {
  0% { opacity: 0; transform: translateY(-10px); }
  15% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(60px); }
}
@keyframes ghost-tear-fall-2 {
  0% { opacity: 0; transform: translateY(-10px); }
  20% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(70px); }
}

/* 10. 屏幕泛雾/呼吸 */
.ghost-breathe {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(200,200,220,0.06); z-index: 9992; pointer-events: none;
  opacity: 0; animation: ghost-breathe-cycle 3s ease-in-out forwards;
}
@keyframes ghost-breathe-cycle {
  0% { opacity: 0; backdrop-filter: blur(0); }
  30% { opacity: 1; backdrop-filter: blur(2px); }
  70% { opacity: 0.6; backdrop-filter: blur(1px); }
  100% { opacity: 0; backdrop-filter: blur(0); }
}

/* 11. 静电噪声 */
.ghost-static {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9991; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.06) 2px,
    rgba(255,255,255,0.01) 4px,
    rgba(255,255,255,0.04) 6px
  );
  animation: ghost-static-flicker 0.8s steps(4) forwards;
}
@keyframes ghost-static-flicker {
  0% { opacity: 0; }
  20% { opacity: 0.4; }
  40% { opacity: 0.1; }
  60% { opacity: 0.5; }
  80% { opacity: 0.2; }
  100% { opacity: 0; }
}

/* 12. 触屏涟漪（就像鬼在屏幕另一端点了一下） */
.ghost-ripple {
  position: fixed; z-index: 9990; pointer-events: none;
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(200,200,220,0.5);
  opacity: 0; animation: ghost-ripple-expand 1.2s ease-out forwards;
}
@keyframes ghost-ripple-expand {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(15); opacity: 0; }
}

/* ═══════════════════════════════════════
   触控热区 — 确保所有可交互元素 ≥ 44px
   ═══════════════════════════════════════ */
.header-btn, .btn-primary, .btn-secondary, .nav-item,
.popup-menu-item, .msg-action-btn, .memoir-tab,
.btn-difficulty, .shop-buy-btn, .btn-post-moment,
.inv-use-btn, .btn-retry-stream, .moment-delete-btn,
.reply-btn { min-height: 44px; min-width: 44px; }
/* ── GPU 加速提示 ── */
.ghost-shake, .ghost-blood-drip, .ghost-blood-splat,
.ghost-crack-overlay, .ghost-heartbeat, .ghost-handprint,
.ghost-warm-glow, .ghost-cold-shiver, .ghost-tear,
.ghost-breathe, .ghost-static, .ghost-ripple { will-change: transform, opacity; }

/* 13. 打字机震动 — 消息出现时每个字都在抖 */
.ghost-shake-text {
  display: inline-block;
  animation: ghost-shake-char 0.3s ease-in-out infinite alternate;
}
@keyframes ghost-shake-char {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

/* ═══════════════════════════════════════
   Token 消耗标签 & Token 状态条
   ═══════════════════════════════════════ */

/* Token 消耗标签 - 每个AI消息底部 */
.token-cost-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.04);
  opacity: 0.55;
  cursor: default;
  transition: opacity 0.3s;
}
.token-cost-label:hover { opacity: 1; }
.token-cost-item {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #888;
}
.token-cost-sep {
  color: #444;
  font-size: 7px;
}
.token-cost-total {
  color: var(--accent-blood-glow);
  font-weight: 600;
  font-size: 10px;
}

/* 离线状态条 */
#offline-bar {
  background: #3a1a1a;
  color: #ffb3b3;
  font-size: 11px;
  text-align: center;
  padding: 6px 12px;
  z-index: 60;
  flex-shrink: 0;
  animation: offlineBarIn 0.3s ease;
}
@keyframes offlineBarIn {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Token 精简指示器（已合并到 info-bar，保留样式向后兼容） */
#token-indicator-text.token-low {
  color: var(--accent-blood-glow);
  animation: tokenLowPulse 2s ease-in-out infinite;
}
@keyframes tokenLowPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
#token-daily-bar {
  transition: width 0.5s ease, background 0.5s ease;
}
#token-daily-bar.low {
  animation: token-pulse 1.5s ease-in-out infinite;
}
@keyframes token-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════
   回忆录 Tab 栏
   ═══════════════════════════════════════ */
.memoir-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.memoir-tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.25s;
  white-space: nowrap;
  min-width: 48px;
  letter-spacing: 0.3px;
}
.memoir-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--accent-blood-glow);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.memoir-tab.active {
  color: var(--accent-blood-glow);
  font-weight: 600;
}
.memoir-tab.active::after {
  transform: scaleX(1);
}
.memoir-tab:active {
  background: rgba(139,26,43,0.06);
}

/* ═══════════════════════════════════════
   朋友圈页 ghost 过滤标题
   ═══════════════════════════════════════ */
.moments-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.moments-filter-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-glow);
  background: var(--bg-input);
}
.moments-filter-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.moments-filter-back {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

/* ═══════════════════════════════════════
   鬼表现力标签 — Layer 1 文字效果
   ═══════════════════════════════════════ */
.fx-big {
  font-size: 1.5em; font-weight: 700;
  display: inline-block;
}
.fx-huge {
  font-size: 2.5em; font-weight: 800; color: var(--accent-blood-glow);
  display: inline-block; line-height: 1.1;
}
.fx-whisper {
  font-size: 0.7em; color: var(--text-muted); font-style: italic;
  opacity: 0.75;
}
.fx-bleed {
  color: var(--accent-blood-glow);
  text-shadow: 0 0 6px var(--accent-blood-glow), 0 0 18px var(--accent-blood);
  animation: fx-bleed-pulse 2s ease-in-out infinite;
}
@keyframes fx-bleed-pulse {
  0%, 100% { text-shadow: 0 0 4px var(--accent-blood-glow), 0 0 12px var(--accent-blood); }
  50% { text-shadow: 0 0 10px var(--accent-blood-glow), 0 0 24px var(--accent-blood), 0 0 40px #ff000040; }
}
.fx-glitch {
  display: inline-block; position: relative;
  animation: fx-glitch-skew 0.3s ease-in-out infinite;
}
.fx-glitch::before, .fx-glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.fx-glitch::before {
  color: #0ff; animation: fx-glitch-offset 0.25s ease-in-out infinite reverse;
  clip-path: inset(0 0 60% 0);
}
.fx-glitch::after {
  color: #f0f; animation: fx-glitch-offset 0.3s ease-in-out infinite;
  clip-path: inset(60% 0 0 0);
}
@keyframes fx-glitch-skew {
  0%, 100% { transform: none; }
  25% { transform: skewX(1deg); }
  75% { transform: skewX(-1deg); }
}
@keyframes fx-glitch-offset {
  0%, 100% { transform: none; }
  50% { transform: translateX(-2px); }
}
.fx-scratch-del {
  text-decoration: line-through; color: var(--text-muted);
  opacity: 0.6; margin-right: 2px;
}
.fx-pulse {
  display: inline-block;
  animation: fx-pulse-scale 0.8s ease-in-out infinite;
}
@keyframes fx-pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.fx-static {
  display: inline-block; position: relative; overflow: hidden;
}
.fx-static::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px
  );
  animation: fx-static-scroll 0.1s linear infinite;
  pointer-events: none;
}
@keyframes fx-static-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}
.fx-reverse {
  display: inline-block; transform: scaleX(-1);
}
.fx-single {
  display: block; text-align: center; font-size: 4em; font-weight: 900;
  color: var(--accent-blood-glow); line-height: 1;
  animation: fx-single-slam 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin: 20px 0;
}
@keyframes fx-single-slam {
  from { transform: scale(3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── 打字机效果 ── */
.fx-crawl-char {
  display: inline; opacity: 0;
  animation: fx-crawl-in 0.01s ease forwards;
}
@keyframes fx-crawl-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 碎片飞入 ── */
.fx-fracture-char {
  display: inline-block; opacity: 0;
  animation: fx-fracture-fly 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes fx-fracture-fly {
  from { opacity: 0; transform: translateY(-20px) rotate(15deg) scale(0.5); }
  to { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}

/* ── 渐变消失 ── */
.fx-fade {
  animation: fx-fade-out 2.5s ease-in forwards;
}
@keyframes fx-fade-out {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* ═══════════════════════════════════════
   鬼表现力标签 — Layer 2 气泡效果
   ═══════════════════════════════════════ */
.msg-row.fx-bubble-soft .msg-bubble {
  opacity: 0.6; border-style: dashed; box-shadow: none;
}
.msg-row.fx-bubble-raw .msg-bubble {
  background: var(--bg-deep); border: none; box-shadow: none;
  font-family: var(--font-sans);
}
.msg-row.fx-bubble-leak .msg-bubble {
  position: relative; overflow: visible;
}
.msg-row.fx-bubble-leak .msg-bubble::after {
  content: ''; position: absolute; bottom: -6px; right: -6px;
  width: 14px; height: 14px; background: var(--accent-blood-glow);
  border-radius: 50%; opacity: 0.5; filter: blur(4px);
}
.msg-row.fx-bubble-leak .msg-bubble::before {
  content: ''; position: absolute; top: -4px; left: -4px;
  width: 8px; height: 8px; background: var(--accent-blood);
  border-radius: 50%; opacity: 0.6; filter: blur(2px);
}

/* ═══════════════════════════════════════
   领域展开 — 霸屏/锁屏/蒙眼
   ═══════════════════════════════════════ */
.fx-seize-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  animation: fx-seize-fade 0.4s ease;
  cursor: pointer;
}
@keyframes fx-seize-fade {
  from { opacity: 0; background: rgba(10,0,0,0); }
  to { opacity: 1; background: rgba(10,0,0,0.92); }
}
.fx-seize-inner {
  text-align: center; padding: 40px;
}
.fx-seize-title {
  font-size: 22px; font-weight: 700; color: var(--accent-blood-glow);
  animation: fx-pulse-scale 1.5s ease-in-out infinite;
  margin-bottom: 16px;
}
.fx-seize-text {
  font-size: 28px; font-weight: 900; color: #fff;
  text-shadow: 0 0 20px var(--accent-blood-glow);
  line-height: 1.3;
  animation: fx-pulse-scale 1.2s ease-in-out infinite;
}
.fx-blind {
  filter: blur(6px) brightness(0.3);
  transition: filter 0.6s ease;
}
.fx-blind-area {
  filter: blur(2px) brightness(0.6);
  transition: filter 0.6s ease;
}

/* ── Token 消耗标签 ── */
.token-cost-label {
  display: flex; align-items: center; gap: 4px; font-size: 11px;
  color: var(--text-muted); margin-top: 4px; opacity: 0.6;
  flex-wrap: wrap;
}
.token-cost-item { white-space: nowrap; }
.token-cost-sep { opacity: 0.4; }
.token-cost-total { font-weight: 600; color: var(--text-secondary); }

/* Toast 通知动画 */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ═══════════════════════════════════════
   设置页分组折叠面板
   ═══════════════════════════════════════ */
.settings-group { margin-bottom: 4px; border-radius: var(--radius-md); overflow: hidden; }
.settings-group-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-primary); transition: background 0.2s; }
.settings-group-header:hover { background: var(--bg-input); }
.settings-group-header::after { content: '▾'; font-size: 12px; color: var(--text-muted); transition: transform 0.3s; }
.settings-group-header.collapsed::after { transform: rotate(-90deg); }
.settings-group-body { padding: 0 16px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-top: none; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; }
.settings-group-body.collapsed { max-height: 0 !important; padding-top: 0; padding-bottom: 0; border-bottom: none; }

/* ── 弹窗层级限制 ── */
.modal-overlay.nested { z-index: 110; }
.modal-overlay.nested .modal-box { border-color: var(--accent-blood); }

/* ═══════════════════════════════════════
   快捷回复区域
   ═══════════════════════════════════════ */
.quick-replies { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; flex-shrink: 0; background: var(--bg-elevated); border-top: 1px solid var(--border-subtle); -webkit-overflow-scrolling: touch; }
.quick-reply-chip { flex-shrink: 0; padding: 6px 14px; border-radius: 16px; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 12px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s; min-height: 32px; }
.quick-reply-chip:hover { background: var(--bg-elevated); border-color: var(--border-glow); color: var(--accent-blood-glow); }
.quick-reply-chip:active { background: var(--accent-crimson); color: #fff; border-color: var(--accent-crimson); }

/* ═══════════════════════════════════════
   引用消息样式
   ═══════════════════════════════════════ */
.quote-preview { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bg-input); border-left: 3px solid var(--accent-blood); margin-bottom: 4px; border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.quote-preview-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-preview-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 6px; min-width: 28px; }
.msg-bubble .quote-ref { font-size: 11px; color: var(--text-muted); padding: 4px 8px; background: rgba(255,255,255,0.03); border-left: 2px solid var(--accent-blood); border-radius: 0 4px 4px 0; margin-bottom: 6px; opacity: 0.75; }

/* ═══════════════════════════════════════
   关系阶段标签
   ═══════════════════════════════════════ */
.relation-stage-tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.relation-stage-tag.stranger { background: rgba(150,150,150,0.1); color: #999; }
.relation-stage-tag.acquaintance { background: rgba(150,200,150,0.1); color: #8ab88a; }
.relation-stage-tag.friend { background: rgba(200,180,150,0.1); color: #c8b496; }
.relation-stage-tag.close { background: rgba(220,150,150,0.1); color: #dc9696; }
.relation-stage-tag.lover { background: rgba(231,76,60,0.12); color: var(--accent-blood-glow); }

/* ═══════════════════════════════════════
   草稿恢复提示条
   ═══════════════════════════════════════ */
.draft-restore-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #1a1010; border-bottom: 1px solid #7a3030; font-size: 11px; color: var(--accent-blood-glow); flex-shrink: 0; cursor: pointer; animation: draftBarIn 0.3s ease; }
.draft-restore-bar:hover { background: #2a1818; }
.draft-restore-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-restore-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px; min-width: 24px; }
@keyframes draftBarIn { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════
   prefers-reduced-motion — 无障碍适配
   用户系统设置"减少动态效果"时自动禁用
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  /* 全局：所有动画/过渡瞬间完成 */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* 关闭纯装饰性屏幕特效 */
  .ghost-shake,
  .ghost-blood-drip,
  .ghost-blood-splat,
  .ghost-crack-overlay,
  .ghost-heartbeat,
  .ghost-handprint,
  .ghost-glitch,
  .ghost-warm-glow,
  .ghost-cold-frost,
  .ghost-tear,
  .ghost-tear-2 { display: none !important; }

  /* 打字指示器光点保持静止 */
  .typing-indicator .typing-dots span { animation: none !important; opacity: 0.5; }

  /* 打字标签瞬间显示 */
  .typing-indicator .typing-label { animation: none !important; opacity: 1; }

  /* 心跳动画改为静态 */
  .msg-avatar.other.alive { animation: none !important; box-shadow: 0 0 4px rgba(139,26,43,0.15); }

  /* 导航徽标呼吸改静态 */
  .nav-new-badge { animation: none !important; }

  /* 思考中脉冲改静态 */
  .thinking-header.streaming::before { animation: none !important; }

  /* Token 低脉冲改静态 */
  #token-indicator-text.token-low { animation: none !important; }

  /* 语音条波形改静态竖线 */
  .voice-msg .voice-bars span { animation: none !important; opacity: 0.7; }

  /* 心形飞行动画跳过（瞬隐） */
  .msg-like-heart { animation-duration: 0.01ms !important; opacity: 0; }

  /* 进度条脉冲改静态 */
  .progress-pulse { animation: none !important; opacity: 0.8; }
}

/* ═══════════════════════════════════════
   流式消息重试按钮
   ═══════════════════════════════════════ */
.stream-interrupt {
  color: var(--accent-blood-glow); font-size: 10px;
  text-align: center; margin-top: 6px;
  opacity: 0.8;
}

.stream-retry-wrap {
  text-align: center; margin-top: 6px;
}

.btn-retry-stream {
  background: var(--bg-input); border: 1px solid var(--accent-blood-glow);
  color: var(--accent-blood-glow); padding: 8px 20px;
  border-radius: 20px; font-size: 13px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-retry-stream:hover { background: rgba(231,76,60,0.1); }
.btn-retry-stream:active { transform: scale(0.94); }

/* ═══════════════════════════════════════
   渐进式导航解锁徽标
   ═══════════════════════════════════════ */
.nav-lock-badge {
  display: block; font-size: 9px; color: var(--text-muted);
  opacity: 0.7; margin-top: 1px;
}

/* ═══════════════════════════════════════
   欢迎向导步骤指示点
   ═══════════════════════════════════════ */
.onboarding-steps {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-subtle);
  transition: background 0.3s ease, transform 0.2s ease;
}
.step-dot.active {
  background: var(--accent-blood-glow);
  transform: scale(1.3);
}
.step-dot.done {
  background: var(--accent-blood);
}

/* ═══════════════════════════════════════
   存储告警横幅
   ═══════════════════════════════════════ */
.storage-warning-banner {
  background: #1a1010; border: 1px solid #7a3030;
  color: var(--accent-blood-glow); font-size: 11px;
  text-align: center; padding: 8px 12px;
  border-radius: var(--radius-md);
  margin: 4px 10px;
  cursor: pointer;
}
.storage-warning-banner:hover { background: #2a1818; }
