/* ============ 整体容器 ============ */
.ai-body {
  background: linear-gradient(160deg, #0d0d14 0%, #111018 60%, #0a0a10 100%);
  border: 1px solid #2a2040;
  border-radius: 12px;
  padding: 16px 12px;
  font-family: "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  color: #c8c0d8;
  line-height: 1.9;
  font-size: 15px;
  box-shadow: 0 0 24px rgba(80,40,120,0.18), inset 0 0 40px rgba(0,0,0,0.4);
  margin: 4px 0;
}

/* ============ 顶部状态胶囊条 ============ */
.ai-statusbar {
  background: linear-gradient(90deg, #1a1228 0%, #221836 50%, #1a1228 100%);
  border: 1px solid #3d2d60;
  border-radius: 8px;
  padding: 7px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #9b85c4;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(100,60,160,0.15);
}
.ai-statusbar p {
  margin: 0;
}

/* ============ 正文容器 ============ */
.ai-article {
  background: rgba(18,14,28,0.6);
  border-left: 2px solid #3d2d60;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ai-article p {
  margin: 0 0 1em 0;
  text-indent: 2em;
  color: #d4cce4;
  font-size: 15px;
  line-height: 2;
}
.ai-article p:last-child {
  margin-bottom: 0;
}

/* ============ 思维链折叠块 ============ */
.ai-body details {
  background: rgba(14,11,22,0.7);
  border: 1px solid #2a1f42;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.ai-body details summary {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #7a6a9a;
  letter-spacing: 0.05em;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, color 0.2s;
}
.ai-body details summary::-webkit-details-marker {
  display: none;
}
.ai-body details summary::before {
  content: "▶";
  font-size: 10px;
  color: #5a4a7a;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ai-body details[open] summary::before {
  transform: rotate(90deg);
}
.ai-body details summary:hover {
  background: rgba(80,50,120,0.15);
  color: #a090c0;
}
.ai-body details[open] summary {
  border-bottom: 1px solid #2a1f42;
  color: #a090c0;
}
.ai-body details > *:not(summary) {
  padding: 10px 14px;
}

/* 思维链内部段落 */
.ai-body details p {
  margin: 0 0 4px 0;
  font-size: 12.5px;
  color: #6a5a8a;
  line-height: 1.7;
}
.ai-body details b {
  color: #8a70b0;
  font-size: 12.5px;
}

/* 行动推荐默认展开 open 状态的特殊美化 */
.ai-body details[open]:last-child {
  border-color: #3d2d60;
}

/* ============ 横向滑动容器 ============ */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 6px 0;
  border-radius: 6px;
}
.scroll-x::-webkit-scrollbar {
  height: 4px;
}
.scroll-x::-webkit-scrollbar-track {
  background: rgba(20,15,35,0.5);
  border-radius: 2px;
}
.scroll-x::-webkit-scrollbar-thumb {
  background: #3d2d60;
  border-radius: 2px;
}
.scroll-x::-webkit-scrollbar-thumb:hover {
  background: #5a4080;
}

/* ============ 表格 ============ */
.scroll-x table {
  white-space: nowrap;
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}
.scroll-x th {
  background: #1a1230;
  color: #8a78aa;
  padding: 7px 12px;
  border: 1px solid #2a1f42;
  font-weight: normal;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}
.scroll-x td {
  background: #100e1a;
  color: #b8acd0;
  padding: 6px 12px;
  border: 1px solid #1e1830;
  text-align: center;
  vertical-align: middle;
  line-height: 1.6;
}
.scroll-x tr:nth-child(even) td {
  background: #130f1e;
}
.scroll-x tr:hover td {
  background: #1e1830;
  color: #d0c4e4;
  transition: background 0.15s;
}

/* ============ 行动推荐按钮列表 ============ */
.ai-options {
  list-style: none;
  padding: 4px 0 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-options li {
  margin: 0;
}
.ai-options li div {
  display: block;
  padding: 9px 14px;
  background: linear-gradient(90deg, #16102a 0%, #1c1430 100%);
  border: 1px solid #2e2250;
  border-radius: 6px;
  color: #a090c8;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.ai-options li div:hover {
  background: linear-gradient(90deg, #231848 0%, #2e2060 100%);
  border-color: #5a40a0;
  color: #c8b8e8;
  box-shadow: 0 0 12px rgba(80,40,160,0.25);
  transform: translateX(3px);
}
.ai-options li div:active {
  background: #2a1c50;
  transform: translateX(1px);
  box-shadow: none;
}

/* ============ 短期/长期记忆区细节 ============ */
.ai-body details p b {
  color: #8878b0;
}

/* ============ 顶部状态栏视角切换模式高亮 ============ */
.ai-statusbar p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: center;
}

/* 👁️视角模式时可用class切换（可选扩展） */
.ai-statusbar.observe-mode {
  background: linear-gradient(90deg, #0e1a14 0%, #122018 50%, #0e1a14 100%);
  border-color: #2d5040;
  color: #70a888;
}

/* ============ 正文内对白颜色兜底 ============ */
.ai-article font[color="blue"] {
  color: #6ab0e8 !important;
}
.ai-article font[color="purple"] {
  color: #c090e0 !important;
}
.ai-article font[color="deeppink"] {
  color: #e07898 !important;
}

/* ============ 男主状态/记忆区内部间距 ============ */
.ai-body details .scroll-x {
  margin: 0;
}

/* ============ 整体字体回退兜底 ============ */
.ai-body * {
  box-sizing: border-box;
}