ai {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #2c3e50;
  max-width: 100%;
}

/* 隐藏思维链，仅供AI后台推演 */
ai tht {
  display: none;
}

ai details {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  overflow: hidden;
  border: 1px solid #eee;
}

ai summary {
  background: linear-gradient(135deg, #2c3e50, #1a252f);
  color: #fff;
  padding: 12px 15px;
  font-weight: bold;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  letter-spacing: 1px;
}
ai summary::-webkit-details-marker { display: none; }

/* 顶部时间场景条 */
ai tc {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(30,60,114,0.3);
}
ai tc l, ai tc c, ai tc r { display: block; }
ai tc c { font-weight: bold; color: #ffd700; text-shadow: 0 0 5px rgba(255,215,0,0.5); }

/* 仿微信/短信通讯录 */
ai chat {
  display: block;
  background: #f5f5f5;
  padding: 15px;
}
ai chat hd {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}
ai msg {
  display: flex;
  margin-bottom: 15px;
  align-items: flex-start;
}
ai msg i {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
ai msg p {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 12px;
  position: relative;
  word-break: break-all;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
/* NPC消息 (左) */
ai msg.l i { background: #fff; border: 1px solid #eee; color: #ff6b81; }
ai msg.l p { background: #fff; border: 1px solid #eee; border-top-left-radius: 0; }
/* 玩家消息 (右) */
ai msg.r { flex-direction: row-reverse; }
ai msg.r i { background: #07c160; color: #fff; }
ai msg.r p { background: #95ec69; border-top-right-radius: 0; }
ai sys {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #999;
  margin: 10px 0;
  background: rgba(0,0,0,0.05);
  padding: 4px 10px;
  border-radius: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* 记忆中枢 */
ai mem {
  display: block;
  padding: 15px;
  background: #fafafa;
}
ai mem t {
  display: block;
  font-weight: bold;
  color: #34495e;
  margin: 10px 0 5px 0;
  border-left: 3px solid #3498db;
  padding-left: 8px;
}
ai mem m {
  display: block;
  background: #fff;
  border: 1px dashed #bdc3c7;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
}
ai mem M {
  display: block;
  background: linear-gradient(to right, #fdfbfb, #ebedee);
  border: 1px solid #dcdde1;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #2f3640;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
  text-indent: 2em;
}

/* 状态与心声 */
ai ply {
  display: flex;
  flex-wrap: wrap;
  padding: 15px;
  gap: 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}
ai ply p {
  background: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #e9ecef;
  font-size: 12px;
  margin: 0;
}
ai ply p b { color: #3498db; margin-right: 6px; }
ai voc {
  display: flex;
  padding: 15px;
  align-items: center;
  background: rgba(255, 107, 129, 0.05);
}
ai voc i {
  background: #ff6b81;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  margin-right: 12px;
}
ai voc p { font-style: italic; color: #e84393; margin: 0; }

/* 女性角色深度监控 */
ai fem { display: block; }
ai fem st {
  display: inline-block;
  width: calc(33.33% - 20px);
  margin: 10px;
  background: #f1f2f6;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}
ai fem st b { display: block; color: #747d8c; font-size: 12px; margin-bottom: 2px; }
ai fem app {
  display: block;
  margin: 0 10px 10px 10px;
  padding: 10px;
  background: #fff0f5;
  border-left: 4px solid #ff6b81;
  font-size: 13px;
  color: #2f3542;
}
ai warn {
  display: block;
  background: #000;
  color: #ff4757;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  border-top: 2px solid #ff4757;
  animation: ai-pulse 2s infinite;
}
@keyframes ai-pulse {
  0% { text-shadow: 0 0 5px #ff4757; }
  50% { text-shadow: 0 0 20px #ff4757, 0 0 30px #ff4757; }
  100% { text-shadow: 0 0 5px #ff4757; }
}
ai grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 15px;
  background: #1e272e;
}
ai bp {
  background: #2f3542;
  border: 1px solid #57606f;
  padding: 10px;
  border-radius: 8px;
  color: #ced6e0;
  font-size: 12px;
  transition: all 0.3s ease;
  cursor: crosshair;
}
ai bp:hover {
  background: #3d1c24;
  border-color: #ff6b81;
  box-shadow: 0 0 15px rgba(255,107,129,0.3);
  transform: translateY(-2px);
}
ai bp b {
  display: block;
  color: #ff6b81;
  margin-bottom: 6px;
  border-bottom: 1px dashed #57606f;
  padding-bottom: 4px;
  font-size: 13px;
}

/* 选项区 */
ai act {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #eee;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
ai act hd {
  display: block;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 5px;
  text-align: center;
}
ai act a {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 10px;
  border-radius: 8px;
  color: #2c3e50;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
ai act a span {
  background: #3498db;
  color: #fff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-right: 10px;
  font-weight: bold;
  flex-shrink: 0;
}
ai act a:hover {
  background: #ebf5fb;
  border-color: #3498db;
  transform: translateX(5px);
}
ai act a.d { background: linear-gradient(135deg, #2c3e50, #000); color: #fff; border: none; }
ai act a.d span { background: #e74c3c; }
ai act a.d:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* 移动端单列适配 */
@media (max-width: 600px) {
  ai tc { flex-direction: column; text-align: center; gap: 5px; }
  ai grid { grid-template-columns: 1fr; }
  ai fem st { width: calc(50% - 20px); }
}