/* 英伦学院风格 聊天框 / 内容框 */
.bg-gray-100\/90.relative.inline-block {
  /* 学院风米白底色 */
  background: linear-gradient(to bottom, #f9f7f2 0%, #f3f0e9 100%) !important;
  /* 经典酒红细边框 */
  border: 1px solid #912c36 !important;
  border-radius: 8px !important;
  /* 复古印刷质感阴影 */
  box-shadow: 0 2px 8px rgba(50, 30, 30, 0.1),
              inset 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
  padding: 16px 22px !important;
  margin: 12px 0 !important;
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
  transition: all 0.25s ease !important;
}

/* 悬停效果：轻微凸起 + 边框加深 */
.bg-gray-100\/90.relative.inline-block:hover {
  box-shadow: 0 4px 12px rgba(50, 30, 30, 0.15) !important;
  border-color: #7a232b !important;
  transform: translateY(-1px) !important;
}

/* 英伦格纹暗纹背景（极淡、不影响阅读） */
.bg-gray-100\/90.relative.inline-block::before {
  content: "" !important;
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* 经典苏格兰格纹 SVG 暗纹（透明度极低） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40' opacity='0.04'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23912c36' stroke-width='1'/%3E%3C/svg%3E") !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* 文本样式 - 正统英伦学院排版 */
.markdown-body {
  /* 复古深棕红文字，高可读性 */
  color: #3a2e2b !important;
  /* 英文衬线字体 + 中文优雅宋体 */
  font-family: "Times New Roman", "Noto Serif SC", "SimSun", "宋体", serif !important;
  font-size: 16px !important;
  line-height: 1.75 !important;
  letter-spacing: 0.2px !important;
  text-shadow: none !important;
  position: relative !important;
  z-index: 1 !important;
  background: transparent !important;
}

/* 英伦学院风格 - 底部按钮样式 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
  color: #912c36 !important;
  font-family: "Times New Roman", "Noto Serif SC", "SimSun", serif !important;
  font-size: 13px !important;
  padding: 4px 8px !important;
  transition: all 0.2s ease !important;
}

.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
  color: #ffffff !important;
  background-color: #912c36 !important;
  border-radius: 4px !important;
}

/* 模型名称和Token计数样式 */
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
  color: #912c36 !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-size: 12px !important;
  font-style: italic !important;
}

/* 移除顶部颜色条 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* ==============================================
   一、顶部栏美化 - 英伦学院 象牙白+酒红边框版
=============================================== */
.sticky.w-full.top-0.flex.items-center {
  background: linear-gradient(180deg, #f9f7f2 0%, #f3f0e9 100%);
  border-bottom: 2px solid #912c36;
  box-shadow: 0 2px 12px rgba(145, 44, 54, 0.12);
  padding: 8px 16px;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.sticky.w-full.top-0.flex.items-center::before {
  content: "";
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: radial-gradient(circle, rgba(145, 44, 54, 0.1) 0%, transparent 60%);
  animation: topGlow 10s linear infinite;
  pointer-events: none;
}

@keyframes topGlow {
  0% { transform: translate(0, 0); }
  50% { transform: translate(15%, 15%); }
  100% { transform: translate(0, 0); }
}

#ai-model-selector .group.flex.items-center {
  background: linear-gradient(180deg, #f9f7f2 0%, #f3f0e9 100%);
  border: 1px solid #912c36;
  border-radius: 20px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(145, 44, 54, 0.15);
  transition: all 0.3s ease;
}

#ai-model-selector .group.flex.items-center:hover {
  box-shadow: 0 4px 12px rgba(145, 44, 54, 0.2);
  transform: translateY(-1px);
}

#ai-model-selector .truncate.text-\[13px\] {
  color: #3a2e2b !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-weight: 500;
}

#ai-model-selector .shrink-0.flex.items-center svg {
  color: #912c36 !important;
  filter: drop-shadow(0 1px 2px rgba(145, 44, 54, 0.2));
}

