/* ═══ B平台加载动画适配（自动注入）═══ */
.flex.items-center.justify-center.size-6 { opacity: 1 !important; }
.flex.items-center.justify-center.size-6 > .flex.gap-2 { display: none !important; }
.is-assistant.w-fit { width: 100% !important; }
.is-assistant > .border.border-muted:has(.flex.items-center.justify-center.size-6) {
  width: 100% !important; background: transparent !important;
  border: none !important; padding: 0 !important;
}
.is-assistant .space-y-3:has(.flex.items-center.justify-center.size-6) {
  display: flex; justify-content: center; width: 100%;
}

/* ═══ B平台表格修正（自动注入）═══ */
.rili-markdown-renderer table { display:table!important; table-layout:auto!important; width:100%!important; border-collapse:collapse!important; }
.rili-markdown-renderer table caption { display:table-caption!important; caption-side:top!important; text-align:center!important; padding:8px!important; }
.rili-markdown-renderer thead { display:table-header-group!important; }
.rili-markdown-renderer tbody { display:table-row-group!important; }
.rili-markdown-renderer tr { display:table-row!important; }
.rili-markdown-renderer th, .rili-markdown-renderer td { display:table-cell!important; }

/* ═══ B平台按钮组保护（自动注入 — 防止按钮消失）═══
   原理：B平台消息操作按钮结构为：
   .flex.items-center.gap-1.ml-auto (hover显隐包装)
     └── .bg-muted.rounded.flex.p-0.5 (按钮组容器)
           └── button.rounded-full.size-7 (单个按钮)
   以下规则使用高specificity + !important确保按钮
   不被任何转换后/透传的CSS规则意外隐藏
   ═══════════════════════════════════════════════ */
/* 按钮组容器保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5,
.is-user .bg-muted.rounded.flex.p-0\.5,
.is-assistant .bg-muted.rounded.flex.p-0\.5 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
}
/* 单个按钮保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5 > button,
.is-user .bg-muted.rounded.flex.p-0\.5 > button,
.is-assistant .bg-muted.rounded.flex.p-0\.5 > button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  clip: auto !important;
  clip-path: none !important;
}
/* hover显隐包装层保护 — 仅保留B平台原生的opacity过渡 */
.flex.items-center.gap-1.ml-auto.md\:opacity-0.group-hover\:opacity-100 {
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
/* 操作行保护 */
.flex.w-full.items-center.justify-between.gap-2.px-2 {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* ═══ B平台顶部栏适配说明（自动注入）═══
   A: div.sticky > div.flex.justify-between
      ├── 左侧空区
      ├── #ai-model-selector (居中)
      └── 右侧工具(设置按钮等)
   B: <header.flex.justify-between>
      ├── #nav-left (侧边栏开关)
      ├── #nav-middle (可能为空)
      └── #nav-right (通知/主题/语言)
   B平台模型按钮不在header内，选择器:
   button:has(> .flex-1.truncate.text-left)
   ═══════════════════════════════════════ */
header.flex.justify-between { position: relative; overflow: visible; }

/* ═══════════════════════════════════════
   🌸 星咲性学院 · 融合臻选版（完整版）
   治愈暖调 · 高清晰度 · 阅读优先
   默认：樱花暖光
   可选：.theme-starry 深夜星空 · 黑金主题
   ═══════════════════════════════════════ */

/* --- 移除默认颜色条 --- */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
  display: none !important;
}

/* ═══════════════════════════════════════
   ✦ 聊天框（统一 · 输入+输出）
   ═══════════════════════════════════════ */

.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
  background: #fffcf8 !important;
  border: 1px solid rgba(206, 147, 216, 0.15) !important;
  border-radius: 16px !important;
  box-shadow:
    0 2px 20px rgba(180, 140, 160, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.6) inset !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  transition: box-shadow 0.4s ease, border-color 0.4s ease !important;
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

.is-user > .border.border-muted,
.is-assistant > .border.border-muted:hover {
  border-color: rgba(206, 147, 216, 0.25) !important;
  box-shadow:
    0 6px 30px rgba(180, 140, 160, 0.1),
    0 0 10px rgba(244, 143, 177, 0.04) !important;
}

/* --- 聊天框顶部细线 --- */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 5% !important;
  right: 5% !important;
  height: 1px !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(206, 147, 216, 0.2) 30%,
    rgba(244, 143, 177, 0.25) 50%,
    rgba(206, 147, 216, 0.2) 70%,
    transparent 100%) !important;
}

