.reply-box {
  font-family: 'Georgia', 'Noto Serif SC', 'Source Han Serif CN', 'SimSun', serif !important;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(139, 90, 43, 0.04) 28px,
      rgba(139, 90, 43, 0.04) 29px
    ),
    linear-gradient(160deg, #fdf6ec 0%, #f9edd5 30%, #faf0e0 60%, #f5e6cc 100%) !important;
  padding: 28px 24px !important;
  border-radius: 6px !important;
  position: relative !important;
  overflow: visible !important;
  border: 2px solid #b8860b !important;
  box-shadow:
    inset 0 0 40px rgba(139, 90, 43, 0.08),
    0 4px 20px rgba(101, 67, 33, 0.15),
    0 1px 3px rgba(101, 67, 33, 0.1) !important;
  color: #3e2723 !important;
  line-height: 1.85 !important;
}

/* 书页顶部烫金装饰线 */
.reply-box::before {
  content: '─── ❀ ✦ ❀ ───' !important;
  position: absolute !important;
  top: 8px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 13px !important;
  color: #b8860b !important;
  letter-spacing: 4px !important;
  text-shadow: 0 0 6px rgba(184, 134, 11, 0.3) !important;
  z-index: 1 !important;
  background: transparent !important;
  height: auto !important;
  right: auto !important;
}

/* 书页底部装饰 */
.reply-box::after {
  content: '─── ❀ ✦ ❀ ───' !important;
  position: absolute !important;
  bottom: 8px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 13px !important;
  color: #b8860b !important;
  letter-spacing: 4px !important;
  text-shadow: 0 0 6px rgba(184, 134, 11, 0.3) !important;
}

/* ══════════════════════════════════════════
   ❀ Details 侧边栏弹窗系统 ❀
   关闭态：右侧边缘的书签标签
   展开态：从右侧滑出的羊皮纸卷轴弹窗
   ══════════════════════════════════════════ */

/* details 基础 - 关闭态为侧边书签 */
.reply-box details {
  position: relative !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 6px 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
  transition: none !important;
  transform: none !important;
}

.reply-box details:hover {
  border-color: transparent !important;
  transform: none !important;
  box-shadow: none !important;
}