.sticky.w-full.top-0 svg.lucide-clock-8,
.sticky.w-full.top-0 svg:has(use[href="#icon-icon-set"]) {
  color: #912c36 !important;
  filter: drop-shadow(0 1px 2px rgba(145, 44, 54, 0.2));
}

.sticky.w-full.top-0 span.MuiBadge-dot.md\:hidden {
  background: #912c36 !important;
  box-shadow: 0 0 6px #912c36;
}

#header-setting-button {
  background: linear-gradient(180deg, #912c36 0%, #7a232b 100%) !important;
  border: 1px solid #7a232b !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(145, 44, 54, 0.25) !important;
}

#header-setting-button:hover {
  box-shadow: 0 3px 10px rgba(145, 44, 54, 0.35) !important;
  transform: translateY(-1px);
}

#header-setting-button svg {
  color: #fff !important;
}

/* ==============================================
   二、底部输入栏美化 - 英伦书卷 象牙纸质感
=============================================== */
.bg-gradient-to-t {
  background: linear-gradient(to top, rgba(249, 247, 242, 0.96) 0%, rgba(243, 240, 233, 0.92) 100%) !important;
  backdrop-filter: blur(8px);
  border-top: 2px solid #912c36;
}

#ai-chat-bottom-input {
  background: linear-gradient(180deg, #ffffff 0%, #faf7f0 100%) !important;
  border: 1px solid #912c36 !important;
  border-radius: 12px;
  box-shadow: inset 0 1px 4px rgba(145, 44, 54, 0.1), 0 2px 8px rgba(145, 44, 54, 0.08);
  margin: 12px;
  position: relative;
  overflow: hidden;
}

#ai-chat-bottom-input::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(145, 44, 54, 0.06), transparent);
  animation: inputShine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes inputShine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: -100%; }
}

#ai-chat-input {
  background: transparent !important;
  color: #3a2e2b !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-size: 14px;
  padding: 12px 16px;
  border: none !important;
  min-height: 48px;
}

#ai-chat-input::placeholder {
  color: #b8a98f !important;
  font-style: italic;
}

#ai-chat-input::selection {
  background: rgba(145, 44, 54, 0.15) !important;
}

/* ==============================================
   三、底部按钮美化 - 英伦学院 酒红徽章按钮
=============================================== */
#ai-mod-button2 button.MuiButton-root {
  background: linear-gradient(180deg, #912c36 0%, #7a232b 100%) !important;
  border: 1px solid #671d23 !important;
  border-radius: 6px !important;
  color: #ffffff !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-weight: 600;
  padding: 6px 14px;
  box-shadow: 0 3px 8px rgba(145, 44, 54, 0.25);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#ai-mod-button2 button.MuiButton-root::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s ease;
}

#ai-mod-button2 button.MuiButton-root:hover {
  box-shadow: 0 5px 12px rgba(145, 44, 54, 0.35);
  transform: translateY(-2px);
}

#ai-mod-button2 button.MuiButton-root:hover::before {
  left: 100%;
}

#ai-mod-button2 button.MuiButton-root svg {
  color: #ffffff !important;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* ==============================================
   四、评论区美化 - 英伦学院 复古笔记风
=============================================== */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
  background: linear-gradient(180deg, #f9f7f2 0%, #f3f0e9 100%) !important;
  border-top: 2px solid #912c36;
}

div.text-lg.font-bold {
  color: #3a2e2b !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-weight: 700;
}

p.MuiTypography-body1.text-grey-600 {
  color: #7a6a5e !important;
  font-family: "Noto Serif SC", serif !important;
}

span.MuiRating-root {
  filter: drop-shadow(0 1px 2px rgba(145, 44, 54, 0.15));
}

span.MuiRating-iconEmpty svg {
  color: #d9c9bc !important;
}

span.MuiRating-iconFilled svg {
  color: #912c36 !important;
}

span.text-orange-500 {
  color: #912c36 !important;
  font-weight: bold;
}