/* --- 聊天框微光背景（极淡） --- */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  pointer-events: none !important;
  z-index: 0 !important;
  opacity: 0.15 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Ccircle cx='45' cy='60' r='1' fill='%23f48fb1'%3E%3Canimate attributeName='opacity' values='0.1;0.5;0.1' dur='4s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='150' cy='30' r='0.6' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.2;0.7;0.2' dur='3s' begin='0.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='250' cy='90' r='0.8' fill='%23ce93d8'%3E%3Canimate attributeName='opacity' values='0.1;0.4;0.1' dur='5s' begin='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='80' cy='180' r='0.5' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.15;0.6;0.15' dur='3.5s' begin='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='200' cy='200' r='0.7' fill='%23f48fb1'%3E%3Canimate attributeName='opacity' values='0.1;0.3;0.1' dur='6s' begin='2s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='120' cy='250' r='0.4' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.2;0.5;0.2' dur='4.5s' begin='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='270' cy='150' r='0.6' fill='%23ce93d8'%3E%3Canimate attributeName='opacity' values='0.1;0.4;0.1' dur='5.5s' begin='2.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
  background-size: 300px 300px !important;
}

/* --- 输入框单独微调 --- */
.is-user > .border.border-muted {
  background: #ffffff !important;
  border-color: rgba(206, 147, 216, 0.2) !important;
}

/* ═══════════════════════════════════════
   ✦ 正文字体分层渲染系统
   ═══════════════════════════════════════ */

.rili-markdown-renderer {
  color: #e0dcd4 !important;
  font-family: 'Noto Serif SC', 'Source Han Serif CN', 'Georgia', serif !important;
  line-height: 1.9 !important;
  letter-spacing: 0.4px !important;
  background: transparent !important;
  position: relative !important;
  z-index: 1 !important;
}

/* --- 叙述/旁白 narr --- */
narr {
  color: #d5cfc6 !important;
  font-size: 14.5px !important;
  line-height: 1.9 !important;
}

/* --- 角色对话 dial --- */
dial {
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.85 !important;
}

/* 不同角色的对话颜色 */
dial[name="白川凛音"],
dial[name="凛音"] {
  color: #7eb8da !important;
}

dial[name="日向暖"],
dial[name="暖"] {
  color: #ffb74d !important;
}

dial[name="九条苍司"],
dial[name="苍司"] {
  color: #b39ddb !important;
}

/* 其他NPC默认对话色 */
dial:not([name="白川凛音"]):not([name="凛音"]):not([name="日向暖"]):not([name="暖"]):not([name="九条苍司"]):not([name="苍司"]) {
  color: #81c784 !important;
}

/* 对话前的角色名标识 - 通过::before伪元素 */
dial::before {
  content: attr(name) !important;
  font-size: 11px !important;
  opacity: 0.5 !important;
  margin-right: 4px !important;
  font-weight: 300 !important;
  letter-spacing: 1px !important;
}

/* --- 心理活动 mind --- */
mind {
  color: #ce93d8 !important;
  font-style: italic !important;
  font-size: 14px !important;
  opacity: 0.9 !important;
}

/* --- 感官描写 sense --- */
sense {
  color: #f6d186 !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  letter-spacing: 0.3px !important;
}

/* --- 环境描写 env --- */
env {
  color: #80cbc4 !important;
  font-size: 14px !important;
  opacity: 0.85 !important;
  letter-spacing: 0.5px !important;
}

/* --- 强调/重要 emp --- */
emp {
  color: #ffd54f !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.15) !important;
}

/* --- 低语/耳语 whisper --- */
whisper {
  color: #b0a8c0 !important;
  font-size: 13px !important;
  font-style: italic !important;
  opacity: 0.7 !important;
  letter-spacing: 1px !important;
}
/* ═══════════════════════════════════════
   ✦ 状态栏美化（樱花暖光）
   ═══════════════════════════════════════ */

