/* ═══ 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平台按钮组保护（自动注入 — 防止按钮消失）═══ */
.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;
}
.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平台顶部栏适配说明（自动注入）═══ */
header.flex.justify-between { position: relative; overflow: visible; }

/* =============================================
   都市余烬
   base-hue:230  base-sat:25%  is-dark:1  accent-hue:38  accent-sat:50%

   bg-deep:#0a0b0f   bg-default:#11131a   bg-paper:rgba(17, 19, 26, 0.65)   bg-raised:rgba(17, 19, 26, 0.8)
   bg-hover:rgba(255, 255, 255, 0.03)  text-main:#f2f0e9    text-sub:#7a7f8c   text-muted:#4a4f5c
   border:rgba(201, 169, 110, 0.12)    accent:#c9a96e       accent-dim:rgba(201, 169, 110, 0.25) accent-text:#f2f0e9
   glow: 0 0 14px rgba(201, 169, 110, 0.25)   glow-soft: 0 0 6px rgba(201, 169, 110, 0.15)

   亮点① blockquote → 左侧余烬金边框 + 冷灰斜体文字
   亮点② 加载动画  → 内嵌SVG SMIL，余烬金圆形脉冲动画
   亮点③ 分隔线    → 余烬金渐变光带
   ============================================= */

/* ===== 危险区域 ===== */
/* 1. 隐藏装饰条 */
[class*="bg-[#F1CBCB]"], [class*="bg-[#c9e1e9]"] { display: none !important; }

/* 2. 代码块 */
.rili-markdown-renderer pre {
  background: rgba(17, 19, 26, 0.8) !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  border-left: 3px solid #c9a96e !important;
  border-radius: 6px !important;
  padding: 1em 1.2em !important;
  overflow-x: auto !important;
}
.rili-markdown-renderer pre code {
  background: transparent !important;
  color: #f2f0e9 !important;
}
.rili-markdown-renderer :not(pre)>code {
  background: rgba(201, 169, 110, 0.25) !important;
  color: #f2f0e9 !important;
  padding: 0.15em 0.45em !important;
  border-radius: 4px !important;
}

/* 3. details折叠块 */
.rili-markdown-renderer details {
  background: #11131a !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  border-radius: 6px !important;
  margin: 8px 0 !important;
  overflow: hidden !important;
  transition: border-color 0.15s !important;
}
.rili-markdown-renderer details[open] {
  border-color: rgba(201, 169, 110, 0.35) !important;
}
.rili-markdown-renderer details summary {
  background: rgba(17, 19, 26, 0.8) !important;
  color: #f2f0e9 !important;
  padding: 8px 12px 8px 32px !important;
  display: block !important;
  position: relative !important;
  border-bottom: 1px solid rgba(201, 169, 110, 0.12) !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  list-style: none !important;
  user-select: none !important;
}
.rili-markdown-renderer details summary::before {
  content: '▶' !important;
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #c9a96e !important;
  font-size: 11px !important;
  transition: transform 0.2s ease !important;
}
.rili-markdown-renderer details[open] summary::before {
  transform: translateY(-50%) rotate(90deg) !important;
}
.rili-markdown-renderer details summary::-webkit-details-marker {
  display: none !important;
}

/* 4. 滚动条 */
::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}
::-webkit-scrollbar-track {
  background: #0a0b0f !important;
}
::-webkit-scrollbar-thumb {
  background: #8f7348 !important;
  border-radius: 3px !important;
}
::-webkit-scrollbar-thumb:hover {
  background: #c9a96e !important;
}

/* 5. 选区 & 占位符全局基础 */
::placeholder {
  color: #4a4f5c !important;
  opacity: 1 !important;
}
::selection {
  background: rgba(201, 169, 110, 0.25) !important;
  color: #f2f0e9 !important;
}

/* 6. 页面背景 */
body, html, #root, .app-root, .h-screen {
  background: #0a0b0f !important;
  color: #f2f0e9 !important;
}

