:root {
  --bg: #f5f5f7;
  --card: #fff;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --border: #d2d2d7;
  --accent: #0a84ff;
  --bubble-me: #95ec69;
  --bubble-them: #fff;
  --code-bg: #1d1d1f;
  --code-ink: #f5f5f7;
}
/* v4.8.35: 删除 prefers-color-scheme dark — 插件只跟主题（data-theme），不再跟系统色彩偏好 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
/* 三栏：左对话目录 + 中聊天主区 + 右 4 Tab 抽屉 */
.chat-app { display: flex; flex-direction: row; height: 100vh; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.chat-rightpanel {
  width: 260px; flex: 0 0 260px;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; min-width: 0;
}

/* v4.6.9: 右栏拆 3:1 — 上 Tab 区，下状态日志固定区 */
.rp-top {
  flex: 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rp-bottom {
  flex: 1;
  min-height: 120px;
  max-height: 38vh;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.rp-log-header {
  display: flex;
  align-items: center;
  padding: 7px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.rp-log-header > span:first-child { flex: 1; }
.rp-log-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.rp-log-clear:hover { border-color: #ff3b30; color: #ff3b30; }
.rp-log-box {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px;
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.55;
}
.rp-log-empty {
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
  padding: 14px 0;
  font-family: inherit;
}
.rp-log-line {
  display: flex; gap: 6px;
  padding: 2px 0;
  word-break: break-word;
}
.rp-log-line .t {
  color: var(--accent);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.rp-log-line .warn { color: #ff9f0a; }
.rp-log-line .err  { color: #ff3b30; }
.rp-log-line .ok   { color: #34c759; }

/* 左侧对话目录 */
.chat-sidebar {
  width: 220px; flex: 0 0 220px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: flex-basis 0.18s ease, width 0.18s ease;
  overflow: hidden;
  position: relative;
}
.chat-sidebar.collapsed .sidebar-search-bar,
.chat-sidebar.collapsed .sidebar-grabber { display: none; }
.sidebar-grabber {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 4px; cursor: col-resize;
  background: transparent;
  transition: background 0.12s;
  z-index: 5;
}
.sidebar-grabber:hover, .sidebar-grabber:active { background: var(--accent); }
.chat-sidebar.collapsed { flex: 0 0 30px; width: 30px; }
.chat-sidebar.collapsed .sidebar-title,
.chat-sidebar.collapsed .sidebar-count,
.chat-sidebar.collapsed .sidebar-list { display: none; }
.sidebar-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.sidebar-title { font-weight: 600; font-size: 12px; color: var(--ink); flex: 1; letter-spacing: 0; }
.sidebar-count {
  font-size: 10.5px; color: var(--ink-soft);
  background: var(--bg); padding: 1px 7px; border-radius: 999px;
  font-family: "SF Mono", monospace;
}
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 14px;
  padding: 2px 4px; border-radius: 4px;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--ink); }
/* 搜索栏 */
.sidebar-search-bar {
  display: flex; gap: 5px; align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.sidebar-search {
  flex: 1; min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.sidebar-search:focus { border-color: var(--accent); }
.sidebar-search::placeholder { color: var(--ink-soft); }
.sidebar-mode-toggle {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 7px;
  font-size: 13px;
  transition: all 0.12s;
}
.sidebar-mode-toggle:hover { background: var(--border); }
.sidebar-mode-toggle[data-mode="global"] {
  background: var(--accent); border-color: var(--accent);
}

/* 列表 */
.sidebar-list {
  flex: 1; overflow-y: auto;
  padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
/* v4.3.5: 对话目录精致化 */
.sidebar-group-label {
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  padding: 14px 4px 6px;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
}
.sidebar-group-label::after {
  content: ""; position: absolute;
  left: 4px; right: 4px; bottom: 3px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.sidebar-group-label:first-child { padding-top: 4px; }
.sidebar-empty {
  text-align: center; color: var(--ink-soft); font-size: 11px;
  padding: 24px 12px; line-height: 1.6;
}
.sidebar-item {
  padding: 9px 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.sidebar-item::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s;
}
.sidebar-item:hover {
  background: rgba(10,132,255,0.04);
  transform: translateX(1px);
}
.sidebar-item:hover::before { background: var(--accent); opacity: 0.5; }
.sidebar-item.active {
  background: rgba(10,132,255,0.1);
}
.sidebar-item.active::before { background: var(--accent); opacity: 1; }
.sidebar-item-head {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 4px;
}
.sidebar-item-num {
  font-size: 11px; color: var(--accent); font-weight: 700;
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: -0.02em;
}
.sidebar-item-time {
  font-size: 10px; color: var(--ink-soft);
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 0.02em;
}
.sidebar-item mark {
  background: rgba(255,212,0,0.5); color: inherit;
  padding: 0 1px; border-radius: 2px;
}
.sidebar-toast {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--accent); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  pointer-events: none;
  animation: toast-fade 1.2s ease forwards;
}
@keyframes toast-fade {
  0% { opacity: 0; transform: translateY(-50%) translateX(6px); }
  15% { opacity: 1; transform: translateY(-50%) translateX(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}
.sidebar-item-text {
  font-size: 12px; color: var(--ink);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* 跳转高亮动画 */
.msg-highlight .msg-bubble {
  animation: msg-highlight-flash 1.5s ease-out;
}
@keyframes msg-highlight-flash {
  0%   { box-shadow: 0 0 0 0 rgba(10,132,255, 0.7); }
  30%  { box-shadow: 0 0 0 6px rgba(10,132,255, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(10,132,255, 0); }
}
.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
/* v4.3.5: 顶部 header 升级 */
.chat-title {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: nowrap;
}
.chat-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.chat-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--ink) 30%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.chat-subtitle {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}
.chat-version {
  color: var(--ink-soft);
  font-size: 10px;
  font-family: "SF Mono", "Consolas", monospace;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  letter-spacing: 0.02em;
  margin-left: 2px;
}
/* v4.8.22 A2: 顶栏图标按钮 — 卡片描边 + hover 青色光晕（danger 粉色）
   v4.8.24: 32→30 对齐其他顶栏按钮（折叠到顶 30 + Tab/并列 30） */
.btn-icon {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  width: 30px; height: 30px;
  padding: 0;
  color: var(--ink-soft);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-icon:hover {
  border-color: var(--neon-1, #5eead4);
  color: var(--neon-1, #5eead4);
  box-shadow: 0 0 12px rgba(94,234,212,0.35), inset 0 0 8px rgba(94,234,212,0.08);
  transform: translateY(-1px);
}
.btn-icon:active { transform: translateY(0); }
.btn-icon svg { display: block; }
/* v4.8.65: with-label 模式 — icon + 文字横排，宽度自适应 */
.btn-icon.with-label {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-icon-label { display: inline-block; }
/* A2: 重置按钮 hover 出粉色光晕 + SVG 轻微旋转暗示"重启" */
.btn-icon.danger { color: #ff9f80; border-color: rgba(255,159,128,0.18); }
.btn-icon.danger:hover {
  border-color: #fb7185;
  color: #fb7185;
  background: rgba(251,113,133,0.06);
  box-shadow: 0 0 14px rgba(251,113,133,0.4), inset 0 0 10px rgba(251,113,133,0.1);
}
.btn-icon.danger:hover svg { animation: btn-icon-spin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes btn-icon-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-25deg); }
}
/* 清空按钮 hover 时扫帚轻微摆动 */
.btn-icon:not(.danger):hover svg { animation: btn-icon-sweep 0.5s ease-out; }
@keyframes btn-icon-sweep {
  0%   { transform: rotate(0deg); }
  40%  { transform: rotate(-12deg); }
  100% { transform: rotate(0deg); }
}

/* v4.5.3 → v4.8.22 A2: 顶栏 Tab/并列 toggle — 霓虹双色发光 */
.hdr-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  background: rgba(94,234,212,0.06);
  border: 1px solid rgba(94,234,212,0.25);
  border-radius: 10px;
  padding: 3px;
  height: 30px;
  margin-right: 4px;
  gap: 1px;
  box-shadow: 0 0 14px rgba(94,234,212,0.12);
}
.hdr-mode-btn {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
}
.hdr-mode-btn:hover { color: var(--neon-1, #5eead4); }
.hdr-mode-btn.active {
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a1024;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(94,234,212,0.45);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* v4.8.30: mini 模式下 mention-menu 也向下弹（同 task-menu） */
body[data-mode="mini"] .mention-menu {
  bottom: auto !important;
  top: calc(100% + 4px) !important;
  margin-bottom: 0 !important;
}

/* v4.8.20 ③ 辩论轮次徽章 — 主区顶部浮现，横扫流光 */
.arena-badge {
  position: absolute;
  top: 64px;                       /* 主对话区顶部下方一点 */
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,159,10,0.18), rgba(255,45,149,0.18));
  border: 1px solid rgba(255,159,10,0.40);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 22px rgba(255,159,10,0.20), 0 2px 6px rgba(0,0,0,0.10);
  backdrop-filter: blur(8px);
  z-index: 50;
  overflow: hidden;
  animation: arena-badge-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.arena-badge[hidden] { display: none; }
.arena-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: arena-badge-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}
.arena-badge-em { font-size: 14px; line-height: 1; }
.arena-badge-mode {
  opacity: 0.75;
  font-weight: 500;
  font-size: 11.5px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,159,10,0.4);
}
.arena-badge.summary {
  background: linear-gradient(135deg, rgba(94,234,212,0.18), rgba(167,139,250,0.18));
  border-color: rgba(94,234,212,0.40);
  box-shadow: 0 6px 22px rgba(94,234,212,0.20), 0 2px 6px rgba(0,0,0,0.10);
}
.arena-badge.summary .arena-badge-mode { border-left-color: rgba(94,234,212,0.4); }
@keyframes arena-badge-in {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.85); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes arena-badge-shine {
  0%, 100% { transform: translateX(-100%); }
  50%      { transform: translateX(120%); }
}
.chat-main { position: relative; }  /* 让 .arena-badge 用 .chat-main 做定位锚 */
/* v4.8.12: 群聊空状态 = 上 2/3 横版海报 + 下 1/3 自定义文案 */
.empty-state {
  flex: 1;                         /* 占满 .chat-messages 剩余高度 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;                       /* v4.8.67: 18→24, 给海报和标题更大缓冲，避免被海报底部遮挡 */
  padding: 12px 16px;
  margin: 0;
  max-width: 100%;
  min-height: 0;                   /* 让 flex children 能正确缩放 */
}
.empty-state {
  position: relative;             /* v4.8.20 ⑤ 让 .es-star 绝对定位的父级 */
}
.empty-state .es-poster {
  /* v4.8.67: 海报不再 flex:2 抢空间，改纯尺寸约束，避免在窄/矮窗口里把 pitch 区域挤到标题被遮挡 */
  flex: 0 0 auto;
  min-height: 0;
  max-width: 100%;
  width: auto;
  max-height: 48%;                 /* v4.8.67: 66→48，给下半部 pitch 足够空间放标题+features+CTA */
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 8px 22px rgba(255, 175, 80, 0.18));  /* v4.8.67: 阴影内敛点 */
  position: relative;
  z-index: 1;                      /* 让海报盖在星点之上 */
}
/* v4.8.20 ⑤ 海报星空 — 12 颗星点 CSS twinkle，0~3s 错开 delay；inline style 控位置 */
.empty-state .es-star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  z-index: 0;                      /* 在海报后面 */
  animation: es-twinkle 3.4s ease-in-out infinite;
  pointer-events: none;
}
.empty-state .es-star-big {
  width: 3px; height: 3px;
  box-shadow: 0 0 6px #fff, 0 0 12px rgba(255,215,140,0.5);
}
.empty-state .es-star:nth-child(1)  { animation-delay: 0s;    }
.empty-state .es-star:nth-child(2)  { animation-delay: 0.4s;  }
.empty-state .es-star:nth-child(3)  { animation-delay: 0.8s;  }
.empty-state .es-star:nth-child(4)  { animation-delay: 1.2s;  }
.empty-state .es-star:nth-child(5)  { animation-delay: 1.6s;  }
.empty-state .es-star:nth-child(6)  { animation-delay: 2.0s;  }
.empty-state .es-star:nth-child(7)  { animation-delay: 2.4s;  }
.empty-state .es-star:nth-child(8)  { animation-delay: 0.3s;  }
.empty-state .es-star:nth-child(9)  { animation-delay: 0.9s;  }
.empty-state .es-star:nth-child(10) { animation-delay: 1.5s;  }
.empty-state .es-star:nth-child(11) { animation-delay: 2.1s;  }
.empty-state .es-star:nth-child(12) { animation-delay: 2.7s;  }
@keyframes es-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  50%      { opacity: 0.95; transform: scale(1); }
}
.empty-state .es-pitch {
  /* v4.8.67: 海报不再 flex 抢空间，pitch 也改成自然撑开（不抢 flex）+ 限高让 tutorial 有位置 */
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
}
.empty-state .es-pitch-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}
.empty-state .es-pitch-em {
  background: linear-gradient(135deg, #ff7a45, #ffaf50);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.empty-state .es-pitch-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
}
.empty-state .es-feat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(127, 127, 127, 0.08);
  border: 1px solid rgba(127, 127, 127, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 500;
}
.empty-state .es-feat-em {
  font-size: 13px;
  line-height: 1;
}
.empty-state .es-pitch-cta {
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0.75;
  font-style: italic;
  letter-spacing: 0.01em;
}
.msg { display: flex; gap: 8px; align-items: flex-start; }
/* v4.8.20 ④ 消息进场动画 — translateY 14px 淡入，头像比气泡多 60ms 错开（拟人节奏）*/
.msg.just-arrived { animation: msg-arrive 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.msg.just-arrived .msg-avatar { animation: msg-avatar-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.06s both; }
@keyframes msg-arrive {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes msg-avatar-bounce {
  0%   { transform: scale(0.6) rotate(-4deg); }
  60%  { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.msg.me { justify-content: flex-end; }
/* v4.8.7: 改为卡牌头像 — 删白底 padding，object-fit cover 让 Q 版角色脸居中露出 */
/* v4.8.9: 36→48（面积 ~1.78x）+ 圆角 10px，让卡牌细节更清晰，跟气泡高度更协调 */
/* v4.8.10: 48→72（边长 2x of 36 原始 = 面积 4x）+ 删黑色外框（box-shadow）— 卡牌自带黄色虚线边框做装饰 */
.msg-avatar {
  width: 72px; height: 72px; border-radius: 12px; flex: 0 0 72px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  background: transparent;
  padding: 0;
  overflow: hidden;
}
.msg-avatar .brand-logo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%; /* 卡牌人物脸在偏上位置，按比例对准头部 */
  display: block;
}
.msg-avatar-fallback { color: var(--ink); font-weight: 700; font-size: 11px; }
/* 各服务 fallback 字母颜色（仅 svg 缺失时显示） */
.msg-avatar-fallback.claude { color: #cc785c; }
.msg-avatar-fallback.gemini { color: #4f8cff; }
.msg-avatar-fallback.chatgpt { color: #10a37f; }
.msg-avatar-fallback.deepseek { color: #4d6bfe; }
.msg-avatar-fallback.doubao { color: #ff7a45; }
.msg-avatar-fallback.qwen { color: #6c5ce7; }
.msg-avatar-fallback.kimi { color: #0abf53; }
.msg-avatar-fallback.yuanbao { color: #d63031; }
.msg-avatar-fallback.grok { color: #1a1a1a; }
.msg-body { max-width: 78%; }
.msg-name { font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
.msg-bubble {
  background: var(--bubble-them); border-radius: 10px; padding: 8px 12px;
  word-wrap: break-word; line-height: 1.5;
  border: 1px solid var(--border);
}
.msg.me .msg-bubble { background: var(--bubble-me); color: #000; border: none; }
.msg-bubble pre {
  background: var(--code-bg); color: var(--code-ink);
  padding: 8px 10px; border-radius: 6px; overflow-x: auto;
  font-family: "SF Mono", Consolas, monospace; font-size: 12px;
  margin: 6px 0;
}
.msg-bubble code { font-family: "SF Mono", Consolas, monospace; background: rgba(0,0,0,0.05); padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.msg-bubble pre code { background: none; padding: 0; color: inherit; }

/* ── 完整 markdown 元素样式（v4.0.10） ── */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3,
.msg-bubble h4, .msg-bubble h5, .msg-bubble h6 {
  margin: 10px 0 6px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.msg-bubble h1 { font-size: 17px; }
.msg-bubble h2 { font-size: 15px; }
.msg-bubble h3 { font-size: 14px; }
.msg-bubble h4, .msg-bubble h5, .msg-bubble h6 { font-size: 13px; }
.msg-bubble h1:first-child, .msg-bubble h2:first-child, .msg-bubble h3:first-child { margin-top: 2px; }
.msg-bubble p { margin: 4px 0; }
.msg-bubble p:first-child { margin-top: 0; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}
.msg-bubble blockquote {
  border-left: 3px solid var(--accent);
  margin: 6px 0;
  padding: 4px 10px;
  color: var(--ink-soft);
  background: rgba(10,132,255,0.05);
  border-radius: 0 6px 6px 0;
}
.msg-bubble ul.md-list, .msg-bubble ol.md-list {
  margin: 4px 0 4px 18px;
  padding: 0;
}
.msg-bubble ul.md-list ul.md-list,
.msg-bubble ul.md-list ol.md-list,
.msg-bubble ol.md-list ul.md-list,
.msg-bubble ol.md-list ol.md-list {
  margin-top: 2px; margin-bottom: 2px;
}
.msg-bubble li { margin: 2px 0; line-height: 1.5; }
.msg-bubble li.md-task { list-style: none; margin-left: -16px; }
.msg-bubble li.md-task input[type="checkbox"] {
  margin-right: 6px; vertical-align: middle;
  accent-color: var(--accent);
}
.msg-bubble table.md-table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.msg-bubble table.md-table th,
.msg-bubble table.md-table td {
  padding: 5px 9px;
  border: 1px solid var(--border);
}
.msg-bubble table.md-table th {
  background: var(--bg);
  font-weight: 600;
  text-align: left;
}
.msg-bubble table.md-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}
.msg-bubble img.md-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 6px 0;
  border: 1px solid var(--border);
}
.msg-bubble del {
  color: var(--ink-soft);
  text-decoration: line-through;
}
.msg-bubble a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.msg-bubble a:hover { border-bottom-style: solid; }

/* ── 代码块"代码 / 预览"切换（v4.0.13） ── */
.code-block-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  background: var(--code-bg);
}
.code-block-tabs {
  display: flex; align-items: stretch;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.code-block-tab {
  background: none; border: none; cursor: pointer;
  padding: 6px 13px; font-size: 11.5px;
  color: var(--ink-soft);
  border-right: 1px solid var(--border);
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0;
  transition: all 0.12s;
}
.code-block-tab:hover { background: var(--bg); color: var(--ink); }
.code-block-tab.active {
  background: var(--code-bg);
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}
.code-block-copy {
  margin-left: auto;
  border-right: none;
  font-size: 12px;
}
.code-block-pane-code > pre {
  margin: 0;
  border-radius: 0;
  border: none;
}
.code-block-pane-preview {
  background: #fff;
  min-height: 200px;
  position: relative;
}
.code-preview-frame {
  width: 100%;
  height: 480px;
  border: none;
  background: #fff;
  display: block;
}

/* ── 现代细滚动条（v4.6.9 全局统一）—— 所有可滚动区都用 6px 灰条 ── */
/* Firefox / 现代浏览器 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 127, 127, 0.25) transparent;
}
/* WebKit / Chromium 系 — 用 * 全局应用（v4.0.12 旧版只列举固定 selector，新加的 .rp-log-box / .tpl-modal-body 等没覆盖） */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.25);
  border-radius: 3px;
  transition: background 0.15s;
}
*:hover::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.45);
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 127, 127, 0.65);
}
/* 表格横向滚动条同款 */
.msg-bubble table.md-table::-webkit-scrollbar {
  height: 6px;
}
.msg-bubble table.md-table::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.25);
  border-radius: 3px;
}
.msg-bubble table.md-table::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 127, 127, 0.55);
}
.msg-typing { display: inline-flex; gap: 3px; align-items: center; opacity: 0.6; }
.msg-typing span { width: 5px; height: 5px; background: currentColor; border-radius: 50%; animation: typing 1.2s ease-in-out infinite; }
.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.msg-rich-pill {
  display: inline-flex; gap: 4px; align-items: center;
  margin-top: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(10,132,255,0.1); color: var(--accent);
  font-size: 11px; cursor: pointer; border: 1px solid rgba(10,132,255,0.3);
}
.msg-rich-pill:hover { background: rgba(10,132,255,0.2); }
.chat-input-bar {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 16px; background: var(--card); border-top: 1px solid var(--border);
}
/* v4.8.22 C2: 输入框彩虹边框（v4.8.23: 改为静态固定边框，不再旋转） */
.chat-input-wrap {
  flex: 1;
  position: relative;
  border-radius: 10px;
  padding: 1px;                    /* 给伪元素留 1px 边框宽度 */
  isolation: isolate;
}
.chat-input-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;
  /* v4.8.23: linear-gradient 静态边框，不再 conic-gradient + rotate */
  background: linear-gradient(135deg,
    rgba(94,234,212,0.55) 0%,
    rgba(167,139,250,0.55) 50%,
    rgba(251,113,133,0.55) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s;
}
/* focus 时光晕加深 */
.chat-input-wrap:focus-within::before { opacity: 1; }
.chat-input-wrap:focus-within { box-shadow: 0 0 14px rgba(94,234,212,0.25); }
.chat-input {
  min-height: 36px; max-height: 120px; overflow-y: auto;
  background: var(--bg); border-radius: 9px; padding: 8px 12px;
  outline: none; line-height: 1.4;
  position: relative;
  z-index: 1;
}
.chat-input:empty::before {
  content: attr(data-placeholder); color: var(--ink-soft); pointer-events: none;
}
.mention-menu {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 140px; padding: 4px; z-index: 10;
}
/* v4.3.14: 模型实力榜（进度条版）+ 作者标语 */
.rp-lb-title { display: flex; align-items: center; gap: 6px; }
/* v4.3.15: 折叠按钮 */
.rp-lb-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-family: inherit;
  border-radius: 3px;
  padding: 0;
  transition: all 0.15s;
  margin-right: 2px;
}
.rp-lb-toggle:hover {
  background: var(--bg);
  color: var(--accent);
}
.rp-leaderboard.collapsed {
  display: none;
}
.rp-lb-meta {
  font-size: 9px;
  color: var(--ink-soft);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.rp-leaderboard { margin: 4px 0 10px; }
.rp-lb-row {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.rp-lb-row:last-of-type { border-bottom: none; }
.rp-lb-head {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 5px;
}
.rp-lb-logo {
  width: 16px; height: 16px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  padding: 1.5px;
  flex-shrink: 0;
}
.rp-lb-name {
  color: var(--ink);
  font-weight: 500;
  font-size: 11px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-lb-grade-tiny {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 0.02em;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.rp-lb-bar-wrap {
  display: flex; align-items: center; gap: 6px;
}
.rp-lb-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.rp-lb-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.rp-lb-elo {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 10px;
  color: var(--ink-soft);
  min-width: 32px;
  text-align: right;
  letter-spacing: -0.02em;
}
.rp-lb-source {
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 8px;
  text-decoration: none;
  padding: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 0.02em;
}
.rp-lb-source:hover { color: var(--accent); }

/* 分级配色 — grade pill */
.rp-lb-grade-Splus {
  background: linear-gradient(135deg, #ffd700, #c084fc);
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(192,132,252,0.4);
}
.rp-lb-grade-S { background: linear-gradient(135deg, #0a84ff, #00d4ff); color: #fff; }
.rp-lb-grade-A { background: linear-gradient(135deg, #34c759, #30d158); color: #fff; }
.rp-lb-grade-B { background: linear-gradient(135deg, #ff9f0a, #ffb340); color: #fff; }
.rp-lb-grade-C { background: var(--ink-soft); color: #fff; }
.rp-lb-grade-unranked {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--ink-soft);
  font-size: 8px;
  padding: 0 4px;
  min-width: auto;
}

/* progress bar 填充色 */
.rp-lb-bar-Splus { background: linear-gradient(90deg, #ffd700, #c084fc); box-shadow: 0 0 6px rgba(192,132,252,0.3); }
.rp-lb-bar-S { background: linear-gradient(90deg, #0a84ff, #00d4ff); }
.rp-lb-bar-A { background: linear-gradient(90deg, #34c759, #30d158); }
.rp-lb-bar-B { background: linear-gradient(90deg, #ff9f0a, #ffb340); }
.rp-lb-bar-C { background: var(--ink-soft); }
.rp-lb-bar-unranked { background: transparent; }
.rp-lb-row-unranked { opacity: 0.6; }
.rp-lb-row-unranked .rp-lb-name { color: var(--ink-soft); }

/* 作者标语 */
.rp-manifesto {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(10,132,255,0.08), rgba(192,132,252,0.08));
  border-left: 3px solid var(--accent);
}
.rp-manifesto-line1 {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.45;
}
.rp-manifesto-line2 {
  font-size: 10.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  letter-spacing: -0.005em;
}

/* v4.4.0: 辩论总结卡片（学术 arXiv 风格 HTML 报告） */
.msg-summary .msg-bubble.summary-bubble {
  background: linear-gradient(135deg, rgba(10,94,58,0.06), rgba(10,132,255,0.06)) !important;
  border: 1px solid var(--accent);
  border-left: 3px solid #0a5e3a;
  padding: 0;
  overflow: hidden;
}
.summary-pitch {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px;
}
.summary-pitch strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.summary-pitch-meta {
  font-size: 11px;
  color: var(--ink-soft);
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 0.02em;
}
.summary-iframe {
  width: 100%;
  height: 600px;
  border: 0;
  background: #fdfdfb;
  display: block;
  border-top: 1px solid var(--border);
}
.msg-summary .msg-meta .acts button[data-act^="summary-"] {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  margin-left: 2px;
}
.msg-summary .msg-meta .acts button[data-act^="summary-"]:hover {
  background: rgba(10,132,255,0.08);
  border-color: var(--accent);
}

/* v4.3.6: AI 长文折叠 */
.msg-bubble-foldable {
  position: relative;
}
.msg-bubble-foldable:not(.expanded) {
  max-height: 320px;
  overflow: hidden;
  padding-bottom: 40px;  /* 给 toggle 按钮留位 */
}
/* v4.8.41 + v4.8.44 + v4.8.48 + v4.8.49 修复: 简洁模式 — 2 行文字 + 下一行展开按钮
   v4.8.48：只显示第 1 个 markdown 子元素 + 其余隐藏（避免多段 markdown 把折叠撑成多行）
   v4.8.49：从严格 1 行放宽到最多 2 行（用户反馈：1 行信息量不够）
   用 line-clamp:2 + max-height:3.2em（line-height 1.5 × 2 行 + 余量）
   第 3 行起 ellipsis 截断；white-space 改为 normal 让文字自然换行（line-clamp 才能生效）*/
.msg-bubble-foldable.compact-fold:not(.expanded) {
  max-height: none;
  padding-bottom: 34px;  /* 给底部 absolute 按钮（≈30px 高）腾位 */
  display: block;
  position: relative;
}
/* 第 1 个子元素：最多 2 行 + ellipsis */
.msg-bubble-foldable.compact-fold:not(.expanded) > *:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;          /* 标准属性（部分浏览器支持） */
  max-height: 3.2em;      /* line-height 1.5 × 2 行 + 余量 = 严格不超过 2 行 */
  overflow: hidden;
  white-space: normal;    /* 必须允许换行，line-clamp 才能在第 2 行后截断 */
  text-overflow: ellipsis;
  margin: 0;
}
/* 其余子元素（除 toggle 按钮）全部隐藏 — 保证简洁模式不被多段 markdown 撑高 */
.msg-bubble-foldable.compact-fold:not(.expanded) > *:not(:first-child):not(.msg-fold-toggle) {
  display: none;
}
.msg-bubble-foldable.compact-fold:not(.expanded)::before {
  display: none;  /* 渐变遮罩不需要 — 已用 ellipsis */
}
.msg-bubble-foldable.compact-fold:not(.expanded) .msg-fold-toggle {
  padding: 5px 12px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  background: transparent;
}
.msg-bubble-foldable:not(.expanded)::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 38px;
  height: 56px;
  background: linear-gradient(transparent, var(--bubble-them));
  pointer-events: none;
  z-index: 1;
}
.msg-fold-toggle {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bubble-them);
  border: none;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  letter-spacing: 0.02em;
  z-index: 2;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* v4.8.59: 防止按钮被父容器压窄时中文"收起" / "展开全文"字符级换行（竖排显示问题）
     nowrap 强制单行；min-width:max-content 保证按钮宽度 ≥ 完整文字宽度，不会被压成竖向 */
  white-space: nowrap;
  min-width: max-content;
}
/* v4.8.59: 同样兜底子元素 — 防 .msg-fold-icon / .msg-fold-count 被压换行 */
.msg-fold-toggle > * {
  flex-shrink: 0;
  white-space: nowrap;
}
.msg-fold-toggle:hover { background: rgba(10,132,255,0.06); }
.msg-bubble-foldable.expanded .msg-fold-toggle {
  position: relative;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.msg-fold-icon {
  font-size: 10px;
  display: inline-block;
}
.msg-fold-count {
  font-size: 10px;
  color: var(--ink-soft);
  font-family: "SF Mono", "Consolas", monospace;
  font-weight: 500;
}

/* v4.3.5: mention item 显示真实 brand logo */
.mention-item {
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 2px;
  transition: all 0.12s;
}
.mention-item:hover, .mention-item.active {
  background: rgba(10,132,255,0.1);
}
.mention-item.active { box-shadow: 0 0 0 1px rgba(10,132,255,0.3) inset; }
.mention-logo {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mention-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
/* v4.8.22 C2: 发送按钮基础尺寸（详细效果在下方 v4.3.4 升级版定义）*/
.btn-send {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; color: #0a1024;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }
/* v4.8.10: 删 dark mode 的 box-shadow + 1px outline — 卡牌自带黄色虚线边框，无需额外描边 */

/* ── 紧凑 meta 行 ── */
.msg-meta {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 3px;
  font-size: 10.5px; color: var(--ink-soft);
  min-height: 18px;
}
.msg-meta .name { color: var(--ink); font-weight: 600; font-size: 11.5px; }
.msg-meta .time { font-family: "SF Mono","JetBrains Mono",Consolas,monospace; font-size: 10px; color: var(--ink-soft); }
.msg-meta .stat { display: flex; align-items: center; gap: 3px; font-size: 10px; }
.msg-meta .stat .pip { width: 6px; height: 6px; border-radius: 50%; }
.msg-meta .stat.done .pip { background: #34c759; }
.msg-meta .stat.done { color: #34c759; }
.msg-meta .stat.streaming .pip { background: #ff9f0a; animation: pulse-stream 1.2s ease-in-out infinite; }
.msg-meta .stat.streaming { color: #ff9f0a; }
.msg-meta .stat.failed .pip { background: #ff3b30; }
.msg-meta .stat.failed { color: #ff3b30; }
@keyframes pulse-stream {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}
.msg-meta .acts { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.msg:hover .msg-meta .acts { opacity: 1; }
/* v4.8.42 K样式: 气泡 5 按钮 — resend/reextract/skip 跳色，copy/jump 中性灰
   配色用 rgba(0,0,0,X) 黑色透明叠层，对浅/深主题都中性（不依赖 prefers-color-scheme） */
.msg-meta .acts button {
  width: 22px; height: 22px;
  background: rgba(127,127,127,0.12);
  border: none; border-radius: 5px;
  color: var(--ink-soft); cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.msg-meta .acts button .ai-icn { width: 13px; height: 13px; }
.msg-meta .acts button[data-act="resend"]    { background: rgba(10,132,255,0.12); color: #0a84ff; }
.msg-meta .acts button[data-act="reextract"] { background: rgba(52,199,89,0.14);  color: #34c759; }
.msg-meta .acts button[data-act="skip"]      { background: rgba(255,159,10,0.14); color: #ff9f0a; }
.msg-meta .acts button:hover {
  transform: scale(1.08);
  filter: saturate(1.2);
}
.msg-meta .acts button[data-act="resend"]:hover    { background: #0a84ff; color: #fff; }
.msg-meta .acts button[data-act="reextract"]:hover { background: #34c759; color: #fff; }
.msg-meta .acts button[data-act="skip"]:hover      { background: #ff9f0a; color: #fff; }
.msg-meta .acts button[data-act="copy"]:hover,
.msg-meta .acts button[data-act="jump"]:hover {
  background: rgba(127,127,127,0.24); color: var(--ink);
}
.me-meta { flex-direction: row-reverse; }
.me-meta .acts { margin-left: 0; margin-right: auto; }

/* ── 左下参与者 roster ── */
/* v4.8.67: padding 收窄 9/16 → 6/12，让整条 chat-roster 高度更紧凑，不再占满一大行 */
.chat-roster {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  min-height: 0;
}
/* v4.8.22 C2: "下轮发言" 改胶囊徽章 + 闪烁圆点 */
.roster-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(94,234,212,0.10);
  color: var(--neon-1, #5eead4);
  border: 1px solid rgba(94,234,212,0.30);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.roster-label::before {
  content: "●";
  font-size: 8px;
  line-height: 1;
  animation: roster-dot 1.6s ease-in-out infinite;
}
@keyframes roster-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
/* v4.8.43: roster 改造为 pill 横排 — [logo + 一行预览]，flex 自适应等宽 */
.roster-items { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.rp-empty {
  font-size: 11px; color: var(--ink-soft); font-style: italic;
}
.roster-pill {
  display: flex; align-items: center;
  background: rgba(127,127,127,0.08);
  border-radius: 14px;
  padding: 2px;
  gap: 4px;
  flex: 1; min-width: 0;
  transition: all 0.15s;
  position: relative;
}
.roster-pill.selected {
  background: rgba(94,234,212,0.10);
  box-shadow: inset 0 0 0 1px rgba(94,234,212,0.30);
}
.roster-pill.unselected { opacity: 0.42; filter: grayscale(0.6); }
.roster-pill:hover { transform: translateY(-1px); }
.rp-logo-btn {
  width: 26px; height: 26px;
  border: none; background: #fff;
  border-radius: 50%;
  cursor: pointer;
  padding: 3px;
  position: relative;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.rp-logo-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--accent);
}
.rp-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rp-check {
  position: absolute; right: -3px; bottom: -3px;
  width: 12px; height: 12px;
  background: #34c759;
  border-radius: 50%;
  color: #fff; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
  line-height: 1;
}
.rp-preview {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: transparent; border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  border-radius: 10px;
  transition: background 0.12s;
}
.rp-preview:hover { background: rgba(0,0,0,0.04); }
.rp-name {
  font-size: 11px; font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
  max-width: 56px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* v4.8.56: pill 预览从严格 1 行放宽到最多 2 行（line-clamp:2 + 允许换行）
   原 white-space:nowrap + ellipsis 把"## Claude responded: 第 1 轮辩论..."只显示一小段
   现在 line-clamp:2 让较长 markdown 标题展示完整两行 + 第 3 行起 ellipsis */
.rp-text {
  flex: 1; min-width: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  /* 严格高度上限：line-height 1.35 × 2 行 × 11.5px ≈ 31px + 余量 */
  max-height: calc(1.35em * 2);
  word-break: break-word;
}
.rp-preview.empty .rp-text { color: var(--ink-soft); font-style: italic; }
.rp-edited {
  font-size: 11px;
  color: #ff9f0a;
  flex-shrink: 0;
  font-weight: 700;
}

/* v4.7.2: 文件上传安全提示 — v4.8.43 改为可智能隐藏（.hidden） */
.roster-upload-hint {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: 0;
  padding: 3px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: help;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
  transition: opacity 0.3s, max-width 0.3s, padding 0.3s, border-width 0.3s;
}
.roster-upload-hint:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.roster-upload-hint.hidden {
  opacity: 0;
  max-width: 0;
  padding: 0;
  border-width: 0;
  margin: 0;
  pointer-events: none;
}

/* v4.8.43: 下方编辑器面板 — 点击某 pill 的预览区时显示 */
.resp-editor {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resp-editor[hidden] { display: none; }
.resp-editor-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-soft);
}
.resp-editor-logo {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.resp-editor-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.resp-editor-meta {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resp-editor-close {
  width: 22px; height: 22px;
  border: none; background: transparent;
  color: var(--ink-soft); cursor: pointer;
  border-radius: 5px;
  font-size: 12px;
  transition: all 0.12s;
}
.resp-editor-close:hover { background: rgba(127,127,127,0.18); color: var(--ink); }
.resp-editor-text {
  width: 100%;
  min-height: 90px;
  max-height: 240px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-shadow: 0 0 0 2px rgba(10,132,255,0.10);
}
.resp-editor-text:focus { box-shadow: 0 0 0 3px rgba(10,132,255,0.20); }

/* ── 任务模式选择器 ── */
/* v4.8.23: task-picker 整体胶囊化 + 按 data-mode 切配色 + 发光呼吸 */
.task-picker-wrap { position: relative; }
.task-picker {
  /* 默认: ask 同时提问 — 青绿渐变 */
  background: linear-gradient(135deg, #5eead4, #34c759);
  color: #0a1024;
  border: 1px solid rgba(94,234,212,0.35);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.30), 0 4px 12px rgba(94,234,212,0.25), 0 0 14px rgba(94,234,212,0.18);
  letter-spacing: 0.02em;
}
.task-picker:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(94,234,212,0.5), 0 6px 18px rgba(94,234,212,0.4), 0 0 22px rgba(94,234,212,0.30);
}
.task-picker:active { transform: translateY(0) scale(0.97); }
.task-picker .icon { font-size: 13px; }
/* 内嵌 .picked 不再有独立背景 — 文字直接在 picker 上 */
.task-picker .picked {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}
.task-picker .caret {
  color: rgba(10,16,36,0.65);
  font-size: 10px;
  transition: transform 0.2s;
}
.task-picker:hover .caret { transform: translateY(1px); }

/* 模式切换配色 — 通过 popup-task-menu.js refreshPill 写入 data-mode */
.task-picker[data-mode="debate"] {
  background: linear-gradient(135deg, #ff8c42, #fb7185);
  color: #fff;
  border-color: rgba(255,140,66,0.4);
  box-shadow: 0 0 0 1px rgba(255,140,66,0.35), 0 4px 12px rgba(255,94,58,0.30), 0 0 14px rgba(255,140,66,0.22);
}
.task-picker[data-mode="debate"]:hover {
  box-shadow: 0 0 0 1px rgba(255,140,66,0.55), 0 6px 18px rgba(255,94,58,0.45), 0 0 22px rgba(255,140,66,0.35);
}
.task-picker[data-mode="debate"] .caret { color: rgba(255,255,255,0.85); }

.task-picker[data-mode="summary"] {
  background: linear-gradient(135deg, #fbbf24, #ff9f0a);
  color: #1a1024;
  border-color: rgba(251,191,36,0.4);
  box-shadow: 0 0 0 1px rgba(251,191,36,0.35), 0 4px 12px rgba(255,159,10,0.30), 0 0 14px rgba(251,191,36,0.22);
}
.task-picker[data-mode="summary"]:hover {
  box-shadow: 0 0 0 1px rgba(251,191,36,0.55), 0 6px 18px rgba(255,159,10,0.45), 0 0 22px rgba(251,191,36,0.35);
}

.task-picker[data-mode="ppt"] {
  background: linear-gradient(135deg, #a78bfa, #4f8cff);
  color: #fff;
  border-color: rgba(167,139,250,0.4);
  box-shadow: 0 0 0 1px rgba(167,139,250,0.35), 0 4px 12px rgba(79,140,255,0.30), 0 0 14px rgba(167,139,250,0.22);
}
.task-picker[data-mode="ppt"]:hover {
  box-shadow: 0 0 0 1px rgba(167,139,250,0.55), 0 6px 18px rgba(79,140,255,0.45), 0 0 22px rgba(167,139,250,0.35);
}
.task-picker[data-mode="ppt"] .caret { color: rgba(255,255,255,0.85); }
.task-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 180px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  z-index: 20;
}
.menu-item {
  padding: 7px 10px; color: var(--ink); font-size: 12px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; position: relative;
}
.menu-item:hover { background: var(--bg); }
.menu-item.active { background: rgba(10,132,255,0.15); color: var(--accent); }
.menu-item .em { font-size: 14px; }
.menu-item .check-mark { margin-left: auto; color: var(--accent); }
.menu-item.has-sub .caret { margin-left: auto; color: var(--ink-soft); font-size: 9px; }
.sub-menu {
  position: absolute; left: 100%; top: -6px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 160px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  display: none;
}
.menu-item.has-sub:hover > .sub-menu { display: block; }
/* v5.2.4: 三级嵌套子菜单 — 内层用 :hover > 直接子选择器，避免外层 hover 时内层都显示 */
/* v5.2.11: 三级菜单沿父项「底部」对齐向上展开 — 父项靠近窗口底部时不会再裁切。
   撤销 v5.2.8 的 max-height/overflow（那个反而把绝对定位的三级 sub-menu 切没了） */
.sub-menu .menu-item.has-sub > .sub-menu {
  left: 100%;
  top: auto;
  bottom: -6px;
}
/* "我全都要"高亮（5 风格列表底部的彩虹分隔项）*/
.menu-item.ppt-all-pick {
  background: linear-gradient(90deg, rgba(255,159,10,0.10), rgba(10,132,255,0.10));
  font-weight: 600;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.menu-item.ppt-all-pick:hover {
  background: linear-gradient(90deg, rgba(255,159,10,0.22), rgba(10,132,255,0.22));
}

/* ── 微动效 + 字距 + 整体精致化 ── */
body { letter-spacing: -0.01em; }
.msg { animation: slide-in 0.25s ease-out; }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* v4.3.5: chat-icon 不再走脉冲动画（替换为真实图标） */
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.12); }
}
/* v4.3.4 → v4.8.22 C2: 科技蓝 → 青紫霓虹（跟卡槽彩虹环、输入框跑光呼应） */
.btn-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5eead4 0%, #a78bfa 60%, #fb7185 100%);
  background-size: 200% 200%;
  box-shadow:
    0 4px 14px rgba(94,234,212,0.40),
    0 0 16px rgba(167,139,250,0.30),
    0 0 0 1px rgba(255,255,255,0.22) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset;
  color: #0a1024;
  border: none;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: btnSendGradient 5s ease infinite;
}
@keyframes btnSendGradient {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-send::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5eead4, #a78bfa, #fb7185);
  z-index: -1;
  opacity: 0.45;
  filter: blur(8px);
  transition: opacity 0.25s;
  animation: btn-send-aura 3s ease-in-out infinite;
}
@keyframes btn-send-aura {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.65; }
}
.btn-send:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow:
    0 8px 22px rgba(94,234,212,0.55),
    0 0 24px rgba(167,139,250,0.45),
    0 0 0 1px rgba(255,255,255,0.30) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset;
}
.btn-send:hover::before { opacity: 0.7; }
.btn-send:active {
  transform: translateY(0) scale(0.94);
  box-shadow:
    0 2px 6px rgba(10,132,255,0.4),
    0 0 0 1px rgba(255,255,255,0.1) inset;
}
.btn-send-icon {
  width: 18px; height: 18px;
  stroke: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  transition: transform 0.2s;
}
.btn-send:hover .btn-send-icon { transform: translateY(-1px); }
.btn-send:disabled {
  opacity: 0.4; cursor: not-allowed;
  animation: none;
  transform: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-send:disabled::before { opacity: 0; }

/* AI 气泡 avatar 可点击跳原页 */
.msg.ai .msg-avatar {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.msg.ai .msg-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--accent);
}
.msg.ai .msg-avatar:hover::after {
  content: "↗";
  position: absolute;
  top: -4px; right: -4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.msg-bubble {
  letter-spacing: -0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.msg-name, .chat-name { letter-spacing: 0; }
.task-picker, .task-menu, .mention-menu {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.chat-header { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.chat-input { transition: border-color 0.15s; }
.chat-input:focus { border-color: var(--accent); outline: none; }
.msg:hover .msg-bubble {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ────────── 右栏 4 Tab 抽屉 (v4.3.5 用 SVG icons) ────────── */
.rp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: relative;
}
.rp-tab {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  background: transparent;
  border: 0; cursor: pointer;
  font-size: 11px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  line-height: 1.3;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  letter-spacing: -0.01em;
  transition: all 0.18s;
  position: relative;
}
.rp-tab-icon {
  width: 18px; height: 18px;
  stroke-width: 1.8;
  transition: transform 0.2s;
}
.rp-tab:hover {
  background: rgba(10,132,255,0.04);
  color: var(--ink);
}
.rp-tab:hover .rp-tab-icon { transform: translateY(-1px); }
.rp-tab.active {
  color: var(--accent);
  font-weight: 700;
  background: linear-gradient(180deg, rgba(10,132,255,0.06), transparent);
}
.rp-tab.active::after {
  content: "";
  position: absolute;
  left: 20%; right: 20%; bottom: -1px;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}
.rp-tab.active .rp-tab-icon {
  filter: drop-shadow(0 0 4px rgba(10,132,255,0.4));
}
/* 旧 emoji style 兼容（兜底） */
.rp-tab .em { display: block; font-size: 14px; margin-bottom: 2px; }
.rp-panel {
  display: none; flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 12px; font-size: 12px; color: var(--ink);
  scrollbar-width: thin;
}
.rp-panel.active { display: block; }
.rp-panel::-webkit-scrollbar { width: 6px; }
.rp-panel::-webkit-scrollbar-thumb {
  background: rgba(128,128,128,0.25); border-radius: 3px;
}
.rp-panel:hover::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.45); }
.rp-section-title {
  font-size: 10px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 6px;
}
.rp-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
}
.rp-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-soft); flex-shrink: 0;
}
.rp-status-dot.ready { background: #34c759; }
.rp-status-dot.busy { background: #ff9f0a; animation: rp-pulse 1.2s ease-in-out infinite; }
.rp-status-dot.error { background: #ff3b30; }
@keyframes rp-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.rp-list-item .name { flex: 1; font-size: 12px; }
.rp-more {
  color: var(--ink-soft); cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
  font-size: 14px; line-height: 1;
  user-select: none;
}
.rp-more:hover { background: var(--card); color: var(--accent); }
/* v4.8.22 B2: 添加 AI 按钮 — 微卡片
   v4.8.23: 3 列网格
   v4.8.24: 删除副标题（用户反馈"没必要"）— logo + name 单行横排 */
.rp-add-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 10px;
}
.rp-add-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 5px;
  font-size: 10.5px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.rp-add-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, rgba(94,234,212,0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.rp-add-btn:hover {
  border-color: var(--neon-1, #5eead4);
  background: linear-gradient(135deg, rgba(94,234,212,0.08), rgba(167,139,250,0.04));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25), 0 0 12px rgba(94,234,212,0.18);
}
.rp-add-btn:hover::after { opacity: 1; }
.rp-add-logo {
  width: 13px; height: 13px;
  object-fit: contain;
  flex-shrink: 0;
}
/* v4.8.25: 字号缩到 10.5 让 Claude/Gemini/DeepSeek 完整显示；删 ellipsis */
.rp-add-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;          /* 保留单行，避免折行影响 3 列网格高度 */
  letter-spacing: -0.01em;
}
.rp-mode-toggle {
  display: flex; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; background: var(--bg);
  margin-bottom: 8px;
}
.rp-mode-btn {
  flex: 1; padding: 5px; text-align: center;
  background: transparent; border: 0; cursor: pointer;
  font-size: 11px; color: var(--ink-soft);
  font-family: inherit;
}
.rp-mode-btn:hover { color: var(--ink); }
.rp-mode-btn.active {
  background: var(--accent); color: #fff; font-weight: 600;
}
.rp-btn {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 6px;
  font-size: 11px; cursor: pointer; color: var(--ink);
  margin-bottom: 4px; font-family: inherit;
}
.rp-btn:hover { border-color: var(--accent); color: var(--accent); }
.rp-btn.primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent); font-weight: 600;
}
.rp-btn.primary:hover { filter: brightness(1.1); color: #fff; }
.rp-btn.danger-soft {
  border-color: #ff3b30; color: #ff3b30;
}
.rp-btn.danger-soft:hover { background: rgba(255,59,48,0.08); }
.rp-textarea {
  width: 100%; padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px;
  color: var(--ink); background: var(--bg);
  font-family: inherit; resize: vertical;
  min-height: 40px; outline: none;
  margin-bottom: 4px;
}
.rp-textarea:focus { border-color: var(--accent); }
.rp-select {
  width: 100%; padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px;
  color: var(--ink); background: var(--bg);
  margin-bottom: 4px; font-family: inherit;
}
.rp-checkbox-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0; font-size: 11px;
  color: var(--ink); margin-bottom: 4px;
  cursor: pointer;
}
.rp-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 10px;
}
.rp-stat-cell {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 8px; text-align: center;
}
.rp-stat-val {
  font-size: 18px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.02em;
  line-height: 1.2;
}
.rp-stat-lbl {
  font-size: 9px; color: var(--ink-soft);
  margin-top: 2px;
}
.rp-substat-tabs { display: flex; gap: 3px; margin-bottom: 8px; }
.rp-substat-tab {
  flex: 1; padding: 4px 2px; text-align: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; font-size: 10px; cursor: pointer;
  color: var(--ink-soft);
}
.rp-substat-tab:hover { color: var(--ink); }
.rp-substat-tab.active {
  background: var(--accent); color: #fff;
  border-color: var(--accent); font-weight: 600;
}

/* v4.6.8: 统计可视化 — 横向柱状图 / 趋势折线 / 热力图 */
.rp-bar-list { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.rp-bar-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.rp-bar-label {
  display: flex; align-items: center; gap: 5px;
  width: 78px; flex-shrink: 0;
  font-size: 11px; color: var(--ink);
}
.rp-bar-em { font-size: 12px; }
.rp-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.rp-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(10,132,255,0.7), rgba(10,132,255,0.95));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.rp-bar-val {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--ink);
  font-weight: 600;
  font-feature-settings: "tnum" 1;
  text-shadow: 0 0 2px var(--card);
}

.rp-chart-wrap {
  margin-top: 14px;
  padding: 10px 8px 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rp-chart-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.rp-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.rp-chart-area { fill: rgba(10,132,255,0.10); }
.rp-chart-line { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.rp-chart-dot { fill: var(--accent); }
.rp-chart-axis { font-size: 9px; fill: var(--ink-soft); font-family: inherit; }
.rp-chart-meta {
  font-size: 10px; color: var(--ink-soft);
  margin-top: 4px; text-align: center;
}

.rp-heat-svg {
  width: 100%;
  height: auto;
  display: block;
}
.rp-heat-label { font-size: 8px; fill: var(--ink-soft); font-family: inherit; }
.rp-heat-cell { transition: opacity 0.2s; cursor: help; }
.rp-heat-cell:hover { stroke: var(--accent); stroke-width: 1; }
.rp-heat-l0 { fill: var(--bg); stroke: var(--border); stroke-width: 0.5; }
.rp-heat-l1 { fill: rgba(10,132,255,0.18); }
.rp-heat-l2 { fill: rgba(10,132,255,0.40); }
.rp-heat-l3 { fill: rgba(10,132,255,0.65); }
.rp-heat-l4 { fill: rgba(10,132,255,0.90); }
.rp-heat-legend-lbl { font-size: 9px; color: var(--ink-soft); margin: 0 4px; }
.rp-heat-legend-sq {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  margin: 0 1px;
  vertical-align: middle;
}
.rp-heat-legend-sq.rp-heat-l0 { background: var(--bg); border: 1px solid var(--border); }
.rp-heat-legend-sq.rp-heat-l1 { background: rgba(10,132,255,0.18); }
.rp-heat-legend-sq.rp-heat-l2 { background: rgba(10,132,255,0.40); }
.rp-heat-legend-sq.rp-heat-l3 { background: rgba(10,132,255,0.65); }
.rp-heat-legend-sq.rp-heat-l4 { background: rgba(10,132,255,0.90); }
.rp-theme-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; margin-bottom: 10px;
}
.rp-theme-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 5px;
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; cursor: pointer;
  color: var(--ink);
}
.rp-theme-item:hover { border-color: var(--accent); }
.rp-theme-item.active {
  border-color: var(--accent);
  background: rgba(10,132,255,0.08);
  color: var(--accent); font-weight: 600;
}
.rp-theme-swatch {
  width: 11px; height: 11px; border-radius: 50%;
  flex-shrink: 0;
}
/* v4.8.15: 风格选择 — 卡牌 logo 风格 2-选 1 cards（含预览图 + 名字 + 描述） */
.rp-style-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.rp-style-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.rp-style-item:hover { border-color: var(--accent); }
.rp-style-item.active {
  border-color: var(--accent);
  background: rgba(10,132,255,0.08);
}
.rp-style-preview {
  width: 40px; height: 56px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center 18%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.rp-style-meta {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.rp-style-name {
  font-size: 12px; font-weight: 600;
  color: var(--ink);
}
.rp-style-item.active .rp-style-name { color: var(--accent); }
.rp-style-desc {
  font-size: 10px; color: var(--ink-soft);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v4.7.2: 老版 .rp-log-box 硬编码深色背景已删除（dead code 自 v4.6.9 状态日志抽出设置 Tab）。
   新版定义在 line 52-115，用 var(--card) / var(--bg)，自动跟主题变。 */
.rp-kbd-list {
  font-size: 11px; line-height: 1.8;
  color: var(--ink);
}
.rp-kbd {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px;
  font-size: 10px; font-family: "SF Mono", "Consolas", monospace;
  color: var(--ink);
}
.rp-empty {
  text-align: center; color: var(--ink-soft);
  font-size: 11px; padding: 20px 10px;
  line-height: 1.6;
}
/* v5.2.25: .rp-action-menu 已删（三点菜单移除，右上 × 直接 removeParticipant） */

/* ────── v4.3.0 精致化：成员卡片 + 添加按钮 logo + 跳过气泡 + 折叠目录 + danger 按钮 ────── */

.rp-count {
  display: inline-block;
  margin-left: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.rp-member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rp-member-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(10,132,255,0.08);
}
.rp-member-logo {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: contain;
  background: var(--bg);
  padding: 2px;
  flex-shrink: 0;
}
.rp-member-logo-fb {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.rp-member-info { flex: 1; min-width: 0; }
.rp-member-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-member-meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 3px;
}
.rp-member-status-txt {
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* 添加按钮 — v4.3.x 老定义被 v4.8.22/23 微卡片版（line 1649-1720）取代，整段移除避免 cascade 覆盖 */

/* 跳过气泡 */
.msg-skipped {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(174,174,178,0.15);
  color: var(--ink-soft);
  border-radius: 8px;
  font-size: 12px;
  font-style: italic;
}
.msg-skipped-row .msg-bubble {
  opacity: 0.7;
  background: transparent !important;
  box-shadow: none !important;
  border: 1px dashed var(--border);
}
.stat.skipped {
  color: var(--ink-soft) !important;
}
.stat.skipped .pip {
  background: var(--ink-soft) !important;
}

/* 顶部 danger 按钮（⚡ 彻底初始化） */
.btn-icon.danger { color: #ff9f0a; }
.btn-icon.danger:hover {
  background: rgba(255,159,10,0.12);
  color: #ff3b30;
}

/* 折叠的对话目录：每个 turn + 内联 AI 回答 */
.sidebar-turn {
  margin-bottom: 4px;
}
/* v4.3.5: 展开 N 条回答 chip 精致化 */
.sidebar-toggle-replies {
  margin-left: auto;
  background: linear-gradient(135deg, var(--bg), var(--card));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  color: var(--ink-soft);
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 2px;
}
.sidebar-toggle-replies:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(10,132,255,0.08);
  transform: scale(1.05);
}
.sidebar-item-pending {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.sidebar-replies {
  margin: 2px 6px 8px 14px;
  border-left: 2px solid var(--border);
  padding-left: 8px;
}
.sidebar-reply {
  display: flex;
  gap: 6px;
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar-reply:hover { background: rgba(10,132,255,0.06); }
.sidebar-reply-logo {
  width: 14px; height: 14px;
  border-radius: 3px;
  object-fit: contain;
  margin-top: 1px;
  flex-shrink: 0;
}
.sidebar-reply-logo-fallback {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.sidebar-reply-body { flex: 1; min-width: 0; }
.sidebar-reply-name {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}
.sidebar-reply-text {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* PPT 工坊 */
.rp-ppt-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.rp-ppt-step {
  padding: 8px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: all 0.15s;
}
.rp-ppt-step:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.rp-ppt-step.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.rp-ppt-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 6px;
}
.rp-ppt-tpl {
  padding: 5px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
}
.rp-ppt-tpl:hover { color: var(--ink); border-color: var(--accent); }
.rp-ppt-tpl.active {
  background: rgba(10,132,255,0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ========================================================================
 *  v4.5.0 · 📋 模板 Tab
 *  内置任务模板（debate.free / debate.collab / summary / ppt）
 *  + 自定义模板（用户片段）
 *  + 弹层编辑器（单字段 / 多字段 tab）
 * ====================================================================== */
.tpl-count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-size: 11px;
}
.tpl-spacer { flex: 1; }
.tpl-mini-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.tpl-mini-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.tpl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}
.tpl-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.15s;
}
.tpl-item:hover { border-color: var(--accent); }

.tpl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  user-select: none;
}
.tpl-em { font-size: 14px; flex-shrink: 0; }
.tpl-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.tpl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  display: none;
}
.tpl-row.tpl-modified .tpl-dot { display: block; }
.tpl-actions {
  display: none;
  gap: 4px;
}
.tpl-item:hover .tpl-actions { display: flex; }
.tpl-actions .tpl-mini-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg);
  font-size: 11px;
}
.tpl-actions .tpl-mini-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--ink);
  border: none;
}

.tpl-preview {
  display: none;
  padding: 0 12px 10px;
  border-top: 1px solid var(--border);
}
.tpl-item.tpl-expanded .tpl-preview { display: block; }
.tpl-pf { margin-top: 8px; }
.tpl-pf-label {
  font-size: 10px;
  color: var(--ink-soft);
  margin-bottom: 3px;
  font-weight: 600;
}
.tpl-pf-mod { color: #ff9f0a; }
.tpl-pf-body {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 10px;
  background: #1d1d1f;
  color: #f5f5f7;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}

.tpl-empty {
  padding: 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 11px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.tpl-action-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tpl-action-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.tpl-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.tpl-action-btn.tpl-action-danger:hover { border-color: #ff3b30; color: #ff3b30; }

/* ---- Modal 弹层 ---- */
.tpl-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tpl-modal-mask[hidden] { display: none; }
.tpl-modal {
  background: var(--card);
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}
.tpl-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.tpl-modal-emoji { font-size: 18px; }
.tpl-modal-title {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  letter-spacing: -0.01em;
}
.tpl-modal-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.tpl-modal-badge.tpl-badge-builtin { background: var(--ink-soft); }
.tpl-modal-badge.tpl-badge-modified { background: #ff9f0a; }

.tpl-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}

.tpl-field-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tpl-field-tab {
  padding: 6px 12px;
  border: none;
  background: transparent;
  font-size: 11px;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  font-family: inherit;
}
.tpl-field-tab:hover { color: var(--ink); }
.tpl-field-tab.tpl-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tpl-tab-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff9f0a;
  margin-left: 5px;
  vertical-align: middle;
}

.tpl-field-row { margin-bottom: 14px; }
.tpl-field-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.tpl-field-row input,
.tpl-field-row textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  resize: vertical;
}
.tpl-field-row textarea {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  min-height: 200px;
}
.tpl-field-row input:focus,
.tpl-field-row textarea:focus { border-color: var(--accent); }
.tpl-help {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.tpl-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
.tpl-modal-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  font-family: inherit;
}
.tpl-modal-btn:hover { border-color: var(--accent); }
.tpl-modal-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.tpl-modal-primary:hover { opacity: 0.9; border-color: var(--accent); }
.tpl-modal-danger {
  color: #ff3b30;
  border-color: transparent;
  background: transparent;
}
.tpl-modal-danger:hover {
  background: rgba(255,59,48,0.1);
  border-color: #ff3b30;
}

/* ---- Toast ---- */
.tpl-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 1100;
}
.tpl-toast.tpl-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- 输入框插入反馈 ---- */
.tpl-input-flash {
  animation: tpl-flash 0.6s ease-out;
}
@keyframes tpl-flash {
  0%   { background: rgba(255,243,205,0.7); }
  100% { background: var(--bg); }
}

/* ========================================================================
 *  v4.6.0 · 角色帽（成员 Tab 入口 + AI 选择 picker）
 * ====================================================================== */
.rp-hat-section { margin: 16px 0 6px; }
.rp-hat-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-size: 10px;
  margin-left: 6px;
}
/* v4.8.22 Hat B: 角色帽胸章 pin — 左侧圆形 icon-pin（青紫渐变发光）+ 右侧文字胶囊 */
.rp-hat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rp-hat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;       /* 左侧给 icon-pin 留位 */
  background: linear-gradient(135deg, rgba(167,139,250,0.10), rgba(94,234,212,0.06));
  border: 1px solid rgba(167,139,250,0.30);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.rp-hat-btn:hover {
  border-color: rgba(167,139,250,0.55);
  background: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(94,234,212,0.10));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(167,139,250,0.30);
}
/* 圆形 icon-pin 包裹 emoji */
.rp-hat-em {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #5eead4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: #0a1024;
  box-shadow: 0 0 8px rgba(167,139,250,0.45), inset 0 0 4px rgba(255,255,255,0.18);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.rp-hat-label {
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* AI 选择菜单（点角色帽后弹出） */
.rp-hat-picker {
  z-index: 900;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 6px;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  animation: rp-hat-picker-in 0.12s ease-out;
}
@keyframes rp-hat-picker-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rp-hat-picker-header {
  font-size: 11px;
  color: var(--ink-soft);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.rp-hat-picker-empty {
  font-size: 11px;
  color: var(--ink-soft);
  padding: 12px 10px;
  text-align: center;
}
.rp-hat-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.rp-hat-picker-item:hover {
  background: var(--bg);
  color: var(--accent);
}
.rp-hat-pi-em { font-size: 14px; }

/* 模板库里"使用入口：成员 Tab" 小提示 */
.tpl-hint-text {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

/* v4.6.2: 角色帽分工模式新增 UI */
.rp-hat-spacer { flex: 1; }
.rp-hat-clear-all {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.rp-hat-clear-all:hover {
  border-color: #ff3b30;
  color: #ff3b30;
}
.rp-hat-btn { position: relative; }   /* 给 badge 定位 */
.rp-hat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1.5px solid var(--card);
  box-sizing: border-box;
}
.rp-hat-pi-tag-cur {
  margin-left: auto;
  font-size: 10px;
  color: var(--accent);
  background: rgba(10,132,255,0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.rp-hat-pi-tag-other {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

/* v4.6.5: LaTeX 公式渲染（轻量 LaTeX→Unicode，无 KaTeX 库）
   - 行内 $...$：默认 italic + 等宽数字字距；title 属性显示原 LaTeX 源码 */
.md-math {
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math",
               "Times New Roman", "Georgia", serif;
  font-style: italic;
  font-feature-settings: "tnum" 1, "ss01" 1;
  padding: 0 1px;
  border-radius: 3px;
  cursor: help;
}
.md-math:hover { background: rgba(10,132,255,0.08); }

/* 块级 $$...$$：居中 + 留白 + hover 显示原 LaTeX */
.md-math-block {
  display: block;
  margin: 12px auto;
  padding: 10px 16px;
  text-align: center;
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math",
               "Times New Roman", "Georgia", serif;
  font-style: italic;
  font-size: 1.05em;
  line-height: 1.8;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: help;
  overflow-x: auto;
}
.md-math-block:hover { border-color: var(--accent); }

/* v4.7.0: 心流柱状图 + 任务分布饼图 */
.rp-flow-bar { transition: opacity 0.2s; cursor: help; }
.rp-flow-bar:hover { opacity: 1 !important; }

.rp-pie-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px;
}
.rp-pie-svg {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.rp-pie-svg circle { transition: stroke-width 0.2s; cursor: help; }
.rp-pie-svg circle:hover { stroke-width: 17; }
.rp-pie-center-num {
  font-size: 18px;
  font-weight: 700;
  fill: var(--ink);
  font-family: inherit;
  font-feature-settings: "tnum" 1;
}
.rp-pie-center-lbl {
  font-size: 9px;
  fill: var(--ink-soft);
  font-family: inherit;
}
.rp-pie-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}
.rp-pie-leg-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-pie-leg-sq {
  width: 9px; height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.rp-pie-leg-name {
  flex: 1;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-pie-leg-val {
  color: var(--ink-soft);
  font-size: 10px;
  font-feature-settings: "tnum" 1;
}
.rp-pie-empty {
  padding: 16px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ========================================================================
 * v4.8.0 · UI 重设计
 *   ① 王者风 3 卡槽（成员 Tab）
 *   ② 时光机时间轴目录（左侧 sidebar）
 *   ③ 极简任务 picker（删 logo + "任务"二字）
 * ====================================================================== */

/* ============ ① 王者风 3 卡槽 ============ */
.hero-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 0 10px;
}
/* v4.8.41: hero-slot 外包一层 wrap 容纳卡片 + 下方快捷按钮（不影响 grid 列宽）*/
.hero-slot-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
/* v4.8.68 Cyber Slash 风：三段斜切梯形拼成一根条 + 永久流光（呼应卡片 cyan 边框） */
/* hover 时该段填充对应色（resend蓝 / reextract绿 / skip橙）+ 内发光，icon 默认灰，hover 出色 */
.hero-quick-actions {
  display: flex;
  height: 28px;
  margin-top: 4px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #0a0d12;
  border: 1px solid #1f2229;
}
.hero-quick-actions::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(94, 234, 212, 0) 30%,
    rgba(94, 234, 212, 0.35) 50%,
    rgba(94, 234, 212, 0) 70%,
    transparent 100%);
  transform: translateX(-100%);
  animation: hqa-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hqa-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-quick-actions::before { animation: none; opacity: 0.18; transform: none; }
}
.hqa-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #9aa0a8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.12s;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  margin-left: -6px;
  font-family: inherit;
  padding: 0;
}
.hqa-btn:first-child { margin-left: 0; clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); }
.hqa-btn:last-child  { clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%); }
.hqa-btn:hover { color: #fff; }
.hqa-btn[data-act="resend"]:hover    { background: rgba(10, 132, 255, 0.4); box-shadow: inset 0 0 16px rgba(10, 132, 255, 0.6); }
.hqa-btn[data-act="reextract"]:hover { background: rgba(52, 199, 89, 0.4);  box-shadow: inset 0 0 16px rgba(52, 199, 89, 0.6); }
.hqa-btn[data-act="skip"]:hover      { background: rgba(255, 159, 10, 0.4); box-shadow: inset 0 0 16px rgba(255, 159, 10, 0.6); }
.hqa-btn:active { transform: scale(0.96); }
.hqa-btn .ai-icn { width: 14px; height: 14px; display: block; position: relative; z-index: 1; }
.hero-slot {
  /* v4.8.17: 0.85 → 0.72 贴合卡牌比例 */
  /* v4.8.19: 0.72 → 0.78 + .hero-slot-logo 改 contain 兜底所有卡牌比例（0.666 ~ 0.881 跨度大）*/
  aspect-ratio: 0.78;
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, rgba(20,20,30,0.96), rgba(15,20,40,0.96));
  border: 1.5px solid rgba(255,215,0,0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 3px rgba(0,0,0,0.2);
}
.hero-slot.empty { border-style: dashed; opacity: 0.7; }
.hero-slot.empty:hover { opacity: 1; transform: translateY(-2px); border-color: rgba(255,215,0,0.55); }

.hero-slot.filled {
  border-color: #5eead4;
  /* v4.8.1: 默认更柔和的边光（比 v4.8.0 弱一半），平时静态不抖 */
  box-shadow:
    0 0 8px rgba(94,234,212,0.20),
    inset 0 0 8px rgba(94,234,212,0.06),
    0 1px 3px rgba(0,0,0,0.25);
}
/* v4.8.1: bounce 进场只在新添加时跑（.just-added），正常渲染时不抖 */
.hero-slot.filled.just-added {
  animation: hero-slot-fill-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes hero-slot-fill-in {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.hero-slot.filled:hover { transform: translateY(-2px) scale(1.02); }

/* v4.8.1: 流光默认隐藏 — 只在添加 (2 圈) 和 hover (1 圈) 时短暂跑 */
.hero-slot.filled .hero-slot-glow {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(94,234,212,0.18) 40%,
    rgba(167,139,250,0.18) 50%,
    transparent 60%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
.hero-slot.filled.just-added .hero-slot-glow {
  animation: hero-slot-shimmer 2.6s ease-in-out 2;
}
.hero-slot.filled:hover .hero-slot-glow {
  animation: hero-slot-shimmer 2.6s ease-in-out 1;
}
@keyframes hero-slot-shimmer {
  0%, 100% { transform: translate(-30%, -30%); opacity: 0; }
  20%, 80% { opacity: 0.7; }
  50% { transform: translate(30%, 30%); opacity: 1; }
}

/* v4.8.20 ① 出战动画：6 颗星芒从槽位中心散开 — 仅 .just-added 时短暂出现 */
.hero-slot-spark {
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff, 0 0 14px rgba(94,234,212,0.6);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}
.hero-slot.just-added .hero-slot-spark {
  animation: hero-slot-spark-out 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s forwards;
}
/* 6 个方向 — 上、右上、右下、下、左下、左上（伞状散开） */
.hero-slot.just-added .hero-slot-spark:nth-child(1) { --sx:   0px; --sy: -32px; }
.hero-slot.just-added .hero-slot-spark:nth-child(2) { --sx:  28px; --sy: -18px; }
.hero-slot.just-added .hero-slot-spark:nth-child(3) { --sx:  28px; --sy:  18px; }
.hero-slot.just-added .hero-slot-spark:nth-child(4) { --sx:   0px; --sy:  32px; }
.hero-slot.just-added .hero-slot-spark:nth-child(5) { --sx: -28px; --sy:  18px; }
.hero-slot.just-added .hero-slot-spark:nth-child(6) { --sx: -28px; --sy: -18px; }
@keyframes hero-slot-spark-out {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx, 0px)), calc(-50% + var(--sy, 0px))) scale(0.3); }
}

/* v4.8.20 ② 发言流光描边：busy 状态卡槽彩虹色边框循环（替代 v4.8.0 单橙呼吸）
   用 box-shadow 多色循环模拟"流光环绕"，比 conic-gradient 实现简单且不需 wrapper */
.hero-slot.filled.status-busy {
  border-color: transparent;
  animation: hero-slot-rainbow 3.2s linear infinite;
}
@keyframes hero-slot-rainbow {
  0%   { box-shadow: 0 0 0 2px #5eead4, 0 0 12px rgba(94,234,212,0.55),  inset 0 0 10px rgba(94,234,212,0.08); }
  25%  { box-shadow: 0 0 0 2px #a78bfa, 0 0 14px rgba(167,139,250,0.55), inset 0 0 10px rgba(167,139,250,0.10); }
  50%  { box-shadow: 0 0 0 2px #fb7185, 0 0 14px rgba(251,113,133,0.55), inset 0 0 10px rgba(251,113,133,0.08); }
  75%  { box-shadow: 0 0 0 2px #fbbf24, 0 0 14px rgba(251,191,36,0.55),  inset 0 0 10px rgba(251,191,36,0.10); }
  100% { box-shadow: 0 0 0 2px #5eead4, 0 0 12px rgba(94,234,212,0.55),  inset 0 0 10px rgba(94,234,212,0.08); }
}
.hero-slot.status-ready { border-color: #34c759; }
.hero-slot.status-error { border-color: #ff3b30; }

/* v4.8.7: 卡牌 logo 充满槽位，覆盖原来 36×36 白底小图模式 */
/* v4.8.19: cover→contain — 卡牌实际比例 0.666 ~ 0.881 跨度大，contain 兜底完整露出（含底部黄虚线 + 边距） */
.hero-slot-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  z-index: 1;
  border-radius: 10px;
  pointer-events: none;
  user-select: none;
}
/* v4.8.7: 卡牌底部添加深色渐变遮罩，让名字 + 状态点可读 */
.hero-slot.filled::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(to top,
    rgba(10,16,36,0.85) 0%,
    rgba(10,16,36,0.55) 55%,
    rgba(10,16,36,0) 100%);
  border-radius: 0 0 10px 10px;
  z-index: 2;
  pointer-events: none;
}
.hero-slot-fb {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: #1a1a2e;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 16px;
  z-index: 3;
  position: relative;
}
.hero-slot-name {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  font-size: 11px;
  color: #f5f7ff;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 3;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 8px rgba(0,0,0,0.5);
}
.hero-slot-status {
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}
.hero-slot-status .rp-status-dot {
  width: 5px; height: 5px;
  display: inline-block;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.hero-slot-status .rp-status-dot.ready { background: #34c759; box-shadow: 0 0 4px #34c759; }
.hero-slot-status .rp-status-dot.busy  { background: #ff9f0a; box-shadow: 0 0 4px #ff9f0a; animation: hero-dot-blink 1.2s ease-in-out infinite; }
.hero-slot-status .rp-status-dot.error { background: #ff3b30; box-shadow: 0 0 4px #ff3b30; }
@keyframes hero-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-slot-check {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a1024;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #16213e;
  z-index: 4;
  box-shadow: 0 1px 3px rgba(94,234,212,0.5);
}
/* v5.2.25: 右上角 × 移除按钮（替代 v4.8.0 的左上 ⋯ 三点菜单） */
.hero-slot-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  border: none;
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.hero-slot:hover .hero-slot-remove { opacity: 1; }
.hero-slot-remove:hover { background: rgba(255,68,68,0.85); color: #fff; }

.hero-slot-plus {
  font-size: 26px;
  color: rgba(255,215,0,0.5);
  font-weight: 200;
  line-height: 1;
}
.hero-slot.empty:hover .hero-slot-plus { color: rgba(255,215,0,0.85); transform: rotate(90deg); transition: all 0.3s; }
.hero-slot-empty-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 6px;
}

/* ============ ② 时光机时间轴目录 ============
   v4.8.24: 整体升级 — 彩虹渐变时间轴 + 渐变圆点 + 卡片化 hover + 霓虹序号 */
.sidebar-list {
  position: relative;
  padding-left: 22px !important;
}
/* 时间轴垂直线 — 青→紫→粉 三色渐变，比单色更生动 */
.sidebar-list::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(94,234,212,0.85) 0%,
    rgba(167,139,250,0.65) 50%,
    rgba(251,113,133,0.30) 100%);
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(94,234,212,0.25);
}
/* 圆点节点 — 默认半透明 + 渐变填充 */
.sidebar-item::before {
  content: "" !important;
  left: -17px !important;
  top: 12px !important;
  bottom: auto !important;
  width: 12px !important;
  height: 12px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(94,234,212,0.6), rgba(167,139,250,0.5)) !important;
  border: 2px solid var(--card) !important;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.4), 0 0 6px rgba(94,234,212,0.3) !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  opacity: 1 !important;
}
.sidebar-item:hover::before {
  background: linear-gradient(135deg, #5eead4, #a78bfa) !important;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.7), 0 0 12px rgba(94,234,212,0.6) !important;
  transform: scale(1.15) !important;
}
.sidebar-item.active::before {
  background: linear-gradient(135deg, #5eead4, #a78bfa, #fb7185) !important;
  box-shadow: 0 0 0 2px rgba(94,234,212,0.4), 0 0 14px rgba(167,139,250,0.7) !important;
  transform: scale(1.2) !important;
}
/* 序号 #1 #2 — 霓虹青色 + 等宽字体 */
.sidebar-item-num {
  color: #5eead4 !important;
  font-weight: 700 !important;
  font-family: "SF Mono", "Consolas", monospace !important;
  letter-spacing: 0.02em;
}
/* 时间戳 — 灰色 monospace，跟序号区分 */
.sidebar-item-time {
  color: var(--ink-soft) !important;
  font-weight: 600 !important;
  font-feature-settings: "tnum" 1;
  font-family: "SF Mono", "Consolas", monospace !important;
  font-size: 11px !important;
}
/* hover 卡片化 — 微圆角背景 + 整条不再水平推动（容易让人觉得晃） */
.sidebar-item {
  border-radius: 8px !important;
  padding: 8px 10px !important;
  transition: background 0.2s, box-shadow 0.2s !important;
}
.sidebar-item:hover {
  background: linear-gradient(135deg, rgba(94,234,212,0.08), rgba(167,139,250,0.04)) !important;
  box-shadow: inset 0 0 0 1px rgba(94,234,212,0.15) !important;
  transform: none !important;
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(94,234,212,0.14), rgba(167,139,250,0.08)) !important;
  box-shadow: inset 0 0 0 1px rgba(94,234,212,0.30) !important;
}
/* 日期分组标签 — 更精致 */
.sidebar-day {
  font-size: 10.5px;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 0 4px 4px;
  position: relative;
}

/* ============ ③ 极简任务 picker（v4.8.23 重写为彩色胶囊，此处微调失效）============
   原 v4.8.0 微调（gap !important + picked font-weight 600）已被 v4.8.23 主体定义覆盖，
   保留空块占位避免后续 grep diff 噪音 — 无实际样式输出 */

/* ============================================================
   v4.8.15 F30: 简洁模式（Mini Bar）
   ============================================================
   触发按钮：橙色高亮 pill，放在 chat-header .chat-actions 区
   折叠态：body[data-mode="mini"]
   - 隐藏顶栏 logo / 消息区 / sidebar / 右栏
   - chat-actions 的按钮组（除 mini-mode 按钮）也隐藏
   - 仅保留 input bar + roster（roster 头像可点击决定下轮发言）
   - .btn-mini-mode 文字由 JS 切成 "⇱ 展开"
============================================================ */
/* v4.8.22 A2: 折叠到顶按钮 — 霓虹外发光
   v4.8.24: 用户反馈"有点太闪亮"，降低光晕强度 + 删 ::before blur aura + 静态化（hover 才发光）*/
.btn-mini-mode {
  background: linear-gradient(135deg, #ff8c42 0%, #ff5e3a 100%);
  color: #fff;
  border: none;
  height: 30px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  margin-right: 8px;
  /* v4.8.24: 大幅降低默认光晕 — 仅 1px 描边 + 浅投影，不再呼吸 */
  box-shadow: 0 0 0 1px rgba(255,140,66,0.25), 0 2px 8px rgba(255,94,58,0.20);
}
.btn-mini-mode:hover {
  transform: translateY(-1px) scale(1.02);
  /* hover 时才出现完整霓虹光晕 */
  box-shadow: 0 0 0 1px rgba(255,140,66,0.55), 0 6px 18px rgba(255,94,58,0.40), 0 0 18px rgba(255,140,66,0.30);
}
.btn-mini-mode:active { transform: translateY(0) scale(0.98); }
/* btn-mini-pulse / btn-mini-aura 已删（v4.8.24 静态化）*/

/* v4.8.41: 简洁模式按钮 — 紧贴折叠到顶，关闭态克制（描边胶囊），开启态渐变实色提示 */
.btn-compact-mode {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  margin-right: 8px;
  transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-compact-mode:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn-compact-mode:active { transform: translateY(0) scale(0.98); }
.btn-compact-mode.active {
  background: linear-gradient(135deg, #5eead4 0%, #34c759 100%);
  color: #0a1024;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.45), 0 4px 12px rgba(52,199,89,0.25);
}
.btn-compact-mode.active:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(94,234,212,0.65), 0 6px 16px rgba(52,199,89,0.35);
}

/* mini 模式 — 全隐藏的区域
   v4.8.57: chat-roster 从隐藏 → 显示（"折叠到顶"新语义：保留 pill 列 + input bar 两行）
   v4.8.58: chat-header 整体隐藏（"展开/简洁"按钮已 DOM-move 到 task-picker 旁边）*/
body[data-mode="mini"] .chat-sidebar,
body[data-mode="mini"] .chat-rightpanel,
body[data-mode="mini"] .chat-messages,
body[data-mode="mini"] .empty-state,
body[data-mode="mini"] .chat-header,
body[data-mode="mini"] .arena-badge {
  display: none !important;
}
/* v4.8.28: mini 模式下 task-menu 改向下弹（窗口上方无空间），
   配合 popup-task-menu.js 在打开时通知 background 撑大窗口让菜单可见 */
body[data-mode="mini"] .task-menu {
  bottom: auto !important;
  top: calc(100% + 6px) !important;
  /* 子菜单仍然 left:100% 横向弹出，不动 */
}
/* v4.8.58: chat-header 整体隐藏后，旧的 chat-title / hdr-mode-toggle / btn-clear / btn-hard-reset
   单独 hide 规则也没意义了，但保留兜底（防 chat-header 因其他原因显示时仍精简） */
body[data-mode="mini"] .chat-title,
body[data-mode="mini"] .chat-actions .hdr-mode-toggle,
body[data-mode="mini"] .chat-actions #btn-clear,
body[data-mode="mini"] .chat-actions #btn-hard-reset {
  display: none !important;
}

/* v4.8.27: mini 模式 — chat-main 原 row flex（单行 bar），
   v4.8.57: 改回 column —— mini 现在是"折叠到顶 = roster pill + input-bar 两行"多行设计
   v4.8.58: chat-header 已隐藏，chat-main 内只剩 chat-roster + chat-input-bar 两行 */
body[data-mode="mini"] .chat-app { height: auto; min-height: 0; }
body[data-mode="mini"] .chat-main {
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: transparent;
}
/* v4.8.58: 按钮 DOM-move 到 input-bar 后用 .in-input-bar 标记 — 改为青绿胶囊 */
.btn-mini-mode.in-input-bar,
.btn-compact-mode.in-input-bar {
  flex-shrink: 0;
  font-size: 11.5px;
  padding: 5px 10px;
  height: 28px;
  border-radius: 14px;
  white-space: nowrap;
}
.btn-mini-mode.in-input-bar {
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a1024;
  border: none;
  box-shadow: 0 0 0 1px rgba(94,234,212,0.35), 0 2px 8px rgba(94,234,212,0.25);
}
.btn-mini-mode.in-input-bar:hover {
  box-shadow: 0 0 0 1px rgba(94,234,212,0.55), 0 6px 18px rgba(94,234,212,0.45);
  transform: translateY(-1px);
}
/* v4.8.57: mini input-bar 恢复正常 row 布局（不再 flex:1 占满，因为现在是 column） */
body[data-mode="mini"] .chat-input-bar {
  padding: 0;
  border-top: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
body[data-mode="mini"] .chat-input-wrap {
  min-width: 0;
}
/* v4.8.57: chat-roster 在 mini 下保持正常 flex 行，但去掉 card 背景让和上下 input/header 视觉融合 */
body[data-mode="mini"] .chat-roster {
  padding: 4px 0;
  background: transparent;
  border-top: none;
}

/* v4.8.30: mini 模式参与者头像横排 — v4.8.57 隐藏（已被 chat-roster pill 取代，避免重复显示 AI 头像）*/
.mini-roster { display: none; }
body[data-mode="mini"] .mini-roster { display: none; }
.mini-ai {
  position: relative;
  width: 28px; height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mini-ai:hover { transform: translateY(-1px) scale(1.06); }
.mini-ai-logo {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: filter 0.25s, opacity 0.25s, box-shadow 0.25s;
}
/* 状态色边框（box-shadow 当外环用，避免 border 占盒模型空间）*/
.mini-ai.status-ready  .mini-ai-logo { box-shadow: 0 0 0 2px #34c759, 0 0 8px rgba(52,199,89,0.45); }
.mini-ai.status-busy   .mini-ai-logo { box-shadow: 0 0 0 2px #ff9f0a, 0 0 10px rgba(255,159,10,0.55); }
.mini-ai.status-error  .mini-ai-logo { box-shadow: 0 0 0 2px #ff3b30, 0 0 8px rgba(255,59,48,0.45); }
.mini-ai.status-idle   .mini-ai-logo { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.18); }
/* 置灰 = 用户点击不发言 — 最高优先级 */
.mini-ai.skipped .mini-ai-logo {
  filter: grayscale(1) brightness(0.55);
  opacity: 0.55;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.10);
}
.mini-ai.skipped:hover .mini-ai-logo {
  filter: grayscale(1) brightness(0.75);
  opacity: 0.75;
}
/* 右下角状态点（叠在头像角落，OS dock-style） */
.mini-ai-dot {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid #0a0a14;
  background: rgba(255,255,255,0.35);
}
.mini-ai-dot.ready  { background: #34c759; }
.mini-ai-dot.busy   { background: #ff9f0a; animation: mini-ai-blink 1.2s ease-in-out infinite; }
.mini-ai-dot.error  { background: #ff3b30; }
.mini-ai-dot.skipped{ background: #6e6e73; }
@keyframes mini-ai-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ============================================================
   v4.8.51: basic 风格（默认基础）— 不打包 webp 卡片，走 brand SVG/PNG 原图
   classic/anime/cat 都是 225×320 webp 满铺卡牌；basic 是透明 brand SVG，
   叠在默认深色 .hero-slot 上会撞色看不清 → 切到白底卡片 + 留 padding
============================================================ */
body[data-logo-style="basic"] .hero-slot {
  background: linear-gradient(135deg, #ffffff, #f5f5f7);
  border-color: #e5e5e7;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.02), 0 1px 3px rgba(0,0,0,0.06);
}
body[data-logo-style="basic"] .hero-slot.filled {
  border-color: #d2d2d7;
}
body[data-logo-style="basic"] .hero-slot.filled.status-ready { border-color: #34c759; }
body[data-logo-style="basic"] .hero-slot.filled.status-busy  { border-color: #ff9f0a; }
body[data-logo-style="basic"] .hero-slot.filled.status-error { border-color: #ff3b30; }
body[data-logo-style="basic"] .hero-slot-logo {
  /* SVG brand 是 1:1 正方形 → 在 225×320 卡里给 padding 让其居中适中 */
  padding: 22% 20% 26% 20%;
  object-position: center;
}
/* basic 卡底部名字遮罩 — 白底场景反相为浅白渐变 */
body[data-logo-style="basic"] .hero-slot.filled::after {
  background: linear-gradient(to top, rgba(245,245,247,0.95) 0%, rgba(245,245,247,0) 100%);
}
body[data-logo-style="basic"] .hero-slot-name {
  color: #1d1d1f;
  text-shadow: none;
}
/* 设置面板 — basic 风格预览图：brand SVG 也需要白底兜底（非 basic 风格无影响）*/
.rp-style-preview[src*="/brands/"] {
  background: #ffffff;
  padding: 6px;
  object-fit: contain;
  border: 1px solid #e5e5e7;
}
/* 聊天气泡头像 — basic 风格下 brand SVG 加白底圆形（避免 dark mode 下黑底 SVG 看不清）*/
body[data-logo-style="basic"] .msg-avatar img {
  background: #ffffff;
  padding: 3px;
}

/* ============================================================
   v4.8.52: .msg.system —— 系统提示气泡（Tab 模式 debugger 警告等）
   居中布局 / 浅橙底（warning）/ 含 ✕ 关闭按钮 / 不渲染头像/时间
============================================================ */
.msg.system {
  display: flex;
  justify-content: center;
  padding: 4px 16px;
  margin: 4px 0;
}
.msg.system .msg-body {
  max-width: 92%;
  width: 100%;
}
.msg-sys-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 159, 10, 0.08);
  border: 1px solid rgba(255, 159, 10, 0.30);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.msg-sys-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #ff9f0a;
}
.msg-sys-text {
  flex: 1;
  min-width: 0;
}
.msg-sys-text strong {
  display: block;
  font-weight: 600;
  color: #ff9f0a;
  margin-bottom: 3px;
  font-size: 12px;
}
.msg-sys-text em {
  font-style: normal;
  background: rgba(255, 159, 10, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
.msg-sys-close {
  flex-shrink: 0;
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.msg-sys-close:hover {
  background: rgba(255, 159, 10, 0.15);
  color: #ff9f0a;
}
/* v4.8.35 决策：不用 prefers-color-scheme；橙色背景半透明叠加 dark/light 主题都自动 OK */

/* ============================================================
   v4.8.62: 新手教程 3 步骤卡（empty-state 下方）
============================================================ */
.es-tutorial {
  position: relative;
  margin: 18px auto 0;
  max-width: 520px;
  width: 100%;
  padding: 14px 22px 14px;        /* v4.8.67: 收紧底部 padding 给翻页栏让位 */
  background: linear-gradient(135deg, rgba(94,234,212,0.08), rgba(167,139,250,0.08));
  border: 1px solid rgba(94,234,212,0.28);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(94,234,212,0.10);
}
/* v4.8.67: 教程头 — 标题 + 进度 "第 N 页 / 共 5 页" */
.es-tutorial-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  padding-right: 24px;            /* 给右上角 ✕ 让位 */
}
.es-tutorial-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-1, #5eead4);
  letter-spacing: 0.04em;
}
.es-tutorial-title::before {
  content: "🎓 ";
  font-size: 14px;
}
.es-tutorial-progress {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.es-tutorial-progress #es-tut-cur {
  color: var(--neon-1, #5eead4);
  font-weight: 700;
}
/* v4.8.67: 单页内容 — 标题 + ol/ul 列表 */
.es-tut-page {
  min-height: 156px;              /* 5 页高度统一，避免翻页时高度跳动 */
}
.es-tut-page[hidden] { display: none; }
.es-tut-page-title {
  font-size: 13px; font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.es-tut-list {
  margin: 0; padding: 0;
  list-style: none;
  display: flex; flex-direction: column;
  gap: 7px;
}
.es-tut-list li {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  padding-left: 14px;
  position: relative;
}
.es-tut-list li::before {
  content: "•";
  position: absolute;
  left: 2px; top: 0;
  color: var(--neon-1, #5eead4);
  font-weight: 700;
}
.es-tut-list strong {
  font-weight: 700;
  color: var(--ink);
  margin-right: 2px;
}
.es-tut-list em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}
.es-tut-list kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  background: rgba(127,127,127,0.15);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 10.5px;
}
/* v4.8.67: 翻页栏 — 左上一页 / 中圆点 / 右下一页 */
.es-tutorial-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(94,234,212,0.14);
  gap: 12px;
}
.es-tut-prev, .es-tut-next {
  background: rgba(127,127,127,0.08);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
  min-width: 78px;
}
.es-tut-prev:hover:not(:disabled),
.es-tut-next:hover:not(:disabled) {
  background: rgba(94,234,212,0.16);
  border-color: rgba(94,234,212,0.4);
  color: var(--neon-1, #5eead4);
}
.es-tut-prev:disabled, .es-tut-next:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.es-tut-dots {
  display: flex; gap: 7px;
  align-items: center;
}
.es-tut-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(127,127,127,0.32);
  cursor: pointer;
  transition: all 0.18s;
}
.es-tut-dot.active {
  width: 18px;
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  border-radius: 999px;
}
.es-tut-dot:hover { background: rgba(94,234,212,0.5); }
.es-tut-dot.active:hover { filter: brightness(1.08); }
.es-tutorial-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  padding: 0;
  border: none; background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  transition: background 0.15s;
}
.es-tutorial-close:hover {
  background: rgba(127,127,127,0.18);
  color: var(--ink);
}
.es-tutorial-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.es-tutorial-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.es-tut-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5eead4, #a78bfa);
  color: #0a1024;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.es-tutorial-steps strong {
  font-weight: 600;
  color: var(--ink);
  margin-right: 2px;
}
.es-tutorial-steps em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}
.es-tutorial-steps kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  background: rgba(127,127,127,0.15);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 10.5px;
  color: var(--ink);
}

/* v4.8.65: 通用 action modal — 跟随插件 data-theme 主题（用 CSS var 不用 prefers-color-scheme）
   v4.8.35 决策：popup.css 禁用 @media prefers-color-scheme，避免家电脑/公司电脑系统色不同导致表现不一致 */
.arena-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8, 10, 16, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.arena-modal-overlay.show { opacity: 1; pointer-events: auto; }
.arena-modal {
  position: relative;
  width: min(420px, 96vw);
  background: var(--card);
  color: var(--ink);
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  text-align: center;
  transform: translateY(8px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, "PingFang SC", system-ui, sans-serif;
}
.arena-modal-overlay.show .arena-modal { transform: translateY(0) scale(1); }
.arena-modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 700;
}
.tone-warning .arena-modal-icon { background: rgba(255, 159, 10, 0.18); color: #ff9f0a; }
.tone-info    .arena-modal-icon { background: rgba(10, 132, 255, 0.18); color: var(--accent); }
.arena-modal-title {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--ink);
}
.arena-modal-message {
  font-size: 13.5px; line-height: 1.55;
  color: var(--ink);
  opacity: 0.85;
  margin-bottom: 10px;
}
.arena-modal-tip {
  font-size: 12px; line-height: 1.5;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: left;
}
.arena-modal-actions {
  display: flex; flex-direction: column-reverse; gap: 8px;
}
.arena-modal-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
}
.arena-modal-btn.primary {
  background: var(--accent);
  color: #fff;
}
.arena-modal-btn.primary:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.arena-modal-btn.primary:active { transform: translateY(0); }
.arena-modal-btn.secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border);
}
.arena-modal-btn.secondary:hover { filter: brightness(0.95); }
.arena-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  border: none; background: transparent;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.arena-modal-close:hover { background: var(--bg); color: var(--ink); }
/* v4.9.0: 敏感信息守门员 modal — 跟 v4.8.65 ChatModal 共用 .arena-modal 基础体系 */
.gatekeeper-modal .arena-modal {
  width: min(480px, 96vw);   /* 比标准 modal 宽一点放命中清单 */
}
.gk-hits {
  margin: 12px 0 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  max-height: 160px;
  overflow-y: auto;
}
.gk-hits-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.gk-hit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.gk-hit-row:last-child { border-bottom: none; }
.gk-hit-cat {
  flex-shrink: 0;
  min-width: 60px;
  padding: 2px 8px;
  background: rgba(255, 159, 10, 0.18);
  color: #ff9f0a;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}
.gk-hit-text {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12.5px;
  color: var(--ink);
  background: rgba(255, 59, 48, 0.10);
  padding: 1px 6px;
  border-radius: 4px;
}

.gk-preview {
  margin-bottom: 16px;
  text-align: left;
}
.gk-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.gk-preview-body {
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.6;
  color: var(--ink);
  max-height: 120px;
  overflow-y: auto;
  word-break: break-all;
}
.gk-mask-tag {
  display: inline;
  background: rgba(52, 199, 89, 0.16);
  color: #34c759;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 11.5px;
  font-weight: 600;
}

/* gk-actions 不同布局：3 按钮横排，主按钮中间 */
.arena-modal-actions.gk-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.arena-modal-actions.gk-actions .arena-modal-btn {
  flex: 1 1 auto;
  min-width: 110px;
}

/* ───────── v5.0.6: 设置 tab「应用」区块 + 新手教程浮动 modal ───────── */
.rp-app-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}
.rp-app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rp-app-row-lbl {
  font-size: 12px;
  color: var(--ink-soft, #6e6e73);
  min-width: 90px;
}
.rp-app-row-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rp-app-btn {
  border: 1px solid var(--border, #d2d2d7);
  background: var(--card, #fff);
  color: var(--ink, #1d1d1f);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rp-app-btn:hover {
  background: var(--accent, #0a84ff);
  color: #fff;
  border-color: var(--accent, #0a84ff);
}
.rp-app-btn.active {
  background: linear-gradient(135deg, #5eead4, #34c759);
  color: #0a1024;
  border-color: transparent;
  font-weight: 700;
}

/* 新手教程 — 浮动 modal 模式（点设置 tab"新手教程"按钮触发） */
.es-tutorial.es-tutorial-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999 !important;
  background: var(--card, #fff);
  border: 1px solid var(--border, #d2d2d7);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  max-width: 560px;
  width: calc(100vw - 60px);
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 24px;
}
