/* ==========================================
   1. 消息气泡区及操作按钮（全局扁平化与粉色特效）
   ========================================== */

/* 用户气泡 - 冰蓝泪水（虚幻的过去） */
#customized-question-content {
  background: linear-gradient(135deg, rgba(147, 197, 253, 0.12) 0%, rgba(165, 180, 252, 0.08) 100%) !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  box-shadow: 0 4px 12px rgba(147, 197, 253, 0.05) !important;
  border-radius: 16px 16px 4px 16px !important;
}

/* AI气泡 - 凋零之红（痛切的终焉） */
#customized-answer-content {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(100, 116, 139, 0.05) 100%) !important;
  border: 1px solid rgba(244, 63, 94, 0.2) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.03) !important;
  border-radius: 16px 16px 16px 4px !important;
}

/* 顶部装饰条微调 */
#customized-question-content .bg-\[\#c9e1e9\] {
  background-color: rgba(147, 197, 253, 0.6) !important;
  height: 3px !important;
}
#customized-answer-content .bg-\[\#F1CBCB\] {
  background-color: rgba(244, 63, 94, 0.6) !important;
  height: 3px !important;
}

/* 消息文字排版与对比度优化 */
#customized-question-content .markdown-body,
#customized-answer-content .markdown-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: inherit !important;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* 模型名称与消耗展示 */
#customized-answer-content .text-purple-500.mt-1 {
  color: rgba(165, 180, 252, 0.8) !important;
}
#customized-answer-content .text-orange-500 {
  color: #f43f5e !important;
  font-weight: 600 !important;
}

/* 
   强力清除所有气泡操作按钮的实体背景
   涵盖：复制、退款、截断、重发、编辑、删除、刷新等所有按钮
*/
#customized-question-content button,
#customized-answer-content button,
#customized-reload-button,
#customized-edit-button,
#customized-resend-button,
#customized-delete-button,
#customized-copy-button,
#customized-truncate-button,
#customized-refund-button,
#customized-copy-question-button,
#customized-create-image-button,
#customized-create-audio-button,
#customized-branch-and-share-button,
#customized-prompt-log-button,
[id*="customized-"][id*="-button"] {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 0.5 !important;
  color: #64748b !important;
  border-radius: 6px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* 悬停时同步呈现凋零红与粉色光晕特效 */
#customized-question-content button:hover,
#customized-answer-content button:hover,
#customized-reload-button:hover,
#customized-edit-button:hover,
#customized-resend-button:hover,
#customized-delete-button:hover,
#customized-copy-button:hover,
#customized-truncate-button:hover,
#customized-refund-button:hover,
#customized-copy-question-button:hover,
#customized-create-image-button:hover,
#customized-create-audio-button:hover,
#customized-branch-and-share-button:hover,
#customized-prompt-log-button:hover,
[id*="customized-"][id*="-button"]:hover {
  opacity: 1 !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.08) !important; /* 粉色悬停光晕 */
  transform: translateY(-1px) !important;
}


/* ==========================================
   2. 加载动画：飘散的黄金妖精粒子
   ========================================== */

#customized-answer-content [class*="dot-flashing"] {
  display: none !important;
}

#customized-answer-content .flex.items-center.justify-center.w-6.h-5 {
  position: relative !important;
  width: 32px !important;
  height: 20px !important;
}

#customized-answer-content .flex.items-center.justify-center.w-6.h-5::before {
  content: '' !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 30" fill="%23f43f5e"><circle cx="15" cy="15" r="6"><animate attributeName="opacity" dur="1.8s" values="0.2;1;0.2" repeatCount="indefinite" begin="0.1s" /><animate attributeName="cy" dur="1.8s" values="18;12;18" repeatCount="indefinite" begin="0.1s" /></circle><circle cx="60" cy="15" r="6"><animate attributeName="opacity" dur="1.8s" values="0.2;1;0.2" repeatCount="indefinite" begin="0.3s" /><animate attributeName="cy" dur="1.8s" values="12;18;12" repeatCount="indefinite" begin="0.3s" /></circle><circle cx="105" cy="15" r="6"><animate attributeName="opacity" dur="1.8s" values="0.2;1;0.2" repeatCount="indefinite" begin="0.5s" /><animate attributeName="cy" dur="1.8s" values="18;12;18" repeatCount="indefinite" begin="0.5s" /></circle></svg>') !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}


/* ==========================================
   3. 顶部控制栏：浮空遗迹控制台
   ========================================== */

/* 顶部控制栏整体 - 磨砂结界 */
.sticky.top-0, 
header,
[class*="header-container"],
#customized-header {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(147, 197, 253, 0.3) !important;
  box-shadow: 0 2px 15px rgba(100, 116, 139, 0.05) !important;
  transition: all 0.3s ease !important;
}

