/* ========================================
   复仇娃娃 · 梦幻花园主题 CSS
   适配背景图：柔光粉绿渐变+高曝光花卉
======================================== */

/* ===== 全局聊天容器背景框美化 ===== */
#ai-chat-container,
[class*="chat-container"],
[class*="ChatContainer"] {
  background: linear-gradient(
    135deg, 
    rgba(245, 249, 237, 0.75) 0%, 
    rgba(254, 248, 240, 0.8) 50%,
    rgba(249, 216, 197, 0.7) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(1.2);
  border-radius: 20px;
  border: 1.5px solid rgba(212, 232, 193, 0.6);
  box-shadow: 
    0 8px 32px rgba(168, 201, 147, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 16px;
}

/* ===== 正文消息气泡美化 ===== */
/* AI消息气泡 */
[class*="ai-message"],
[class*="assistant-message"],
text > p {
  background: linear-gradient(135deg, #fef8f0 0%, #f5f9ed 100%) !important;
  border-left: 3px solid #d4e8c1 !important;
  border-radius: 12px 12px 12px 0;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(168, 201, 147, 0.12);
  color: #6b8e5a;
  line-height: 1.8;
  margin-bottom: 12px;
}

/* 用户消息气泡 */
[class*="user-message"] {
  background: linear-gradient(135deg, #f9d8c5 0%, #fef8f0 100%) !important;
  border-right: 3px solid #a8c993 !important;
  border-radius: 12px 12px 0 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(249, 216, 197, 0.15);
  color: #6b8e5a;
}

/* ===== 状态栏 details/summary 美化 ===== */
details {
  background: linear-gradient(135deg, rgba(254, 248, 240, 0.9), rgba(245, 249, 237, 0.85));
  border: 1px solid rgba(212, 232, 193, 0.5);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

details:hover {
  border-color: rgba(168, 201, 147, 0.7);
  box-shadow: 0 4px 16px rgba(168, 201, 147, 0.15);
}

details[open] {
  background: linear-gradient(135deg, rgba(254, 248, 240, 0.95), rgba(212, 232, 193, 0.3));
  border-color: #a8c993;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: #6b8e5a;
  font-size: 14px;
  letter-spacing: 0.3px;
  user-select: none;
  transition: color 0.2s ease;
}

summary:hover {
  color: #a8c993;
}

summary::marker {
  color: #d4e8c1;
}

/* ===== info 顶部状态栏美化 ===== */
info {
  display: block;
  background: linear-gradient(90deg, rgba(212, 232, 193, 0.25), rgba(249, 216, 197, 0.2));
  border-left: 4px solid #a8c993;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #6b8e5a;
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(168, 201, 147, 0.1);
}

/* ===== 表格美化 ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: rgba(254, 248, 240, 0.6);
  border-radius: 8px;
  overflow: hidden;
}

table tr {
  border-bottom: 1px solid rgba(212, 232, 193, 0.3);
  transition: background 0.2s ease;
}

table tr:hover {
  background: rgba(212, 232, 193, 0.15);
}

table td {
  padding: 10px 14px;
  color: #6b8e5a;
  font-size: 13px;
}

table td:first-child {
  font-weight: 600;
  color: #a8c993;
}

/* ===== 输入框美化 ===== */
#ai-chat-input {
  background: rgba(254, 248, 240, 0.9) !important;
  color: #6b8e5a !important;
  border: none !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
}

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

/* 输入框外层容器 */
#ai-chat-input-container,
div:has(> #ai-chat-input) {
  background: linear-gradient(135deg, rgba(254, 248, 240, 0.85), rgba(245, 249, 237, 0.8)) !important;
  border: 1.5px solid rgba(212, 232, 193, 0.6) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(12px) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease !important;
}

div:has(> #ai-chat-input):focus-within {
  border-color: rgba(168, 201, 147, 0.9) !important;
  box-shadow: 
    0 0 0 3px rgba(212, 232, 193, 0.2),
    0 4px 16px rgba(168, 201, 147, 0.25) !important;
  transform: translateY(-1px);
}

/* ===== 发送按钮美化 ===== */
#ai-send-button {
  background: linear-gradient(135deg, #d4e8c1, #a8c993) !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 8px rgba(168, 201, 147, 0.2);
}

#ai-send-button:hover {
  background: linear-gradient(135deg, #e0f0d0, #b9d9a5) !important;
  box-shadow: 
    0 4px 16px rgba(168, 201, 147, 0.35),
    0 0 20px rgba(212, 232, 193, 0.4) !important;
  transform: scale(1.05) translateY(-2px);
}

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

#ai-send-button svg {
  color: #6b8e5a !important;
  fill: #6b8e5a !important;
  transition: transform 0.3s ease;
}

#ai-send-button:hover svg {
  transform: translateX(2px);
}

/* ===== 第一排工具栏（复制/刷新/编辑等）===== */
.MuiButton-textPrimary {
  color: #a8c993 !important;
  font-weight: 500 !important;
  transition: all 0.25s ease !important;
  border-radius: 8px !important;
}

.MuiButton-textPrimary:hover {
  background: rgba(212, 232, 193, 0.2) !important;
  color: #6b8e5a !important;
  box-shadow: 0 2px 8px rgba(168, 201, 147, 0.15);
}

/* ===== 第二排工具栏（Mod/记忆增强/调试等）===== */
.MuiButton-outlinedPrimary {
  border-color: rgba(212, 232, 193, 0.6) !important;
  color: #a8c993 !important;
  background: rgba(254, 248, 240, 0.5) !important;
  transition: all 0.25s ease !important;
  border-radius: 8px !important;
}

.MuiButton-outlinedPrimary:hover {
  background: rgba(212, 232, 193, 0.25) !important;
  border-color: rgba(168, 201, 147, 0.8) !important;
  color: #6b8e5a !important;
  box-shadow: 0 2px 12px rgba(168, 201, 147, 0.2);
}

/* ===== 底部翻页区域统一色调 ===== */
.MuiPaginationItem-root {
  color: #a8c993 !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.MuiPaginationItem-root:hover {
  background: rgba(212, 232, 193, 0.2) !important;
  color: #6b8e5a !important;
}

.MuiPaginationItem-root.Mui-selected {
  background: linear-gradient(135deg, rgba(212, 232, 193, 0.5), rgba(168, 201, 147, 0.3)) !important;
  color: #6b8e5a !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 6px rgba(168, 201, 147, 0.2);
}

/* ===== 模组/评论区美化 ===== */
[class*="comment"],
[class*="mod-card"],
[class*="review"] {
  background: linear-gradient(135deg, rgba(254, 248, 240, 0.8), rgba(245, 249, 237, 0.7)) !important;
  border: 1px solid rgba(212, 232, 193, 0.5) !important;
  border-radius: 12px !important;
  padding: 14px !important;
  margin: 8px 0 !important;
  backdrop-filter: blur(8px) !important;
  transition: all 0.3s ease !important;
}

[class*="comment"]:hover,
[class*="mod-card"]:hover,
[class*="review"]:hover {
  border-color: rgba(168, 201, 147, 0.7) !important;
  box-shadow: 0 4px 16px rgba(168, 201, 147, 0.15) !important;
  transform: translateY(-2px);
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(245, 249, 237, 0.4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4e8c1, #a8c993);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a8c993, #6b8e5a);
}

/* ===== 微动画增强 ===== */
@keyframes softGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(212, 232, 193, 0.3); }
  50% { box-shadow: 0 0 20px rgba(168, 201, 147, 0.4); }
}

#ai-send-button:hover {
  animation: softGlow 2s ease-in-out infinite;
}

