/* ======================
   CSS 模块化重构 - 莫兰迪绿调主题
   基于万界换妻系统风格优化
   结构说明：
   1. 每个模块包含基础样式和对应的暗色模式适配
   2. 使用清晰的注释分隔各个模块
   3. 响应式设计整合在对应模块中
   ====================== */

/* ======================
   1. 全局与基础设置
   ====================== */
* {
  box-sizing: border-box !important;
}

/* 全局分隔线样式优化 - 莫兰迪绿调 */
hr {
  border: none !important;
  border-top: 2px solid #c8d6c4 !important;
  margin: 1.5em 0 !important;
  opacity: 0.9 !important;
}

hr:hover {
  opacity: 1 !important;
  box-shadow: 0 0 10px rgba(143, 168, 143, 0.4) !important;
}

/* 暗色模式适配 - 全局分隔线 */
@media (prefers-color-scheme: dark) {
  hr {
    border-top: 2px solid #d9d1c7 !important;
    opacity: 0.8 !important;
  }
  
  hr:hover {
    box-shadow: 0 0 10px rgba(180, 190, 170, 0.4) !important;
  }
}

/* ======================
   2. 核心元素：头像
   ====================== */
.mb-2 .shrink-0 { display: none; } /* 隐藏头像 */

/* ======================
   3. 可折叠内容区 (details) - 莫兰迪绿调
   ====================== */
details {
  position: relative !important;
  width: 100% !important;
  max-width: 800px !important;
  margin: 15px auto !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 1em !important;
  top: auto !important;
  right: auto !important;
  z-index: 1 !important;
}

details summary {
  max-width: 100% !important;
  width: 100% !important;
  padding: 6px 16px 6px 38px !important;
  margin: 0 !important;
  position: relative !important;
  background: linear-gradient(to right, #8fa88f, #a8bda6) !important;
  color: #f8faf6 !important;
  border-radius: 20px !important;
  font-size: 1.1em !important;
  font-weight: bold !important;
  cursor: pointer !important;
  list-style: none !important;
  box-shadow: 0 2px 8px rgba(120, 145, 120, 0.2) !important;
  transition: all 0.3s ease !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  height: auto !important;
}

details summary::before {
  content: "📕" !important;
  position: absolute !important;
  left: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(0deg) !important;
  font-size: 1em !important;
  color: #f8faf6 !important;
  z-index: 2 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform-origin: center !important;
}

details[open] summary::before {
  content: "📖" !important;
  transform: translateY(-50%) rotate(15deg) !important;
  color: #ffe8a0 !important;
  text-shadow: 0 0 8px rgba(200, 175, 100, 0.5) !important;
}

details[open] summary {
  background: linear-gradient(to right, #9ab89a, #b8cdb6) !important;
  box-shadow: 0 4px 15px rgba(120, 145, 120, 0.4) !important;
  border-radius: 20px !important;
}

details summary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(120, 145, 120, 0.3) !important;
  background: linear-gradient(to right, #9ab89a, #b8cdb6) !important;
}

details > div {
  width: 100% !important;
  padding: 20px !important;
  margin-top: 0 !important;
  border-radius: 0 0 10px 10px !important;
  box-shadow: 0 4px 20px rgba(120, 145, 120, 0.15) !important;
  border: 1px solid #d8e3d4 !important;
  background: linear-gradient(135deg, #fafcfa 0%, #f2f6f1 100%) !important;
  animation: slideDown 0.3s ease-out !important;
  color: #3d4a3d !important;
  backdrop-filter: blur(5px) !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
  }
}

/* 暗色模式适配 - 可折叠内容区 */
@media (prefers-color-scheme: dark) {
  details {
    background: transparent !important;
    border-color: transparent !important;
    color: #d8e0d4 !important;
    box-shadow: none !important;
  }
  
  details summary {
    background: linear-gradient(to right, #556355, #657365) !important;
    color: #f0f4ee !important;
  }
  
  details summary:hover,
  details[open] summary {
    background: linear-gradient(to right, #657365, #758375) !important;
  }
  
  details > div {
    background: linear-gradient(135deg, #3d4a3d 0%, #4a5a4a 100%) !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  }
  
  details > div h1,
  details > div h2,
  details > div h3,
  details > div h4 {
    color: #d8e0d4 !important;
    border-bottom-color: #5a6b5a !important;
  }
  
  details > div code {
    background: #5a6b5a !important;
    color: #d8e0d4 !important;
  }
}

/* 响应式设计 - 可折叠内容区 */
@media (max-width: 768px) {
  details {
    max-width: 95% !important;
    margin: 10px auto !important;
  }
  
  details summary {
    padding: 5px 12px 5px 40px !important;
    font-size: 1em !important;
  }
  
  details summary::before {
    left: 12px !important;
  }

  details > div {
    padding: 15px !important;
  }
}

@media (max-width: 480px) {
  details summary {
    padding: 4px 10px 4px 36px !important;
    font-size: 1em !important;
  }
  
  details summary::before {
    left: 12px !important;
  }

  details > div {
    padding: 12px !important;
  }
}

/* ======================
   4. 表格样式 (table) - 莫兰迪绿调
   ====================== */
.table-container {
  max-height: 400px !important;
  overflow: auto !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(120, 145, 120, 0.1) !important;
  margin: 20px 0 !important;
}

details table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: rgba(250, 252, 249, 0.98) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

details th {
  background: #a8bda6 !important;
  color: #f8faf6 !important;
  font-weight: bold !important;
  padding: 14px 18px !important;
  text-align: left !important;
  border-bottom: 2px solid #5a735a !important;
  font-size: 1.1em !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

details td {
  padding: 12px 18px !important;
  border-bottom: 1px solid #c8d6c4 !important;
  color: #2d3a2d !important;
  transition: background-color 0.2s !important;
}

details tr:last-child td {
  border-bottom: none !important;
}

details tr:hover td {
  background-color: rgba(143, 168, 143, 0.1) !important;
}

details tr:nth-child(even) {
  background-color: rgba(230, 240, 228, 0.4) !important;
}

/* 暗色模式适配 - 表格 */
@media (prefers-color-scheme: dark) {
  .table-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }
  
  details table {
    background-color: rgba(45, 55, 45, 0.9) !important;
  }
  
  details th {
    background: linear-gradient(to bottom, #4a5a4a, #3d4a3d) !important;
    border-bottom-color: #2d3a2d !important;
  }
  
  details td {
    color: #d8e0d4 !important;
    border-bottom-color: #5a6b5a !important;
  }
  
  details tr:nth-child(even) {
    background-color: rgba(42, 50, 42, 0.4) !important;
  }
  
  details tr:hover td {
    background-color: rgba(90, 107, 90, 0.3) !important;
  }
}

/* 响应式设计 - 表格 */
@media (max-width: 768px) {
  .table-container {
    max-height: 300px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  details table {
    min-width: 100% !important;
    width: auto !important;
  }
  
  .table-container::-webkit-scrollbar {
    height: 8px !important;
  }
  
  .table-container::-webkit-scrollbar-thumb {
    background-color: rgba(120, 145, 120, 0.3) !important;
    border-radius: 4px !important;
  }
}

@media (max-width: 480px) {
  details th, details td {
    padding: 10px 12px !important;
    font-size: 0.9em !important;
  }
  
  details td {
    word-break: break-word !important;
  }
}

/* ======================
   5. AI 输出对话框 - 莫兰迪绿调
   ====================== */
.group .bg-gray-100\/90 {
  background: rgba(250, 252, 249, 0.95) !important;
  border: 2px solid #b0c4ad !important;
  border-radius: 12px !important;
  box-shadow: 3px 3px 8px rgba(120, 145, 120, 0.2) !important;
  color: #2d3a2d !important;
  padding: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  position: relative !important;
  font-size: 1.0em !important;
  line-height: 1.6 !important;
}

.group .bg-gray-100\/90::before {
  content: "" !important;
  position: absolute !important;
  top: -10px !important;
  left: 20px !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 10px solid transparent !important;
  border-right: 10px solid transparent !important;
  border-bottom: 10px solid #b0c4ad !important;
}

.group .bg-gray-100\/90::after {
  content: "" !important;
  position: absolute !important;
  top: -8px !important;
  left: 20px !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 10px solid transparent !important;
  border-right: 10px solid transparent !important;
  border-bottom: 10px solid rgba(250, 252, 249, 0.95) !important;
}

.group .bg-gray-100\/90 p,
.group .bg-gray-100\/90 li,
.group .bg-gray-100\/90 td,
.group .bg-gray-100\/90 th {
  margin: 15px 0 !important;
  line-height: 1.7 !important;
  font-size: 1.05em !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  color: #4a5a4a !important;
  text-align: justify !important;
  position: relative !important;
}

.group .bg-gray-100\/90 p:last-child,
.group .bg-gray-100\/90 li:last-child {
  margin-bottom: 0 !important;
}

/* 暗色模式适配 - AI 输出对话框 */
@media (prefers-color-scheme: dark) {
  .group .bg-gray-100\/90 {
    background: rgba(45, 55, 45, 0.95) !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4) !important;
  }
  
  .group .bg-gray-100\/90::after {
    border-bottom: 10px solid rgba(45, 55, 45, 0.95) !important;
  }
  
  .group .bg-gray-100\/90 p,
  .group .bg-gray-100\/90 li,
  .group .bg-gray-100\/90 td,
  .group .bg-gray-100\/90 th {
    color: #d8e0d4 !important;
  }
}

/* ======================
   6. 底部输入区域 - 莫兰迪绿调（已整合发送按钮修复）
   ====================== */
#ai-chat-bottom-input { 
  background: transparent !important; 
  backdrop-filter: none !important; 
}

#ai-chat-input {
  background-color: #fafcfa !important;
  border: 2px solid #b0c4ad !important;
  border-radius: 8px !important;
  color: #4a5a4a !important;
  box-shadow: inset 2px 2px 4px rgba(120, 145, 120, 0.1) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 0.85em !important;
  padding: 12px 16px !important;
}

/* 发送按钮修复（原模块17） */
#ai-send-button {
  width: 32px !important;
  height: 32px !important;
  overflow: visible !important;
}
#ai-send-button svg {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
  fill: #8fa88f !important;
  color: #8fa88f !important;
}
#ai-send-button:hover svg {
  fill: #a8bda6 !important;
  color: #a8bda6 !important;
}

/* 暗色模式适配 - 底部输入区域 + 发送按钮 */
@media (prefers-color-scheme: dark) {
  #ai-chat-input {
    background-color: #3d4a3d !important;
    border: 2px solid #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.2) !important;
  }
  /* 暗色模式下发送按钮配色 */
  #ai-send-button svg {
    fill: #9ab89a !important;
    color: #9ab89a !important;
  }
  #ai-send-button:hover svg {
    fill: #b8cdb6 !important;
    color: #b8cdb6 !important;
  }
}