/* summary - 侧边书签标签样式 */
.reply-box details summary {
  display: flex !important;
  align-items: center !important;
  width: fit-content !important;
  margin-left: auto !important;
  background: linear-gradient(135deg, #8b0000, #a0522d) !important;
  color: #fdf6ec !important;
  font-weight: bold !important;
  padding: 8px 18px 8px 14px !important;
  cursor: pointer !important;
  list-style: none !important;
  border: 1.5px solid #b8860b !important;
  border-right: none !important;
  border-radius: 8px 0 0 8px !important;
  font-size: 13.5px !important;
  letter-spacing: 1.5px !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  box-shadow:
    -2px 2px 8px rgba(101, 67, 33, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
}

.reply-box details summary:hover {
  background: linear-gradient(135deg, #a52a2a, #b8860b) !important;
  padding-left: 20px !important;
  box-shadow:
    -3px 3px 12px rgba(184, 134, 11, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* 隐藏默认三角 */
.reply-box details summary::-webkit-details-marker {
  display: none !important;
}

/* summary 前缀图标 */
.reply-box details summary::before {
  content: '📖' !important;
  display: inline-block !important;
  margin-right: 8px !important;
  font-size: 14px !important;
  transition: transform 0.4s ease !important;
  color: #ffd700 !important;
}

.reply-box details[open] summary::before {
  content: '📕' !important;
  transform: scale(1.1) !important;
}

/* 展开态 summary 样式变化 */
.reply-box details[open] summary {
  background: linear-gradient(135deg, #b8860b, #daa520) !important;
  color: #3e2723 !important;
  border-color: #8b6914 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  box-shadow:
    -2px 2px 12px rgba(184, 134, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  border-bottom: 1.5px solid #8b6914 !important;
  border-radius: 8px 8px 0 0 !important;
  border-right: 1.5px solid #8b6914 !important;
  width: 100% !important;
  margin-left: 0 !important;
}

/* ── 展开内容 · 卷轴弹窗面板 ── */
.reply-box details[open] > :not(summary) {
  animation: scrollUnfurl 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes scrollUnfurl {
  0% {
    opacity: 0;
    max-height: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    max-height: 2000px;
    transform: translateX(0);
  }
}

/* 展开后的内容区域整体样式 */
.reply-box details[open] {
  background:
    linear-gradient(160deg, #fdf6ec 0%, #f7e8cc 50%, #f5e1be 100%) !important;
  border: 1.5px solid #b8860b !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow:
    0 6px 24px rgba(101, 67, 33, 0.2),
    inset 0 0 30px rgba(139, 90, 43, 0.06) !important;
  padding: 0 16px 16px 16px !important;
  margin: 6px 0 !important;
}

/* 展开内容内部的 pre/code 块 */
.reply-box details pre {
  background: rgba(253, 246, 236, 0.8) !important;
  border: 1px solid rgba(184, 134, 11, 0.3) !important;
  border-radius: 6px !important;
  padding: 14px !important;
  margin: 10px 0 !important;
  overflow-x: auto !important;
}

.reply-box details code {
  background: rgba(253, 246, 236, 0.6) !important;
  color: #3e2723 !important;
  font-family: 'Courier New', 'Source Code Pro', monospace !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  border: none !important;
  border-radius: 4px !important;
}

.reply-box details pre code {
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
}

/* ══════════════════════════════════════════
   ❀ 正文面板 · 书页主体 ❀
   ══════════════════════════════════════════ */

.reply-box .panel {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.6) 0%, rgba(253, 246, 236, 0.4) 100%) !important;
  border: 1.5px solid #b8860b !important;
  border-radius: 6px !important;
  padding: 24px 22px !important;
  margin: 22px 0 !important;
  box-shadow:
    0 3px 15px rgba(101, 67, 33, 0.1),
    inset 0 0 20px rgba(139, 90, 43, 0.04) !important;
  position: relative !important;
}

/* 面板顶部烫金花纹 */
.reply-box .panel::before {
  content: '── ✿ ──' !important;
  position: absolute !important;
  top: -11px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #fdf6ec !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  color: #b8860b !important;
  letter-spacing: 3px !important;
  height: auto !important;
  right: auto !important;
}

/* 面板底部装饰 */
.reply-box .panel::after {
  content: '── ✿ ──' !important;
  position: absolute !important;
  bottom: -11px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #fdf6ec !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  color: #b8860b !important;
  letter-spacing: 3px !important;
}

.reply-box .panel h3 {
  color: #8b0000 !important;
  font-size: 18px !important;
  margin-bottom: 16px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid rgba(184, 134, 11, 0.3) !important;
  font-weight: bold !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
  letter-spacing: 2px !important;
  text-shadow: none !important;
  text-align: center !important;
}

/* 标题两侧装饰 */
.reply-box .panel h3::before {
  content: '❦ ' !important;
  color: #b8860b !important;
}

.reply-box .panel h3::after {
  content: ' ❦' !important;
  color: #b8860b !important;
}

.reply-box .panel p {
  color: #3e2723 !important;
  line-height: 1.9 !important;
  font-size: 15px !important;
  text-indent: 2em !important;
  text-align: justify !important;
}

/* ══════════════════════════════════════════
   ❀ 玩家选项 · 命运之书的选择页 ❀
   ══════════════════════════════════════════ */

.reply-box .player-options {
  list-style: none !important;
  padding: 0 !important;
  margin: 28px 0 20px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  counter-reset: option-counter !important;
}

.reply-box .player-options li {
  counter-increment: option-counter !important;
  background:
    linear-gradient(135deg, rgba(253, 246, 236, 0.9) 0%, rgba(247, 232, 204, 0.9) 100%) !important;
  border: 1.5px solid #b8860b !important;
  border-radius: 6px !important;
  padding: 14px 18px 14px 50px !important;
  font-size: 14px !important;
  color: #3e2723 !important;
  transition: all 0.35s ease !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
  line-height: 1.6 !important;
  box-shadow: 0 2px 8px rgba(101, 67, 33, 0.08) !important;
}

/* 选项序号 - 烫金圆章 */
.reply-box .player-options li::before {
  content: counter(option-counter) !important;
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 26px !important;
  height: 26px !important;
  background: linear-gradient(135deg, #b8860b, #daa520) !important;
  color: #fdf6ec !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: bold !important;
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.3) !important;
}

.reply-box .player-options li:hover {
  border-color: #8b0000 !important;
  background:
    linear-gradient(135deg, rgba(255, 240, 240, 0.95) 0%, rgba(253, 230, 220, 0.95) 100%) !important;
  transform: translateX(6px) !important;
  box-shadow:
    0 4px 16px rgba(139, 0, 0, 0.12),
    -3px 0 0 #8b0000 !important;
}

.reply-box .player-options li:hover::before {
  background: linear-gradient(135deg, #8b0000, #a52a2a) !important;
  box-shadow: 0 2px 8px rgba(139, 0, 0, 0.35) !important;
}

/* 选项右侧装饰箭头 */
.reply-box .player-options li::after {
  content: '›' !important;
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 20px !important;
  color: #b8860b !important;
  transition: all 0.3s ease !important;
  opacity: 0.5 !important;
}

.reply-box .player-options li:hover::after {
  right: 12px !important;
  color: #8b0000 !important;
  opacity: 1 !important;
}

/* ══════════════════════════════════════════
   ❀ 聊天框美化 · 书信风格 ❀
   ══════════════════════════════════════════ */

/* 统一聊天气泡 */
.bg-gray-100\/90.relative.inline-block {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(139, 90, 43, 0.03) 28px,
      rgba(139, 90, 43, 0.03) 29px
    ),
    linear-gradient(160deg, #fdf6ec 0%, #f9edd5 50%, #f5e6cc 100%) !important;
  border: 1.5px solid #b8860b !important;
  border-radius: 8px !important;
  box-shadow:
    0 3px 15px rgba(101, 67, 33, 0.12),
    inset 0 0 25px rgba(139, 90, 43, 0.05) !important;
  isolation: isolate !important;
}

/* 聊天框内文本 */
.markdown-body {
  color: #3e2723 !important;
  font-family: 'Georgia', 'Noto Serif SC', 'Source Han Serif CN', serif !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
  background: transparent !important;
  position: relative !important;
  z-index: 1 !important;
}

/* 隐藏顶部颜色装饰条 */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
  display: none !important;
}

/* 底部按钮 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
  color: #8b6914 !important;
  transition: all 0.3s ease !important;
}

.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
  color: #8b0000 !important;
}

/* 模型名称 */
.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
  color: #a0522d !important;
  font-family: 'Georgia', serif !important;
}

/* Token消耗 */
.text-orange-500 {
  color: #b8860b !important;
}

/* ══════════════════════════════════════════
   ❀ 代码块美化 · 古籍手抄本风格 ❀
   ══════════════════════════════════════════ */

/* 代码块根 */
.markdown-body pre {
  background: transparent !important;
  border: none !important;
  margin: 14px 0 !important;
  padding: 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}

/* 代码块主容器 */
.markdown-body pre > div {
  border: 1.5px solid #b8860b !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 3px 12px rgba(101, 67, 33, 0.1) !important;
}

/* 代码块头部栏 */
.markdown-body pre > div > div.flex.justify-between.h-8,
.markdown-body pre > div > div.border-b {
  background: linear-gradient(135deg, #8b0000, #a0522d) !important;
  border-bottom: 1px solid #b8860b !important;
  padding: 6px 14px !important;
}

/* 语言标签 */
.markdown-body pre > div > div.flex.justify-between > div.text-\[13px\],
.markdown-body pre > div > div.flex.justify-between > div:first-child {
  color: #fdf6ec !important;
  font-family: 'Georgia', serif !important;
  font-weight: bold !important;
  letter-spacing: 1px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* 复制按钮外层 */
.markdown-body pre div[data-tooltip-id^="copy-tooltip"] {
  background: rgba(253, 246, 236, 0.15) !important;
  border: 1px solid rgba(184, 134, 11, 0.4) !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
}

.markdown-body pre div[data-tooltip-id^="copy-tooltip"]:hover {
  background-color: rgba(253, 246, 236, 0.3) !important;
  border-color: #daa520 !important;
}

/* 复制图标 hover */
.markdown-body pre div[data-tooltip-id^="copy-tooltip"] > div:hover {
  background-color: rgba(253, 246, 236, 0.2) !important;
}

/* 代码内容区 */
.markdown-body pre > div > div[node] {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 24px,
      rgba(139, 90, 43, 0.04) 24px,
      rgba(139, 90, 43, 0.04) 25px
    ),
    linear-gradient(160deg, #fdf6ec 0%, #f9edd5 100%) !important;
  color: #3e2723 !important;
  padding: 16px 16px 16px 14px !important;
  font-family: 'Courier New', 'Source Code Pro', monospace !important;
  font-size: 13.5px !important;
  line-height: 1.7 !important;
}

/* 代码元素 */
.markdown-body pre code[class^="language-"] {
  color: #3e2723 !important;
  font-family: 'Courier New', 'Source Code Pro', monospace !important;
  text-shadow: none !important;
}

/* 纯代码块 */
.markdown-body pre > code[node],
.markdown-body pre > code:only-child {
  background:
    linear-gradient(160deg, #fdf6ec 0%, #f9edd5 100%) !important;
  color: #3e2723 !important;
  border: 1.5px solid #b8860b !important;
  border-radius: 6px !important;
  padding: 14px !important;
  display: block !important;
  font-family: 'Courier New', 'Source Code Pro', monospace !important;
}

/* ══════════════════════════════════════════
   ❀ 输入框 · 书信写作台 ❀
   ══════════════════════════════════════════ */

#ai-chat-bottom-input {
  border: 1.5px solid #b8860b !important;
  border-radius: 10px !important;
  background:
    linear-gradient(160deg, #fdf6ec 0%, #f9edd5 100%) !important;
  box-shadow:
    0 3px 12px rgba(101, 67, 33, 0.1),
    inset 0 0 15px rgba(139, 90, 43, 0.04) !important;
  overflow: hidden !important;
}

#ai-chat-input {
  border: none !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #3e2723 !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
  font-size: 15px !important;
  padding: 14px 18px !important;
  line-height: 1.7 !important;
  transition: all 0.3s ease !important;
}

#ai-chat-input:focus {
  box-shadow: inset 0 0 20px rgba(184, 134, 11, 0.08) !important;
  outline: none !important;
}

#ai-chat-input::placeholder {
  color: #a0522d !important;
  opacity: 0.5 !important;
  font-style: italic !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
}

#ai-chat-input::selection {
  background: rgba(184, 134, 11, 0.2) !important;
  color: #3e2723 !important;
}

/* 底部栏背景 */
.bg-gradient-to-t {
  background: linear-gradient(to top, #fdf6ec 0%, rgba(253, 246, 236, 0.8) 70%, transparent 100%) !important;
}

/* ══════════════════════════════════════════
   ❀ 按钮栏 · 圆润书签按钮 ❀
   ══════════════════════════════════════════ */

#ai-mod-button2 button.MuiButton-root {
  border: 1.5px solid #b8860b !important;
  border-radius: 20px !important;
  font-weight: bold !important;
  transition: all 0.3s ease !important;
  background: linear-gradient(135deg, #fdf6ec 0%, #f9edd5 100%) !important;
  color: #5d4037 !important;
  font-family: 'Georgia', 'Noto Serif SC', serif !important;
  padding: 6px 18px !important;
  box-shadow: 0 2px 8px rgba(101, 67, 33, 0.1) !important;
  letter-spacing: 0.5px !important;
}

#ai-mod-button2 button.MuiButton-root:hover {
  border-color: #8b0000 !important;
  background: linear-gradient(135deg, #fff0f0 0%, #fce4d6 100%) !important;
  color: #8b0000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(139, 0, 0, 0.15) !important;
}

#ai-mod-button2 button.MuiButton-root svg {
  transition: all 0.3s ease !important;
}

#ai-mod-button2 button.MuiButton-root:hover svg {
  transform: scale(1.1) !important;
}

/* ══════════════════════════════════════════
   ❀ 顶部栏 · 书脊装饰 ❀
   ══════════════════════════════════════════ */

.sticky.w-full.top-0.flex.items-center {
  background: linear-gradient(135deg, #5d4037 0%, #3e2723 50%, #5d4037 100%) !important;
  border-bottom: 2px solid #b8860b !important;
  box-shadow: 0 3px 12px rgba(62, 39, 35, 0.2) !important;
}

#ai-model-selector .group.flex.items-center {
  background: rgba(253, 246, 236, 0.1) !important;
  border: 1px solid rgba(184, 134, 11, 0.3) !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  transition: all 0.3s ease !important;
}

#ai-model-selector .group.flex.items-center:hover {
  background: rgba(253, 246, 236, 0.2) !important;
  border-color: #b8860b !important;
}

#ai-model-selector .truncate.text-\[13px\] {
  color: #fdf6ec !important;
  font-family: 'Georgia', serif !important;
  font-weight: bold !important;
  letter-spacing: 0.5px !important;
}

#ai-model-selector .shrink-0.flex.items-center svg {
  color: #daa520 !important;
}

#header-setting-button {
  color: #fdf6ec !important;
  transition: all 0.3s ease !important;
}

#header-setting-button:hover {
  color: #daa520 !important;
}