div.flex.flex-col.border-gray-200 {
  border: 1px solid #d9c9bc !important;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.7);
}

textarea.rc-textarea {
  background: transparent !important;
  color: #3a2e2b !important;
  font-family: "Noto Serif SC", serif !important;
  padding: 12px;
  border: none !important;
}

div.bg-gray-100.text-gray-500 {
  background: rgba(145, 44, 54, 0.08) !important;
  color: #912c36 !important;
  font-family: "Noto Serif SC", serif !important;
  padding: 4px 12px;
}

div.cursor-pointer.group.flex.items-center.justify-center {
  background: linear-gradient(180deg, #912c36 0%, #7a232b 100%) !important;
  border: 1px solid #671d23 !important;
  border-radius: 6px;
  padding: 8px 16px;
  color: #ffffff !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  transition: all 0.3s ease;
}

div.cursor-pointer.group.flex.items-center.justify-center:hover {
  box-shadow: 0 4px 10px rgba(145, 44, 54, 0.3);
  transform: translateY(-1px);
}

div[data-state="closed"] svg[data-icon="Send03"] {
  color: #ffffff !important;
}

div.style_divider__mW0YX {
  border-color: #d9c9bc !important;
  opacity: 0.7;
}

div.group.ml-0 {
  background: rgba(249, 247, 242, 0.6) !important;
  border: 1px solid rgba(217, 201, 188, 0.6);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

div.group.ml-0:hover {
  background: rgba(249, 247, 242, 0.9) !important;
  border-color: #912c36;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(145, 44, 54, 0.12);
}

div.group img.rounded-full {
  border: 2px solid #912c36;
  box-shadow: 0 2px 6px rgba(145, 44, 54, 0.15);
}

div.text-sm.text-grey-600 span.font-bold {
  color: #3a2e2b !important;
  font-family: "Times New Roman", "Noto Serif SC", serif !important;
  font-weight: 600;
}

span.text-\[10px\] {
  background: #912c36 !important;
  color: #ffffff !important;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
}

div.break-all {
  color: #3a2e2b !important;
  font-family: "Noto Serif SC", serif !important;
  line-height: 1.65;
}

div.text-xs.text-grey-600 {
  color: #9c8b7c !important;
  font-family: "Noto Serif SC", serif !important;
}

button.text-gray-400 {
  color: #912c36 !important;
  transition: all 0.3s ease;
}

button.text-gray-400:hover {
  color: #7a232b !important;
  transform: scale(1.1);
}

span.cursor-pointer {
  color: #912c36 !important;
  font-family: "Noto Serif SC", serif !important;
  transition: all 0.3s ease;
  position: relative;
}

span.cursor-pointer::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #912c36;
  transition: width 0.3s ease;
}

span.cursor-pointer:hover::after {
  width: 100%;
}

div.ml-8.border-l {
  border-color: #d9c9bc !important;
}

/* ==============================================
   五、暗色模式 - 英伦学院 藏青暗夜版
=============================================== */
@media (prefers-color-scheme: dark) {
  /* 顶部栏深色 */
  .sticky.w-full.top-0.flex.items-center {
    background: linear-gradient(180deg, #1a2b4a 0%, #121a2c 100%);
    border-bottom-color: #912c36;
  }
  
  #ai-model-selector .group.flex.items-center {
    background: linear-gradient(180deg, #243657 0%, #1a2b4a 100%);
    border-color: #912c36;
  }
  
  #ai-model-selector .truncate.text-\[13px\] {
    color: #f3f0e9 !important;
  }
  
  /* 输入栏深色 */
  .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(26, 43, 74, 0.96) 0%, rgba(18, 26, 44, 0.92) 100%) !important;
    border-top-color: #912c36;
  }
  
  #ai-chat-bottom-input,
  div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background: #243657 !important;
    border-color: #912c36 !important;
  }
  
  #ai-chat-input,
  textarea.rc-textarea {
    color: #f3f0e9 !important;
  }
  
  #ai-chat-input::placeholder {
    color: #b8b0a8 !important;
  }
  
  /* 评论区深色 */
  div.group.ml-0 {
    background: rgba(26, 43, 74, 0.6) !important;
    border-color: rgba(145, 44, 54, 0.4);
  }
  
  div.group.ml-0:hover {
    background: rgba(26, 43, 74, 0.9) !important;
    border-color: #912c36;
  }

  div.flex.flex-col.border-gray-200 {
    background: rgba(36, 54, 87, 0.8);
    border-color: #3a4a6a !important;
  }
}