/* ======================
   7. 顶部横幅
   ====================== */
.sticky.w-full.top-0.h-16 {
  background: #000 !important;
  background-image: url('https://youke1.picui.cn/s1/2025/08/14/689dd42f18d31.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  border-bottom: 1px solid rgba(160, 176, 208, 0.7) !important;
}

/* 暗色模式适配 - 顶部横幅 */
@media (prefers-color-scheme: dark) {
  .sticky.w-full.top-0.h-16 {
    border-bottom: 1px solid rgba(74, 85, 104, 0.7) !important;
  }
}

/* ======================
   8. 按钮样式 - 莫兰迪绿调（已整合按钮图标修复 + 用户气泡刷新按钮修复）
   ====================== */
.flex.items-center.gap-2.pb-2 > button,
.MuiButtonBase-root.MuiButton-root.MuiButton-default, 
.flex.items-center.gap-2.mb-4 button.px-3 {
  background: linear-gradient(to bottom, #f2f6f1, #e8f0e6) !important;
  color: #4a5a4a !important;
  border: 1px solid #b8a08a !important;
  border-radius: 6px !important;
  box-shadow: 2px 2px 0px rgba(180, 155, 130, 0.5) !important;
  font-weight: bold !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  text-transform: none !important;
  transition: all 0.1s ease-in-out !important;
  padding: 4px 10px !important;
  font-size: 0.85em !important;
}

.flex.items-center.gap-2.pb-2 > button:hover,
.MuiButtonBase-root.MuiButton-root.MuiButton-default:hover, 
.flex.items-center.gap-2.mb-4 button.px-3:hover { 
  background: linear-gradient(to bottom, #e8f0e6, #d8e3d4) !important;
  color: #4a5a4a !important;
  transform: translate(2px, 2px) !important;
  box-shadow: 0px 0px 2px rgba(120, 145, 120, 0.2) !important;
}

/* 按钮图标修复（原模块16） */
.css-m3x93c svg,
.css-m3x93c i,
.css-m3x93c span,
.css-m3x93c * {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #8fa88f !important;
  fill: #8fa88f !important;
  font-family: inherit !important;
}
.css-m3x93c {
  font-family: var(--font-system), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto !important;
}
.css-m3x93c svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
}
.css-m3x93c:hover {
  background-color: rgba(143, 168, 143, 0.15) !important;
}

/* 用户气泡刷新按钮修复（融入模块8） */
#customized-resend-button.css-b8ryli {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 4px !important;
  color: #8fa88f !important;
  background: transparent !important;
  border-radius: 6px !important;
  overflow: visible !important;
  border: none !important;
}

#customized-resend-button.css-b8ryli svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  fill: #8fa88f !important;
  color: #8fa88f !important;
  flex-shrink: 0 !important;
}

#customized-resend-button.css-b8ryli:hover {
  background-color: rgba(143, 168, 143, 0.12) !important;
}

#customized-resend-button.css-b8ryli:hover svg {
  fill: #a8bda6 !important;
  color: #a8bda6 !important;
}

/* 暗色模式适配 - 按钮样式 + 图标修复 + 刷新按钮 */
@media (prefers-color-scheme: dark) {
  .flex.items-center.gap-2.pb-2 > button,
  .MuiButtonBase-root.MuiButton-root.MuiButton-default, 
  .flex.items-center.gap-2.mb-4 button.px-3 {
    background: linear-gradient(to bottom, #4a5a4a, #3d4a3d) !important;
    color: #d8e0d4 !important;
    border: 2px solid #6a7a6a !important;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
  }
  
  .flex.items-center.gap-2.pb-2 > button:hover,
  .MuiButtonBase-root.MuiButton-root.MuiButton-default:hover, 
  .flex.items-center.gap-2.mb-4 button.px-3:hover {
    background: linear-gradient(to bottom, #3d4a3d, #2d3a2d) !important;
    color: #d8e0d4 !important;
  }

  .css-m3x93c svg,
  .css-m3x93c i,
  .css-m3x93c span {
    color: #9ab89a !important;
    fill: #9ab89a !important;
  }

  /* 刷新按钮暗色模式 */
  #customized-resend-button.css-b8ryli {
    color: #9ab89a !important;
  }
  #customized-resend-button.css-b8ryli svg {
    fill: #9ab89a !important;
    color: #9ab89a !important;
  }
  #customized-resend-button.css-b8ryli:hover {
    background-color: rgba(154, 184, 154, 0.15) !important;
  }
  #customized-resend-button.css-b8ryli:hover svg {
    fill: #c8d8c4 !important;
    color: #c8d8c4 !important;
  }
}

/* ======================
   9. 元素隐藏
   ====================== */
.MuiButtonBase-root.MuiButton-root.MuiButton-default.css-w13mdt,
.absolute.z-40 .px-4.py-2.hover\:bg-indigo-100:nth-child(5),
.css-nkqe49 { 
  display: none !important; 
}

/* ======================
   10. 侧边栏、弹出菜单与对话框 - 莫兰迪绿调
   ====================== */
#ai-model-selector .group {
  background: #fafcfa !important;
  border: 1px solid #b0c4ad !important;
  border-radius: 6px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}
#ai-model-selector .group:hover { 
  box-shadow: 0 0 10px rgba(143, 168, 143, 0.5) !important;
  border-color: #c8d6c4 !important;
}
#ai-model-selector .group *, #ai-model-selector .group { 
  color: #4a5a4a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.MuiDialog-paper,
