/* ═══ 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; }

/* ============================================================
   1. 基础聊天框与全局暗金适配
   ============================================================ */
[class*="bg-[#F1CBCB]"], [class*="bg-[#c9e1e9]"] { display: none !important; }
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    background: linear-gradient(145deg, #1a1a1a 0%, #2a2419 100%) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    padding: 14px 6px !important;
}
.rili-markdown-renderer {
    color: #d8d8d8 !important;
    font-family: "Segoe UI", "PingFang SC", sans-serif !important;
}
/* ============================================================
   2. 状态栏 (Details/Summary)
   ============================================================ */
.rili-markdown-renderer details {
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border-radius: 8px !important;
    margin: 10px 0 !important;
    padding: 2px !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
}
.rili-markdown-renderer details[open] {
    border: 1px solid rgba(212, 175, 55, 0.5) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1) !important;
}
.rili-markdown-renderer summary {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%) !important;
    color: #d4af37 !important;  /* 标题保留暗金 */
    font-weight: bold !important;
    padding: 10px 14px !important;
    cursor: pointer !important;
    list-style: none !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
}
.rili-markdown-renderer summary::before {
    content: "◈";
    margin-right: 8px !important;
    font-size: 12px !important;
    transition: transform 0.3s !important;
}
.rili-markdown-renderer details[open] summary::before {
    transform: rotate(90deg) !important;
    color: #fff !important;
}
.rili-markdown-renderer summary:hover {
    background: rgba(212, 175, 55, 0.25) !important;
    color: #e6c65c !important;
}
/* ============================================================
   3. 状态栏内容：正文改中性浅灰，不再整块金色
   ============================================================ */
.rili-markdown-renderer pre {
    background: rgba(15, 15, 15, 0.55) !important;
    border-left: 3px solid rgba(212, 175, 55, 0.6) !important;  /* 金色只留左侧竖条 */
    color: #d4d4d4 !important;  /* 主文字：中性浅灰 */
    padding: 12px !important;
    margin: 8px !important;
    border-radius: 4px !important;
    font-family: "Cascadia Code", Consolas, monospace !important;
    font-size: 0.85em !important;
    white-space: pre-wrap !important;
    line-height: 1.6 !important;
}
/* 行动指引块：琥珀高亮但降饱和，更耐看 */
.rili-markdown-renderer code {
    background: rgba(212, 175, 55, 0.08) !important;
    color: #e8b964 !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
}
/* 女神名册表格 */
.goddess-table-wrapper {
    overflow-x: auto !important;
    margin: 8px !important;
}
.goddess-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.8em !important;
    background: #1a1a1a !important;
}
.goddess-table th {
    background: rgba(212, 175, 55, 0.15) !important;  /* 表头柔金底 + 金字，比实心金更耐看 */
    color: #d4af37 !important;
    padding: 8px !important;
    text-align: left !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}
.goddess-table td {
    padding: 8px !important;
    border: 1px solid rgba(212, 175, 55, 0.15) !important;
    color: #d0cfc9 !important;
}
.goddess-table tr:nth-child(even) {
    background: rgba(212, 175, 55, 0.04) !important;
}
/* ============================================================
   4. 底部按钮与加载动画
   ============================================================ */
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #b8952e !important;
}
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground,
/* [Token消耗hover逻辑转换未启用]
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground,
.text-orange-500 {
    color: #a68a44 !important;
}
*/
.style-module__AtdJSq__dot-flashing.style-module__AtdJSq__text { display: none !important; }
.flex.items-center.justify-center.size-6 {
    position: relative !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='4' cy='12' r='2' fill='%23d4af37'%3E%3Canimate attributeName='r' dur='0.8s' values='2;4;2' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='2' fill='%23d4af37'%3E%3Canimate attributeName='r' dur='0.8s' values='2;4;2' repeatCount='indefinite' begin='0.2s'/%3E%3C/circle%3E%3Ccircle cx='20' cy='12' r='2' fill='%23d4af37'%3E%3Canimate attributeName='r' dur='0.8s' values='2;4;2' repeatCount='indefinite' begin='0.4s'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}