/* --- 顶部信息栏 header --- */
header {
  display: block !important;
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #e8eaf6 100%) !important;
  border: 1px solid rgba(206, 147, 216, 0.3) !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  margin-bottom: 8px !important;
  font-size: 13px !important;
  color: #3a2a2a !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 2px 12px rgba(206, 147, 216, 0.15), inset 0 1px 0 rgba(255,255,255,0.6) !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
}

header::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, transparent, #ce93d8, #f48fb1, #ce93d8, transparent) !important;
}

/* --- 今日课程 today --- */
today {
  display: block !important;
  background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%) !important;
  border: 1px solid rgba(255, 183, 77, 0.3) !important;
  border-left: 3px solid #ffb74d !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  margin-bottom: 10px !important;
  font-size: 12.5px !important;
  color: #3a2a2a !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 1px 6px rgba(255, 183, 77, 0.12) !important;
}

/* --- 正文容器 text --- */
text {
  display: block !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(253,242,248,0.9) 100%) !important;
  border: 1px solid rgba(244, 143, 177, 0.2) !important;
  border-radius: 14px !important;
  padding: 20px 22px !important;
  margin: 10px 0 !important;
  line-height: 1.9 !important;
  font-size: 14.5px !important;
  color: #2c2c2c !important;
  box-shadow: 0 4px 20px rgba(206, 147, 216, 0.08), 0 1px 3px rgba(0,0,0,0.04) !important;
  position: relative !important;
  overflow: hidden !important;
}

text::before {
  content: '🌸' !important;
  position: absolute !important;
  top: 8px !important;
  right: 12px !important;
  font-size: 16px !important;
  opacity: 0.2 !important;
}

text p {
  margin: 0 0 12px 0 !important;
  text-indent: 2em !important;
}

text p:last-child {
  margin-bottom: 0 !important;
}

/* --- 折叠面板 details/summary --- */
details {
  background: linear-gradient(135deg, rgba(248, 237, 253, 0.95) 0%, rgba(237, 247, 255, 0.95) 100%) !important;
  border: 1px solid rgba(186, 147, 216, 0.25) !important;
  border-radius: 12px !important;
  margin: 6px 0 !important;
  overflow: hidden !important;
  box-shadow: 0 2px 10px rgba(156, 117, 186, 0.08) !important;
  transition: all 0.3s ease !important;
}

details:hover {
  box-shadow: 0 4px 16px rgba(156, 117, 186, 0.15) !important;
  border-color: rgba(186, 147, 216, 0.4) !important;
}

details[open] {
  background: linear-gradient(135deg, rgba(255, 245, 252, 0.98) 0%, rgba(245, 240, 255, 0.98) 100%) !important;
}

details summary {
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: bold !important;
  color: #5a2a7a !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, rgba(206, 147, 216, 0.12) 0%, rgba(144, 202, 249, 0.08) 100%) !important;
  border-bottom: 1px solid rgba(186, 147, 216, 0.15) !important;
  transition: all 0.2s ease !important;
  list-style: none !important;
  position: relative !important;
}

details summary::-webkit-details-marker {
  display: none !important;
}

details summary::before {
  content: '▸' !important;
  margin-right: 8px !important;
  transition: transform 0.2s ease !important;
  display: inline-block !important;
}

details[open] summary::before {
  transform: rotate(90deg) !important;
}

details summary:hover {
  background: linear-gradient(135deg, rgba(206, 147, 216, 0.2) 0%, rgba(144, 202, 249, 0.15) 100%) !important;
}

details > :not(summary) {
  padding: 0 16px !important;
  color: #3a2a2a !important;
}

details code {
  background: rgba(206, 147, 216, 0.1) !important;
  color: #7b1fa2 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
}

details strong {
  color: #ad1457 !important;
}

details hr {
  border: none !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(206, 147, 216, 0.3), transparent) !important;
  margin: 8px 0 !important;
}

/* ═══════════════════════════════════════
   ✦ 底部元素（按钮/模型名/token）
   ═══════════════════════════════════════ */

.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
  color: rgba(123, 31, 162, 0.6) !important;
  border-radius: 6px !important;
  transition: all 0.3s ease !important;
}