/* ⚠️ 输入框彻底可见性修复（核心） */
/* 覆盖所有输入框、文本域及可编辑元素，确保浅色文字始终可见 */
textarea,
input[type="text"],
input[type="search"],
#ai-chat-input,
.rc-textarea,
[contenteditable="true"] {
  background: rgba(17, 19, 26, 0.65) !important;
  color: #f2f0e9 !important;
  caret-color: #c9a96e !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  box-shadow: none !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
textarea:focus,
input[type="text"]:focus,
input[type="search"]:focus,
#ai-chat-input:focus,
.rc-textarea:focus,
[contenteditable="true"]:focus {
  border-color: rgba(201, 169, 110, 0.35) !important;
  box-shadow: 0 0 14px rgba(201, 169, 110, 0.25) !important;
}
/* 占位符单独强化，避免与正文混淆 */
textarea::placeholder,
input[type="text"]::placeholder,
input[type="search"]::placeholder,
#ai-chat-input::placeholder,
.rc-textarea::placeholder,
[contenteditable="true"]::placeholder {
  color: #4a4f5c !important;
  opacity: 1 !important;
}
/* 选中文本时的高亮 */
textarea::selection,
input[type="text"]::selection,
input[type="search"]::selection,
#ai-chat-input::selection,
.rc-textarea::selection,
[contenteditable="true"]::selection {
  background: rgba(201, 169, 110, 0.25) !important;
  color: #f2f0e9 !important;
}

/* ===== 顶部导航 ===== */
header.flex.justify-between {
  background: rgba(17, 19, 26, 0.65) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(201, 169, 110, 0.12) !important;
  color: #f2f0e9 !important;
}
#nav-middle .group.flex.items-center {
  color: #f2f0e9 !important;
}
#nav-middle .group.flex.items-center:hover {
  color: #c9a96e !important;
}
#nav-middle button:has(> .flex-1.truncate.text-left) .flex-1.truncate.text-left {
  color: #f2f0e9 !important;
}
#nav-middle .shrink-0.flex.items-center svg {
  color: #7a7f8c !important;
}
#nav-middle .group:hover .shrink-0.flex.items-center svg {
  color: #c9a96e !important;
}
#nav-right button {
  color: #7a7f8c !important;
}
#nav-right button:hover {
  color: #c9a96e !important;
}

/* ===== 开场白区域 ===== */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
  background: #11131a !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  color: #7a7f8c !important;
}
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"]:hover {
  border-color: rgba(201, 169, 110, 0.35) !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: #7a7f8c !important;
}
div.flex.items-center.h-9.cursor-pointer.group:hover svg {
  color: #c9a96e !important;
}

/* ===== 侧边栏 ===== */
.shadow-lg.border-r.border-gray-200 {
  background: #11131a !important;
  border-right: 1px solid rgba(201, 169, 110, 0.12) !important;
}
.MuiList-root {
  background: transparent !important;
}
.conversation-text {
  color: #f2f0e9 !important;
}

/* ===== 功能按钮 ===== */
#ai-mod-button2 {
  background: transparent !important;
}
#ai-mod-button2 button.MuiButton-root {
  background: rgba(17, 19, 26, 0.8) !important;
  color: #c9a96e !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  transition: background-color 0.15s, border-color 0.15s !important;
}
#ai-mod-button2 button.MuiButton-root:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(201, 169, 110, 0.35) !important;
  box-shadow: 0 0 6px rgba(201, 169, 110, 0.15) !important;
}
#ai-mod-button2 button.MuiButton-root svg {
  color: #c9a96e !important;
}

/* ===== 聊天气泡 ===== */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
  background: rgba(17, 19, 26, 0.65) !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  box-shadow: none !important;
  transition: box-shadow 0.2s ease !important;
}
.is-user > .border.border-muted:hover {
  box-shadow: 0 0 6px rgba(201, 169, 110, 0.15) !important;
}
.rili-markdown-renderer {
  color: #f2f0e9 !important;
}
.rili-markdown-renderer h1, .rili-markdown-renderer h2, .rili-markdown-renderer h3 {
  color: #e0c897 !important;
  border-bottom: 1px solid rgba(201, 169, 110, 0.12) !important;
  padding-bottom: 0.3em !important;
  margin-top: 1em !important;
}
.rili-markdown-renderer ul, .rili-markdown-renderer ol, .rili-markdown-renderer li {
  color: #f2f0e9 !important;
}
.rili-markdown-renderer blockquote {
  border-left: 4px solid #c9a96e !important;
  color: #7a7f8c !important;
  font-style: italic !important;
  padding-left: 12px !important;
  margin: 1em 0 !important;
  background-color: rgba(17, 19, 26, 0.6) !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
}
.rili-markdown-renderer table {
  border-collapse: collapse !important;
  width: 100% !important;
}
.rili-markdown-renderer th, .rili-markdown-renderer td {
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  padding: 8px !important;
  text-align: left !important;
}
.rili-markdown-renderer th {
  background-color: rgba(17, 19, 26, 0.8) !important;
  color: #f2f0e9 !important;
}
.rili-markdown-renderer td {
  background-color: rgba(17, 19, 26, 0.65) !important;
  color: #f2f0e9 !important;
}
.rili-markdown-renderer strong {
  color: #e0c897 !important;
  font-weight: bold !important;
}
.rili-markdown-renderer em {
  color: #7a7f8c !important;
  font-style: italic !important;
}
.rili-markdown-renderer a {
  color: #c9a96e !important;
  text-decoration: underline !important;
}
.rili-markdown-renderer p {
  color: #f2f0e9 !important;
}