.absolute.z-40.w-48.bg-white.border, 
.w-\[360px\].max-h-\[480px\].rounded-lg, 
.absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 {
  background: rgba(250, 252, 249, 0.95) !important;
  border: 1px solid #b0c4ad !important;
  border-radius: 8px !important;
  box-shadow: 0 0 20px rgba(143, 168, 143, 0.3) !important;
  backdrop-filter: blur(15px) !important;
}
.MuiDialogContent-root,
.MuiDialogTitle-root,
.MuiDialogActions-root,
.absolute.z-40.w-48.bg-white.border > *, 
.w-\[360px\].max-h-\[480px\].rounded-lg *, 
.absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 * { 
  color: #4a5a4a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
.absolute.z-40.w-48.bg-white.border > *:hover, 
.absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 > div:hover { 
  background: rgba(143, 168, 143, 0.15) !important;
}
.MuiDialogContent-dividers {
  border-top: 1px solid rgba(160, 180, 155, 0.7) !important;
  border-bottom: 1px solid rgba(160, 180, 155, 0.7) !important;
}

.MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar { width: 8px !important; }
.MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-track { background: rgba(250, 252, 249, 0.5) !important; border-radius: 4px !important; }
.MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-thumb { 
  background: #b0c4ad !important;
  border-radius: 4px !important; 
  border: 1px solid #fafcfa !important; 
}
.MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-thumb:hover { background: #8fa88f !important; }

div.duration-500.w-60.MuiBox-root {
  background: rgba(250, 252, 249, 0.8) !important;
  border-right: 1px solid #b0c4ad !important;
  backdrop-filter: blur(10px) !important;
}
div.duration-500.w-60.MuiBox-root * {
  color: #4a5a4a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
div.duration-500.w-60.MuiBox-root .MuiListItemButton-root:hover {
  background: rgba(143, 168, 143, 0.15) !important;
}

div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar { width: 6px !important; }
div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar-track { background: transparent !important; }
div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar-thumb { 
  background: #b0c4ad !important;
  border-radius: 3px !important; 
}
div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar-thumb:hover { background: #8fa88f !important; }

.sticky.top-0.my-0.mx-3.border-\[1\.5px\] {
  background: rgba(250, 252, 249, 0.6) !important;
  border: 1px solid #b0c4ad !important;
  backdrop-filter: blur(5px) !important;
  position: relative !important;
  padding-top: 25px !important;
}
.sticky.top-0.my-0.mx-3.border-\[1\.5px\]::before {
  content: '留下你的评论' !important;
  position: absolute !important;
  top: 5px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  color: #8fa88f !important;
  font-size: 14px !important;
  font-weight: bold !important;
  text-shadow: 0 0 5px rgba(143, 168, 143, 0.3) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
.translate-y-0 .p-3.overflow-y-auto {
  background: rgba(250, 252, 249, 0.6) !important;
}

.block.w-full.sm\:w-\[240px\].shrink-0 {
  background: rgba(250, 252, 249, 0.6) !important;
  border-left: 1px solid #b0c4ad !important;
}
.block.w-full.sm\:w-\[240px\].shrink-0 * {
  color: #4a5a4a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
.block.w-full.sm\:w-\[240px\].shrink-0 div[class*="hover:bg-gray-200"]:hover {
  background: rgba(143, 168, 143, 0.15) !important;
}

/* 暗色模式适配 - 侧边栏、弹出菜单与对话框 */
@media (prefers-color-scheme: dark) {
  #ai-model-selector .group {
    background: #3d4a3d !important;
    border-color: #5a6b5a !important;
  }
  
  #ai-model-selector .group:hover {
    box-shadow: 0 0 10px rgba(90, 107, 90, 0.5) !important;
    border-color: #7a8a7a !important;
  }
  
  #ai-model-selector .group *, #ai-model-selector .group {
    color: #d8e0d4 !important;
  }
  
  .MuiDialog-paper,
  .absolute.z-40.w-48.bg-white.border, 
  .w-\[360px\].max-h-\[480px\].rounded-lg, 
  .absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 {
    background: rgba(45, 55, 45, 0.95) !important;
    border-color: #5a6b5a !important;
    box-shadow: 0 0 20px rgba(90, 107, 90, 0.3) !important;
  }
  
  .MuiDialogContent-root,
  .MuiDialogTitle-root,
  .MuiDialogActions-root,
  .absolute.z-40.w-48.bg-white.border > *, 
  .w-\[360px\].max-h-\[480px\].rounded-lg *, 
  .absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 * {
    color: #d8e0d4 !important;
  }
  
  .absolute.z-40.w-48.bg-white.border > *:hover, 
  .absolute.z-40.text-gray-700.right-0.mt-6.w-48.bg-white.border.border-gray-200.rounded-lg.shadow-lg.py-2 > div:hover {
    background: rgba(90, 107, 90, 0.25) !important;
  }
  
  .MuiDialogContent-dividers {
    border-top: 1px solid rgba(90, 107, 90, 0.7) !important;
    border-bottom: 1px solid rgba(90, 107, 90, 0.7) !important;
  }
  
  .MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-track {
    background: rgba(45, 55, 45, 0.5) !important;
  }
  
  .MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-thumb {
    background: #5a6b5a !important;
    border-color: #3d4a3d !important;
  }
  
  .MuiDialogContent-root.MuiDialogContent-dividers::-webkit-scrollbar-thumb:hover {
    background: #7a8a7a !important;
  }
  
  div.duration-500.w-60.MuiBox-root {
    background: rgba(45, 55, 45, 0.8) !important;
    border-right: 1px solid #5a6b5a !important;
  }
  
  div.duration-500.w-60.MuiBox-root * {
    color: #d8e0d4 !important;
  }
  
  div.duration-500.w-60.MuiBox-root .MuiListItemButton-root:hover {
    background: rgba(90, 107, 90, 0.2) !important;
  }
  
  div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar-thumb {
    background: #5a6b5a !important;
  }
  
  div.duration-500.w-60.MuiBox-root .MuiList-root::-webkit-scrollbar-thumb:hover {
    background: #7a8a7a !important;
  }
  
  .sticky.top-0.my-0.mx-3.border-\[1\.5px\] {
    background: rgba(45, 55, 45, 0.6) !important;
    border-color: #5a6b5a !important;
  }
  
  .sticky.top-0.my-0.mx-3.border-\[1\.5px\]::before {
    color: #9ab89a !important;
    text-shadow: 0 0 5px rgba(154, 184, 154, 0.3) !important;
  }
  
  .translate-y-0 .p-3.overflow-y-auto {
    background: rgba(45, 55, 45, 0.6) !important;
  }
  
  .block.w-full.sm\:w-\[240px\].shrink-0 {
    background: rgba(45, 55, 45, 0.6) !important;
    border-left: 1px solid #5a6b5a !important;
  }
  
  .block.w-full.sm\:w-\[240px\].shrink-0 * {
    color: #d8e0d4 !important;
  }
  
  .block.w-full.sm\:w-\[240px\].shrink-0 div[class*="hover:bg-gray-200"]:hover {
    background: rgba(90, 107, 90, 0.2) !important;
  }
}

/* ======================
   11. 积分信息栏 - 莫兰迪绿调
   ====================== */
.MuiStack-root.text-purple-500.mt-1.css-1kz283j {
  background: linear-gradient(145deg, #f2f6f1, #e8f0e6) !important;
  border: 1px solid #c8d6c4 !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 4px rgba(120, 145, 120, 0.1) !important;
  padding: 4px 8px !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  margin-top: 6px !important;
  position: relative !important;
  height: auto !important;
  min-height: 22px !important;
  gap: 3px !important;
}

.MuiStack-root.text-purple-500.mt-1.css-1kz283j::before {
  content: "📚" !important;
  position: absolute !important;
  left: 5px !important;
  font-size: 0.7em !important;
  color: rgba(120, 145, 120, 0.3) !important;
}

.MuiStack-root.text-purple-500.mt-1.css-1kz283j::after {
  content: "🔖" !important;
  position: absolute !important;
  right: 5px !important;
  font-size: 0.7em !important;
  color: rgba(120, 145, 120, 0.3) !important;
}

.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
  color: #2d3a2d !important;
  font-size: 0.7em !important;
  font-weight: bold !important;
  padding: 2px 4px !important;
  background: rgba(250, 252, 249, 0.8) !important;
  border-radius: 4px !important;
  border: 1px solid rgba(160, 180, 155, 0.2) !important;
  margin: 1px 0.5px !important;
  word-break: break-all !important;
  line-height: 1.2 !important;
}

.MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03 {
  color: #2d3a2d !important;
  font-size: 0.65em !important;
  padding: 2px 4px !important;
  background: rgba(250, 252, 249, 0.8) !important;
  border-radius: 4px !important;
  border: 1px solid rgba(160, 180, 155, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  margin: 1px 0.5px !important;
  word-break: break-all !important;
  line-height: 1.2 !important;
}

.MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03::before {
  content: "•" !important;
  margin-right: 3px !important;
  font-size: 0.6em !important;
  color: #7d967d !important;
}

/* 暗色模式适配 - 积分信息栏 */
@media (prefers-color-scheme: dark) {
  .MuiStack-root.text-purple-500.mt-1.css-1kz283j {
    background: linear-gradient(135deg, #3d4a3d, #4a5a4a) !important;
    border: 1px solid #5a6b5a !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
  }
  
  .MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: #d8e0d4 !important;
    background: rgba(45, 55, 45, 0.7) !important;
    border: 1px solid rgba(90, 107, 90, 0.2) !important;
  }
  
  .MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03 {
    color: #d8e0d4 !important;
    background: rgba(45, 55, 45, 0.7) !important;
    border: 1px solid rgba(90, 107, 90, 0.2) !important;
  }
  
  .MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03::before {
    color: #9ab89a !important;
  }
}

/* 响应式设计 - 积分信息栏 */
@media (max-width: 480px) {
  .MuiStack-root.text-purple-500.mt-1.css-1kz283j {
    padding: 3px 6px !important;
    min-height: 20px !important;
    gap: 2px !important;
    margin-top: 4px !important;
  }
  
  .MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    font-size: 0.65em !important;
    padding: 1px 3px !important;
    margin: 0.5px !important;
  }
  
  .MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03 {
    font-size: 0.6em !important;
    padding: 1px 3px !important;
    margin: 0.5px !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .MuiStack-root.text-purple-500.mt-1.css-1kz283j {
    padding: 4px 8px !important;
    min-height: 22px !important;
    gap: 3px !important;
  }
  .MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    font-size: 0.7em !important;
    padding: 2px 4px !important;
  }
  .MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03 {
    font-size: 0.65em !important;
    padding: 2px 4px !important;
  }
}

@media (min-width: 769px) {
  .MuiStack-root.text-purple-500.mt-1.css-1kz283j {
    padding: 4px 8px !important;
    min-height: 22px !important;
    gap: 3px !important;
  }

  .MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    font-size: 0.7em !important;
    padding: 2px 4px !important;
    margin: 1px !important;
  }

  .MuiTypography-root.MuiTypography-body2.text-orange-500.css-1x48u03 {
    font-size: 0.65em !important;
    padding: 2px 4px !important;
    margin: 1px !important;
  }
}

/* ======================
   12. 叙事正文专用样式保护 - 莫兰迪绿调
   ====================== */
details > div.narrative-content,
.narrative-content {
  background: linear-gradient(135deg, #fafcfa 0%, #f2f6f1 100%) !important;
  border: 1px solid #c8d6c4 !important;
  border-radius: 10px !important;
  padding: 20px 15px !important;
  margin: 15px 0 !important;
  line-height: 1.7 !important;
  font-size: 1.05em !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  color: #4a5a4a !important;
  text-align: justify !important;
  box-shadow: 0 4px 12px rgba(143, 168, 143, 0.1) !important;
  position: relative !important;
}

.narrative-content p {
  margin-bottom: 1.2em !important;
  text-indent: 0 !important;
}

.narrative-content p:last-child {
  margin-bottom: 0 !important;
}

.narrative-content ::selection {
  background: #a8bda6 !important;
  color: #2d3a2d !important;
}

.narrative-content ::-moz-selection {
  background: #a8bda6 !important;
  color: #2d3a2d !important;
}

.narrative-content.compact {
  padding: 20px 15px !important;
  border-radius: 10px !important;
  font-size: 1em !important;
  line-height: 1.6 !important;
}

.narrative-content::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.8) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* 暗色模式适配 - 叙事正文 */
@media (prefers-color-scheme: dark) {
  .narrative-content {
    background: linear-gradient(135deg, #3d4a3d 0%, #4a5a4a 100%) !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }
  
  .narrative-content ::selection {
    background: #5a6b5a !important;
    color: #d8e0d4 !important;
  }
  
  .narrative-content ::-moz-selection {
    background: #5a6b5a !important;
    color: #d8e0d4 !important;
  }
  
  .narrative-content::before {
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1) !important;
  }
}

/* ======================
   13. 状态面板特殊修复 - 莫兰迪绿调
   ====================== */
details .content-wrapper {
  background: #f2f6f1 !important;
  border: 1px solid #c8d6c4 !important;
  margin-top: 8px !important;
  border-radius: 10px !important;
  padding: 15px !important;
  font-family: 'Consolas', 'Monaco', monospace !important;
  font-size: 0.9em !important;
  line-height: 1.5 !important;
  color: #3d4a3d !important;
}

details .content-wrapper strong {
  color: #6b5a8a !important;
  font-weight: 700 !important;
}

details .content-wrapper pre,
details .content-wrapper code {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  font: inherit !important;
  color: inherit !important;
  line-height: inherit !important;
  white-space: inherit !important;
}

/* 暗色模式适配 - 状态面板 */
@media (prefers-color-scheme: dark) {
  details .content-wrapper {
    background: #3d4a3d !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
  }
  
  details .content-wrapper strong {
    color: #b0c4e0 !important;
  }
}

/* ======================
   14. 小说设定卡片样式 - 莫兰迪绿调
   ====================== */
.novel-setting-card {
  background: linear-gradient(145deg, #fafcfa 0%, #f2f6f1 100%) !important;
  border: 1px solid #c8d6c4 !important;
  border-radius: 12px !important;
  padding: 20px 18px !important;
  margin: 18px 0 !important;
  box-shadow: 
    0 4px 16px rgba(143, 168, 143, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.7 !important;
  color: #4a5a4a !important;
  position: relative !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  overflow: hidden !important;
}

.novel-setting-card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, #8fa88f, #a8bda6, #8fa88f) !important;
  border-radius: 12px 12px 0 0 !important;
}

.novel-setting-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 
    0 6px 20px rgba(143, 168, 143, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  border-color: #c8d6c4 !important;
}

.novel-setting-card p,
.novel-setting-card div {
  margin-bottom: 12px !important;
  font-size: 1em !important;
  color: #5a6b5a !important;
  line-height: 1.6 !important;
}

.novel-setting-card p:last-child {
  margin-bottom: 0 !important;
}

.novel-setting-card .setting-icon {
  display: inline-block !important;
  width: 20px !important;
  text-align: center !important;
  margin-right: 8px !important;
  opacity: 0.8 !important;
  transition: opacity 0.3s ease !important;
}

.novel-setting-card:hover .setting-icon {
  opacity: 1 !important;
}

.novel-setting-card .highlight {
  color: #3d4a3d !important;
  font-weight: 600 !important;
  background: linear-gradient(120deg, transparent 0%, rgba(143, 168, 143, 0.1) 100%) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  margin: 0 2px !important;
}

.novel-setting-card .card-title {
  margin: 0 0 16px 0 !important;
  font-size: 1.1em !important;
  font-weight: 600 !important;
  color: #3d4a3d !important;
  text-align: center !important;
  padding: 8px 0 !important;
  border-bottom: 2px solid #a8bda6;
  letter-spacing: 0.5px !important;
}

/* 暗色模式适配 - 小说设定卡片 */
@media (prefers-color-scheme: dark) {
  .novel-setting-card {
    background: linear-gradient(145deg, #3d4a3d 0%, #4a5a4a 100%) !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  }
  
  .novel-setting-card::before {
    background: linear-gradient(90deg, #5a6b5a, #6a7a6a, #5a6b5a) !important;
  }
  
  .novel-setting-card:hover {
    border-color: #6a7a6a !important;
    box-shadow: 
      0 6px 25px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  }
  
  .novel-setting-card p,
  .novel-setting-card div {
    color: #d8e0d4 !important;
  }
  
  .novel-setting-card .highlight {
    color: #f0f4ee !important;
    background: linear-gradient(120deg, transparent 0%, rgba(90, 107, 90, 0.3) 100%) !important;
  }
  
  .novel-setting-card .card-title {
    color: #d8e0d4 !important;
    border-bottom-color: #6a7a6a !important;
  }
}

/* 响应式设计 - 小说设定卡片 */
@media (max-width: 768px) {
  .novel-setting-card {
    padding: 16px 14px !important;
    margin: 15px 0 !important;
    border-radius: 10px !important;
  }
  
  .novel-setting-card p,
  .novel-setting-card div {
    font-size: 0.9em !important;
    line-height: 1.6 !important;
  }
}

/* ======================
   15. 行动选项卡片 - 莫兰迪绿调
   ====================== */
.action-card {
  background: linear-gradient(145deg, #fafcfa, #f2f6f1);
  border: 1px solid #c8d6c4;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(143, 168, 143, 0.1);
  transition: all 0.3s ease;
}

.action-card:hover {
  box-shadow: 0 6px 20px rgba(143, 168, 143, 0.15);
  transform: translateY(-1px);
}

.action-header {
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #4a5a4a;
  border-bottom: 2px solid #a8bda6;
  padding-bottom: 8px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  padding: 12px 15px;
  background: white;
  border: 1px solid #d8e3d4;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 1em;
  line-height: 1.4;
  color: #5a6b5a;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-touch-callout: text !important;
}

.action-btn * {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  pointer-events: none;
}

.action-btn:hover {
  background: #eef2ec;
  border-color: #a8bda6;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(143, 168, 143, 0.2);
}

.action-btn:active {
  transform: translateY(-2px) !important;
  box-shadow: 0 2px 8px rgba(143, 168, 143, 0.2) !important;
  background: #eef2ec !important;
  border-color: #a8bda6 !important;
}

/* 暗色模式适配 - 行动选项卡片 */
@media (prefers-color-scheme: dark) {
  .action-card {
    background: linear-gradient(145deg, #3d4a3d, #4a5a4a) !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }
  
  .action-header {
    color: #d8e0d4 !important;
    border-bottom-color: #6a7a6a !important;
  }
  
  .action-btn {
    background: #3d4a3d !important;
    border-color: #5a6b5a !important;
    color: #d8e0d4 !important;
  }
  
  .action-btn:hover {
    background: #4a5a4a !important;
    border-color: #6a7a6a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }
  
  .action-btn:active {
    background: #4a5a4a !important;
    border-color: #6a7a6a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }
}

/* 响应式设计 - 行动选项卡片 */
@media (max-width: 768px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
  
  .action-card {
    padding: 15px;
    margin: 15px 0;
  }
}

/* ======================
   16. 顶部导航栏美化 - 莫兰迪绿调主题
   ====================== */

/* 1. 导航栏整体容器 */
.flex.items-center.justify-between.w-full.relative {
  background: linear-gradient(to bottom, #f2f6f1, #e8f0e6) !important;
  border-bottom: 2px solid #b0c4ad !important;
  box-shadow: 0 4px 12px rgba(120, 145, 120, 0.25) !important;
  padding: 4px 12px !important;
  position: relative !important;
  z-index: 10 !important;
}

/* 暗色模式适配 - 导航栏整体 */
@media (prefers-color-scheme: dark) {
  .flex.items-center.justify-between.w-full.relative {
    background: linear-gradient(to bottom, #3d4a3d, #4a5a4a) !important;
    border-bottom-color: #5a6b5a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }
}

/* 2. 左侧"未公开"状态标签 */
.px-2\\.5.py-px.text-xs.leading-5.rounded-md.inline-flex.items-center.text-green-800.bg-green-100.flex-shrink-0 {
  background: linear-gradient(135deg, #8fa88f, #a8bda6) !important;
  color: #ffffff !important;
  border: 1px solid #c8d6c4 !important;
  box-shadow: 0 0 8px rgba(143, 168, 143, 0.4) !important;
  font-weight: bold !important;
  letter-spacing: 1px !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;
  font-family: "Segoe UI", -apple-system, sans-serif !important;
  text-transform: uppercase !important;
}

/* 暗色模式 - 状态标签 */
@media (prefers-color-scheme: dark) {
  .px-2\\.5.py-px.text-xs.leading-5.rounded-md.inline-flex.items-center.text-green-800.bg-green-100.flex-shrink-0 {
    background: linear-gradient(135deg, #5a6b5a, #6a7a6a) !important;
    color: #f0f4ee !important;
    border-color: #5a6b5a !important;
    box-shadow: 0 0 8px rgba(90, 107, 90, 0.4) !important;
  }
}

/* 3. 语言切换与设置按钮通用图标颜色 */
.MuiIconButton-root svg,
button.MuiButtonBase-root svg {
  color: #8fa88f !important;
  fill: #8fa88f !important;
  transition: color 0.2s, filter 0.2s !important;
}

.MuiIconButton-root:hover svg {
  color: #a8bda6 !important;
  fill: #a8bda6 !important;
  filter: drop-shadow(0 0 6px rgba(143, 168, 143, 0.6)) !important;
}

/* 暗色模式 - 图标 */
@media (prefers-color-scheme: dark) {
  .MuiIconButton-root svg,
  button.MuiButtonBase-root svg {
    color: #9ab89a !important;
    fill: #9ab89a !important;
  }
  .MuiIconButton-root:hover svg {
    color: #c8d8c4 !important;
    fill: #c8d8c4 !important;
  }
}

/* 4. 模型选择器 (中间部分) */
#ai-model-selector .Group {
  background: rgba(250, 252, 249, 0.9) !important;
  border: 1.5px solid #b0c4ad !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(120, 145, 120, 0.15), inset 0 1px 0 rgba(255,255,255,0.8) !important;
  font-family: "Segoe UI", -apple-system, sans-serif !important;
  transition: all 0.3s ease !important;
  padding: 2px 8px !important;
  position: relative !important;
}

#ai-model-selector .Group:hover {
  border-color: #c8d6c4 !important;
  box-shadow: 0 0 12px rgba(143, 168, 143, 0.5), inset 0 1px 0 rgba(255,255,255,0.8) !important;
}

#ai-model-selector .Group .truncate {
  color: #4a5a4a !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

#ai-model-selector .Group svg,
#ai-model-selector .Group [data-icon="ChevronDown"] path {
  stroke: #8fa88f !important;
  color: #8fa88f !important;
}

#ai-model-selector .Group:hover svg,
#ai-model-selector .Group:hover [data-icon="ChevronDown"] path {
  stroke: #a8bda6 !important;
  color: #a8bda6 !important;
}

/* 暗色模式 - 模型选择器 */
@media (prefers-color-scheme: dark) {
  #ai-model-selector .Group {
    background: rgba(45, 55, 45, 0.9) !important;
    border-color: #5a6b5a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  }
  #ai-model-selector .Group .truncate {
    color: #d8e0d4 !important;
  }
  #ai-model-selector .Group svg,
  #ai-model-selector .Group [data-icon="ChevronDown"] path {
    stroke: #9ab89a !important;
    color: #9ab89a !important;
  }
  #ai-model-selector .Group:hover {
    border-color: #7a8a7a !important;
    box-shadow: 0 0 12px rgba(90, 107, 90, 0.4), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  }
}

/* 5. 隐藏的时间聊天图标 */
.cursor-pointer.items-center.hidden.gap-1.text-xs svg,
.cursor-pointer.items-center.hidden.gap-1.text-xs use {
  color: #8fa88f !important;
  fill: #8fa88f !important;
}

/* 6. 设置按钮区域右侧额外微调 */
.MuiBox-root.css-0:has(> #header-setting-button) button {
  background: transparent !important;
}

/* 7. 为导航栏增加莫兰迪绿装饰线条 */
.flex.items-center.justify-between.w-full.relative::after {
  content: "" !important;
  position: absolute !important;
  bottom: -2px !important;
  left: 0 !important;
  width: 100% !important;
  height: 1px !important;
  background: linear-gradient(to right, transparent, #b0c4ad, transparent) !important;
  opacity: 0.6 !important;
}

/* 暗色模式下装饰线 */
@media (prefers-color-scheme: dark) {
  .flex.items-center.justify-between.w-full.relative::after {
    background: linear-gradient(to right, transparent, #7a8a7a, transparent) !important;
    opacity: 0.5 !important;
  }
}

/* 响应式微调 */
@media (max-width: 640px) {
  .flex.items-center.justify-between.w-full.relative {
    padding: 4px 8px !important;
  }
  #ai-model-selector .Group {
    padding: 2px 6px !important;
  }
}

/* ======================
   17. 加载状态 - 构思剧情动画 (莫兰迪绿调)
   ====================== */

/* ---------- 外层容器扩展 ---------- */
div:has(> [class*="dot-flashing"]) {
  width: auto !important;
  min-width: 150px !important;
  height: auto !important;
  min-height: 30px !important;
  overflow: visible !important;
}

/* ---------- 内层元素重置 ---------- */
[class*="dot-flashing"] {
  width: auto !important;
  height: auto !important;
  min-width: 140px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  animation: none !important;
  font-size: 0 !important;
  color: transparent !important;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 8px !important;
}

/* ---------- 清除原始伪元素 ---------- */
[class*="dot-flashing"]::before,
[class*="dot-flashing"]::after {
  animation: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: absolute !important;
}
[class*="dot-flashing"]::before {
  content: none !important;
  width: 0 !important;
  height: 0 !important;
}
[class*="dot-flashing"]::after {
  content: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---------- ::before - 莫兰迪绿光点装饰 ---------- */
[class*="dot-flashing"]::before {
  content: "" !important;
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  min-height: 6px !important;
  background: radial-gradient(circle, #b0c4ad 0%, rgba(176,196,173,0.6) 40%, transparent 70%) !important;
  border-radius: 50% !important;
  box-shadow:
    0 0 6px rgba(143,168,143,0.8),
    0 0 12px rgba(143,168,143,0.4),
    0 0 20px rgba(143,168,143,0.2) !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
  animation: dotGreenPulse 2s ease-in-out infinite !important;
  transform-origin: center !important;
}

@keyframes dotGreenPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 6px rgba(143,168,143,0.8),
      0 0 12px rgba(143,168,143,0.4),
      0 0 20px rgba(143,168,143,0.2);
  }
  50% {
    transform: translateY(-5px) scale(1.2);
    box-shadow:
      0 0 10px rgba(168,189,166,1),
      0 0 18px rgba(168,189,166,0.6),
      0 0 30px rgba(168,189,166,0.35);
  }
}

/* ---------- ::after - 文字"正在构思剧情" ---------- */
[class*="dot-flashing"]::after {
  content: "正在构思剧情" !important;
  display: inline-block !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  /* 莫兰迪绿金属流动渐变 */
  background-image: linear-gradient(
    105deg,
    #6a7a6a 0%,
    #8fa88f 15%,
    #a8bda6 35%,
    #e8f0e6 50%,
    #a8bda6 65%,
    #8fa88f 85%,
    #6a7a6a 100%
  ) !important;
  background-size: 300% 100% !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  color: transparent !important;
  text-shadow: none !important;
  animation: conceiveGreenFlow 3s ease-in-out infinite !important;
  filter: drop-shadow(0 0 6px rgba(143,168,143,0.5)) !important;
  transition: filter 0.5s ease !important;
}

@keyframes conceiveGreenFlow {
  0%, 100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 4px rgba(143,168,143,0.4));
  }
  25% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 10px rgba(168,189,166,0.75));
  }
  50% {
    background-position: 200% 50%;
    filter: drop-shadow(0 0 16px rgba(180,200,178,0.9));
  }
  75% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 10px rgba(168,189,166,0.75));
  }
}

/* ---------- 暗色模式适配 ---------- */
@media (prefers-color-scheme: dark) {
  [class*="dot-flashing"]::before {
    background: radial-gradient(circle, #c8d8c4 0%, rgba(200,216,196,0.7) 40%, transparent 70%) !important;
    box-shadow:
      0 0 8px rgba(200,216,196,0.9),
      0 0 16px rgba(200,216,196,0.5),
      0 0 24px rgba(200,216,196,0.3) !important;
  }

  @keyframes dotGreenPulseDark {
    0%, 100% {
      transform: translateY(0) scale(1);
      box-shadow:
        0 0 8px rgba(200,216,196,0.9),
        0 0 16px rgba(200,216,196,0.5),
        0 0 24px rgba(200,216,196,0.3);
    }
    50% {
      transform: translateY(-5px) scale(1.2);
      box-shadow:
        0 0 14px rgba(220,235,215,1),
        0 0 22px rgba(220,235,215,0.7),
        0 0 36px rgba(220,235,215,0.45);
    }
  }

  [class*="dot-flashing"]::before {
    animation-name: dotGreenPulseDark !important;
  }

  [class*="dot-flashing"]::after {
    background-image: linear-gradient(
      105deg,
      #8fa88f 0%,
      #9ab89a 15%,
      #c8d8c4 35%,
      #eef5ec 50%,
      #c8d8c4 65%,
      #9ab89a 85%,
      #8fa88f 100%
    ) !important;
    filter: drop-shadow(0 0 8px rgba(168,189,166,0.6)) !important;
  }

  @keyframes conceiveGreenFlowDark {
    0%, 100% {
      background-position: 0% 50%;
      filter: drop-shadow(0 0 6px rgba(168,189,166,0.5));
    }
    25% {
      background-position: 100% 50%;
      filter: drop-shadow(0 0 14px rgba(200,216,196,0.8));
    }
    50% {
      background-position: 200% 50%;
      filter: drop-shadow(0 0 20px rgba(215,230,210,0.95));
    }
    75% {
      background-position: 100% 50%;
      filter: drop-shadow(0 0 14px rgba(200,216,196,0.8));
    }
  }

  [class*="dot-flashing"]::after {
    animation-name: conceiveGreenFlowDark !important;
  }
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 768px) {
  div:has(> [class*="dot-flashing"]) {
    min-width: 135px !important;
    min-height: 26px !important;
  }
  [class*="dot-flashing"] {
    min-width: 125px !important;
    padding: 3px 6px !important;
  }
  [class*="dot-flashing"]::before {
    width: 5px !important;
    height: 5px !important;
    min-width: 5px !important;
    min-height: 5px !important;
    margin-right: 6px !important;
  }
  [class*="dot-flashing"]::after {
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
  }
}

@media (max-width: 480px) {
  div:has(> [class*="dot-flashing"]) {
    min-width: 120px !important;
    min-height: 24px !important;
  }
  [class*="dot-flashing"] {
    min-width: 110px !important;
    padding: 2px 5px !important;
  }
  [class*="dot-flashing"]::before {
    width: 4px !important;
    height: 4px !important;
    min-width: 4px !important;
    min-height: 4px !important;
    margin-right: 5px !important;
  }
  [class*="dot-flashing"]::after {
    font-size: 12px !important;
    letter-spacing: 0px !important;
  }
}

/* ======================
   15. 行动选项卡片（莫兰迪绿调极简版）
   ====================== */

/* 外层容器 */
.acts {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #c8d6c4;
  border-radius: 10px;
  background: #f2f6f1;
}

/* 标题 */
.acts-h {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  color: #4a5a4a;
}

/* 选项网格 */
.acts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 单个选项：用 div 而不是 button，保证文字可拖拽/长按复制 */
.opt {
  padding: 10px 12px;
  border: 1px solid #c8d6c4;
  border-radius: 8px;
  background: #ffffff;
  color: #5a6b5a;
  cursor: text;
  user-select: text !important;
  -webkit-user-select: text !important;
  -webkit-touch-callout: default !important;
  line-height: 1.5;
  word-break: break-word;
}

.opt:hover {
  background: #eef2ec;
  border-color: #a8bda6;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  .acts {
    background: #3d4a3d;
    border-color: #5a6b5a;
  }
  .acts-h {
    color: #d8e0d4;
  }
  .opt {
    background: #3d4a3d;
    border-color: #5a6b5a;
    color: #d8e0d4;
  }
  .opt:hover {
    background: #4a5a4a;
    border-color: #6a7a6a;
  }
}

/* 移动端单列 */
@media (max-width: 600px) {
  .acts-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================
   莫兰迪绿调（无边框输入区）- 新平台完整适配
   涵盖消息气泡、输入框、工具栏、发送按钮及细节补全
   ====================== */

/* ---------- 0. 设计令牌（CSS 变量） ---------- */
:root {
  --md-bg-light: #fafcfa;
  --md-bg-light-rgb: 250, 252, 250;
  --md-bg-container: #f2f6f1;
  --md-bg-container-2: #e8f0e6;
  --md-bg-container-3: #d8e3d4;
  --md-border: #b0c4ad;
  --md-border-strong: #8fa88f;
  --md-accent: #b8a08a;              /* 莫兰迪暖棕点缀 */
  --md-text: #2d3a2d;
  --md-icon: #8fa88f;
  --md-shadow: rgba(120, 145, 120, 0.12);
  --md-shadow-hover: rgba(120, 145, 120, 0.18);
  --md-send-from: #b8a08a;
  --md-send-to: #a08878;
  --md-send-text: #ffffff;
  --md-divider: #c8d6c4;
  --md-inset-shadow: rgba(120, 145, 120, 0.08);
  --md-focus-ring: rgba(143, 168, 143, 0.15);
  --md-placeholder: #8a9a8a;
}

/* ---------- 1. 消息气泡 ---------- */
div:has(> .space-y-3 > .rili-markdown-renderer) {
  background: rgba(var(--md-bg-light-rgb), 0.95) !important;
  border: 2px solid var(--md-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 10px var(--md-shadow) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  transition: box-shadow 0.2s ease !important;
}
div:has(> .space-y-3 > .rili-markdown-renderer):hover {
  box-shadow: 0 4px 16px var(--md-shadow-hover) !important;
}
div:has(> .space-y-3 > .rili-markdown-renderer) .rili-markdown-renderer,
div:has(> .space-y-3 > .rili-markdown-renderer) p,
div:has(> .space-y-3 > .rili-markdown-renderer) li,
div:has(> .space-y-3 > .rili-markdown-renderer) td,
div:has(> .space-y-3 > .rili-markdown-renderer) th {
  color: var(--md-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.7 !important;
  font-size: 1.05em !important;
}

/* ---------- 2. 输入组容器（无边框，柔阴影） ---------- */
[data-slot="input-group"] {
  background-color: var(--md-bg-light) !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 12px var(--md-shadow) !important;
  transition: box-shadow 0.2s ease !important;
}
[data-slot="input-group"]:focus-within {
  box-shadow: 0 0 0 4px var(--md-focus-ring), 0 2px 12px var(--md-shadow) !important;
}

/* ---------- 3. 文本框（可拖拽调整大小，无边框） ---------- */
[data-slot="input-group-control"] {
  background-color: var(--md-bg-light) !important;
  border: none !important;
  border-radius: 8px !important;
  color: var(--md-text) !important;
  box-shadow: inset 0 1px 4px var(--md-inset-shadow) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.95em !important;
  line-height: 1.6 !important;
  padding: 12px 16px !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
  resize: vertical !important;
}
[data-slot="input-group-control"]:focus-visible {
  background-color: rgba(var(--md-bg-light-rgb), 0.98) !important;
  box-shadow: inset 0 1px 6px var(--md-inset-shadow), 0 0 0 3px var(--md-focus-ring) !important;
  outline: none !important;
}
[data-slot="input-group-control"]::placeholder {
  color: var(--md-placeholder) !important;
  opacity: 0.8 !important;
}

/* ---------- 4. 工具栏容器（保留上下分割线） ---------- */
#prompt-input-header,
#prompt-input-footer {
  background: rgba(var(--md-bg-light-rgb), 0.6) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
#prompt-input-header {
  border-bottom: 1px solid var(--md-divider) !important;
  padding-bottom: 6px !important;
}
#prompt-input-footer {
  border-top: 1px solid var(--md-divider) !important;
  padding-top: 6px !important;
}

/* 分隔竖线 */
#prompt-input-header .w-px,
#prompt-input-footer .w-px {
  background-color: var(--md-divider) !important;
}

/* 通用按钮（暖棕色边框，莫兰迪特色） */
#prompt-input-header button[class*="border-input"],
#prompt-input-footer button[class*="border-input"] {
  background: linear-gradient(to bottom, var(--md-bg-container), var(--md-bg-container-2)) !important;
  border-color: var(--md-accent) !important;
  color: var(--md-text) !important;
  box-shadow: 0 1px 3px var(--md-shadow) !important;
  transition: all 0.15s ease !important;
}
#prompt-input-header button[class*="border-input"]:hover,
#prompt-input-footer button[class*="border-input"]:hover {
  background: linear-gradient(to bottom, var(--md-bg-container-2), var(--md-bg-container-3)) !important;
  border-color: var(--md-border-strong) !important;
  box-shadow: 0 2px 6px var(--md-shadow-hover) !important;
  transform: translateY(-1px) !important;
}
#prompt-input-header button[class*="border-input"]:focus-visible,
#prompt-input-footer button[class*="border-input"]:focus-visible {
  box-shadow: 0 0 0 2px var(--md-border-strong), 0 1px 3px var(--md-shadow) !important;
  outline: none !important;
}

/* 模型选择器按钮（暖棕边框一致） */
button:has(img[alt="google logo"]) {
  background: linear-gradient(to bottom, var(--md-bg-container), var(--md-bg-container-2)) !important;
  border-color: var(--md-accent) !important;
  color: var(--md-text) !important;
  box-shadow: 0 1px 3px var(--md-shadow) !important;
}
button:has(img[alt="google logo"]):hover {
  background: linear-gradient(to bottom, var(--md-bg-container-2), var(--md-bg-container-3)) !important;
  border-color: var(--md-border-strong) !important;
}
button:has(img[alt="google logo"]):focus-visible {
  box-shadow: 0 0 0 2px var(--md-border-strong), 0 1px 3px var(--md-shadow) !important;
  outline: none !important;
}

/* 图标颜色 */
#prompt-input-header svg,
#prompt-input-footer svg {
  color: var(--md-icon) !important;
}

/* 发送按钮 - 暖棕色渐变 */
#prompt-input-footer button[type="submit"] {
  background: linear-gradient(135deg, var(--md-send-from), var(--md-send-to)) !important;
  border: none !important;
  color: var(--md-send-text) !important;
  box-shadow: 0 2px 8px rgba(160, 136, 120, 0.35) !important;
  transition: all 0.2s ease !important;
}
#prompt-input-footer button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--md-send-to), var(--md-send-from)) !important;
  box-shadow: 0 4px 12px rgba(160, 136, 120, 0.45) !important;
  transform: translateY(-1px) !important;
}
#prompt-input-footer button[type="submit"] svg {
  color: var(--md-send-text) !important;
}
#prompt-input-footer button[type="submit"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(160, 136, 120, 0.4), 0 2px 8px rgba(160, 136, 120, 0.35) !important;
}