.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
  color: #7b1fa2 !important;
  background: rgba(206, 147, 216, 0.08) !important;
}

.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
  color: rgba(90, 70, 70, 0.6) !important;
  font-size: 11px !important;
}

/* [Token消耗hover逻辑转换未启用]
.text-orange-500 {
  color: rgba(156, 117, 186, 0.7) !important;
  font-size: 11px !important;
}
*/

/* ═══════════════════════════════════════
   ✦ 加载动画：粉色脉冲
   ═══════════════════════════════════════ */

.flex.items-center.justify-center.size-6 > .flex.gap-2 {
  display: none !important;
}

.flex.items-center.justify-center.size-6 {
  position: relative !important;
  min-height: 28px !important;
}

.flex.items-center.justify-center.size-6::before {
  content: '' !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 16px !important;
  height: 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='%23f48fb1'%3E%3Canimate attributeName='r' values='2;5;2' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='opacity' values='0.8;0.2;0.8' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

.flex.items-center.justify-center.size-6::after {
  content: '' !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 28px !important;
  height: 28px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12' fill='none' stroke='%23f48fb1' stroke-width='0.8' stroke-dasharray='8 16' opacity='0.4'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 14 14' to='360 14 14' dur='4s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

/* ═══════════════════════════════════════
   ✦ 顶部栏
   ═══════════════════════════════════════ */

header.flex.justify-between {
  background: linear-gradient(135deg,
    rgba(255, 248, 252, 0.96) 0%,
    rgba(248, 237, 253, 0.95) 100%) !important;
  border-bottom: 1px solid rgba(206, 147, 216, 0.15) !important;
  box-shadow: 0 2px 20px rgba(206, 147, 216, 0.1) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

#nav-middle button:has(> .flex-1.truncate.text-left) .flex-1.truncate.text-left {
  color: #5a2a7a !important;
  font-weight: 600 !important;
}

#nav-middle .shrink-0.flex.items-center svg {
  color: rgba(156, 117, 186, 0.5) !important;
}

#nav-right button {
  color: rgba(156, 117, 186, 0.5) !important;
  transition: color 0.3s ease !important;
}

#nav-right button:hover {
  color: #7b1fa2 !important;
}

#nav-right button svg {
  color: inherit !important;
}

header.flex.justify-between.w-full.top-0 svg.lucide-clock-8 {
  color: rgba(156, 117, 186, 0.5) !important;
}

/* ═══════════════════════════════════════
   ✦ 底部输入栏
   ═══════════════════════════════════════ */

.bg-gradient-to-t {
  background: linear-gradient(to top,
    rgba(255, 248, 252, 0.98) 0%,
    rgba(255, 248, 252, 0.7) 60%,
    transparent 100%) !important;
}

#ai-chat-bottom-input {
  background: rgba(255, 248, 252, 0.9) !important;
  border: 1px solid rgba(206, 147, 216, 0.15) !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 20px rgba(206, 147, 216, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
  transition: all 0.3s ease !important;
}

#ai-chat-bottom-input:focus-within {
  border-color: rgba(206, 147, 216, 0.3) !important;
  box-shadow: 0 4px 30px rgba(206, 147, 216, 0.12), 0 0 15px rgba(244, 143, 177, 0.05) !important;
}

#ai-chat-input {
  color: #2c2c2c !important;
  font-family: 'Noto Serif SC', 'Source Han Serif CN', serif !important;
}

#ai-chat-input::placeholder {
  color: rgba(156, 117, 186, 0.3) !important;
}

#ai-chat-input::selection {
  background: rgba(206, 147, 216, 0.2) !important;
  color: #4a148c !important;
}

/* ═══════════════════════════════════════
   ✦ 按钮栏
   ═══════════════════════════════════════ */

#ai-mod-button2 button.MuiButton-root {
  background: rgba(248, 237, 253, 0.8) !important;
  border: 1px solid rgba(206, 147, 216, 0.15) !important;
  border-radius: 10px !important;
  color: rgba(123, 31, 162, 0.6) !important;
  font-size: 12px !important;
  transition: all 0.3s ease !important;
}

