/* 统一聊天气泡圆角、无边框、柔和阴影 */
.group.is-user > div:first-child,
.group.is-assistant > div:first-child {
  border-radius: 16px !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
  backdrop-filter: blur(8px) !important;
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
}

/* 用户气泡背景（温暖琥珀金） */
.group.is-user > div:first-child {
  background: linear-gradient(135deg, #f5e6d3, #e8cfa0) !important;
}

/* 助理气泡背景（深邃半透明） */
.group.is-assistant > div:first-child {
  background: rgba(20, 22, 30, 0.75) !important;
}

/* 用户气泡内默认文字颜色（深色适配浅底） */
.group.is-user > div:first-child .rili-markdown-renderer {
  color: #1a1a1a !important;
}

/* 助理气泡内默认文字颜色（浅色适配深底） */
.group.is-assistant > div:first-child .rili-markdown-renderer {
  color: #e5e5e5 !important;
}

/* 底部附加信息透明度 */
.text-xs.font-mono.text-muted-foreground {
  color: rgba(255,255,255,0.75) !important;
}

/* 操作按钮始终可见 */
.bg-muted.rounded.flex {
  background: transparent !important;
}
.group .md\:opacity-0 {
  opacity: 1 !important;
}
.bg-muted.rounded.flex button {
  opacity: 1 !important;
  color: rgba(255,255,255,0.85) !important;
}
.bg-muted.rounded.flex button svg.lucide {
  stroke: rgba(255,255,255,0.85) !important;
}

/* 状态栏折叠块美化 */
.rili-markdown-renderer details {
  margin: 10px 0;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.rili-markdown-renderer details:hover {
  background: rgba(255,255,255,0.08);
}
.rili-markdown-renderer summary {
  font-weight: 600;
  cursor: pointer;
  color: #D4A843 !important;
  outline: none;
  font-size: 0.95em;
}
.rili-markdown-renderer details[open] summary {
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(212,168,67,0.3);
  padding-bottom: 6px;
}
.rili-markdown-renderer details p {
  margin: 4px 0;
  line-height: 1.5;
}

/* 加载动画替换 */
.flex.gap-2.w-full.h-full.items-center.justify-center > span {
  display: none !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #D4A843;
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}