@media (max-width: 480px) {
    .rili-markdown-renderer pre { font-size: 0.75em !important; padding: 8px !important; }
    .rili-markdown-renderer summary { font-size: 0.9em !important; }
}
/* --- 顶部栏美化 --- */
header.flex.justify-between {
    background-color: rgba(18, 18, 31, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(191, 90, 242, 0.25) !important;
}

/* 模型名称金紫渐变 */
#nav-middle button:has(> .flex-1.truncate.text-left) .flex-1.truncate.text-left {
    background: linear-gradient(90deg, #d4af37, #bf5af2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
    font-family: "Inter", sans-serif !important;
}

/* 顶部图标颜色适配 */
header.flex.justify-between.w-full.top-0 svg {
    color: #bf5af2 !important;
}

/* --- 底部输入栏 --- */
#ai-chat-bottom-input {
    background: transparent !important;
}

#ai-chat-input {
    background-color: #16161f !important;
    border: 1px solid rgba(191, 90, 242, 0.35) !important;
    color: #e0e0e0 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

#ai-chat-input:focus {
    border-color: #bf5af2 !important;
    box-shadow: 0 0 12px rgba(191, 90, 242, 0.35) !important;
}

#ai-chat-input::placeholder {
    color: #6b6b8a !important;
}

/* --- 按钮美化 --- */

/* Mod 按钮：金色实底 */
#ai-mod-button2 button.MuiButton-root {
    background-color: #d4af37 !important;
    color: #000000 !important;
    font-weight: bold !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

#ai-mod-button2 button.MuiButton-root:hover {
    background-color: #f1c40f !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6) !important;
    transform: translateY(-1px);
}

/* 呼吸动画定义 */
@keyframes pulse-generating {
    0% { background-color: #bf5af2; box-shadow: 0 0 5px rgba(191, 90, 242, 0.5); }
    50% { background-color: #ff2d55; box-shadow: 0 0 15px rgba(255, 45, 85, 0.7); }
    100% { background-color: #bf5af2; box-shadow: 0 0 5px rgba(191, 90, 242, 0.5); }
}

/* 正在生成中的按钮状态 (识别停止图标) */
button.MuiButton-root:has(svg.lucide-stop-circle),
button.MuiButton-root:has(svg[data-icon="stop"]) {
    animation: pulse-generating 2s infinite !important;
    color: white !important;
}

/* 次要按钮 (Roll/重试等) */
button.MuiButton-outlinedPrimary {
    background-color: transparent !important;
    border: 1px solid #bf5af2 !important;
    color: #bf5af2 !important;
}

/* --- 页码美化 --- */
.MuiPaginationItem-root {
    color: #5a5a78 !important;
    transition: all 0.2s !important;
}

.MuiPaginationItem-root.Mui-selected {
    color: #d4af37 !important;
    background-color: transparent !important;
    border-bottom: 2px solid #bf5af2 !important;
    border-radius: 0 !important;
    font-weight: bold !important;
}

.MuiPaginationItem-root:hover {
    color: #bf5af2 !important;
    background-color: rgba(191, 90, 242, 0.1) !important;
}

/* --- 评论区美化 --- */
/* 评论区主背景强制覆盖 */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background-color: #0d0d14 !important;
    color: #d1d1d1 !important;
}

/* 评论项卡片化 */
div.group.ml-0 {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(191, 90, 242, 0.15) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    transition: border 0.3s ease !important;
}

div.group.ml-0:hover {
    border-color: rgba(191, 90, 242, 0.35) !important;
}

/* 用户名与时间戳 */
div.text-sm.text-grey-600 span.font-bold {
    color: #d4af37 !important;
}

div.text-xs.text-grey-600 {
    color: #5a5a78 !important;
}

/* 评分星星颜色 */
span.MuiRating-iconFilled svg {
    color: #d4af37 !important;
}

/* 评论输入框适配 */
textarea.rc-textarea {
    background-color: #16161f !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(191, 90, 242, 0.2) !important;
}

/* 置顶或点赞较多的评论高亮 */
div.group.ml-0:has(button.text-blue-500), 
div.group.ml-0:has(.lucide-arrow-up-circle) {
    background-color: rgba(191, 90, 242, 0.08) !important;
    border: 1px solid rgba(191, 90, 242, 0.4) !important;
}

/* 分割线 */
div.style_divider__mW0YX {
    background-color: rgba(191, 90, 242, 0.1) !important;
}