/* ---------- 5. 顶部导航栏适配（新增） ---------- */
header {
  background-color: var(--md-bg-light) !important;
  border-bottom: 1px solid var(--md-divider) !important;
  box-shadow: 0 2px 8px var(--md-shadow) !important;
  color: var(--md-text) !important;
}

/* 导航栏内所有按钮基础样式 */
header button {
  background: transparent !important;
  border: none !important;
  color: var(--md-text) !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease !important;
}

/* 按钮悬停 */
header button:hover {
  background: linear-gradient(to bottom, var(--md-bg-container), var(--md-bg-container-2)) !important;
  color: var(--md-text) !important;
  box-shadow: 0 1px 3px var(--md-shadow) !important;
  transform: translateY(-1px) !important;
}

/* 按钮聚焦 */
header button:focus-visible {
  box-shadow: 0 0 0 2px var(--md-border-strong), 0 1px 3px var(--md-shadow) !important;
  outline: none !important;
}

/* 图标颜色 */
header button svg {
  color: var(--md-icon) !important;
  transition: color 0.15s ease !important;
}
header button:hover svg {
  color: var(--md-text) !important;
}

/* 中间区域文字 */
#nav-middle {
  color: var(--md-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.95em !important;
}

/* ---------- 6. 暗色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --md-bg-light: #3d4a3d;
    --md-bg-light-rgb: 61, 74, 61;
    --md-bg-container: #4a5a4a;
    --md-bg-container-2: #3d4a3d;
    --md-bg-container-3: #2d3a2d;
    --md-border: #5a6b5a;
    --md-border-strong: #8fa88f;
    --md-accent: #9a8270;              /* 暗色下暖棕微调 */
    --md-text: #d8e0d4;
    --md-icon: #9ab89a;
    --md-shadow: rgba(0, 0, 0, 0.3);
    --md-shadow-hover: rgba(0, 0, 0, 0.45);
    --md-send-from: #a08878;
    --md-send-to: #907868;
    --md-send-text: #ffffff;
    --md-divider: #5a6b5a;
    --md-inset-shadow: rgba(0, 0, 0, 0.2);
    --md-focus-ring: rgba(143, 168, 143, 0.3);
    --md-placeholder: #7a8a7a;
  }

  /* 输入组容器 */
  [data-slot="input-group"] {
    background-color: var(--md-bg-light) !important;
    box-shadow: 0 2px 12px var(--md-shadow) !important;
  }
  [data-slot="input-group"]:focus-within {
    box-shadow: 0 0 0 4px var(--md-focus-ring), 0 2px 12px var(--md-shadow) !important;
  }

  /* 文本框 */
  [data-slot="input-group-control"] {
    background-color: var(--md-bg-light) !important;
    box-shadow: inset 0 1px 4px var(--md-inset-shadow) !important;
    color: var(--md-text) !important;
  }
  [data-slot="input-group-control"]:focus-visible {
    background-color: rgba(var(--md-bg-light-rgb), 0.98) !important;
    box-shadow: inset 0 1px 6px var(--md-inset-shadow), 0 0 0 3px var(--md-focus-ring) !important;
  }
  [data-slot="input-group-control"]::placeholder {
    color: var(--md-placeholder) !important;
  }

  /* 消息气泡 */
  div:has(> .space-y-3 > .rili-markdown-renderer) {
    background: rgba(var(--md-bg-light-rgb), 0.95) !important;
    border-color: var(--md-border) !important;
    box-shadow: 0 2px 10px var(--md-shadow) !important;
  }
  div:has(> .space-y-3 > .rili-markdown-renderer):hover {
    box-shadow: 0 4px 16px var(--md-shadow-hover) !important;
  }
  div:has(> .space-y-3 > .rili-markdown-renderer) .rili-markdown-renderer,
  div:has(> .space-y-3 > .rili-markdown-renderer) p,
  div:has(> .space-y-3 > .rili-markdown-renderer) li,
  div:has(> .space-y-3 > .rili-markdown-renderer) td,
  div:has(> .space-y-3 > .rili-markdown-renderer) th {
    color: var(--md-text) !important;
  }

  /* 工具栏容器 */
  #prompt-input-header,
  #prompt-input-footer {
    background: rgba(var(--md-bg-light-rgb), 0.6) !important;
  }
  #prompt-input-header {
    border-bottom-color: var(--md-divider) !important;
  }
  #prompt-input-footer {
    border-top-color: var(--md-divider) !important;
  }

  /* 分隔竖线 */
  #prompt-input-header .w-px,
  #prompt-input-footer .w-px {
    background-color: var(--md-divider) !important;
  }

  /* 通用按钮（暖棕边框） */
  #prompt-input-header button[class*="border-input"],
  #prompt-input-footer button[class*="border-input"],
  button:has(img[alt="google logo"]) {
    background: linear-gradient(to bottom, var(--md-bg-container), var(--md-bg-container-2)) !important;
    border-color: var(--md-accent) !important;
    color: var(--md-text) !important;
  }
  #prompt-input-header button[class*="border-input"]:hover,
  #prompt-input-footer button[class*="border-input"]:hover,
  button:has(img[alt="google logo"]):hover {
    background: linear-gradient(to bottom, var(--md-bg-container-2), var(--md-bg-container-3)) !important;
    border-color: var(--md-border-strong) !important;
  }
  #prompt-input-header button[class*="border-input"]:focus-visible,
  #prompt-input-footer button[class*="border-input"]:focus-visible,
  button:has(img[alt="google logo"]):focus-visible {
    box-shadow: 0 0 0 2px var(--md-border-strong), 0 1px 3px var(--md-shadow) !important;
  }

  /* 图标 */
  #prompt-input-header svg,
  #prompt-input-footer svg {
    color: var(--md-icon) !important;
  }

  /* 发送按钮 */
  #prompt-input-footer button[type="submit"] {
    background: linear-gradient(135deg, var(--md-send-from), var(--md-send-to)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  }
  #prompt-input-footer button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--md-send-to), var(--md-send-from)) !important;
  }
  #prompt-input-footer button[type="submit"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(160, 136, 120, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  }
  #prompt-input-footer button[type="submit"] svg {
    color: var(--md-send-text) !important;
  }

  /* 顶部导航栏暗色适配 */
  header {
    background-color: var(--md-bg-light) !important;
    border-bottom-color: var(--md-divider) !important;
    box-shadow: 0 2px 8px var(--md-shadow) !important;
  }
  header button:hover {
    background: linear-gradient(to bottom, var(--md-bg-container), var(--md-bg-container-2)) !important;
  }
  header button svg {
    color: var(--md-icon) !important;
  }
  header button:hover svg {
    color: var(--md-text) !important;
  }
}