#ai-mod-button2 button.MuiButton-root:hover {
  background: rgba(243, 229, 252, 0.9) !important;
  border-color: rgba(206, 147, 216, 0.3) !important;
  color: #7b1fa2 !important;
}

#ai-mod-button2 button.MuiButton-root svg {
  color: inherit !important;
}

/* ═══════════════════════════════════════
   ✦ 开场白选择器
   ═══════════════════════════════════════ */

div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
  background: rgba(255, 248, 252, 0.9) !important;
  border: 1px solid rgba(206, 147, 216, 0.15) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
}

div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"]:hover {
  border-color: rgba(206, 147, 216, 0.3) !important;
}

div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="SlidersH"],
div.flex.items-center.h-9.cursor-pointer.group svgbutton:has(> .flex-1.truncate.text-left) svg {
  color: rgba(156, 117, 186, 0.4) !important;
}

/* ═══════════════════════════════════════
   ✦ 分页栏
   ═══════════════════════════════════════ */

.MuiPaginationItem-root {
  color: rgba(123, 31, 162, 0.5) !important;
  border-color: rgba(206, 147, 216, 0.15) !important;
  transition: all 0.3s ease !important;
}

.MuiPaginationItem-root.Mui-selected {
  background: linear-gradient(135deg, rgba(206, 147, 216, 0.2), rgba(244, 143, 177, 0.2)) !important;
  color: #7b1fa2 !important;
  border-color: rgba(206, 147, 216, 0.35) !important;
}

.MuiPaginationItem-root:hover:not(.Mui-selected) {
  background: rgba(206, 147, 216, 0.06) !important;
  border-color: rgba(206, 147, 216, 0.25) !important;
}

.MuiPaginationItem-root.Mui-disabled {
  color: rgba(206, 147, 216, 0.2) !important;
}

.MuiPaginationItem-icon {
  color: rgba(156, 117, 186, 0.4) !important;
}

.flex.w-full.items-center.justify-between.gap-2.px-2.css-1uwir8f .MuiBox-root {
  color: rgba(90, 70, 70, 0.5) !important;
}

.MuiInputBase-input {
  color: #5a2a7a !important;
  border-color: rgba(206, 147, 216, 0.2) !important;
}

/* ═══════════════════════════════════════
   ✦ 评论区
   ═══════════════════════════════════════ */

div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
  background: linear-gradient(180deg,
    rgba(255, 248, 252, 0.97) 0%,
    rgba(248, 237, 253, 0.98) 100%) !important;
}

div.text-lg.font-bold {
  color: #5a2a7a !important;
}

p.MuiTypography-body1.text-grey-600 {
  color: rgba(90, 70, 70, 0.6) !important;
}

span.MuiRating-iconEmpty svg {
  color: rgba(206, 147, 216, 0.2) !important;
}

span.MuiRating-iconFilled svg {
  color: #f48fb1 !important;
}

/* [Token消耗hover逻辑转换未启用]
span.text-orange-500 {
  color: #7b1fa2 !important;
}
*/

div.flex.flex-col.border-gray-200 {
  border-color: rgba(206, 147, 216, 0.12) !important;
}

textarea.rc-textarea {
  background: rgba(248, 237, 253, 0.8) !important;
  color: #2c2c2c !important;
  border: 1px solid rgba(206, 147, 216, 0.15) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
}

textarea.rc-textarea:focus {
  border-color: rgba(206, 147, 216, 0.3) !important;
  box-shadow: 0 0 0 3px rgba(206, 147, 216, 0.06) !important;
}

div.bg-gray-100.text-gray-500 {
  background: rgba(248, 237, 253, 0.5) !important;
  color: rgba(90, 70, 70, 0.4) !important;
}

div.cursor-pointer.group.flex.items-center.justify-center {
  color: rgba(156, 117, 186, 0.5) !important;
  transition: color 0.3s ease !important;
}

div.cursor-pointer.group.flex.items-center.justify-center:hover {
  color: #7b1fa2 !important;
}

div[data-state="closed"] svg[data-icon="Send03"] {
  color: inherit !important;
}

div.style_divider__mW0YX {
  background: linear-gradient(90deg, transparent, rgba(206, 147, 216, 0.15), transparent) !important;
}

