/* ═══════════════════════════════════════
   WASTELAND_TERMINAL OS v5.2 (Typography & Dialogue Color Extension)
   【对话声轨与高亮强化版】
   - 加粗字体强化绿色荧光高亮 (Neon Tech-Green)
   - 对话按发声源区隔颜色：男性(冷蓝) / 女性(粉红) / 系统播报(终端绿)
   ═══════════════════════════════════════ */

/* ▸ 核心容器 */
ai {
  display: block;
  --bg: #0d0f14;
  --panel: #13161c;
  --text: #96c4a7;
  --narr: #d2e6d9;
  --main: #ffca8c;
  --tech: #69ff8f;
  --warn: #ff6e6e;
  --pink: #ff8ecd;
  --bond: #ff9ed8;
  --line: #22262e;

  /* ▸ 对话色彩定义 */
  --male-voice: #64b5f6;      /* 男性对话·深冷浅蓝 */
  --male-bg: rgba(100, 181, 246, 0.08);
  --male-border: rgba(100, 181, 246, 0.35);

  --female-voice: #ff8ecd;    /* 女性对话·荧粉温润 */
  --female-bg: rgba(255, 142, 205, 0.08);
  --female-border: rgba(255, 142, 205, 0.35);

  --sys-voice: #69ff8f;       /* 系统播报·源质高绿 */
  --sys-bg: rgba(105, 255, 143, 0.08);
  --sys-border: rgba(105, 255, 143, 0.4);

  background: var(--bg);
  background-image:
    linear-gradient(rgba(105,255,143,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105,255,143,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(105,255,143,0.15);
  box-shadow: inset 0 0 35px rgba(0,0,0,0.4), 0 4px 15px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

/* ▸ CRT 扫描线 */
ai::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 50;
}

/* ▸ 终端暗角 */
ai::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
  z-index: 50;
  animation: crt-flick 8s ease-in-out infinite;
}
@keyframes crt-flick { 0%,100%{opacity:1} 50%{opacity:0.96} }

/* ▸ 层级与边距 */
ai > * { position: relative; z-index: 1; }
ai details, ai article, ai hd { margin-left: 12px; margin-right: 12px; }

/* ═══════ 场景头 ═══════ */
ai hd {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, rgba(105,255,143,0.1), rgba(255,202,140,0.04), transparent);
  border-bottom: 1px solid rgba(105,255,143,0.2);
  border-left: 3px solid var(--tech);
  padding: 10px 14px;
  margin-top: 12px;
  margin-bottom: 0;
  border-radius: 0 4px 0 0;
  font-size: 13px;
  color: var(--main);
  font-weight: 700;
  letter-spacing: 1px;
}
ai hd::before {
  content: '▶ SYSTEM_LOG';
  color: var(--tech);
  font-size: 11px;
  text-shadow: 0 0 4px var(--tech);
  margin-right: 8px;
  flex-shrink: 0;
}
ai hd::after {
  content: '◉ REC';
  color: var(--warn);
  font-size: 11px;
  margin-left: auto;
  flex-shrink: 0;
  animation: rec-blink 2s ease-in-out infinite;
}
@keyframes rec-blink { 0%,100%{opacity:1;} 50%{opacity:.3;} }

/* ═══════ 正文叙事区 ═══════ */
ai article {
  display: block;
  background:
    linear-gradient(180deg, rgba(20,23,28,0.8), rgba(15,17,21,0.9)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 30px,
      rgba(105,255,143,0.015) 30px,
      rgba(105,255,143,0.015) 31px
    );
  border-left: 3px solid rgba(105,255,143,0.4);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-top: none;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  border-radius: 0 0 4px 0;
  color: var(--narr);
  font-size: 14.5px;
  line-height: 1.85;
}
ai article::before {
  content: '[ NEURAL_STREAM :: OBSERVATION_ONLY ]';
  display: block;
  font-size: 10px;
  color: rgba(105,255,143,0.4);
  letter-spacing: 2px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(105,255,143,0.15);
}
ai article::after {
  content: '──────── ◈ AWAITING_USER_INPUT ────────';
  display: block;
  text-align: center;
  font-size: 10px;
  color: rgba(255,202,140,0.6);
  letter-spacing: 1px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(105,255,143,0.15);
}
ai article p {
  margin: 10px 0;
  padding: 4px 4px 4px 12px;
  border-left: 2px solid transparent;
  transition: all .3s ease;
  text-indent: 2em;
}
ai article p:first-of-type { margin-top: 0; }
ai article p:hover {
  border-left-color: var(--tech);
  background: linear-gradient(90deg, rgba(105,255,143,0.05), transparent 60%);
}