/* ======================
   最终优化补丁：防抖动 + 消除加载卡顿（兼容新/旧平台）
   直接追加到主题 CSS 末尾即可
   ====================== */

/* ----- 1. 防止高度变化时聊天区自动滚动（核心） ----- */
/*
   请根据实际滚动容器替换选择器。
   新平台通常的消息列表容器带有 overflow-y-auto 类，已用通用选择器捕获；
   若仍抖动，请 F12 找到滚动元素，将其类名/ID 添加到下列选择器中。
*/
body,                                 /* 兜底 */
[class*="overflow-y-auto"],
[class*="overflow-y-scroll"],
.chat-scroll-container,              /* 旧平台占位 */
.message-list {                      /* 旧平台占位 */
  overflow-anchor: none !important;            /* 禁用滚动锚定 */
  scroll-behavior: auto !important;            /* 关闭平滑滚动（避免阻塞渲染） */
  scrollbar-gutter: stable !important;         /* 预留滚动条空间，防止宽度抖动 */
}

/* ----- 2. details 折叠优化（平稳过渡，不影响布局） ----- */
details {
  contain: none !important;                    /* 移除可能导致渲染死锁的属性 */
}

details > div {
  overflow: hidden !important;
  transition: max-height 0.25s ease-out, opacity 0.25s ease-out !important;
  max-height: 3000px !important;               /* 需大于面板实际最大高度，可按需调整 */
  opacity: 1 !important;
  animation: none !important;                  /* 禁用原 slideDown 动画 */
}

