/* ===== 容器与全局变量 ===== */
ai {
  --pk: #ff2a6d;
  --cy: #00ffcc;
  --bl: #667eea;
  --pr: #764ba2;
  --bg: #0d0d14;
  --bg2: #13131f;
  --bg3: #1a1a28;
  --tx: #e2e8f0;
  --tx2: #8892a4;
  --bdr: rgba(255,42,109,.25);
  display: block;
  position: relative;
  background: var(--bg);
  color: var(--tx);
  font: 14px/1.7 'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
  padding: 6px 10px 10px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255,42,109,.12), inset 0 0 60px rgba(0,0,0,.4);
  overflow: hidden;
}

/* 电路板纹理背景 */
ai::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .03;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 40h20v-20h20v40h20v-60h20' fill='none' stroke='%2300ffcc' stroke-width='.5'/%3E%3Ccircle cx='20' cy='40' r='2' fill='%23ff2a6d'/%3E%3Ccircle cx='40' cy='20' r='2' fill='%23ff2a6d'/%3E%3Ccircle cx='60' cy='60' r='2' fill='%23ff2a6d'/%3E%3C/svg%3E");
}

/* 左侧霓虹竖线 */
ai::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--pk), var(--cy), var(--pk), transparent);
  box-shadow: 0 0 8px var(--pk);
  animation: neonPulse 4s ease-in-out infinite;
}

@keyframes neonPulse {
  0%,100% { opacity: .6; box-shadow: 0 0 6px var(--pk) }
  50% { opacity: 1; box-shadow: 0 0 14px var(--pk), 0 0 24px rgba(255,42,109,.3) }
}

/* ===== 顶部信息条 hd ===== */
ai > hd {
  display: block;
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--tx2);
  padding: 6px 8px;
  margin: 0 0 6px;
  background: linear-gradient(90deg, transparent, rgba(0,255,204,.04), rgba(255,42,109,.04), transparent);
  border-bottom: 1px solid rgba(255,42,109,.12);
  position: relative;
}

ai > hd::before, ai > hd::after {
  content: '◆';
  font-size: 6px;
  color: var(--pk);
  vertical-align: middle;
  margin: 0 6px;
  text-shadow: 0 0 4px var(--pk);
}

/* ===== 正文 article ===== */
ai > article {
  position: relative;
  padding: 10px 8px 12px;
  margin: 0 0 6px;
  border-left: 2px solid rgba(102,126,234,.2);
  background: linear-gradient(135deg, rgba(102,126,234,.02), transparent);
}

ai > article p {
  margin: 0 0 8px;
  text-indent: 2em;
  text-align: justify;
}

ai > article p:last-child { margin-bottom: 0 }

/* ===== details / summary 通用 ===== */
ai details {
  margin: 0 0 4px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.04);
}

ai summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 10px;
  list-style: none;
  position: relative;
  transition: all .25s;
  user-select: none;
}

ai summary::-webkit-details-marker { display: none }

ai summary::after {
  content: '▸';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  transition: transform .25s;
  color: inherit;
  opacity: .5;
}

ai details[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
}

ai summary:hover {
  filter: brightness(1.3);
  text-shadow: 0 0 8px currentColor;
}

/* ===== 思维链 (第一个details) ===== */
ai > details:first-of-type {
  border-left: 2px solid var(--pk);
  background: linear-gradient(135deg, rgba(255,42,109,.03), var(--bg2));
  margin-bottom: 6px;
}

ai > details:first-of-type > summary {
  color: var(--pk);
  background: rgba(255,42,109,.06);
  text-shadow: 0 0 6px rgba(255,42,109,.3);
}

ai > details:first-of-type > summary::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--pk);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--pk);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%,100% { opacity: 1 }
  50% { opacity: .3 }
}

/* ===== 骑手档案 ===== */
ai > details:nth-of-type(2) {
  border-left: 2px solid var(--cy);
}

ai > details:nth-of-type(2) > summary {
  color: var(--cy);
  background: rgba(0,255,204,.05);
}

/* ===== 互动对象 ===== */
ai > details:nth-of-type(3) {
  border-left: 2px solid #d299c2;
}

ai > details:nth-of-type(3) > summary {
  color: #d299c2;
  background: rgba(210,153,194,.06);
}