button.MuiButton-containedPrimary {
  background: linear-gradient(135deg, rgba(206, 147, 216, 0.2), rgba(244, 143, 177, 0.2)) !important;
  color: #7b1fa2 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(206, 147, 216, 0.25) !important;
}

button.MuiButton-outlinedPrimary {
  color: rgba(123, 31, 162, 0.5) !important;
  border-color: rgba(206, 147, 216, 0.2) !important;
  border-radius: 8px !important;
}

button.MuiButton-outlinedPrimary:hover {
  background: rgba(206, 147, 216, 0.06) !important;
  border-color: rgba(206, 147, 216, 0.3) !important;
}

div.group img.rounded-full {
  border: 1.5px solid rgba(206, 147, 216, 0.25) !important;
}

div.text-sm.text-grey-600 span.font-bold {
  color: #3a2a2a !important;
}

span.text-\[10px\] {
  color: rgba(156, 117, 186, 0.5) !important;
}

div.break-all {
  color: #2c2c2c !important;
  line-height: 1.7 !important;
}

div.text-xs.text-grey-600 {
  color: rgba(90, 70, 70, 0.4) !important;
}

button.text-gray-400 {
  color: rgba(156, 117, 186, 0.3) !important;
  transition: color 0.2s ease !important;
}

button.text-gray-400:hover {
  color: #7b1fa2 !important;
}

button.text-gray-400 svg {
  color: inherit !important;
}

span.cursor-pointer {
  color: rgba(90, 70, 70, 0.5) !important;
  transition: color 0.2s ease !important;
}

span.cursor-pointer:hover {
  color: #7b1fa2 !important;
}

div.ml-8.border-l {
  border-color: rgba(206, 147, 216, 0.1) !important;
}

div.p-3.overflow-y-auto {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(206, 147, 216, 0.2) transparent !important;
}

/* ═══════════════════════════════════════
   ✦ 移动端适配
   ═══════════════════════════════════════ */

@media (max-width: 480px) {
  .is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    border-radius: 12px !important;
  }

  text {
    padding: 14px 16px !important;
    border-radius: 10px !important;
  }

  narr, sense {
    font-size: 14px !important;
  }

  dial {
    font-size: 14.5px !important;
  }

  mind, env {
    font-size: 13.5px !important;
  }

  whisper {
    font-size: 12.5px !important;
  }

  header {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }

  details summary {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
}

/* ═══════════════════════════════════════
   ✦ 低动效模式
   ═══════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .is-user > .border.border-muted,
.is-assistant > .border.border-muted::before {
    opacity: 0.05 !important;
  }

  .is-user > .border.border-muted,
.is-assistant > .border.border-muted,
  details,
  #ai-chat-bottom-input,
  #ai-mod-button2 button.MuiButton-root {
    transition: none !important;
  }
}

/* ═══════════════════════════════════════
   ✦ 深夜星空 · 黑金主题（可选主题）
   使用时在 body 或容器上添加 class="theme-starry"
   ═══════════════════════════════════════ */

.theme-starry .is-user > .border.border-muted,
.is-assistant > .border.border-muted {
  background: linear-gradient(160deg,
    rgba(15, 15, 25, 0.94) 0%,
    rgba(22, 20, 35, 0.92) 40%,
    rgba(18, 18, 30, 0.93) 70%,
    rgba(12, 12, 22, 0.95) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.15) !important;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(212, 175, 55, 0.06) inset !important;
}

.theme-starry .is-user > .border.border-muted,
.is-assistant > .border.border-muted:hover {
  border-color: rgba(212, 175, 55, 0.25) !important;
  box-shadow:
    0 6px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(212, 175, 55, 0.04) !important;
}

.theme-starry .is-user > .border.border-muted,
.is-assistant > .border.border-muted::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.4) 30%,
    rgba(255, 215, 100, 0.6) 50%,
    rgba(212, 175, 55, 0.4) 70%,
    transparent 100%) !important;
}

