ai {
  --bg: #1a0b0e; /* 极暗红底色 */
  --pnl: #2a1116; /* 面板色 */
  --gold: #d4af37; /* 金莲色 */
  --pink: #e0508c; /* 情欲粉 */
  --txt: #f5ebd9; /* 骨白色文字 */
  --bor: rgba(212, 175, 55, 0.2);
  
  display: block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--txt);
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* 顶部环境栏 */
ai hd {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--gold);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bor);
  letter-spacing: 2px;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

/* 正文区域 */
ai article {
  display: block;
  margin-bottom: 15px;
  font-size: 15px;
}

/* 一级折叠面板 (恩偿录 & 星记忆回廊) */
ai details {
  background: var(--pnl);
  border: 1px solid var(--bor);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
ai summary {
  list-style: none;
  text-align: center;
  font-weight: bold;
  color: var(--pink);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px dashed var(--bor);
  margin-bottom: 8px;
  text-shadow: 0 0 8px rgba(224, 80, 140, 0.4);
}
ai summary::-webkit-details-marker { display: none; }

/* 二级嵌套面板 (星记忆配置 & 星记忆区) */
ai details details {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(224, 80, 140, 0.15);
  box-shadow: none;
  margin-bottom: 6px;
  padding: 6px;
}
ai details details summary {
  font-size: 13px;
  color: var(--gold);
  border-bottom: none;
  margin-bottom: 0;
  text-shadow: none;
}

/* 分区容器 */
ai p {
  display: block;
  margin: 0 0 10px 0;
  padding: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
/* 分区标题 */
ai p[t]::before {
  content: attr(t);
  display: block;
  font-size: 12px;
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: 6px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, rgba(212,175,55,0.15) 0%, transparent 100%);
}

/* 数据项 */
ai d {
  display: block;
  font-size: 13px;
  color: #d8c8b8;
  margin-bottom: 2px;
}

/* 内心想法引用 */
ai q {
  display: block;
  font-style: italic;
  color: var(--pink);
  font-size: 13px;
  padding: 4px 8px;
  background: rgba(224, 80, 140, 0.05);
  border-radius: 4px;
  margin-top: 4px;
}
ai q::before { content: "「"; }
ai q::after { content: "」"; }

/* 核心：感官细节网格卡片 */
ai p.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  background: transparent;
  padding: 0;
}
ai d[l] {
  background: linear-gradient(135deg, rgba(224, 80, 140, 0.1) 0%, rgba(26, 11, 14, 0.8) 100%);
  border: 1px solid rgba(224, 80, 140, 0.3);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  margin: 0;
  transition: all 0.3s ease;
}
ai d[l]:hover {
  border-color: var(--pink);
  box-shadow: 0 0 8px rgba(224, 80, 140, 0.4);
}
ai d[l]::before {
  content: attr(l) "：";
  color: var(--pink);
  font-weight: bold;
}

/* === 星记忆回廊：Markdown表格与分割线美化 === */
ai table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  background: transparent;
}
ai th {
  background: linear-gradient(180deg, rgba(212,175,55,0.15) 0%, transparent 100%);
  color: var(--gold);
  border: 1px solid var(--bor);
  padding: 6px;
  text-align: left;
  font-weight: normal;
}
ai td {
  border: 1px solid rgba(224, 80, 140, 0.15);
  padding: 6px;
  color: #d8c8b8;
  vertical-align: top;
}
ai tr:hover td {
  background: rgba(224, 80, 140, 0.08);
}
ai hr {
  border: none;
  border-top: 1px dashed var(--bor);
  margin: 12px 0;
}