/* ===== 全局容器 ===== */
ai {
  display: block;
  background: #0a0a0a;
  color: #c8d6c3;
  font-family: 'Courier New', monospace;
  padding: 16px;
  border: 1px solid #1a3a1a;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  line-height: 1.7;
  font-size: 15px;
}

/* 扫描线效果 */
ai::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.03) 2px,
    rgba(0, 255, 65, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

ai > * {
  position: relative;
  z-index: 2;
}

/* ===== details/summary 通用 ===== */
ai details {
  background: rgba(0, 255, 65, 0.03);
  border: 1px solid #1a3a1a;
  border-radius: 6px;
  margin: 10px 0;
  padding: 0;
}

ai details > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: bold;
  color: #00ff41;
  font-size: 14px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
  list-style: none;
  border-bottom: 1px solid #1a3a1a;
  user-select: none;
}

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

ai details > summary::before {
  content: '▸ ';
  color: #00ff41;
}

ai details[open] > summary::before {
  content: '▾ ';
}

ai details[open] > summary {
  background: rgba(0, 255, 65, 0.06);
}

ai details > *:not(summary) {
  padding: 0 14px;
}

/* ===== 正文区 text ===== */
ai text {
  display: block;
  margin: 16px 0;
  padding: 16px;
  color: #e0e8dc;
  font-family: 'Georgia', 'Noto Serif SC', serif;
  font-size: 15.5px;
  line-height: 2;
  border-left: 3px solid #00ff41;
  background: rgba(0, 255, 65, 0.02);
  border-radius: 0 6px 6px 0;
}

/* ===== 字段标签 f ===== */
ai f {
  color: #00ff41;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.4);
}

/* ===== 数据行 d ===== */
ai d {
  display: block;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(0, 255, 65, 0.1);
  font-size: 13.5px;
}

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

/* ===== 分组容器 g / u / m / x ===== */
ai g, ai u, ai m, ai x {
  display: block;
  padding: 10px 14px;
}

/* ===== 小标题 h ===== */
ai h {
  display: block;
  color: #00ff41;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 14px;
  margin: 6px 0 2px;
  border-left: 3px solid #ff6b35;
  background: rgba(255, 107, 53, 0.05);
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

/* ===== 引用/标注 q ===== */
ai q {
  color: #888;
  font-size: 12px;
  font-style: normal;
}

ai q::before, ai q::after {
  content: none;
}

/* ===== 身体状态行 r 区域 ===== */
ai r {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 8px 0;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 107, 53, 0.2);
}

ai r i {
  font-style: normal;
  font-size: 12.5px;
  color: #ff9a76;
  padding: 3px 0;
}

/* ===== 选项区 o ===== */
ai o {
  display: block;
  padding: 10px 14px;
  margin: 5px 0;
  background: rgba(0, 255, 65, 0.04);
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  color: #c8d6c3;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

ai o:hover {
  background: rgba(0, 255, 65, 0.12);
  border-color: #00ff41;
  color: #00ff41;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
  padding-left: 20px;
}

/* ===== think 隐藏思维链 ===== */
ai think {
  display: none;
}

/* ===== 底层运算阵列特殊样式 ===== */
ai details:first-child {
  border-color: #2a1a1a;
  background: rgba(255, 0, 0, 0.02);
}

ai details:first-child > summary {
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
  ai {
    padding: 10px;
    font-size: 14px;
  }
  ai r {
    grid-template-columns: 1fr;
  }
  ai text {
    padding: 12px;
    font-size: 14.5px;
  }
}