ai {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #cbd5e1;
  letter-spacing: 0.2px;
  word-break: break-word;
}

/* 基础折叠容器 */
ai details {
  display: block;
  background: rgba(18, 20, 26, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-sizing: border-box;
}

ai details[open] {
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
}

/* 标题栏统一样式 */
ai summary {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
  color: #e5c158;
  background: linear-gradient(90deg, rgba(35, 39, 48, 0.95) 0%, rgba(20, 22, 28, 0.95) 100%);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  letter-spacing: 0.5px;
}

ai details[open] > summary {
  border-bottom-color: rgba(212, 175, 55, 0.25);
}

ai summary:hover {
  color: #fff3c4;
  background: rgba(45, 50, 62, 0.95);
}

/* 前置时间/地点/环境栏 */
ai hd {
  display: block;
  background: rgba(20, 22, 28, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #f3d993;
}
ai hd b {
  color: #e5c158;
  margin-left: 6px;
}
ai hd b:first-child {
  margin-left: 0;
}

/* 正文叙事容器 */
ai txt {
  display: block;
  background: rgba(15, 17, 21, 0.95);
  color: #e2e8f0;
  padding: 12px 15px;
  border-left: 4px solid #d4af37;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
  white-space: pre-wrap;
}

/* 👁️ 读心术专属模块 (支持原生折叠 + 紫粉流光) */
ai details[t="mind"] {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(40, 20, 60, 0.75) 0%, rgba(20, 15, 35, 0.85) 100%);
  box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.2);
}
ai details[t="mind"] > summary {
  color: #d8b4fe;
  background: linear-gradient(90deg, rgba(55, 30, 80, 0.95) 0%, rgba(25, 15, 40, 0.95) 100%);
  border-bottom-color: rgba(168, 85, 247, 0.3);
}
ai details[t="mind"] d {
  display: block;
  padding: 4px 12px;
  font-size: 13px;
  color: #f3e8ff;
}
ai details[t="mind"] d:first-of-type {
  padding-top: 8px;
}
ai details[t="mind"] d:last-of-type {
  padding-bottom: 8px;
}
ai details[t="mind"] d[t="表"]::before {
  content: "💬 表面：";
  color: #c084fc;
  font-weight: bold;
}
ai details[t="mind"] d[t="里"]::before {
  content: "💗 潜意识：";
  color: #f472b6;
  font-weight: bold;
}

/* 详情条目 d 标签与前缀映射 */
ai d {
  display: block;
  padding: 2px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}
ai details[open] > d:first-of-type {
  padding-top: 8px;
}
ai details[open] > d:last-of-type {
  padding-bottom: 8px;
}

ai d[t]::before {
  font-weight: bold;
  color: #94a3b8;
  margin-right: 4px;
}
ai d[t="推导"]::before { content: "1. 记忆推导："; }
ai d[t="阶段"]::before { content: "2. 阶段锁定："; }
ai d[t="修罗场"]::before { content: "3. 冲突评估："; }
ai d[t="读心"]::before { content: "4. 读心监听："; }
ai d[t="策略"]::before { content: "5. 输出策略："; }

ai d[t="身份"]::before { content: "身份："; color: #e5c158; }
ai d[t="姿态"]::before { content: "💼 姿态态度："; }
ai d[t="保密"]::before { content: "保密状态："; color: #38bdf8; }
ai d[t="潜意识"]::before { content: "🧠 潜意识："; color: #c084fc; }
ai d[t="穿搭"]::before { content: "👗 穿搭特征："; }
ai d[t="动机"]::before { content: "🧠 潜意识/动机："; color: #94a3b8; }

/* NPC 分区容器 */
ai p[t] {
  display: block;
  margin: 6px 10px 10px 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
}
ai p[t]:last-of-type {
  border-bottom: none;
  margin-bottom: 4px;
}
ai p[t]::before {
  content: "[" attr(t) "]";
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #e5c158;
  border-left: 3px solid #e5c158;
  padding-left: 6px;
  margin: 6px 0 6px 2px;
}

/* 身体与外貌高定框 */
ai d[t="外貌"] {
  background: rgba(30, 27, 38, 0.7);
  border: 1px dashed rgba(225, 112, 85, 0.4);
  border-radius: 6px;
  padding: 5px 8px;
  margin: 4px 0;
  color: #f1f5f9;
}
ai d[t="外貌"]::before {
  content: "💃 身体外貌：";
  color: #fb923c;
}

/* 性经验/身体开发度专属警示框 */
ai d[t="经历"] {
  background: rgba(40, 20, 30, 0.8);
  border: 1px solid rgba(232, 67, 147, 0.4);
  border-radius: 6px;
  padding: 5px 8px;
  margin: 4px 0;
  color: #ff7675;
  font-weight: 500;
}
ai d[t="经历"]::before {
  content: "🔞 性与开发：";
  color: #f43f5e;
}

/* 防线与好感字段 */
ai d[t="好感"] {
  margin-top: 4px;
  font-weight: 500;
}
ai d[t="好感"]::before {
  content: "🏰 史诗防线：";
  color: #e5c158;
}

/* 剧情记忆库列表 */
ai p[t="短期记忆"]::before { content: "⏱️ 即时短期记忆"; color: #e5c158; border-left-color: #e5c158; }
ai p[t="长期记忆"]::before { content: "📜 绝密沉淀长期记忆"; color: #e5c158; border-left-color: #e5c158; }

/* 💡 行动建议模块 (支持原生折叠与悬浮交互) */
ai details[t="act"] {
  padding-bottom: 4px;
}
ai details[t="act"] d {
  padding: 4px 10px;
  margin: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;
  cursor: default;
}
ai details[t="act"] d:hover {
  background: rgba(212, 175, 55, 0.15);
  color: #fff3c4;
  transform: translateX(4px);
}