/* ===== 加载动画 ===== */
.flex.items-center.justify-center.size-6 > .flex.gap-2 {
  display: none !important;
}
.flex.items-center.justify-center.size-6 {
  width: 24px !important;
  height: 20px !important;
}
.flex.items-center.justify-center.size-6::before {
  content: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"%3E%3Ccircle cx="8" cy="8" r="4" fill="%23c9a96e"%3E%3Canimate attributeName="r" from="4" to="6" dur="1s" begin="0s" repeatCount="indefinite" calcMode="spline" keySplines="0.4 0 0.2 1;0.4 0 0.2 1" keyTimes="0;0.5;1"/%3E%3Canimate attributeName="opacity" from="1" to="0" dur="1s" begin="0s" repeatCount="indefinite" calcMode="spline" keySplines="0.4 0 0.2 1;0.4 0 0.2 1" keyTimes="0;0.5;1"/%3E%3C/circle%3E%3C/svg%3E') !important;
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  animation: none !important;
  margin-right: 4px !important;
}
.flex.items-center.justify-center.size-6::after {
  content: none !important;
}

/* ===== 底部输入区（背景渐变 + 发送按钮） ===== */
.bg-gradient-to-t {
  background: linear-gradient(to top, #0a0b0f 30%, transparent 100%) !important;
}
#ai-chat-bottom-input {
  background: transparent !important;
}
#ai-send-button {
  background: #c9a96e !important;
  color: #f2f0e9 !important;
  transition: background-color 0.15s !important;
}
#ai-send-button:hover {
  background: #e0c897 !important;
}