/* 顶部控制栏标题文字 */
.sticky.top-0 font, 
.sticky.top-0 span, 
.sticky.top-0 p,
header font,
header span {
  color: #1e293b !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

/* 顶部控制栏内的所有图标与按钮 */
.sticky.top-0 button,
.sticky.top-0 svg,
.sticky.top-0 a,
header button,
header svg {
  color: #475569 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
}

.sticky.top-0 button:hover,
.sticky.top-0 svg:hover,
.sticky.top-0 a:hover,
header button:hover,
header svg:hover {
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.08) !important;
  border-radius: 6px !important;
}

/* 模型选择器按钮 */
#customized-model-selector {
  background: rgba(241, 245, 249, 0.7) !important;
  border: 1px solid rgba(147, 197, 253, 0.3) !important;
  border-radius: 8px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}
#customized-model-selector:hover {
  border-color: rgba(244, 63, 94, 0.4) !important;
  background: rgba(244, 63, 94, 0.03) !important;
}

/* 顶部设置按钮 */
#header-setting-button {
  background: rgba(147, 197, 253, 0.1) !important;
  border: 1px solid rgba(147, 197, 253, 0.3) !important;
  color: #3b82f6 !important;
  border-radius: 50% !important;
}
#header-setting-button:hover {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
  color: #f43f5e !important;
  transform: rotate(30deg) !important;
}


/* ==========================================
   4. 底部输入区与快捷键（含MOD与隐藏调试按钮美化）
   ========================================== */

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

.bg-white.border-\[1\.5px\] {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(147, 197, 253, 0.4) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(100, 116, 139, 0.06) !important;
}
.bg-white.border-\[1\.5px\]:focus-within {
  border-color: rgba(244, 63, 94, 0.6) !important;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15) !important;
  background: #ffffff !important;
}

#ai-chat-input {
  color: #0f172a !important;
  caret-color: #f43f5e !important;
  font-weight: 500 !important;
}
#ai-chat-input::placeholder {
  color: #64748b !important;
  opacity: 0.8 !important;
}

/* 发送按钮 */
#ai-send-button {
  background-color: rgba(147, 197, 253, 0.2) !important;
  border: 1px solid rgba(147, 197, 253, 0.4) !important;
  color: #2563eb !important;
  border-radius: 8px !important;
}
#ai-send-button:hover {
  background-color: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  color: #e11d48 !important;
}

/* 
   MOD按钮、隐藏/展开按钮及子功能键（调试、记忆增强等）同步美化 
*/
#ai-mod-button,
#toggle-sub-buttons,
#ai-mod-button2 button,
#customized-ai-summary-button,
#customized-flow-button,
#customized-comment-button,
#customized-scroll-to-bottom-button,
[id*="debug-button"],
[id*="shortcut-command-button"] {
  border: 1px solid rgba(147, 197, 253, 0.3) !important;
  color: #475569 !important;
  background: rgba(255, 255, 255, 0.5) !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
  border-radius: 8px !important;
  opacity: 0.5 !important; /* 强制半透明 */
  box-shadow: none !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

#ai-mod-button:hover,
#toggle-sub-buttons:hover,
#ai-mod-button2 button:hover,
#customized-ai-summary-button:hover,
#customized-flow-button:hover,
#customized-comment-button:hover,
#customized-scroll-to-bottom-button:hover,
[id*="debug-button"]:hover,
[id*="shortcut-command-button"]:hover {
  opacity: 1 !important; /* 悬停完全显现 */
  border-color: rgba(244, 63, 94, 0.5) !important;
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.08) !important; /* 粉色悬停光晕 */
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.1) !important;
}


/* ==========================================
   5. 评论区：终焉的石化与叹息
   ========================================== */

.absolute.bottom-0.z-20.inset-x-0.bg-white {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-top: 2px solid rgba(244, 63, 94, 0.25) !important;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px 16px 0 0 !important;
}

button[aria-label="close"] {
  color: #64748b !important;
}
button[aria-label="close"]:hover {
  color: #f43f5e !important;
  transform: scale(1.1) !important;
}

.MuiRating-iconFilled {
  color: #f43f5e !important;
  filter: drop-shadow(0 0 2px rgba(244, 63, 94, 0.4)) !important;
}
.MuiRating-iconEmpty {
  color: rgba(148, 163, 184, 0.3) !important;
}

/* 排序按钮组 */
.p-3.overflow-y-auto.h-full > .MuiStack-root:first-child button {
  border-radius: 6px !important;
}
.MuiButton-containedPrimary {
  background-color: rgba(244, 63, 94, 0.15) !important;
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  color: #f43f5e !important;
}
.MuiButton-outlinedPrimary {
  border: 1px solid rgba(147, 197, 253, 0.3) !important;
  color: #64748b !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

/* 评论输入框 */
.flex.flex-col.border-\[1\.5px\].border-gray-200 {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(147, 197, 253, 0.3) !important;
  border-radius: 10px !important;
}
textarea[placeholder="发表评论"] {
  color: #0f172a !important;
  caret-color: #f43f5e !important;
}

#basic-button {
  color: #93c5fd !important;
}
#basic-button:hover {
  color: #f43f5e !important;
}