/* ═══════════════════════════════════════
   【加粗高亮与多轨对话系统】
   ═══════════════════════════════════════ */

/* ▸ 全局加粗绿色高亮 */
ai strong, ai b {
  color: var(--tech) !important;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(105, 255, 143, 0.45);
  letter-spacing: 0.3px;
  padding: 0 1px;
}

/* ▸ 1. 男性角色对话 (支持 <q class="m">, <say m>, <m> 标签) */
ai q.m, ai say[m], ai m,
ai p > m, ai article m {
  color: var(--male-voice) !important;
  text-shadow: 0 0 6px rgba(100, 181, 246, 0.4);
  font-weight: 600;
  quotes: none;
}
ai q.m::before, ai say[m]::before, ai m::before {
  content: "“";
  color: var(--male-voice);
  opacity: 0.8;
}
ai q.m::after, ai say[m]::after, ai m::after {
  content: "”";
  color: var(--male-voice);
  opacity: 0.8;
}

/* 独立对话气泡块（可选） */
ai p.say-m, ai div.say-m {
  border-left: 2px solid var(--male-voice);
  background: var(--male-bg);
  padding: 4px 10px;
  margin: 6px 0;
  color: var(--male-voice);
  text-indent: 0;
  border-radius: 0 4px 4px 0;
}

/* ▸ 2. 女性角色对话 (支持 <q class="f">, <say f>, <f> 标签) */
ai q.f, ai say[f], ai f,
ai p > f, ai article f {
  color: var(--female-voice) !important;
  text-shadow: 0 0 6px rgba(255, 142, 205, 0.4);
  font-weight: 600;
  quotes: none;
}
ai q.f::before, ai say[f]::before, ai f::before {
  content: "“";
  color: var(--female-voice);
  opacity: 0.8;
}
ai q.f::after, ai say[f]::after, ai f::after {
  content: "”";
  color: var(--female-voice);
  opacity: 0.8;
}

/* 独立对话气泡块（可选） */
ai p.say-f, ai div.say-f {
  border-left: 2px solid var(--female-voice);
  background: var(--female-bg);
  padding: 4px 10px;
  margin: 6px 0;
  color: var(--female-voice);
  text-indent: 0;
  border-radius: 0 4px 4px 0;
}

/* ▸ 3. 系统/机械播报 (支持 <q class="sys">, <say sys>, <sys> 标签) */
ai q.sys, ai say[sys], ai sys,
ai p > sys, ai article sys {
  color: var(--sys-voice) !important;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(105, 255, 143, 0.55);
}
ai q.sys::before, ai say[sys]::before, ai sys::before {
  content: "【SYSTEM: ";
  font-size: 0.85em;
  opacity: 0.85;
}
ai q.sys::after, ai say[sys]::after, ai sys::after {
  content: "】";
  font-size: 0.85em;
  opacity: 0.85;
}

/* 独立播报横幅（可选） */
ai p.say-sys, ai div.say-sys {
  border: 1px dashed var(--sys-border);
  background: var(--sys-bg);
  padding: 6px 12px;
  margin: 8px 0;
  color: var(--sys-voice);
  text-indent: 0;
  border-radius: 3px;
  font-size: 13.5px;
  box-shadow: inset 0 0 10px rgba(105, 255, 143, 0.1);
}