.theme-starry .is-user > .border.border-muted,
.is-assistant > .border.border-muted::before {
  opacity: 0.4 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Ccircle cx='45' cy='60' r='1' fill='%23d4af37'%3E%3Canimate attributeName='opacity' values='0.1;0.7;0.1' dur='4s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='150' cy='30' r='0.6' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.2;0.9;0.2' dur='3s' begin='0.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='250' cy='90' r='0.8' fill='%23d4af37'%3E%3Canimate attributeName='opacity' values='0.1;0.6;0.1' dur='5s' begin='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='80' cy='180' r='0.5' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.15;0.8;0.15' dur='3.5s' begin='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='200' cy='200' r='0.7' fill='%23d4af37'%3E%3Canimate attributeName='opacity' values='0.1;0.5;0.1' dur='6s' begin='2s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='120' cy='250' r='0.4' fill='%23fffde7'%3E%3Canimate attributeName='opacity' values='0.2;0.7;0.2' dur='4.5s' begin='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='270' cy='150' r='0.6' fill='%23d4af37'%3E%3Canimate attributeName='opacity' values='0.1;0.6;0.1' dur='5.5s' begin='2.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
}

.theme-starry .is-user > .border.border-muted {
  background: linear-gradient(160deg,
    rgba(20, 18, 32, 0.92) 0%,
    rgba(25, 22, 40, 0.90) 100%) !important;
  border-color: rgba(120, 100, 180, 0.2) !important;
}

/* 深夜星空正文颜色覆盖 */
.theme-starry .rili-markdown-renderer {
  color: #e0dcd4 !important;
}

.theme-starry narr {
  color: #d5cfc6 !important;
}

.theme-starry dial[name="白川凛音"],
.theme-starry dial[name="凛音"] {
  color: #7eb8da !important;
}

.theme-starry dial[name="日向暖"],
.theme-starry dial[name="暖"] {
  color: #ffb74d !important;
}

.theme-starry dial[name="九条苍司"],
.theme-starry dial[name="苍司"] {
  color: #b39ddb !important;
}

.theme-starry dial:not([name="白川凛音"]):not([name="凛音"]):not([name="日向暖"]):not([name="暖"]):not([name="九条苍司"]):not([name="苍司"]) {
  color: #81c784 !important;
}

.theme-starry mind {
  color: #ce93d8 !important;
}

.theme-starry sense {
  color: #f6d186 !important;
}

.theme-starry env {
  color: #80cbc4 !important;
}

.theme-starry emp {
  color: #ffd54f !important;
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.15) !important;
}

.theme-starry whisper {
  color: #b0a8c0 !important;
}

/* 深夜星空状态栏 */
.theme-starry header {
  background: linear-gradient(135deg, rgba(30, 27, 45, 0.9) 0%, rgba(20, 18, 32, 0.95) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.15) !important;
  border-left: 3px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 10px !important;
  color: #c5b88a !important;
  box-shadow: none !important;
}

.theme-starry header::before {
  background: none !important;
}

.theme-starry today {
  background: rgba(25, 22, 40, 0.85) !important;
  border: 1px solid rgba(255, 183, 77, 0.15) !important;
  border-left: 3px solid rgba(255, 183, 77, 0.35) !important;
  color: #d4a056 !important;
  box-shadow: none !important;
}

.theme-starry text {
  background: rgba(18, 16, 28, 0.5) !important;
  border: 1px solid rgba(212, 175, 55, 0.08) !important;
  border-radius: 12px !important;
  color: #e0dcd4 !important;
  box-shadow: none !important;
}

.theme-starry text::before {
  content: '✦' !important;
  color: rgba(212, 175, 55, 0.4) !important;
  opacity: 1 !important;
}

.theme-starry details {
  background: linear-gradient(135deg, rgba(25, 22, 40, 0.9) 0%, rgba(18, 16, 30, 0.92) 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.1) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.theme-starry details:hover {
  border-color: rgba(212, 175, 55, 0.2) !important;
  box-shadow: none !important;
}

.theme-starry details[open] {
  background: linear-gradient(135deg, rgba(28, 25, 45, 0.95) 0%, rgba(20, 18, 35, 0.95) 100%) !important;
}

.theme-starry details summary {
  color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.05) !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08) !important;
}

.theme-starry details summary::before {
  content: '◆' !important;
  color: rgba(212, 175, 55, 0.5) !important;
}