svg[data-icon="Send03"] {
  color: #93c5fd !important;
}
svg[data-icon="Send03"]:hover {
  color: #f43f5e !important;
  transform: scale(1.05) !important;
}

.flex.flex-col.border-\[1\.5px\].border-gray-200 ~ div[class*="divider"] {
  border-color: rgba(100, 116, 139, 0.1) !important;
}

.group.ml-0 button.text-gray-400 {
  transition: color 0.3s ease !important;
}
.group.ml-0 button.text-gray-400:hover {
  color: #f43f5e !important;
}
.group.ml-0 span.cursor-pointer {
  color: #64748b !important;
}
.group.ml-0 span.cursor-pointer:hover {
  color: #93c5fd !important;
}

.p-3.overflow-y-auto.h-full::-webkit-scrollbar {
  width: 5px !important;
}
.p-3.overflow-y-auto.h-full::-webkit-scrollbar-thumb {
  background: rgba(147, 197, 253, 0.3) !important;
  border-radius: 10px !important;
}
.p-3.overflow-y-auto.h-full::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 63, 94, 0.4) !important;
}


/* ==========================================
   6. 状态栏 (Details/Summary) 终焉终端美化
   ========================================== */

.markdown-body details {
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  margin: 12px 0 !important;
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.02) !important;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

.markdown-body details[open] {
  border-color: rgba(244, 63, 94, 0.3) !important;
  background: rgba(244, 63, 94, 0.02) !important;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.05) !important;
}

.markdown-body details summary {
  font-weight: 600 !important;
  color: #475569 !important;
  cursor: pointer !important;
  padding: 6px 0 !important;
  list-style: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  transition: color 0.3s ease !important;
}

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

.markdown-body details summary::after {
  content: '✦' !important;
  color: rgba(147, 197, 253, 0.8) !important;
  font-size: 12px !important;
  transition: transform 0.4s ease, color 0.4s ease !important;
}

.markdown-body details[open] summary::after {
  content: '✧' !important;
  color: #f43f5e !important;
  transform: rotate(90deg) !important;
}

.markdown-body details summary:hover {
  color: #f43f5e !important;
}

.markdown-body details details {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px dashed rgba(100, 116, 139, 0.2) !important;
  margin: 8px 0 !important;
}

/* 记忆表格 */
.markdown-body table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 12px 0 !important;
  font-size: 12px !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

.markdown-body th {
  background-color: rgba(147, 197, 253, 0.15) !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
  padding: 8px !important;
}

.markdown-body td {
  border: 1px solid rgba(147, 197, 253, 0.15) !important;
  padding: 6px 8px !important;
  color: #334155 !important;
}

/* 行动选项 */
.markdown-body details:has(summary:contains("行动选项")) {
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  background: rgba(244, 63, 94, 0.03) !important;
}

.markdown-body details:has(summary:contains("行动选项")) p {
  padding: 10px 14px !important;
  margin: 8px 0 !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  font-size: 13px !important;
  color: #1e293b !important;
}

.markdown-body details:has(summary:contains("行动选项")) p:hover {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: #f43f5e !important;
  color: #f43f5e !important;
  transform: translateX(4px) !important;
}


/* ==========================================
   7. 暗色模式适配
   ========================================== */
@media (prefers-color-scheme: dark) {
  .sticky.top-0,
  header {
    background: rgba(15, 23, 42, 0.85) !important;
    border-bottom-color: rgba(244, 63, 94, 0.3) !important;
  }
  .sticky.top-0 font, 
  .sticky.top-0 span, 
  .sticky.top-0 p,
  header font,
  header span {
    color: #f8fafc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
  }
  .sticky.top-0 button,
  .sticky.top-0 svg,
  .sticky.top-0 a,
  header button,
  header svg {
    color: #cbd5e1 !important;
  }
  .bg-white.border-\[1\.5px\] {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
  }
  #ai-chat-input {
    color: #f8fafc !important;
  }
  #ai-chat-input::placeholder {
    color: #94a3b8 !important;
  }
  .markdown-body details {
    background: rgba(15, 23, 42, 0.4) !important;
  }
  .markdown-body details summary {
    color: #cbd5e1 !important;
  }
  .markdown-body details:has(summary:contains("行动选项")) p {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #f8fafc !important;
  }
  .absolute.bottom-0.z-20.inset-x-0.bg-white {
    background: rgba(15, 23, 42, 0.95) !important;
  }
  .MuiButton-outlinedPrimary {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #cbd5e1 !important;
  }
  textarea[placeholder="发表评论"] {
    color: #f8fafc !important;
  }
}