/* ═══════ 悬浮折叠主面板 ═══════ */
ai > details {
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  border-radius: 4px;
  padding: 0 10px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
ai > details:last-of-type { margin-bottom: 12px; }
ai > details[open] {
  border-color: rgba(105,255,143,0.4);
  box-shadow: -3px 0 0 var(--tech), 0 4px 12px rgba(0,0,0,0.3);
  padding-bottom: 12px;
  background: linear-gradient(135deg, rgba(105,255,143,0.04), transparent 30%);
}

/* 主面板标题 */
ai > details > summary {
  padding: 12px 4px;
  font-weight: 700;
  color: var(--main);
  cursor: pointer;
  font-size: 15px;
  user-select: none;
  margin: 0 -10px;
  padding-left: 14px;
  border-bottom: 1px solid transparent;
  transition: all .2s ease;
}
ai > details > summary::marker { color: var(--tech); }
ai > details > summary:hover {
  color: var(--tech);
  text-shadow: 0 0 8px rgba(105,255,143,0.4);
  background: rgba(105,255,143,0.04);
}
ai > details[open] > summary {
  color: var(--tech);
  border-bottom: 1px dashed rgba(105,255,143,0.3);
  margin-bottom: 10px;
  background: transparent;
}

/* ═══════ MOD 专属警示皮肤 ═══════ */
ai > details[mod] {
  border-color: rgba(255,142,205,0.25);
  background: linear-gradient(to right, rgba(255,142,205,0.02), transparent);
}
ai > details[mod] > summary {
  color: var(--pink);
}
ai > details[mod] > summary::marker { color: var(--pink); }
ai > details[mod] > summary:hover {
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255,142,205,0.4);
  background: rgba(255,142,205,0.05);
}
ai > details[mod][open] {
  border-color: rgba(255,142,205,0.4);
  box-shadow: -3px 0 0 var(--pink), 0 4px 12px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, rgba(255,142,205,0.05), transparent 30%);
}
ai > details[mod][open] > summary {
  color: var(--pink);
  border-bottom-color: rgba(255,142,205,0.3);
}
ai > details[mod] h3 {
  color: var(--pink);
  border-bottom-color: rgba(255,142,205,0.2);
}

/* ═══════ 子折叠面板 ═══════ */
ai details details {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(105,255,143,0.12);
  margin: 10px 0;
  padding: 0 10px;
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
}
ai details details:hover {
  border-color: rgba(105,255,143,0.25);
}
ai details details[open] {
  border-color: rgba(255,202,140,0.3);
  background: rgba(6,7,9,0.5);
  padding-bottom: 10px;
  box-shadow: -2px 0 0 var(--main), inset 0 0 10px rgba(0,0,0,0.4);
}
ai details details > summary {
  padding: 10px 4px;
  font-weight: bold;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  margin: 0 -10px;
  padding-left: 14px;
  border-bottom: 1px solid transparent;
}
ai details details > summary::marker { color: var(--main); }
ai details details > summary:hover {
  color: var(--main);
  background: rgba(255,202,140,0.05);
}
ai details details[open] > summary {
  color: var(--main);
  border-bottom: 1px dashed rgba(255,202,140,0.2);
  margin-bottom: 8px;
}

/* ═══════ 通用文本与标签 ═══════ */
ai p { margin: 8px 0; }
ai em { color: var(--pink); display: block; font-size: 12px; margin-bottom: 4px; }

ai wn, ai pk {
  display: inline-block;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.95em;
}
ai wn {
  color: var(--warn);
  background: rgba(255,110,110,0.1);
  border: 1px solid rgba(255,110,110,0.3);
  animation: crt-pulse-red 2.5s ease-in-out infinite;
}
ai pk {
  color: var(--pink);
  background: rgba(255,142,205,0.1);
  border: 1px solid rgba(255,142,205,0.3);
  animation: crt-pulse-pink 3s ease-in-out infinite;
}
@keyframes crt-pulse-red {
  0%,100%{box-shadow:inset 0 0 2px rgba(255,110,110,.1)}
  50%{box-shadow:inset 0 0 8px rgba(255,110,110,.4); border-color:rgba(255,110,110,.6)}
}
@keyframes crt-pulse-pink {
  0%,100%{box-shadow:inset 0 0 2px rgba(255,142,205,.1)}
  50%{box-shadow:inset 0 0 8px rgba(255,142,205,.4); border-color:rgba(255,142,205,.6)}
}