/* ===== 响应式优化（移动端）===== */
@media (max-width: 768px) {
  #ai-chat-container {
    border-radius: 12px;
    padding: 12px;
  }
  
  details {
    padding: 10px 12px;
  }
  
  #ai-chat-input {
    font-size: 13px !important;
  }
}

/* ===== 行动推荐外层容器 ===== */
action {
  display: block;
  background: linear-gradient(135deg, 
    rgba(254, 248, 240, 0.85), 
    rgba(212, 232, 193, 0.25));
  border: 1.5px solid rgba(212, 232, 193, 0.6);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(168, 201, 147, 0.12);
}

/* ===== 行动推荐标题 ===== */
.action-title {
  font-size: 14px;
  font-weight: 700;
  color: #6b8e5a;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(168, 201, 147, 0.4);
  text-align: center;
}

/* ===== 单个行动选项卡片 ===== */
.action-item {
  display: flex;
  align-items: center;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(212, 232, 193, 0.5);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  color: #6b8e5a;
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* ===== 选项hover时的光扫过效果 ===== */
.action-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(249, 216, 197, 0.3), 
    transparent);
  transition: left 0.5s ease;
}

.action-item:hover::before {
  left: 100%;
}

.action-item:hover {
  background: linear-gradient(135deg, 
    rgba(212, 232, 193, 0.4), 
    rgba(249, 216, 197, 0.3));
  border-color: rgba(168, 201, 147, 0.8);
  transform: translateX(4px);
  box-shadow: 0 3px 12px rgba(168, 201, 147, 0.2);
  color: #5a7a4a;
}