/* ===== 感官监控区 ===== */
ai p.sn {
  border: 1px dashed rgba(255,42,109,.35) !important;
  background: rgba(255,42,109,.03) !important;
  border-radius: 5px;
  position: relative;
  padding-top: 22px !important;
}

ai p.sn::before {
  content: '【躯壳感官实时反馈监控】';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--pk);
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(255,42,109,.4);
}

ai p.sn > d {
  border-left-color: rgba(255,42,109,.2) !important;
}

ai p.sn > d::first-line {
  color: #ff99aa;
}

/* ===== 城市暗面雷达 ===== */
ai > details:nth-of-type(4) {
  border-left: 2px solid #f5a623;
}

ai > details:nth-of-type(4) > summary {
  color: #f5a623;
  background: rgba(245,166,35,.06);
}

/* ===== 记忆回廊 ===== */
ai > details:nth-of-type(5) {
  border-left: 2px solid var(--bl);
}

ai > details:nth-of-type(5) > summary {
  color: var(--bl);
  background: rgba(102,126,234,.06);
}

/* 短期记忆标签 */
ai > details:nth-of-type(5) p[t="短期"] {
  border-left-color: var(--cy) !important;
}

ai > details:nth-of-type(5) p[t="短期"]::before {
  color: var(--cy) !important;
  text-shadow: 0 0 4px rgba(0,255,204,.3);
}

/* 长期记忆标签 */
ai > details:nth-of-type(5) p[t="长期"] {
  border-left-color: var(--bl) !important;
}

ai > details:nth-of-type(5) p[t="长期"]::before {
  color: var(--bl) !important;
  text-shadow: 0 0 4px rgba(102,126,234,.3);
}

ai > details:nth-of-type(5) p[t="长期"] > d {
  font-size: 12px;
  line-height: 1.6;
  color: var(--tx2);
}

/* ===== p[t] 分区标题 ===== */
ai p[t] {
  position: relative;
  margin: 0;
  padding: 6px 8px 4px 12px;
  border-left: 2px solid rgba(255,255,255,.08);
}

ai p[t]::before {
  content: '◈ ' attr(t);
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: var(--tx2);
  letter-spacing: 1px;
  margin-bottom: 3px;
  text-transform: uppercase;
}

/* ===== d 标签 ===== */
ai d {
  display: block;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
}

ai d:last-child { border-bottom: none }

/* ===== f 标签（角色名高亮） ===== */
ai f {
  color: var(--cy);
  font-weight: bold;
  text-shadow: 0 0 4px rgba(0,255,204,.2);
}

/* ===== 选项区 ===== */
ai .ac {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  position: relative;
}

ai .ac::before {
  content: '▸▸▸ 请选择你的交互干涉方案 ◂◂◂';
  display: block;
  width: 100%;
  text-align: center;
  color: var(--pk);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 8px rgba(255,42,109,.3);
}

ai .ac {
  flex-wrap: wrap;
}

ai .ac::before {
  flex: 0 0 100%;
}

ai q {
  flex: 1 1 0;
  display: block;
  background: var(--bg3);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  quotes: none;
  border-left: 3px solid;
  transition: all .25s;
  cursor: default;
  min-width: 0;
}

ai q:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}

ai q.a { border-left-color: var(--pk); color: #ffb3c6 }
ai q.b { border-left-color: var(--pr); color: #c9b3e6 }
ai q.c { border-left-color: var(--bl); color: #b3c6ff }

ai q.a:hover { box-shadow: 0 3px 12px rgba(255,42,109,.15) }
ai q.b:hover { box-shadow: 0 3px 12px rgba(118,75,162,.15) }
ai q.c:hover { box-shadow: 0 3px 12px rgba(102,126,234,.15) }

/* ===== 滚动条美化 ===== */
ai ::-webkit-scrollbar { width: 3px }
ai ::-webkit-scrollbar-track { background: transparent }
ai ::-webkit-scrollbar-thumb { background: var(--pk); border-radius: 3px }

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
  ai { padding: 4px 6px 8px; font-size: 13px }
  ai q { flex: 1 1 100%; }
  ai summary { font-size: 12px; padding: 5px 8px }
  ai d { font-size: 12px }
}