/* 平铺物资 */
ai flat { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px 0; }
ai d {
  display: inline-flex; align-items: center;
  background: rgba(150,196,167,0.06);
  border: 1px solid rgba(150,196,167,0.25);
  padding: 4px 10px; border-radius: 3px; font-size: 13px;
  color: #dbe4f0; transition: all 0.25s ease;
}
ai d:hover { border-color: var(--main); color: #fff; background: rgba(255,202,140,0.15); transform: translateY(-2px); }

/* 列表 */
ai ul { list-style-type: none; padding-left: 0; margin: 8px 0; }
ai li {
  background: rgba(150,196,167,0.04);
  border: 1px solid rgba(150,196,167,0.12);
  padding: 6px 10px; margin-bottom: 4px; border-radius: 3px; position: relative; transition: all 0.25s ease;
}
ai li:hover {
  border-color: rgba(255,202,140,0.5); background: rgba(255,202,140,0.08);
  transform: translateX(4px); box-shadow: -2px 0 0 var(--main); color: #e4eaf5;
}

/* ▸ 双列排布 */
ai li.split { 
  display: flex; 
  justify-content: flex-start; 
  align-items: center; 
}
ai li.split > span { 
  flex: 1; 
}
ai li.split > span:nth-child(2) { 
  border-left: 1px dashed rgba(150,196,167,0.25); 
  padding-left: 15px; 
}

ai li ul { margin: 6px 0 0 0; border-left: 1px dashed rgba(105,255,143,0.3); padding-left: 12px; }
ai li ul li { background: transparent; border: none; border-bottom: 1px solid rgba(150,196,167,0.15); border-radius: 0; padding: 4px 0; }
ai li ul li:hover { transform: translateX(3px); box-shadow: none; border-bottom-color: var(--main); }
ai li ul li:last-child { border-bottom: none; }

/* 推荐动作列表 */
ai ol { padding-left: 20px; color: var(--tech); font-weight: 700; margin: 8px 0; }
ai ol li {
  margin-bottom: 6px; color: var(--text); font-weight: 400;
  background: rgba(150,196,167,0.04); border: 1px solid rgba(150,196,167,0.12);
  padding: 6px 10px; border-radius: 3px; transition: all .25s ease;
}
ai ol li:hover { border-color: var(--tech); background: rgba(105,255,143,0.08); transform: translateX(4px); box-shadow: -2px 0 0 var(--tech); color: #fff; }

/* 表格 */
ai table {
  width: 100%; margin: 10px 0; border-collapse: separate; border-spacing: 0;
  font-size: 13px; background: rgba(6,7,9,0.7); box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  border-radius: 4px; border: 1px solid var(--line); overflow: hidden;
}
ai th { 
  background: rgba(105,255,143,0.15); 
  color: var(--tech); 
  text-align: left; 
  padding: 8px 10px; 
  border-bottom: 2px solid var(--line); 
  font-weight: 700; 
}
ai td { 
  padding: 8px 10px; 
  border-bottom: 1px solid rgba(150,196,167,0.15); 
  color: var(--text); 
  background: transparent;
  transition: all 0.2s ease; 
}
ai tr:last-child td { border-bottom: none; }
ai tr:hover td { 
  background: rgba(255,202,140,0.12); 
  color: var(--text);
  border-bottom-color: rgba(255,202,140,0.4); 
}

ai h3 { color: var(--main); font-size: 14px; margin: 14px 0 6px; padding: 6px 0; border-bottom: 1px solid rgba(255,202,140,0.2); }

/* 标签词典 */
ai pk[t]::before, ai wn[t]::before { font-weight: 700; margin-right: 4px; }
ai pk[t="xp"]::before  { content: "[性癖参数]:"; }
ai pk[t="qm"]::before  { content: "[亲密度指标]:"; }
ai pk[t="gx"]::before  { content: "[阵营/生态关系]:"; }
ai pk[t="jb"]::before  { content: "[专属特权羁绊]:"; }
ai pk[t="xj"]::before  { content: "[生存与被摄履历]:"; }
ai pk[t="nx"]::before  { content: "[神经频段窃听]:"; }
ai pk[t="gl"]::before  { content: "【战术攻坚导向】"; }
ai wn[t="yw"]::before  { content: "[机体饥渴阈值]:"; }
ai wn[t="dx"]::before  { content: "【物理/抗拒底线】:"; }
ai wn[t="nl"]::before  { content: "[直控资产/收容性偶]:"; }
ai wn[t="weakness"]::before { content: "【弱点扫描】:"; }
ai wn[t="injury"]::before { content: "伤势状态:"; }
ai wn[t="debuff"]::before { content: "异常状态:"; }