/* ===== 评论区 ===== */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
  background: #11131a !important;
  border-top: 1px solid rgba(201, 169, 110, 0.12) !important;
}
div.text-lg.font-bold {
  color: #f2f0e9 !important;
}
p.MuiTypography-body1.text-grey-600 {
  color: #7a7f8c !important;
}
span.MuiRating-root {
  color: #c9a96e !important;
}
span.MuiRating-iconEmpty svg {
  color: #4a4f5c !important;
}
span.MuiRating-iconFilled svg {
  color: #c9a96e !important;
}
div.flex.flex-col.border-gray-200 {
  border-color: rgba(201, 169, 110, 0.12) !important;
}
div.bg-gray-100.text-gray-500 {
  background: rgba(17, 19, 26, 0.8) !important;
  color: #7a7f8c !important;
}
div.cursor-pointer.group.flex.items-center.justify-center {
  color: #7a7f8c !important;
}
div.cursor-pointer.group.flex.items-center.justify-center:hover {
  color: #c9a96e !important;
}
div[data-state="closed"] svg[data-icon="Send03"] {
  color: #c9a96e !important;
}
div.style_divider__mW0YX {
  background: linear-gradient(to right, rgba(201, 169, 110, 0) 0%, rgba(201, 169, 110, 0.35) 50%, rgba(201, 169, 110, 0) 100%) !important;
  height: 1px !important;
  border: none !important;
  margin: 16px 0 !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2.css-1dmzxoz {
  background: transparent !important;
}
button.MuiButton-containedPrimary {
  background: #c9a96e !important;
  color: #f2f0e9 !important;
}
button.MuiButton-containedPrimary:hover {
  background: #e0c897 !important;
}
button.MuiButton-outlinedPrimary {
  border-color: #c9a96e !important;
  color: #c9a96e !important;
}
button.MuiButton-outlinedPrimary:hover {
  background: rgba(201, 169, 110, 0.25) !important;
  color: #e0c897 !important;
}
div.p-3.overflow-y-auto {
  background: #11131a !important;
  border-radius: 4px !important;
}
div.group.ml-0 {
  background: #11131a !important;
}
div.group img.rounded-full {
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
}
div.text-sm.text-grey-600 span.font-bold {
  color: #f2f0e9 !important;
}
span.text-[10px] {
  color: #4a4f5c !important;
}
div.break-all {
  color: #7a7f8c !important;
}
div.text-xs.text-grey-600 {
  color: #4a4f5c !important;
}
button.text-gray-400 {
  color: #4a4f5c !important;
}
button.text-gray-400:hover {
  color: #c9a96e !important;
}
button.text-gray-400 svg {
  color: #4a4f5c !important;
}
button.text-gray-400:hover svg {
  color: #c9a96e !important;
}
span.cursor-pointer {
  color: #c9a96e !important;
}
div.ml-8.border-l {
  border-left: 1px solid rgba(201, 169, 110, 0.12) !important;
}

/* ===== 分页 ===== */
.MuiPaginationItem-root {
  color: #7a7f8c !important;
  border-radius: 4px !important;
  transition: background-color 0.15s, color 0.15s !important;
}
.MuiPaginationItem-root:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: #c9a96e !important;
}
.MuiPaginationItem-root.Mui-selected {
  background: #c9a96e !important;
  color: #f2f0e9 !important;
}
.MuiPaginationItem-root.Mui-disabled {
  color: #4a4f5c !important;
  opacity: 0.6 !important;
}
.MuiPaginationItem-icon {
  color: #c9a96e !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2.css-1uwir8f {
  background: transparent !important;
}
.MuiInputBase-input {
  background: rgba(17, 19, 26, 0.65) !important;
  color: #f2f0e9 !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  border-radius: 4px !important;
}

/* ===== MUI 全局 ===== */
.MuiButton-root {
  background: rgba(17, 19, 26, 0.8) !important;
  color: #f2f0e9 !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s !important;
}
.MuiButton-root:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(201, 169, 110, 0.35) !important;
  box-shadow: 0 0 6px rgba(201, 169, 110, 0.15) !important;
}
.MuiButton-contained {
  background: #c9a96e !important;
  color: #f2f0e9 !important;
}
.MuiButton-contained:hover {
  background: #e0c897 !important;
}
.MuiButton-outlined {
  border-color: #c9a96e !important;
  color: #c9a96e !important;
}
.MuiButton-outlined:hover {
  background: rgba(201, 169, 110, 0.25) !important;
  color: #e0c897 !important;
}
.MuiIconButton-root {
  color: #7a7f8c !important;
  transition: color 0.15s, background-color 0.15s !important;
}
.MuiIconButton-root:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #c9a96e !important;
}
.MuiDialog-paper, .MuiDrawer-paper {
  background: #11131a !important;
  color: #f2f0e9 !important;
  border: 1px solid rgba(201, 169, 110, 0.12) !important;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.5) !important;
}
.MuiBackdrop-root {
  background-color: rgba(0, 0, 0, 0.7) !important;
}
.MuiDivider-root {
  background-color: rgba(201, 169, 110, 0.12) !important;
}
.MuiTypography-root {
  color: #f2f0e9 !important;
}
.MuiRating-icon {
  color: #c9a96e !important;
}
.MuiOutlinedInput-root {
  background: rgba(17, 19, 26, 0.65) !important;
  color: #f2f0e9 !important;
}
.MuiOutlinedInput-notchedOutline {
  border-color: rgba(201, 169, 110, 0.12) !important;
  transition: border-color 0.15s !important;
}
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(201, 169, 110, 0.35) !important;
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: #c9a96e !important;
}
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
  color: #7a7f8c !important;
}
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7 {
  color: #c9a96e !important;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  /* 移动端适配占位 */
}

/* ===== 降速兜底 ===== */
@media (prefers-reduced-motion: reduce) {
  .flex.items-center.justify-center.size-6::before { animation-duration: 4s !important; }
}