/* ============================================
   🎸 江声 · 完整内置CSS
   风格：暖色手账拼贴 · 磨砂文艺
   色系：奶油米黄底 / 雾霾蓝强调 / 暖棕装饰
   ============================================ */

/* ----- 字体加载（霞鹜文楷） ----- */
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.7.0/style.css');

/* ----- 思维链隐藏 ----- */
think {
  display: none;
}

/* ========== AI消息气泡（透明化） ========== */
.msg-ai .msg-content,
.msg-ai .message-content,
.ai-message {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', 'PingFang SC', serif !important;
}

/* ========== 用户消息气泡 ========== */
.msg-user .msg-content,
.msg-user .message-content,
.user-message {
  background: rgba(183, 156, 126, 0.25) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  border: 1px solid rgba(183, 156, 126, 0.35) !important;
  border-radius: 18px 18px 4px 18px !important;
  color: #5a4a3a !important;
  padding: 12px 16px !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  font-size: 14.5px !important;
  line-height: 1.8 !important;
  margin: 6px 0 !important;
}

/* ========== 顶部场景栏 <scene> ========== */
scene {
  display: block;
  background: linear-gradient(135deg, rgba(150, 170, 185, 0.35), rgba(183, 156, 126, 0.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(150, 170, 185, 0.4);
  border-left: 3px solid #96aab9;
  border-radius: 4px 12px 12px 4px;
  padding: 10px 16px;
  margin: 8px 0 14px 0;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: 13.5px;
  color: #6b7b8a;
  letter-spacing: 1.5px;
  position: relative;
  overflow: hidden;
}

scene::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(210, 185, 155, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

scene p {
  margin: 0 !important;
  padding: 0 !important;
}

/* ========== 正文区域 <text> ========== */
text {
  display: block;
  background: rgba(250, 245, 238, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(210, 195, 175, 0.45);
  border-radius: 14px;
  padding: 22px 20px;
  margin: 10px 0 16px 0;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: 15px;
  line-height: 2;
  color: #3d3530;
  letter-spacing: 0.5px;
  position: relative;
  box-shadow:
    0 2px 16px rgba(150, 130, 100, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

text::before {
  content: '✦';
  position: absolute;
  top: -8px;
  left: 20px;
  font-size: 14px;
  color: #c4a882;
  background: #faf5ee;
  padding: 0 6px;
  letter-spacing: 3px;
  opacity: 0.7;
}

text p {
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  text-indent: 2em;
}

text p:last-child {
  margin-bottom: 0 !important;
}

/* 正文微光装饰 */
@keyframes shimmer {
  0% { opacity: 0.3; transform: translateX(-10px); }
  50% { opacity: 0.6; transform: translateX(10px); }
  100% { opacity: 0.3; transform: translateX(-10px); }
}

text::after {
  content: '✧';
  position: absolute;
  bottom: -8px;
  right: 20px;
  font-size: 12px;
  color: #c4a882;
  background: rgba(250, 245, 238, 0.8);
  padding: 0 6px;
  animation: shimmer 4s ease-in-out infinite;
  opacity: 0.5;
}

/* ========== 状态栏 details/summary ========== */
details {
  background: rgba(250, 245, 238, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 185, 165, 0.4);
  border-radius: 12px;
  margin: 8px 0;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 1px 8px rgba(150, 130, 100, 0.06);
}

details[open] {
  background: rgba(250, 245, 238, 0.75);
  box-shadow: 0 2px 14px rgba(150, 130, 100, 0.1);
}

summary {
  padding: 11px 16px;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: #6b5e52;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: all 0.25s ease;
  border-bottom: 1px solid transparent;
  user-select: none;
  background: linear-gradient(90deg, rgba(196, 168, 130, 0.08) 0%, transparent 100%);
}

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

summary::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #b09a82;
  transition: transform 0.3s ease;
  opacity: 0.6;
}

details[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

details[open] > summary {
  border-bottom: 1px solid rgba(200, 185, 165, 0.35);
  color: #96aab9;
  background: linear-gradient(90deg, rgba(150, 170, 185, 0.1) 0%, transparent 100%);
}

summary:hover {
  color: #96aab9;
}

/* 状态栏内部 */
details > :not(summary) {
  padding: 0 16px;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif;
  font-size: 13.5px;
  line-height: 1.9;
  color: #5a4e44;
}

details strong {
  color: #7a8fa0;
  font-weight: 600;
}

details ul,
details ol {
  padding-left: 8px;
  margin: 4px 0;
}

details li {
  margin: 2px 0;
  list-style: none;
  position: relative;
  padding-left: 14px;
}

details li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #c4a882;
  font-weight: bold;
  font-size: 16px;
  line-height: 1.9;
}

/* 哥哥心声 blockquote */
details blockquote {
  background: linear-gradient(135deg, rgba(150, 170, 185, 0.12), rgba(183, 156, 126, 0.1));
  border: none;
  border-left: 3px solid #96aab9;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 8px 0;
  font-style: italic;
  color: #7a8fa0;
  font-size: 13px;
  line-height: 1.85;
  position: relative;
}

details blockquote::before {
  content: '💭';
  position: absolute;
  top: -10px;
  left: -12px;
  font-size: 16px;
  font-style: normal;
}

/* 行动推荐列表 */
details:last-of-type li {
  background: rgba(150, 170, 185, 0.08);
  border-radius: 8px;
  padding: 7px 12px 7px 28px;
  margin: 5px 0;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

details:last-of-type li:hover {
  background: rgba(150, 170, 185, 0.18);
  border-color: rgba(150, 170, 185, 0.3);
  transform: translateX(4px);
}

details:last-of-type li::before {
  content: '▸';
  color: #96aab9;
  font-size: 12px;
  left: 10px;
}

/* ========== hr 分隔线 ========== */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 168, 130, 0.4), transparent);
  margin: 16px 0;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(183, 156, 126, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(183, 156, 126, 0.5);
}

/* ========== 文字选中 ========== */
::selection {
  background: rgba(150, 170, 185, 0.3);
  color: #3d3530;
}

/* ========== 链接 ========== */
a {
  color: #96aab9 !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

a:hover {
  color: #7a8fa0 !important;
  text-decoration: underline !important;
}

/* =============================================
   🎹 以下为平台组件美化（已验证可用的选择器）
   配色统一至 雾霾蓝+暖棕 色系
   ============================================= */

/* ===== 输入框 ===== */
#ai-chat-input {
  background: rgba(250, 245, 238, 0.85) !important;
  color: #3d3530 !important;
  border: none !important;
  font-size: 14px !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  line-height: 1.7 !important;
}

#ai-chat-input::placeholder {
  color: #b5a898 !important;
  opacity: 0.7 !important;
}

/* 输入框外层容器 */
#ai-chat-input-container,
div:has(> #ai-chat-input) {
  background: rgba(250, 245, 238, 0.6) !important;
  border: 1.5px solid rgba(150, 170, 185, 0.45) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

div:has(> #ai-chat-input):focus-within {
  border-color: #96aab9 !important;
  box-shadow: 0 0 0 3px rgba(150, 170, 185, 0.15), 0 0 8px rgba(150, 170, 185, 0.2) !important;
}

/* ===== 发送按钮 ===== */
#ai-send-button {
  background: linear-gradient(135deg, #96aab9, #7a8fa0) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(150, 170, 185, 0.3) !important;
}

#ai-send-button:hover {
  background: linear-gradient(135deg, #a8bcc8, #8a9eae) !important;
  box-shadow: 0 4px 12px rgba(150, 170, 185, 0.45) !important;
  transform: scale(1.05) !important;
}

#ai-send-button:active {
  transform: scale(0.98) !important;
}

#ai-send-button svg {
  color: #fff !important;
  fill: #fff !important;
}

/* ===== 第一排工具栏（复制/刷新/编辑等） ===== */
.MuiButton-textPrimary {
  color: #7a8fa0 !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  transition: all 0.25s ease !important;
}

.MuiButton-textPrimary:hover {
  background: rgba(150, 170, 185, 0.12) !important;
  color: #96aab9 !important;
}

/* ===== 第二排工具栏（Mod/记忆增强/调试等） ===== */
.MuiButton-outlinedPrimary {
  border-color: rgba(150, 170, 185, 0.45) !important;
  color: #7a8fa0 !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
  transition: all 0.25s ease !important;
  border-radius: 10px !important;
}

.MuiButton-outlinedPrimary:hover {
  background: rgba(150, 170, 185, 0.1) !important;
  border-color: #96aab9 !important;
  color: #96aab9 !important;
}

/* ===== 底部翻页 ===== */
.MuiPaginationItem-root {
  color: #7a8fa0 !important;
  font-family: 'LXGW WenKai', 'Noto Serif SC', serif !important;
}

.MuiPaginationItem-root.Mui-selected {
  background: rgba(150, 170, 185, 0.2) !important;
  color: #96aab9 !important;
  font-weight: 600 !important;
}

.MuiPaginationItem-root:hover {
  background: rgba(150, 170, 185, 0.1) !important;
}