details:not([open]) > div {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-width: 0 !important;
}

/* ----- 3. 加载动画性能优化（消除卡顿） ----- */
/*
   将原有的 box-shadow 和 filter 动画替换为纯 transform + opacity，
   完全不占用主线程，加载时也不会卡死界面。
*/
[class*="dot-flashing"]::before {
  background: #c4a08c !important;
  border-radius: 50% !important;
  opacity: 0.9 !important;
  box-shadow: none !important;                  /* 移除昂贵阴影 */
  animation: dotWarmPulse 1.5s ease-in-out infinite !important;
}

@keyframes dotWarmPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-5px) scale(1.25);
    opacity: 1;
  }
}

[class*="dot-flashing"]::after {
  animation: conceiveWarmFlow 2.5s ease-in-out infinite !important;
  filter: none !important;                     /* 去掉 drop-shadow 滤镜 */
  text-shadow: 0 0 8px rgba(196, 160, 140, 0.3) !important;  /* 改用较轻的阴影 */
}

@keyframes conceiveWarmFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 200% 50%; }
}

/* 暗色模式下的加载动画 */
@media (prefers-color-scheme: dark) {
  [class*="dot-flashing"]::before {
    background: #d0b8a8 !important;
    box-shadow: none !important;
    animation-name: dotWarmPulseDark !important;
  }
  @keyframes dotWarmPulseDark {
    0%, 100% {
      transform: translateY(0) scale(1);
      opacity: 0.7;
    }
    50% {
      transform: translateY(-5px) scale(1.25);
      opacity: 1;
    }
  }
  [class*="dot-flashing"]::after {
    filter: none !important;
    text-shadow: 0 0 8px rgba(230, 210, 190, 0.3) !important;
    animation-name: conceiveWarmFlowDark !important;
  }
  @keyframes conceiveWarmFlowDark {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 200% 50%; }
  }
}

/* ----- 4. 加载期间暂停其他元素的过渡（可选，进一步减轻主线程压力） ----- */
/*
   当页面中出现加载动画时，临时暂停其所在父容器中其他元素的 transition/animation，
   避免和加载动画争抢渲染资源。
*/
div:has(> [class*="dot-flashing"]) * {
  transition-duration: 0s !important;
  animation-play-state: paused !important;
}

/* 但必须让加载动画自身正常运行 */
div:has(> [class*="dot-flashing"]) [class*="dot-flashing"],
div:has(> [class*="dot-flashing"]) [class*="dot-flashing"]::before,
div:has(> [class*="dot-flashing"]) [class*="dot-flashing"]::after {
  animation-play-state: running !important;
}