/* ==============================================
   六、响应式适配 - 移动端优化
=============================================== */
@media (max-width: 768px) {
  .sticky.w-full.top-0.flex.items-center {
    padding: 6px 12px;
  }
  
  #ai-chat-bottom-input {
    margin: 8px;
  }
}

@media (max-width: 480px) {
  .sticky.w-full.top-0.flex.items-center {
    padding: 4px 8px;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }
}

/* 容器：羊皮纸质感与双线边框 */
ai {
  display: block;
  background-color: #fdfaf1;
  background-image: linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  color: #2c3e50;
  font-family: "Georgia", "Times New Roman", serif;
  padding: 18px;
  border: 4px double #1a2a3a;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15), inset 0 0 100px rgba(184, 134, 11, 0.05);
  margin: 12px 0;
  line-height: 1.7;
}

/* 正文区域：文学排版感 */
ai main {
  display: block;
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.4);
  border-left: 4px solid #800000;
  font-size: 16px;
  color: #1a1a1a;
  text-align: justify;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.05);
}

/* 折叠面板整体样式 */
ai details {
  margin-bottom: 10px;
  border: 1px solid #d4af37;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

ai details[open] {
  box-shadow: 0 5px 15px rgba(26, 42, 58, 0.1);
  background: rgba(255, 255, 255, 0.6);
}

/* 标题栏：绸缎标签感 */
ai summary {
  padding: 10px 15px;
  background: #1a2a3a;
  color: #d4af37;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  border-bottom: 2px solid #b8860b;
  display: flex;
  align-items: center;
  outline: none;
}

ai summary::-webkit-details-marker { display: none; }

ai summary:hover {
  background: #800000;
  color: #fdfaf1;
}

/* 字段内容排版 */
ai details > * {
  padding: 8px 15px;
  font-size: 14px;
}

/* 强调文字 */
ai strong {
  color: #800000;
  font-weight: 700;
  border-bottom: 1px dotted #800000;
}

/* 表格：严谨学术档案风格 */
ai table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
  background: #fff;
}

ai th {
  background: #1a2a3a;
  color: #d4af37;
  padding: 8px;
  border: 1px solid #d4af37;
  text-align: left;
}

ai td {
  padding: 6px 8px;
  border: 1px solid #eee;
  color: #3e4a59;
}

ai tr:nth-child(even) {
  background: #f9f6f0;
}

/* 列表美化（生理监测与行动推荐） */
ai ul {
  padding-left: 20px;
  margin: 10px 0;
}

ai li {
  margin-bottom: 5px;
  color: #2c3e50;
}

/* 行动推荐特别样式 */
ai details:last-of-type li {
  list-style: none;
  padding: 8px 12px;
  background: #f0ede4;
  margin-left: -10px;
  border-left: 3px solid #1a2a3a;
  transition: 0.2s;
}

ai details:last-of-type li:hover {
  background: #1a2a3a;
  color: #fdfaf1;
  transform: translateX(5px);
}

/* 生理监测区：特殊的边缘光晕（模拟信息素） */
ai details:nth-of-type(4) {
  position: relative;
  border: 1px solid #800000;
}

ai details:nth-of-type(4)[open]::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: inset 0 0 15px rgba(128, 0, 0, 0.1);
  pointer-events: none;
}

/* 分隔线 */
ai hr {
  border: none;
  height: 1px;
  background-image: linear-gradient(to right, transparent, #b8860b, transparent);
  margin: 15px 0;
}