ai {
  /* --- 核心配色系统 --- */
  --d: #0a0a0a; /* Dark */
  --p: #ff00ff; /* Pink */
  --c: #00ffff; /* Cyan */
  --a: #ffbf00; /* Amber */
  --w: #e0e0e0; /* White */
  --b: rgba(0, 255, 255, 0.3); /* Border */
  --bg: rgba(10, 10, 10, 0.85);
  
  /* --- 容器全局设定 --- */
  display: block;
  background: var(--bg);
  border: 1px solid var(--b);
  padding: 16px;
  font-family: 'Noto Sans SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: var(--w);
  position: relative;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(0, 255, 255, 0.2);
  overflow: hidden;
}

/* --- HUD装饰性边角 --- */
ai::before, ai::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--c);
  border-style: solid;
  opacity: 0.8;
  pointer-events: none;
}
ai::before { top: 5px; left: 5px; border-width: 2px 0 0 2px; }
ai::after { top: 5px; right: 5px; border-width: 2px 2px 0 0; }

/* --- 标题与信息 --- */
ai hd {
  display: block;
  font-family: 'Teko', 'Impact', sans-serif;
  font-size: 2.4em;
  color: var(--p);
  text-align: center;
  text-shadow: 0 0 4px var(--p), 0 0 8px var(--p), 0 0 16px #ff00de, 0 0 24px #ff00de;
  animation: glitch 2s infinite steps(8), flicker 3s infinite alternate;
  margin: 0;
  padding: 0;
  letter-spacing: 2px;
}
ai info {
  display: block;
  text-align: center;
  font-size: 0.8em;
  color: var(--c);
  margin: 4px 0 16px;
  border-bottom: 1px solid var(--b);
  padding-bottom: 8px;
}

/* --- 叙事正文 --- */
ai tx p {
  line-height: 1.7;
  margin: 0 0 1em 0;
  text-indent: 2em;
}

/* --- 状态栏整体 --- */
ai st {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
ai details {
  border: 1px solid var(--b);
  background: rgba(0,0,0,0.3);
  transition: background 0.3s;
}
ai details[open] {
  background: rgba(0,255,255,0.05);
  box-shadow: 0 0 8px rgba(0,255,255,0.3);
}
ai summary {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  color: var(--c);
  position: relative;
  list-style: none; /* Hide default arrow */
  outline: none;
}
ai summary::-webkit-details-marker { display: none; }
ai summary::before {
  content: '[+]';
  margin-right: 8px;
  color: var(--a);
  font-family: monospace;
}
ai details[open] > summary::before { content: '[-]'; }
ai summary:hover { background: rgba(0, 255, 255, 0.1); }

/* --- 信息分区与数据项 --- */
ai details > p, ai details > act {
  padding: 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  border-top: 1px solid var(--b);
}
ai p[t]::before {
  content: attr(t);
  font-weight: bold;
  color: var(--p);
  margin-bottom: 8px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(255,0,255,0.3);
}
ai f {
  font-size: 1.3em;
  font-weight: bold;
  color: var(--w);
  display: block;
}
ai d {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  font-size: 0.9em;
}
ai d::before {
  content: attr(n);
  color: var(--c);
  opacity: 0.8;
  padding-right: 10px;
}

/* --- 特殊UI元素 --- */
ai p[t="天赋"] { flex-flow: row wrap; gap: 6px; }
ai i {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid var(--b);
  padding: 3px 8px;
  font-style: normal;
  font-size: 0.8em;
  color: var(--c);
}
ai bar {
  width: 100%;
  height: 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--b);
  padding: 1px;
}
ai fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--p), var(--c));
}
ai q {
  display: block;
  font-size: 0.85em;
  padding-left: 1.2em;
  position: relative;
  color: rgba(224, 224, 224, 0.8);
}
ai q::before {
  content: '»';
  position: absolute;
  left: 0;
  color: var(--a);
}
ai act d {
  display: block;
  padding: 8px;
  border: 1px solid var(--b);
  background: rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.2s;
  grid-template-columns: 1fr; /* Override grid for actions */
}
ai act d::before{ content: ''; } /* Clear label for actions */
ai act d:hover {
  background: var(--c);
  color: var(--d);
  border-color: var(--c);
  box-shadow: 0 0 8px var(--c);
}

/* --- 动画效果 --- */
@keyframes glitch {
  0%, 100% { transform: none; opacity: 1; }
  25% { transform: skew(-0.8deg, -0.3deg); opacity: 0.8; }
  50% { transform: none; opacity: 1; }
  75% { transform: skew(0.8deg, 0.2deg); opacity: 0.8; }
}
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 0 0 4px var(--p), 0 0 8px var(--p), 0 0 16px #ff00de, 0 0 24px #ff00de;
    opacity: 1;
  }
  20%, 24%, 55% { text-shadow: none; opacity: 0.8; }
}