/* ===== 选项前的字母序号 ===== */
.action-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #d4e8c1, #a8c993);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(168, 201, 147, 0.3);
  transition: transform 0.3s ease;
}

.action-item:hover .action-num {
  transform: scale(1.15) rotate(-8deg);
}

/* ===== 自定义输入选项（区别样式）===== */
.action-custom {
  background: rgba(249, 216, 197, 0.2);
  border-style: dashed;
  border-color: rgba(249, 216, 197, 0.7);
  font-style: italic;
  color: #b5957a;
}

.action-custom:hover {
  background: linear-gradient(135deg, 
    rgba(249, 216, 197, 0.35), 
    rgba(254, 248, 240, 0.5));
  border-color: rgba(232, 180, 150, 0.9);
  color: #9a7a60;
}

.action-custom .action-num {
  background: linear-gradient(135deg, #f9d8c5, #e8b496);
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  action {
    padding: 12px;
  }
  .action-item {
    font-size: 12.5px;
    padding: 10px 12px;
  }
  .action-num {
    min-width: 22px;
    height: 22px;
    margin-right: 10px;
  }
}

/* ========================================
   嵌套 details 美化（NPC信息栏内部子卡片）
   风格：与外层保持一致，通过内缩+色带体现层级
======================================== */

/* ===== 嵌套的 details 子卡片 ===== */
details details {
  background: linear-gradient(135deg, 
    rgba(254, 248, 240, 0.7), 
    rgba(245, 249, 237, 0.65));
  border: 1px solid rgba(212, 232, 193, 0.4);
  border-left: 3px solid rgba(168, 201, 147, 0.6);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0 8px 12px;
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* ===== 嵌套 details 左侧装饰性圆点 ===== */
details details::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #d4e8c1, #a8c993);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 6px rgba(168, 201, 147, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

details details:hover::before {
  opacity: 1;
}

/* ===== 嵌套 details hover 状态 ===== */
details details:hover {
  border-left-color: #a8c993;
  background: linear-gradient(135deg, 
    rgba(254, 248, 240, 0.85), 
    rgba(212, 232, 193, 0.25));
  box-shadow: 0 3px 12px rgba(168, 201, 147, 0.12);
  transform: translateX(2px);
}

/* ===== 嵌套 details 展开状态 ===== */
details details[open] {
  background: linear-gradient(135deg, 
    rgba(254, 248, 240, 0.9), 
    rgba(212, 232, 193, 0.2));
  border-left-color: #a8c993;
  border-left-width: 4px;
}

/* ===== 嵌套 summary 字体略小、颜色略淡 ===== */
details details > summary {
  font-size: 13px;
  font-weight: 600;
  color: #7a9668;
  letter-spacing: 0.2px;
  padding: 2px 0;
}

details details > summary:hover {
  color: #6b8e5a;
}

/* ===== 嵌套 details 内部段落文字 ===== */
details details p {
  font-size: 12.5px;
  color: #6b8e5a;
  line-height: 1.7;
  margin: 4px 0;
  padding-left: 4px;
}

/* ===== 嵌套 details 内部加粗标签（字段名）美化 ===== */
details details p b {
  color: #a8c993;
  font-weight: 600;
  margin-right: 4px;
  letter-spacing: 0.3px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  details details {
    padding: 8px 12px;
    margin: 6px 0 6px 8px;
  }
  details details > summary {
    font-size: 12.5px;
  }
  details details p {
    font-size: 12px;
  }
}

/* ===== NPC栏最底部的提示文字（精确匹配class）===== */
.npc-tip {
  display: block;
  font-size: 12px;
  color: #b5957a;
  font-style: italic;
  text-align: center;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(249, 216, 197, 0.15);
  border-radius: 6px;
  border: 1px dashed rgba(249, 216, 197, 0.5);
}