.theme-starry details summary:hover {
  background: rgba(212, 175, 55, 0.08) !important;
}

.theme-starry details > :not(summary) {
  color: #b8b0a0 !important;
}

.theme-starry details strong {
  color: #d4af37 !important;
}

.theme-starry details hr {
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.15), transparent) !important;
}

.theme-starry details code {
  background: rgba(212, 175, 55, 0.08) !important;
  color: #d4af37 !important;
}

/* 深夜星空顶部栏 */
.theme-starry header.flex.justify-between {
  background: linear-gradient(135deg,
    rgba(15, 13, 25, 0.96) 0%,
    rgba(22, 20, 35, 0.95) 100%) !important;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4) !important;
}

.theme-starry #nav-middle button:has(> .flex-1.truncate.text-left) .flex-1.truncate.text-left {
  color: #d4af37 !important;
}

.theme-starry #nav-middle .shrink-0.flex.items-center svg {
  color: rgba(212, 175, 55, 0.5) !important;
}

.theme-starry #nav-right button {
  color: rgba(212, 175, 55, 0.5) !important;
}

.theme-starry #nav-right button:hover {
  color: #d4af37 !important;
}

.theme-starry header.flex.justify-between.w-full.top-0 svg.lucide-clock-8 {
  color: rgba(212, 175, 55, 0.5) !important;
}

/* 深夜星空底部输入栏 */
.theme-starry .bg-gradient-to-t {
  background: linear-gradient(to top,
    rgba(12, 10, 20, 0.98) 0%,
    rgba(12, 10, 20, 0.7) 60%,
    transparent 100%) !important;
}

.theme-starry #ai-chat-bottom-input {
  background: rgba(22, 20, 35, 0.9) !important;
  border: 1px solid rgba(212, 175, 55, 0.12) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(212, 175, 55, 0.04) !important;
}

.theme-starry #ai-chat-bottom-input:focus-within {
  border-color: rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.03) !important;
}

.theme-starry #ai-chat-input {
  color: #d5cfc6 !important;
}

.theme-starry #ai-chat-input::placeholder {
  color: rgba(212, 175, 55, 0.25) !important;
}

.theme-starry #ai-chat-input::selection {
  background: rgba(212, 175, 55, 0.2) !important;
  color: #fffde7 !important;
}

/* 深夜星空按钮栏 */
.theme-starry #ai-mod-button2 button.MuiButton-root {
  background: rgba(25, 22, 40, 0.8) !important;
  border: 1px solid rgba(212, 175, 55, 0.1) !important;
  color: rgba(212, 175, 55, 0.6) !important;
}

.theme-starry #ai-mod-button2 button.MuiButton-root:hover {
  background: rgba(30, 27, 48, 0.9) !important;
  border-color: rgba(212, 175, 55, 0.25) !important;
  color: #d4af37 !important;
}

/* 深夜星空评论区及杂项（继承原暗色完整覆盖） */
.theme-starry .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
  color: rgba(212, 175, 55, 0.5) !important;
}

.theme-starry .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
  color: #d4af37 !important;
  background: rgba(212, 175, 55, 0.06) !important;
}

.theme-starry .flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
  color: rgba(180, 160, 120, 0.5) !important;
}

/* [Token消耗hover逻辑转换未启用]
.theme-starry .text-orange-500 {
  color: rgba(212, 175, 55, 0.6) !important;
}
*/

/* 深夜星空加载动画 */
.theme-starry .flex.items-center.justify-center.size-6::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='%23d4af37'%3E%3Canimate attributeName='r' values='2;5;2' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='opacity' values='0.8;0.2;0.8' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
}

.theme-starry .flex.items-center.justify-center.size-6::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='12' fill='none' stroke='%23d4af37' stroke-width='0.8' stroke-dasharray='8 16' opacity='0.4'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 14 14' to='360 14 14' dur='4s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
}

/* 低动效模式 - 深夜星空 */
@media (prefers-reduced-motion: reduce) {
  .theme-starry .is-user > .border.border-muted,
.is-assistant > .border.border-muted::before {
    opacity: 0.15 !important;
  }
}